]>
Commit | Line | Data |
---|---|---|
3e87ef69 | 1 | // @(#) $Id$ |
2 | ||
acf814d1 | 3 | #ifndef ALIL3ALTROMEMHANDLER_H |
4 | #define ALIL3ALTROMEMHANDLER_H | |
5 | ||
6 | #include "AliL3RootTypes.h" | |
acf814d1 | 7 | |
faebf2f5 | 8 | //Maximum size of Altro packet equals 1000 bit |
9 | #define ALTRO_PACKET_SIZE 125 | |
10 | ||
11 | //Maximum 10 bit data to be stored in one packet | |
acf814d1 | 12 | #define MAX_VALS 94 |
13 | ||
faebf2f5 | 14 | //Maximum size of array to store whole pad |
15 | #define ALTRO_SIZE (100*ALTRO_PACKET_SIZE) | |
16 | ||
acf814d1 | 17 | class AliL3AltroMemHandler { |
18 | ||
19 | public: | |
faebf2f5 | 20 | |
acf814d1 | 21 | AliL3AltroMemHandler(); |
a36f659c | 22 | void Write(UShort_t row, UChar_t pad, UShort_t time, UShort_t charge); |
23 | Bool_t Read(UShort_t &row, UChar_t &pad, UShort_t &time, UShort_t &charge); | |
24 | Bool_t ReadSequence(UShort_t &row, UChar_t &pad, UShort_t &time, UChar_t &n, UShort_t **charges); | |
faebf2f5 | 25 | void WriteFinal(); |
26 | ||
27 | Bool_t SetASCIIOutput(FILE *file); | |
acf814d1 | 28 | Bool_t SetBinaryOutput(FILE *file); |
a36f659c | 29 | Bool_t SetASCIIInput(FILE *file); |
30 | Bool_t SetBinaryInput(FILE *file); | |
acf814d1 | 31 | |
32 | private: | |
faebf2f5 | 33 | |
54b54089 | 34 | UShort_t fAltroMem[ALTRO_SIZE]; // Altro memoru |
35 | UShort_t fTimesPerPad[1024]; // time samples per pad | |
36 | UShort_t fChargesPerPad[1024]; // charges per pad | |
37 | ||
38 | FILE *fInBinary; //! // binary input file | |
39 | FILE *fOutBinary; //! // binary output file | |
40 | UShort_t fLRow; //read row | |
41 | UChar_t fLPad; //read pad | |
42 | UShort_t fRRow; //read row | |
43 | UChar_t fRPad; //read pad | |
44 | UShort_t fRTime; //read time | |
45 | UShort_t fCounter; //total counter | |
46 | UShort_t fTCounter; //time counter | |
47 | UShort_t fPCounter; //packet counter | |
48 | UShort_t fRCounter; //read counter | |
49 | UShort_t fSCounter; //sequence counter | |
50 | Bool_t fFlag; //flag to indicate no return at the end of packet (binary) | |
faebf2f5 | 51 | |
acf814d1 | 52 | void Clear(); |
a36f659c | 53 | void ClearRead(); |
faebf2f5 | 54 | void Add(UShort_t charge, UShort_t time); |
55 | void MakeAltroPackets(); | |
56 | void AddTrailer(); | |
57 | void Write(); | |
58 | ||
9c50e540 | 59 | ClassDef(AliL3AltroMemHandler,1) |
acf814d1 | 60 | }; |
61 | ||
62 | #endif | |
63 | ||
64 | ||
65 | ||
66 | ||
67 | ||
68 |