]>
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> | |
7 | #include <Riostream.h> | |
8 | ||
9 | ||
10 | struct AliMiniHeader { | |
11 | UInt_t fSize; | |
12 | UChar_t fDetectorID; | |
13 | UChar_t fMagicWord[3]; | |
14 | UChar_t fVersion; | |
15 | UChar_t fCompressionFlag; | |
16 | UShort_t fDDLID; | |
17 | }; | |
18 | ||
19 | class AliRawReader: public TObject { | |
20 | public : | |
21 | AliRawReader(const char* fileName, Bool_t addNumber = kTRUE); | |
22 | virtual ~AliRawReader(); | |
23 | ||
24 | inline Int_t GetDetectorID() const {return fMiniHeader.fDetectorID;}; | |
25 | inline Int_t GetDDLID() const {return fMiniHeader.fDDLID;}; | |
26 | inline Int_t GetVersion() const {return fMiniHeader.fVersion;}; | |
27 | inline Bool_t IsCompressed() const {return fMiniHeader.fCompressionFlag != 0;}; | |
28 | ||
29 | Bool_t ReadNextInt(UInt_t& data); | |
30 | Bool_t ReadNextShort(UShort_t& data); | |
31 | Bool_t ReadNextChar(UChar_t& data); | |
32 | ||
33 | protected : | |
34 | Bool_t OpenNextFile(); | |
35 | ||
36 | Bool_t ReadMiniHeader(); | |
37 | ||
38 | const char* fFileName; // name of input files | |
39 | Int_t fFileNumber; // number of current input file | |
40 | fstream* fStream; // stream of raw digits | |
41 | AliMiniHeader fMiniHeader; // current mini header | |
42 | Int_t fCount; // counter of bytes to be read for current DDL | |
43 | ||
44 | ClassDef(AliRawReader, 0) // base class for reading raw digits | |
45 | }; | |
46 | ||
47 | #endif |