]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RAW/AliRawReaderRoot.h
Return pointer to the base class
[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 AliRawVEvent;
17 class AliRawVEquipment;
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(AliRawVEvent* 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 AliRawVEvent* 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     AliRawVEvent*    fEvent;        // (super) event
73     AliRawEventHeaderBase* fEventHeader; // (super) event header
74     Int_t            fSubEventIndex; // index of current sub event
75     AliRawVEvent*    fSubEvent;     // current sub event
76     Int_t            fEquipmentIndex; // index of current equipment
77     AliRawVEquipment*fEquipment;    // current equipment
78     AliRawData*      fRawData;      // current raw data
79     UChar_t*         fPosition;     // current position in the raw data
80     UChar_t*         fEnd;          // end position of the current subevent
81
82     void SwapData(const void* inbuf, const void* outbuf, UInt_t size);
83
84
85     ClassDef(AliRawReaderRoot, 0) // class for reading raw digits from a root file
86 };
87
88 #endif