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