]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FIT/AliFITRawReader.h
improve auto-rebin & landaugaus fit + add Align & RecoParam spec. storage + minor...
[u/mrichter/AliRoot.git] / FIT / AliFITRawReader.h
1 #ifndef ALIFITRAWREADER_H
2 #define ALIFITRAWREADER_H
3 /***************************************************************************
4  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
5  * reserved. 
6  *
7  * Alla Maevskaya INR RAS alla@inr.ru
8  *
9  * See cxx source for full Copyright notice                               
10  ***************************************************************************/
11
12  
13 #include <TTask.h>
14 #include "AliRawReader.h"
15
16   
17 class AliFITRawReader : public TTask {
18   public :
19
20   AliFITRawReader(AliRawReader *rawReader) ;
21
22   virtual  ~AliFITRawReader();
23   AliFITRawReader(const AliFITRawReader& o): TTask(o),
24     fRawReader(0),
25     fData(NULL),
26     fPosition(0),
27     fBunchID(0),
28     fPrintout(kFALSE)
29     { for ( Int_t k=0; k<500; k++)   fAllData[k] = -1;}
30   
31   AliFITRawReader& operator=(const AliFITRawReader&) { return *this; }
32
33
34   Bool_t  Next(); //read next raw digit
35   Int_t            GetPosition();
36   UInt_t         GetNextWord();
37   Int_t GetData( Int_t channel) {return fAllData[channel];}
38
39
40   enum EFITRawReaderError {
41     kIncorrectDataSize = 1,
42     kWrongDRMHeader = 2,
43     kWrongDRMTrailer = 3,
44     kWrongTRMHeader = 4,
45     kWrongTRMTrailer = 5,
46     kWrongChain0Header = 6,
47     kWrongChain0Trailer = 7,
48     kWrongChain1Header = 8,
49     kWrongChain1Trailer = 9,
50     kIncorrectLUT = 10
51   };
52
53    Int_t GetTRMBunchID() {return fBunchID;};
54
55   void SetPrintout(Bool_t pp ) {fPrintout = pp;}
56   UInt_t GetChannel(Int_t iTRM, Int_t iTDC, Int_t iChain, Int_t ichannel);     
57   protected :
58
59   AliRawReader*    fRawReader;    // object for reading the raw data
60   UChar_t*         fData;         // raw data
61   Int_t            fPosition;     // current (32 bit) position in fData
62   Int_t            fBunchID;       //bunchID from TRM chain header
63   Bool_t           fPrintout;      // advanced printout
64   Int_t            fAllData[500]; // container for raw data
65   
66  ClassDef(AliFITRawReader,1) //class for reading FIT Raw data
67 };
68
69 #endif