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> |
42d20574 |
7 | #include "AliMiniHeader.h" |
8de97894 |
8 | |
a6e7b125 |
9 | |
a6e7b125 |
10 | class AliRawReader: public TObject { |
11 | public : |
8de97894 |
12 | AliRawReader(); |
42d20574 |
13 | AliRawReader(const AliRawReader& rawReader); |
14 | AliRawReader& operator = (const AliRawReader& rawReader); |
15 | virtual ~AliRawReader() {}; |
8de97894 |
16 | |
17 | void Select(Int_t detectorID, |
18 | Int_t minDDLID = -1, Int_t maxDDLID = -1); |
a6e7b125 |
19 | |
42d20574 |
20 | virtual UInt_t GetType() const = 0; |
21 | virtual UInt_t GetRunNumber() const = 0; |
22 | virtual const UInt_t* GetEventId() const = 0; |
23 | virtual const UInt_t* GetTriggerPattern() const = 0; |
24 | virtual const UInt_t* GetDetectorPattern() const = 0; |
25 | virtual const UInt_t* GetAttributes() const = 0; |
c946ab02 |
26 | virtual UInt_t GetLDCId() const = 0; |
42d20574 |
27 | virtual UInt_t GetGDCId() const = 0; |
04fa961a |
28 | |
c946ab02 |
29 | virtual Int_t GetEquipmentSize() const = 0; |
30 | virtual Int_t GetEquipmentType() const = 0; |
31 | virtual Int_t GetEquipmentId() const = 0; |
32 | virtual const UInt_t* GetEquipmentAttributes() const = 0; |
33 | virtual Int_t GetEquipmentElementSize() const = 0; |
a6e7b125 |
34 | |
c946ab02 |
35 | Int_t GetDataSize() const |
36 | {if (fMiniHeader) return fMiniHeader->fSize; else return 0;}; |
37 | Int_t GetDetectorID() const |
38 | {if (fMiniHeader) return fMiniHeader->fDetectorID; else return -1;}; |
39 | Int_t GetDDLID() const |
40 | {if (fMiniHeader) return fMiniHeader->fDDLID; else return -1;}; |
41 | Int_t GetVersion() const |
42 | {if (fMiniHeader) return fMiniHeader->fVersion; else return -1;}; |
43 | Bool_t IsCompressed() const |
44 | {if (fMiniHeader) return fMiniHeader->fCompressionFlag != 0; |
45 | else return kFALSE;}; |
46 | |
47 | virtual Bool_t ReadHeader() = 0; |
8de97894 |
48 | virtual Bool_t ReadNextData(UChar_t*& data) = 0; |
49 | virtual Bool_t ReadNextInt(UInt_t& data); |
50 | virtual Bool_t ReadNextShort(UShort_t& data); |
51 | virtual Bool_t ReadNextChar(UChar_t& data); |
52 | |
53 | virtual Bool_t Reset() = 0; |
a6e7b125 |
54 | |
be50fca2 |
55 | enum {kErrMagic=1, kErrNoMiniHeader=2, kErrMiniMagic=4, |
56 | kErrSize=8, kErrOutOfBounds=16}; |
b4857df7 |
57 | virtual Int_t CheckData() const; |
58 | Int_t GetErrorCode() {return fErrorCode;}; |
59 | |
a6e7b125 |
60 | protected : |
42d20574 |
61 | Bool_t IsSelected() const; |
a6e7b125 |
62 | |
b4857df7 |
63 | Bool_t CheckMiniHeader(AliMiniHeader* miniHeader = NULL) const; |
8de97894 |
64 | virtual Bool_t ReadNext(UChar_t* data, Int_t size) = 0; |
a6e7b125 |
65 | |
8de97894 |
66 | AliMiniHeader* fMiniHeader; // current mini header |
a6e7b125 |
67 | Int_t fCount; // counter of bytes to be read for current DDL |
68 | |
8de97894 |
69 | Int_t fSelectDetectorID; // id of selected detector (<0 = no selection) |
70 | Int_t fSelectMinDDLID; // minimal index of selected DDLs (<0 = no selection) |
71 | Int_t fSelectMaxDDLID; // maximal index of selected DDLs (<0 = no selection) |
72 | |
b4857df7 |
73 | Int_t fErrorCode; // code of last error |
74 | |
a6e7b125 |
75 | ClassDef(AliRawReader, 0) // base class for reading raw digits |
76 | }; |
77 | |
78 | #endif |