]> git.uio.no Git - u/mrichter/AliRoot.git/blob - T0/AliT0RawReader.h
raw reader for 2chains DRM, the same as for monitoring
[u/mrichter/AliRoot.git] / T0 / AliT0RawReader.h
1 #ifndef ALIT0RAWREADER_H
2 #define ALIT0RAWREADER_H
3  
4 #include <TTask.h>
5 #include <Riostream.h>
6 #include "AliRawReader.h"
7 #include "AliT0Parameters.h"
8  
9 class AliT0RawReader : public TTask {
10   public :
11
12   AliT0RawReader(AliRawReader *rawReader) ;
13
14   virtual  ~AliT0RawReader();
15   AliT0RawReader(const AliT0RawReader& o): TTask(o),
16     fRawReader(0),
17     fData(NULL),
18     fPosition(0),
19     fParam(0)
20     {}
21   
22   AliT0RawReader& operator=(const AliT0RawReader&) { return *this; }
23
24
25   Bool_t  Next(); //read next raw digit
26   Int_t            GetPosition();
27   UInt_t         GetNextWord();
28   Int_t GetData(Int_t channel, Int_t hit) {return fAllData[channel][hit];}
29   //  void SetNumberOfTRM(Int_t trm=2) {fNTRM=trm;}
30
31   enum ET0RawReaderError {
32     kIncorrectDataSize = 1,
33     kWrongDRMHeader = 2,
34     kWrongDRMTrailer = 3,
35     kWrongTRMHeader = 4,
36     kWrongTRMTrailer = 5,
37     kWrongChain0Header = 6,
38     kWrongChain0Trailer = 7,
39     kWrongChain1Header = 8,
40     kWrongChain1Trailer = 9,
41     kIncorrectLUT = 10
42   };
43
44    
45   protected :
46
47   AliRawReader*    fRawReader;    // object for reading the raw data
48   UChar_t*         fData;         // raw data
49   Int_t            fPosition;     // current (32 bit) position in fData
50   AliT0Parameters *fParam;
51   //  Int_t            fNTRM; //number of TRMs, 1 - testbeam; 2 - simulation
52   
53   Int_t fAllData[110][5];
54   
55  ClassDef(AliT0RawReader,1) //class for reading T0 Raw data
56 };
57
58 typedef AliT0RawReader AliSTARTRawReader; // for backward compatibility
59  
60 #endif