3 #ifndef ALIL3DDLRAWREADER_H
4 #define ALIL3DDLRAWREADER_H
6 #include "AliL3RootTypes.h"
8 // see description in upcoming ALICE note
9 // by D.Favretto and A.K.Mohanty
10 struct AliL3DDLMiniHeader
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
20 class AliL3DDLRawReader
24 virtual ~AliL3DDLRawReader();
26 void Select(Int_t detectorID, Int_t minDDLID = -1, Int_t maxDDLID = -1);
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;};
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);
40 virtual Bool_t Reset() = 0;
43 Bool_t IsSelected() const;
45 Bool_t CheckMiniHeader() const;
46 virtual Bool_t ReadNext(UChar_t* data, Int_t size) = 0;
48 AliL3DDLMiniHeader* fMiniHeader; // current mini header
49 Int_t fCount; // counter of bytes to be read for current DDL
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)
55 ClassDef(AliL3DDLRawReader,1) //AliL3DDLRawReader