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