]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/misc/AliL3AltroMemHandler.h
added the delete of EMCAL object posted in the folder when new file is opened
[u/mrichter/AliRoot.git] / HLT / misc / AliL3AltroMemHandler.h
1 #ifndef ALIL3ALTROMEMHANDLER_H
2 #define ALIL3ALTROMEMHANDLER_H
3
4 #include "AliL3RootTypes.h"
5
6 //Maximum size of Altro packet equals 1000 bit
7 #define ALTRO_PACKET_SIZE 125
8
9 //Maximum 10 bit data to be stored in one packet
10 #define MAX_VALS 94
11
12 //Maximum size of array to store whole pad
13 #define ALTRO_SIZE (100*ALTRO_PACKET_SIZE)
14
15 class AliL3AltroMemHandler {
16
17   public: 
18
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);
23    void WriteFinal();
24
25    Bool_t SetASCIIOutput(FILE *file);
26    Bool_t SetBinaryOutput(FILE *file);
27    Bool_t SetASCIIInput(FILE *file);
28    Bool_t SetBinaryInput(FILE *file);
29
30   private:
31
32    UShort_t altromem[ALTRO_SIZE];
33    UShort_t times_per_pad[1024];
34    UShort_t charges_per_pad[1024];
35
36    FILE *fInBinary;  //!
37    FILE *fOutBinary; //!
38    UShort_t lrow;
39    UChar_t lpad;
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?
49
50    void Clear();
51    void ClearRead();
52    void Add(UShort_t charge, UShort_t time);
53    void MakeAltroPackets();
54    void AddTrailer();
55    void Write();
56
57    ClassDef(AliL3AltroMemHandler,1)
58 };
59
60 #endif
61
62
63
64
65
66