]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/misc/AliL3DDLRawReader.h
New version of SPD raw-data reconstruction. The format now correponds to the actual...
[u/mrichter/AliRoot.git] / HLT / misc / AliL3DDLRawReader.h
1 // @(#) $Id$
2
3 #ifndef ALIL3DDLRAWREADER_H
4 #define ALIL3DDLRAWREADER_H
5
6 #include "AliL3RootTypes.h"
7
8 // see description in upcoming ALICE note
9 // by D.Favretto and A.K.Mohanty
10 struct AliL3DDLMiniHeader 
11 {
12   UInt_t    fSize;           // size
13   UChar_t   fDetectorID;     // detector ID
14   UChar_t   fMagicWord[3];   // magic word
15   UChar_t   fVersion;        // version
16   UChar_t   fCompressionFlag;// compression flag
17   UShort_t  fDDLID;          // DDL ID
18 };
19
20 class AliL3DDLRawReader 
21 {
22   public :
23     AliL3DDLRawReader();
24     virtual ~AliL3DDLRawReader();
25
26     void Select(Int_t detectorID, Int_t minDDLID = -1, Int_t maxDDLID = -1);
27
28     Int_t     GetDataSize()   const {return fMiniHeader->fSize;};
29     Int_t     GetDetectorID() const {return fMiniHeader->fDetectorID;};
30     Int_t     GetDDLID()      const {return fMiniHeader->fDDLID;};
31     Int_t     GetVersion()    const {return fMiniHeader->fVersion;};
32     Bool_t    IsCompressed()  const {return fMiniHeader->fCompressionFlag != 0;};
33
34     virtual Bool_t   ReadMiniHeader() = 0;
35     virtual Bool_t   ReadNextData(UChar_t*& data) = 0;
36     virtual Bool_t   ReadNextInt(UInt_t& data);
37     virtual Bool_t   ReadNextShort(UShort_t& data);
38     virtual Bool_t   ReadNextChar(UChar_t& data);
39
40     virtual Bool_t   Reset() = 0;
41
42   protected :
43     Bool_t           IsSelected() const;
44
45     Bool_t           CheckMiniHeader() const;
46     virtual Bool_t   ReadNext(UChar_t* data, Int_t size) = 0;
47
48     AliL3DDLMiniHeader*  fMiniHeader;  // current mini header
49     Int_t                fCount;       // counter of bytes to be read for current DDL
50
51     Int_t            fSelectDetectorID;  // id of selected detector (<0 = no selection)
52     Int_t            fSelectMinDDLID;    // minimal index of selected DDLs (<0 = no selection)
53     Int_t            fSelectMaxDDLID;    // maximal index of selected DDLs (<0 = no selection)
54
55     ClassDef(AliL3DDLRawReader,1) //AliL3DDLRawReader
56 };
57
58 #endif