]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliRawReader.h
Concomitant clusterisation and trigger reconstruction
[u/mrichter/AliRoot.git] / STEER / AliRawReader.h
1 #ifndef ALIRAWREADER_H
2 #define ALIRAWREADER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 #include <TObject.h>
7
8
9 struct AliMiniHeader {
10   UInt_t    fSize;
11   UChar_t   fDetectorID;
12   UChar_t   fMagicWord[3];
13   UChar_t   fVersion;
14   UChar_t   fCompressionFlag;
15   UShort_t  fDDLID;
16 };
17
18 class AliRawReader: public TObject {
19   public :
20     AliRawReader();
21
22     void             Select(Int_t detectorID, 
23                             Int_t minDDLID = -1, Int_t maxDDLID = -1);
24
25     inline Int_t     GetDataSize() const {return fMiniHeader->fSize;};
26     inline Int_t     GetDetectorID() const {return fMiniHeader->fDetectorID;};
27     inline Int_t     GetDDLID() const {return fMiniHeader->fDDLID;};
28     inline Int_t     GetVersion() const {return fMiniHeader->fVersion;};
29     inline Bool_t    IsCompressed() const {return fMiniHeader->fCompressionFlag != 0;};
30
31     virtual Bool_t   ReadMiniHeader() = 0;
32     virtual Bool_t   ReadNextData(UChar_t*& data) = 0;
33     virtual Bool_t   ReadNextInt(UInt_t& data);
34     virtual Bool_t   ReadNextShort(UShort_t& data);
35     virtual Bool_t   ReadNextChar(UChar_t& data);
36
37     virtual Bool_t   Reset() = 0;
38
39   protected :
40     Bool_t           IsSelected();
41
42     Bool_t           CheckMiniHeader();
43     virtual Bool_t   ReadNext(UChar_t* data, Int_t size) = 0;
44
45     AliMiniHeader*   fMiniHeader;  // current mini header
46     Int_t            fCount;       // counter of bytes to be read for current DDL
47
48     Int_t            fSelectDetectorID;  // id of selected detector (<0 = no selection)
49     Int_t            fSelectMinDDLID;    // minimal index of selected DDLs (<0 = no selection)
50     Int_t            fSelectMaxDDLID;    // maximal index of selected DDLs (<0 = no selection)
51
52     ClassDef(AliRawReader, 0) // base class for reading raw digits
53 };
54
55 #endif