]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RAW/AliRawReaderFile.h
alimdc RPM spec file updated
[u/mrichter/AliRoot.git] / RAW / AliRawReaderFile.h
1 #ifndef ALIRAWREADERFILE_H
2 #define ALIRAWREADERFILE_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 ///////////////////////////////////////////////////////////////////////////////
9 ///
10 /// This is a class for reading raw data files.
11 ///
12 ///////////////////////////////////////////////////////////////////////////////
13
14 #include "AliRawReader.h"
15 #ifdef __CINT__
16 class fstream;
17 #else
18 #include <Riostream.h>
19 #endif
20 #include <TString.h>
21
22
23 class AliRawReaderFile: public AliRawReader {
24   public :
25     AliRawReaderFile(Int_t eventNumber = -1);
26     AliRawReaderFile(const char* dirName, Int_t eventNumber = -1);
27     virtual ~AliRawReaderFile();
28
29     virtual void     RequireHeader(Bool_t required);
30
31     virtual UInt_t   GetType() const {return 0;};
32     virtual UInt_t   GetRunNumber() const {return 0;};
33     virtual const UInt_t* GetEventId() const {return 0;};
34     virtual const UInt_t* GetTriggerPattern() const {return 0;};
35     virtual const UInt_t* GetDetectorPattern() const {return 0;};
36     virtual const UInt_t* GetAttributes() const {return 0;};
37     virtual const UInt_t* GetSubEventAttributes() const {return 0;};
38     virtual UInt_t   GetLDCId() const {return 0;};
39     virtual UInt_t   GetGDCId() const {return 0;};
40     virtual UInt_t   GetTimestamp() const {return 0;};
41
42     virtual Int_t    GetEquipmentSize() const {return 0;};
43     virtual Int_t    GetEquipmentType() const {return 0;};
44     virtual Int_t    GetEquipmentId() const {return fEquipmentId;};
45     virtual const UInt_t* GetEquipmentAttributes() const {return NULL;};
46     virtual Int_t    GetEquipmentElementSize() const {return 0;};
47     virtual Int_t    GetEquipmentHeaderSize() const {return 0;};
48
49     virtual Bool_t   ReadHeader();
50     virtual Bool_t   ReadNextData(UChar_t*& data);
51     virtual Bool_t   ReadNext(UChar_t* data, Int_t size);
52
53     virtual Bool_t   Reset();
54
55     virtual Bool_t   NextEvent();
56     virtual Bool_t   RewindEvents();
57
58   protected :
59     TString          GetDirName() const;
60     void*            OpenDirectory();
61     Bool_t           OpenNextFile();
62
63     Int_t            fEventIndex;  // index of the event
64     TString          fDirName;     // name of the input directory
65     void*            fDirectory;   // pointer to the input directory
66     fstream*         fStream;      // stream of raw digits
67     Int_t            fEquipmentId; // equipment ID from file name
68     UChar_t*         fBuffer;      // buffer for payload
69     Int_t            fBufferSize;  // size of fBuffer in bytes
70
71   private :
72     AliRawReaderFile(const AliRawReaderFile& rawReader);
73     AliRawReaderFile& operator = (const AliRawReaderFile& rawReader);
74
75     ClassDef(AliRawReaderFile, 0) // class for reading raw digits from a file
76 };
77
78 #endif