1 #ifndef ALIL3ALTROMEMHANDLER_H
2 #define ALIL3ALTROMEMHANDLER_H
4 #include "AliL3RootTypes.h"
6 //Maximum size of Altro packet equals 1000 bit
7 #define ALTRO_PACKET_SIZE 125
9 //Maximum 10 bit data to be stored in one packet
12 //Maximum size of array to store whole pad
13 #define ALTRO_SIZE (100*ALTRO_PACKET_SIZE)
15 class AliL3AltroMemHandler {
19 AliL3AltroMemHandler();
20 void Write(UShort_t row, UChar_t pad, UShort_t time, UShort_t charge);
21 Bool_t Read(UShort_t &row, UChar_t &pad, UShort_t &time, UShort_t &charge);
22 Bool_t ReadSequence(UShort_t &row, UChar_t &pad, UShort_t &time, UChar_t &n, UShort_t **charges);
25 Bool_t SetASCIIOutput(FILE *file);
26 Bool_t SetBinaryOutput(FILE *file);
27 Bool_t SetASCIIInput(FILE *file);
28 Bool_t SetBinaryInput(FILE *file);
32 UShort_t altromem[ALTRO_SIZE];
33 UShort_t times_per_pad[1024];
34 UShort_t charges_per_pad[1024];
40 UShort_t rrow; //read row
41 UChar_t rpad; //read pad
42 UShort_t rtime; //read time
43 UShort_t counter; //total counter
44 UShort_t tcounter; //time counter
45 UShort_t pcounter; //packet counter
46 UShort_t rcounter; //read counter
47 UShort_t scounter; //sequence counter
48 Bool_t flag; //Binary File?
52 void Add(UShort_t charge, UShort_t time);
53 void MakeAltroPackets();
57 ClassDef(AliL3AltroMemHandler,1)