]> git.uio.no Git - u/mrichter/AliRoot.git/blob - T0/AliT0RawReader.h
hardcoded lookup table for online reading
[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     fIsOnline(kFALSE)
21     {}
22   
23   AliT0RawReader& operator=(const AliT0RawReader&) { return *this; }
24
25
26   Bool_t  Next(); //read next raw digit
27   Int_t            GetPosition();
28   UInt_t         GetNextWord();
29   Int_t GetData(Int_t channel, Int_t hit) {return fAllData[channel][hit];}
30   //  void SetNumberOfTRM(Int_t trm=2) {fNTRM=trm;}
31
32   enum ET0RawReaderError {
33     kIncorrectDataSize = 1,
34     kWrongDRMHeader = 2,
35     kWrongDRMTrailer = 3,
36     kWrongTRMHeader = 4,
37     kWrongTRMTrailer = 5,
38     kWrongChain0Header = 6,
39     kWrongChain0Trailer = 7,
40     kWrongChain1Header = 8,
41     kWrongChain1Trailer = 9,
42     kIncorrectLUT = 10
43   };
44
45   void SetOnlineMode(Bool_t on=kFALSE) {fIsOnline=on;}
46   Bool_t IsOnlineMode () {return fIsOnline;}
47      
48   protected :
49
50   AliRawReader*    fRawReader;    // object for reading the raw data
51   UChar_t*         fData;         // raw data
52   Int_t            fPosition;     // current (32 bit) position in fData
53   AliT0Parameters *fParam;
54 //  Int_t            fNTRM; //number of TRMs, 1 - testbeam; 2 - simulation
55   Bool_t           fIsOnline;
56   
57   Int_t fAllData[110][5];
58   
59  ClassDef(AliT0RawReader,2) //class for reading T0 Raw data
60 };
61
62 typedef AliT0RawReader AliSTARTRawReader; // for backward compatibility
63  
64 #endif