]>
Commit | Line | Data |
---|---|---|
a6e7b125 | 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> | |
8de97894 | 7 | |
a6e7b125 | 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 : | |
8de97894 | 20 | AliRawReader(); |
21 | ||
22 | void Select(Int_t detectorID, | |
23 | Int_t minDDLID = -1, Int_t maxDDLID = -1); | |
a6e7b125 | 24 | |
04fa961a | 25 | virtual UInt_t GetType() = 0; |
26 | virtual UInt_t GetRunNumber() = 0; | |
27 | virtual const UInt_t* GetEventId() = 0; | |
28 | virtual const UInt_t* GetTriggerPattern() = 0; | |
29 | virtual const UInt_t* GetDetectorPattern() = 0; | |
30 | virtual const UInt_t* GetAttributes() = 0; | |
31 | virtual UInt_t GetGDCId() = 0; | |
32 | ||
8de97894 | 33 | inline Int_t GetDataSize() const {return fMiniHeader->fSize;}; |
34 | inline Int_t GetDetectorID() const {return fMiniHeader->fDetectorID;}; | |
35 | inline Int_t GetDDLID() const {return fMiniHeader->fDDLID;}; | |
36 | inline Int_t GetVersion() const {return fMiniHeader->fVersion;}; | |
37 | inline Bool_t IsCompressed() const {return fMiniHeader->fCompressionFlag != 0;}; | |
a6e7b125 | 38 | |
8de97894 | 39 | virtual Bool_t ReadMiniHeader() = 0; |
40 | virtual Bool_t ReadNextData(UChar_t*& data) = 0; | |
41 | virtual Bool_t ReadNextInt(UInt_t& data); | |
42 | virtual Bool_t ReadNextShort(UShort_t& data); | |
43 | virtual Bool_t ReadNextChar(UChar_t& data); | |
44 | ||
45 | virtual Bool_t Reset() = 0; | |
a6e7b125 | 46 | |
47 | protected : | |
8de97894 | 48 | Bool_t IsSelected(); |
a6e7b125 | 49 | |
8de97894 | 50 | Bool_t CheckMiniHeader(); |
51 | virtual Bool_t ReadNext(UChar_t* data, Int_t size) = 0; | |
a6e7b125 | 52 | |
8de97894 | 53 | AliMiniHeader* fMiniHeader; // current mini header |
a6e7b125 | 54 | Int_t fCount; // counter of bytes to be read for current DDL |
55 | ||
8de97894 | 56 | Int_t fSelectDetectorID; // id of selected detector (<0 = no selection) |
57 | Int_t fSelectMinDDLID; // minimal index of selected DDLs (<0 = no selection) | |
58 | Int_t fSelectMaxDDLID; // maximal index of selected DDLs (<0 = no selection) | |
59 | ||
a6e7b125 | 60 | ClassDef(AliRawReader, 0) // base class for reading raw digits |
61 | }; | |
62 | ||
63 | #endif |