Line data Source code
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 : #include <iosfwd>
16 : #include <TString.h>
17 : using std::fstream;
18 :
19 : class TArrayC;
20 :
21 : class AliRawReaderFile: public AliRawReader {
22 : public :
23 : AliRawReaderFile(Int_t eventNumber = -1);
24 : AliRawReaderFile(const char* dirName, Int_t eventNumber = -1);
25 : virtual ~AliRawReaderFile();
26 :
27 : virtual void RequireHeader(Bool_t required);
28 :
29 0 : virtual UInt_t GetType() const {return fType;};
30 0 : virtual UInt_t GetRunNumber() const {return fRunNb;};
31 0 : virtual const UInt_t* GetEventId() const {return fId;};
32 0 : virtual const UInt_t* GetTriggerPattern() const {return fTriggerPattern;};
33 0 : virtual const UInt_t* GetDetectorPattern() const {return &fDetectorPattern;};
34 0 : virtual const UInt_t* GetAttributes() const {return 0;};
35 0 : virtual const UInt_t* GetSubEventAttributes() const {return 0;};
36 0 : virtual UInt_t GetLDCId() const {return 0;};
37 0 : virtual UInt_t GetGDCId() const {return 0;};
38 0 : virtual UInt_t GetTimestamp() const {return fTimestamp;};
39 :
40 0 : virtual Int_t GetEquipmentSize() const {return fEquipmentSize;};
41 0 : virtual Int_t GetEquipmentType() const {return 0;};
42 10 : virtual Int_t GetEquipmentId() const {return fEquipmentId;};
43 0 : virtual const UInt_t* GetEquipmentAttributes() const {return NULL;};
44 0 : virtual Int_t GetEquipmentElementSize() const {return 0;};
45 0 : virtual Int_t GetEquipmentHeaderSize() const {return 0;};
46 :
47 : virtual Bool_t ReadHeader();
48 : virtual Bool_t ReadNextData(UChar_t*& data);
49 : virtual Bool_t ReadNext(UChar_t* data, Int_t size);
50 :
51 : virtual Bool_t Reset();
52 :
53 : virtual Bool_t NextEvent();
54 : virtual Bool_t RewindEvents();
55 :
56 0 : void SetEventType(UInt_t type) { fType = type; }
57 0 : void SetRunNb(UInt_t run) { fRunNb = run; }
58 0 : void SetDetectorPattern(UInt_t pattern) { fDetectorPattern = pattern; }
59 :
60 : protected :
61 : TString GetDirName() const;
62 : void* OpenDirectory();
63 : Bool_t OpenNextFile();
64 : Bool_t CreateFileIndex();
65 :
66 : Int_t fEventIndex; // index of the event
67 : TString fDirName; // name of the input directory
68 : void* fDirectory; // pointer to the input directory
69 : fstream* fStream; // stream of raw digits
70 : Int_t fEquipmentId; // equipment ID from file name
71 : UChar_t* fBuffer; // buffer for payload
72 : Int_t fBufferSize; // size of fBuffer in bytes
73 : Int_t fEquipmentSize; // equipment size from raw-data payload
74 : TArrayC* fDDLIndex; //! the index of DDL files
75 : Int_t fDDLCurrent; //! the index of DDL files
76 :
77 : UInt_t fType; // event type (no idea from where to get it - put physics_event)
78 : UInt_t fRunNb; // run number (no idea from where to get it - put 0)
79 : UInt_t fId[2]; // id field (read from the first CDH found, period is not filled)
80 : UInt_t fTriggerPattern[4]; // the trigger class pattern (read from the first CDH found)
81 : UInt_t fDetectorPattern; // the detector pattern (no idea from where to read it)
82 : UInt_t fTimestamp; // event timestamp (read from the DDL file creation time)
83 :
84 : private :
85 : AliRawReaderFile(const AliRawReaderFile& rawReader);
86 : AliRawReaderFile& operator = (const AliRawReaderFile& rawReader);
87 :
88 128 : ClassDef(AliRawReaderFile, 0) // class for reading raw digits from a file
89 : };
90 :
91 : #endif
|