]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RAW/AliTPCRawStream.h
support multiple equipments per sub event in the root raw data format
[u/mrichter/AliRoot.git] / RAW / AliTPCRawStream.h
1 #ifndef ALITPCRAWSTREAM_H
2 #define ALITPCRAWSTREAM_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 ///////////////////////////////////////////////////////////////////////////////
9 ///
10 /// This class provides access to TPC digits in raw data.
11 ///
12 ///////////////////////////////////////////////////////////////////////////////
13
14 #include <TObject.h>
15 #include "AliTPCCompression.h"
16
17 class AliRawReader;
18
19
20 class AliTPCRawStream: public TObject {
21   public :
22     AliTPCRawStream(AliRawReader* rawReader);
23     AliTPCRawStream(const AliTPCRawStream& stream);
24     AliTPCRawStream& operator = (const AliTPCRawStream& stream);
25     virtual ~AliTPCRawStream();
26
27     virtual Bool_t   Next();
28
29     Int_t            GetSector() const {return fSector;};
30     Int_t            GetPrevSector() const {return fPrevSector;};
31     Bool_t           IsNewSector() const {return fSector != fPrevSector;};
32     Int_t            GetRow() const {return fRow;};
33     Int_t            GetPrevRow() const {return fPrevRow;};
34     Bool_t           IsNewRow() const {return (fRow != fPrevRow) || IsNewSector();};
35     Int_t            GetPad() const {return fPad;};
36     Int_t            GetPrevPad() const {return fPrevPad;};
37     Bool_t           IsNewPad() const {return (fPad != fPrevPad) || IsNewRow();};
38     Int_t            GetTime() const {return fTime;};
39     Int_t            GetSignal() const {return fSignal;};
40
41   protected :
42     UShort_t         Get10BitWord(UChar_t* buffer, Int_t position) const;
43
44     AliRawReader*    fRawReader;    // object for reading the raw data
45
46     AliTPCCompression    fCompression;   // object for decompression
47     static const Int_t   fgkNumTables = 5; // number of (de)compression tables
48     static AliTPCHNode** fgRootNode;     // (de)compression tables
49
50     static const Int_t fgkDataMax = 10000000; // size of array for uncompressed raw data
51     UShort_t*        fData;         // uncompressed raw data
52     Int_t            fDataSize;     // actual size of the uncompressed raw data
53     Int_t            fPosition;     // current position in fData
54     Int_t            fCount;        // counter of words to be read for current trailer
55     Int_t            fBunchLength;  // remaining number of signal bins in the current bunch
56     static const Int_t fgkOffset = 1; // offset of signal
57
58     Int_t            fSector;       // index of current sector
59     Int_t            fPrevSector;   // index of previous sector
60     Int_t            fRow;          // index of current row
61     Int_t            fPrevRow;      // index of previous row
62     Int_t            fPad;          // index of current pad
63     Int_t            fPrevPad;      // index of previous pad
64     Int_t            fTime;         // index of current time bin
65     Int_t            fSignal;       // signal in ADC counts
66
67     ClassDef(AliTPCRawStream, 0)    // base class for reading TPC raw digits
68 };
69
70 #endif