]>
Commit | Line | Data |
---|---|---|
1 | #ifndef ALIL3ALTROMEMHANDLER_H | |
2 | #define ALIL3ALTROMEMHANDLER_H | |
3 | ||
4 | #include "AliL3RootTypes.h" | |
5 | #include "AliL3Logging.h" | |
6 | ||
7 | //Maximum size of Altro packet equals 1000 bit | |
8 | #define ALTRO_PACKET_SIZE 125 | |
9 | ||
10 | //Maximum 10 bit data to be stored in one packet | |
11 | #define MAX_VALS 94 | |
12 | ||
13 | //Maximum size of array to store whole pad | |
14 | #define ALTRO_SIZE (100*ALTRO_PACKET_SIZE) | |
15 | ||
16 | class AliL3AltroMemHandler { | |
17 | ||
18 | public: | |
19 | ||
20 | AliL3AltroMemHandler(); | |
21 | void Write(UShort_t row, UChar_t pad, UShort_t charge, UShort_t time); | |
22 | void WriteFinal(); | |
23 | ||
24 | Bool_t SetASCIIOutput(FILE *file); | |
25 | Bool_t SetBinaryOutput(FILE *file); | |
26 | //Bool_t SetBinaryInput(FILE *file); | |
27 | ||
28 | private: | |
29 | ||
30 | UShort_t altromem[ALTRO_SIZE]; | |
31 | UShort_t times_per_pad[1024]; | |
32 | UShort_t charges_per_pad[1024]; | |
33 | ||
34 | //FILE *fInBinary; | |
35 | FILE *fOutBinary; | |
36 | UShort_t lrow; | |
37 | UChar_t lpad; | |
38 | ||
39 | UShort_t counter; //totalcounter | |
40 | UShort_t tcounter; //timecounter | |
41 | UShort_t pcounter; //packetcounter | |
42 | Bool_t flag; | |
43 | ||
44 | void Clear(); | |
45 | void Add(UShort_t charge, UShort_t time); | |
46 | void MakeAltroPackets(); | |
47 | void AddTrailer(); | |
48 | void Write(); | |
49 | ||
50 | ClassDef(AliL3AltroMemHandler,1) | |
51 | }; | |
52 | ||
53 | #endif | |
54 | ||
55 | ||
56 | ||
57 | ||
58 | ||
59 |