X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=RAW%2FAliRawReaderFile.h;h=be9d1e13aac4edae5a698187bf39102e02a33d63;hb=9c4994717c5e567fd89a7e81bb7af4c8b3486a58;hp=c4f29d119a9fec0b1be46964f34b132ff4888a51;hpb=42d205747b31bafccfb08c136d8b5bc8edc806c5;p=u%2Fmrichter%2FAliRoot.git diff --git a/RAW/AliRawReaderFile.h b/RAW/AliRawReaderFile.h index c4f29d119a9..be9d1e13aac 100644 --- a/RAW/AliRawReaderFile.h +++ b/RAW/AliRawReaderFile.h @@ -3,6 +3,14 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ +/* $Id$ */ + +/////////////////////////////////////////////////////////////////////////////// +/// +/// This is a class for reading raw data files. +/// +/////////////////////////////////////////////////////////////////////////////// + #include "AliRawReader.h" #ifdef __CINT__ class fstream; @@ -10,39 +18,76 @@ class fstream; #include #endif #include +using std::fstream; +class TArrayC; class AliRawReaderFile: public AliRawReader { public : - AliRawReaderFile(const char* fileName, Bool_t addNumber = kTRUE); - AliRawReaderFile(const AliRawReaderFile& rawReader); - AliRawReaderFile& operator = (const AliRawReaderFile& rawReader); + AliRawReaderFile(Int_t eventNumber = -1); + AliRawReaderFile(const char* dirName, Int_t eventNumber = -1); virtual ~AliRawReaderFile(); - virtual UInt_t GetType() const {return 0;}; - virtual UInt_t GetRunNumber() const {return 0;}; - virtual const UInt_t* GetEventId() const {return 0;}; - virtual const UInt_t* GetTriggerPattern() const {return 0;}; - virtual const UInt_t* GetDetectorPattern() const {return 0;}; + virtual void RequireHeader(Bool_t required); + + virtual UInt_t GetType() const {return fType;}; + virtual UInt_t GetRunNumber() const {return fRunNb;}; + virtual const UInt_t* GetEventId() const {return fId;}; + virtual const UInt_t* GetTriggerPattern() const {return fTriggerPattern;}; + virtual const UInt_t* GetDetectorPattern() const {return &fDetectorPattern;}; virtual const UInt_t* GetAttributes() const {return 0;}; + virtual const UInt_t* GetSubEventAttributes() const {return 0;}; + virtual UInt_t GetLDCId() const {return 0;}; virtual UInt_t GetGDCId() const {return 0;}; + virtual UInt_t GetTimestamp() const {return fTimestamp;}; + virtual Int_t GetEquipmentSize() const {return fEquipmentSize;}; + virtual Int_t GetEquipmentType() const {return 0;}; + virtual Int_t GetEquipmentId() const {return fEquipmentId;}; + virtual const UInt_t* GetEquipmentAttributes() const {return NULL;}; + virtual Int_t GetEquipmentElementSize() const {return 0;}; + virtual Int_t GetEquipmentHeaderSize() const {return 0;}; - virtual Bool_t ReadMiniHeader(); + virtual Bool_t ReadHeader(); virtual Bool_t ReadNextData(UChar_t*& data); + virtual Bool_t ReadNext(UChar_t* data, Int_t size); virtual Bool_t Reset(); + virtual Bool_t NextEvent(); + virtual Bool_t RewindEvents(); + + void SetEventType(UInt_t type) { fType = type; } + void SetRunNb(UInt_t run) { fRunNb = run; } + void SetDetectorPattern(UInt_t pattern) { fDetectorPattern = pattern; } + protected : + TString GetDirName() const; + void* OpenDirectory(); Bool_t OpenNextFile(); + Bool_t CreateFileIndex(); - virtual Bool_t ReadNext(UChar_t* data, Int_t size); - - TString fFileName; // name of input files - Int_t fFileNumber; // number of current input file + Int_t fEventIndex; // index of the event + TString fDirName; // name of the input directory + void* fDirectory; // pointer to the input directory fstream* fStream; // stream of raw digits + Int_t fEquipmentId; // equipment ID from file name UChar_t* fBuffer; // buffer for payload Int_t fBufferSize; // size of fBuffer in bytes + Int_t fEquipmentSize; // equipment size from raw-data payload + TArrayC* fDDLIndex; //! the index of DDL files + Int_t fDDLCurrent; //! the index of DDL files + + UInt_t fType; // event type (no idea from where to get it - put physics_event) + UInt_t fRunNb; // run number (no idea from where to get it - put 0) + UInt_t fId[2]; // id field (read from the first CDH found, period is not filled) + UInt_t fTriggerPattern[4]; // the trigger class pattern (read from the first CDH found) + UInt_t fDetectorPattern; // the detector pattern (no idea from where to read it) + UInt_t fTimestamp; // event timestamp (read from the DDL file creation time) + + private : + AliRawReaderFile(const AliRawReaderFile& rawReader); + AliRawReaderFile& operator = (const AliRawReaderFile& rawReader); ClassDef(AliRawReaderFile, 0) // class for reading raw digits from a file };