]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RAW/AliRawReaderRoot.h
New method fos accessing raw-event object directly. Needed by EMCAL for some special...
[u/mrichter/AliRoot.git] / RAW / AliRawReaderRoot.h
1 #ifndef ALIRAWREADERROOT_H
2 #define ALIRAWREADERROOT_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 from a root file.
11 ///
12 ///////////////////////////////////////////////////////////////////////////////
13
14 #include "AliRawReader.h"
15
16 class AliRawEvent;
17 class AliRawEquipment;
18 class AliRawData;
19 class TFile;
20 class TBranch;
21
22
23 class AliRawReaderRoot: public AliRawReader {
24   public :
25     AliRawReaderRoot();
26     AliRawReaderRoot(const char* fileName, Int_t eventNumber = -1);
27     AliRawReaderRoot(AliRawEvent* event);
28     AliRawReaderRoot(const AliRawReaderRoot& rawReader);
29     AliRawReaderRoot& operator = (const AliRawReaderRoot& rawReader);
30     virtual ~AliRawReaderRoot();
31
32     virtual const AliRawEventHeaderBase* GetEventHeader() const;
33
34     virtual UInt_t   GetType() const;
35     virtual UInt_t   GetRunNumber() const;
36     virtual const UInt_t* GetEventId() const;
37     virtual const UInt_t* GetTriggerPattern() const;
38     virtual const UInt_t* GetDetectorPattern() const;
39     virtual const UInt_t* GetAttributes() const;
40     virtual const UInt_t* GetSubEventAttributes() const;
41     virtual UInt_t   GetLDCId() const;
42     virtual UInt_t   GetGDCId() const;
43     virtual UInt_t   GetTimestamp() const;
44
45     virtual Int_t    GetEquipmentSize() const;
46     virtual Int_t    GetEquipmentType() const;
47     virtual Int_t    GetEquipmentId() const;
48     virtual const UInt_t* GetEquipmentAttributes() const;
49     virtual Int_t    GetEquipmentElementSize() const;
50     virtual Int_t    GetEquipmentHeaderSize() const;
51
52     virtual Bool_t   ReadHeader();
53     virtual Bool_t   ReadNextData(UChar_t*& data);
54     virtual Bool_t   ReadNext(UChar_t* data, Int_t size);
55
56     virtual Bool_t   Reset();
57
58     virtual Bool_t   NextEvent();
59     virtual Bool_t   RewindEvents();
60     virtual Bool_t   GotoEvent(Int_t event);
61     virtual Int_t    GetEventIndex() const { return fEventIndex; }
62     virtual Int_t    GetNumberOfEvents() const;
63
64     virtual Int_t    CheckData() const;
65
66     virtual const AliRawEvent* GetEvent() const {return fEvent;}
67
68   protected :
69     TFile*           fFile;         // raw data root file
70     TBranch*         fBranch;       // branch of raw events
71     Int_t            fEventIndex;   // index of the event in the tree
72     AliRawEvent*     fEvent;        // (super) event
73     Int_t            fSubEventIndex; // index of current sub event
74     AliRawEvent*     fSubEvent;     // current sub event
75     Int_t            fEquipmentIndex; // index of current equipment
76     AliRawEquipment* fEquipment;    // current equipment
77     AliRawData*      fRawData;      // current raw data
78     UChar_t*         fPosition;     // current position in the raw data
79     UChar_t*         fEnd;          // end position of the current subevent
80
81     void SwapData(const void* inbuf, const void* outbuf, UInt_t size);
82
83
84     ClassDef(AliRawReaderRoot, 0) // class for reading raw digits from a root file
85 };
86
87 #endif