]> git.uio.no Git - u/mrichter/AliRoot.git/blame - RAW/AliRawReaderFile.h
Add bkg subtraction (optional); change to LCH11h as default input set
[u/mrichter/AliRoot.git] / RAW / AliRawReaderFile.h
CommitLineData
04fa961a 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
bea6b2a4 6/* $Id$ */
7
8///////////////////////////////////////////////////////////////////////////////
9///
10/// This is a class for reading raw data files.
11///
12///////////////////////////////////////////////////////////////////////////////
13
04fa961a 14#include "AliRawReader.h"
cfe26801 15#ifdef __CINT__
16class fstream;
17#else
04fa961a 18#include <Riostream.h>
cfe26801 19#endif
04fa961a 20#include <TString.h>
52d2af54 21using std::fstream;
04fa961a 22
df3a33be 23class TArrayC;
04fa961a 24
25class AliRawReaderFile: public AliRawReader {
26 public :
dd9a70fe 27 AliRawReaderFile(Int_t eventNumber = -1);
28 AliRawReaderFile(const char* dirName, Int_t eventNumber = -1);
04fa961a 29 virtual ~AliRawReaderFile();
30
299738b9 31 virtual void RequireHeader(Bool_t required);
32
be974aae 33 virtual UInt_t GetType() const {return fType;};
34 virtual UInt_t GetRunNumber() const {return fRunNb;};
35 virtual const UInt_t* GetEventId() const {return fId;};
36 virtual const UInt_t* GetTriggerPattern() const {return fTriggerPattern;};
37 virtual const UInt_t* GetDetectorPattern() const {return &fDetectorPattern;};
42d20574 38 virtual const UInt_t* GetAttributes() const {return 0;};
e94ad92c 39 virtual const UInt_t* GetSubEventAttributes() const {return 0;};
39f9963f 40 virtual UInt_t GetLDCId() const {return 0;};
42d20574 41 virtual UInt_t GetGDCId() const {return 0;};
be974aae 42 virtual UInt_t GetTimestamp() const {return fTimestamp;};
04fa961a 43
1c10cde6 44 virtual Int_t GetEquipmentSize() const {return fEquipmentSize;};
39f9963f 45 virtual Int_t GetEquipmentType() const {return 0;};
46 virtual Int_t GetEquipmentId() const {return fEquipmentId;};
47 virtual const UInt_t* GetEquipmentAttributes() const {return NULL;};
48 virtual Int_t GetEquipmentElementSize() const {return 0;};
299738b9 49 virtual Int_t GetEquipmentHeaderSize() const {return 0;};
04fa961a 50
39f9963f 51 virtual Bool_t ReadHeader();
04fa961a 52 virtual Bool_t ReadNextData(UChar_t*& data);
bf22797a 53 virtual Bool_t ReadNext(UChar_t* data, Int_t size);
04fa961a 54
55 virtual Bool_t Reset();
56
dd9a70fe 57 virtual Bool_t NextEvent();
58 virtual Bool_t RewindEvents();
59
be974aae 60 void SetEventType(UInt_t type) { fType = type; }
61 void SetRunNb(UInt_t run) { fRunNb = run; }
62 void SetDetectorPattern(UInt_t pattern) { fDetectorPattern = pattern; }
63
04fa961a 64 protected :
dd9a70fe 65 TString GetDirName() const;
66 void* OpenDirectory();
04fa961a 67 Bool_t OpenNextFile();
df3a33be 68 Bool_t CreateFileIndex();
04fa961a 69
dd9a70fe 70 Int_t fEventIndex; // index of the event
39f9963f 71 TString fDirName; // name of the input directory
72 void* fDirectory; // pointer to the input directory
04fa961a 73 fstream* fStream; // stream of raw digits
39f9963f 74 Int_t fEquipmentId; // equipment ID from file name
04fa961a 75 UChar_t* fBuffer; // buffer for payload
76 Int_t fBufferSize; // size of fBuffer in bytes
1c10cde6 77 Int_t fEquipmentSize; // equipment size from raw-data payload
df3a33be 78 TArrayC* fDDLIndex; //! the index of DDL files
79 Int_t fDDLCurrent; //! the index of DDL files
04fa961a 80
be974aae 81 UInt_t fType; // event type (no idea from where to get it - put physics_event)
82 UInt_t fRunNb; // run number (no idea from where to get it - put 0)
83 UInt_t fId[2]; // id field (read from the first CDH found, period is not filled)
b3c6961a 84 UInt_t fTriggerPattern[4]; // the trigger class pattern (read from the first CDH found)
be974aae 85 UInt_t fDetectorPattern; // the detector pattern (no idea from where to read it)
86 UInt_t fTimestamp; // event timestamp (read from the DDL file creation time)
87
f3c1e83c 88 private :
89 AliRawReaderFile(const AliRawReaderFile& rawReader);
90 AliRawReaderFile& operator = (const AliRawReaderFile& rawReader);
91
04fa961a 92 ClassDef(AliRawReaderFile, 0) // class for reading raw digits from a file
93};
94
95#endif