]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/rec/AliRawReaderHLT.h
getting rid of compilation warnings
[u/mrichter/AliRoot.git] / HLT / rec / AliRawReaderHLT.h
1 //-*- Mode: C++ -*-
2 // $Id$
3
4 #ifndef ALIRAWREADERHLT_H
5 #define ALIRAWREADERHLT_H
6 //* This file is property of and copyright by the ALICE HLT Project        * 
7 //* ALICE Experiment at CERN, All rights reserved.                         *
8 //* See cxx source for full Copyright notice                               *
9
10 /** @file   AliRawReaderHLT.h
11     @author Matthias Richter
12     @date   
13     @brief  AliRawReader implementation which replaces original input of
14             detectors with the appropriate HLT output.                    */
15
16 // see below for class documentation
17 // or
18 // refer to README to build package
19 // or
20 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
21
22 #include "AliHLTDataTypes.h"
23 #include "AliRawReader.h"      // RAW, base class
24 #include "TString.h"
25 #include <vector>
26
27 class AliHLTOUT;
28 class AliHLTOUTHandler;
29
30 /**
31  * @class AliRawReaderHLT
32  * Handler of HLTOUT data for AliRawReader input.
33  */
34 class AliRawReaderHLT : public AliRawReader {
35  public:
36   /** constructor */
37   AliRawReaderHLT(AliRawReader* pParentReader, const char* options=NULL);
38   /** destructor */
39   virtual ~AliRawReaderHLT();
40
41   // interface methods of AliRawReader
42   void     Select(Int_t detectorID, 
43                   Int_t minDDLID = -1, Int_t maxDDLID = -1);
44 //   void     Select(const char *detectorName, 
45 //                Int_t minDDLID = -1, Int_t maxDDLID = -1);
46
47   using AliRawReader::Select;
48
49   void     SelectEquipment(Int_t equipmentType, 
50                            Int_t minEquipmentId = -1, 
51                            Int_t maxEquipmentId = -1);
52   void     SkipInvalid(Bool_t skip = kTRUE);
53   void     SelectEvents(Int_t type);
54
55   UInt_t   GetType() const;
56   UInt_t   GetRunNumber() const;
57   const UInt_t* GetEventId() const;
58   const UInt_t* GetTriggerPattern() const;
59   const UInt_t* GetDetectorPattern() const;
60   const UInt_t* GetAttributes() const;
61   const UInt_t* GetSubEventAttributes() const;
62   UInt_t   GetLDCId() const;
63   UInt_t   GetGDCId() const;
64   UInt_t   GetTimestamp() const;
65
66   const UInt_t* GetEquipmentAttributes() const;
67   Int_t    GetEquipmentElementSize() const;
68   Int_t    GetEquipmentHeaderSize() const;
69
70   Int_t    GetEquipmentSize() const;
71   Int_t    GetEquipmentType() const;
72   Int_t    GetEquipmentId() const;
73   Bool_t   ReadHeader();
74   Bool_t   ReadNextData(UChar_t*& data);
75   Bool_t   ReadNextInt(UInt_t& data);
76   Bool_t   ReadNextShort(UShort_t& data);
77   Bool_t   ReadNextChar(UChar_t& data);
78   Bool_t   ReadNext(UChar_t* data, Int_t size);
79
80   Bool_t   Reset();
81
82   Bool_t   NextEvent();
83   Bool_t   RewindEvents();
84
85  protected:
86
87  private:
88   /** standard constructor prohibited */
89   AliRawReaderHLT();
90   /** copy constructor prohibited */
91   AliRawReaderHLT(const AliRawReaderHLT&);
92   /** assignment operator prohibited */
93   AliRawReaderHLT& operator=(const AliRawReaderHLT&);
94
95   /**
96    * Scan the options.
97    * Set the ids for the specified detectors in the detector
98    * list. Currently, no other options are available.
99    */
100   int ScanOptions(const char* options);
101
102   /**
103    * Read the next data block from the HLT stream
104    */
105   Bool_t ReadNextHLTData();
106
107   /**
108    * Check if a ddlid is part of the ones which are selected for
109    * input replacement.
110    */
111   Bool_t IsHLTInput(int ddlid);
112
113   /** the rawreader */
114   AliRawReader* fpParentReader; //!transient
115
116   /** options */
117   TString fOptions; //!transient
118
119   /** current data set, either extracted from the HLT stream or parent raw reader */
120   const AliHLTUInt8_t* fpData; // !transient
121
122   /** size of the current data set */
123   int fDataSize; // !transient
124
125   /** current stream offset in the data set */
126   int fOffset; // !transient
127
128   /** equipment id of the current data set, >0 indicates data set from HLT stream */
129   int fEquipmentId; // !transient
130
131   /** indicates the availibility of data from the HLT stream */
132   bool fbHaveHLTData; // !transient
133
134   /** list of detectors for which data will be taken from HLT stream */
135   vector<int> fDetectors; // !transient
136
137   /** instance of the HLTOUT handler */
138   AliHLTOUT* fpHLTOUT; // !transient
139
140   /** instance of the data handler providing the current data buffer */
141   AliHLTOUTHandler* fpDataHandler; // !transient
142
143   ClassDef(AliRawReaderHLT, 2)
144 };
145
146 #define ALIHLTREC_LIBRARY                   "libHLTrec.so"
147 #define ALIHLTREC_LIBRARY_VERSION           0
148 #define ALIRAWREADERHLT_CREATE_INSTANCE     "AliRawReaderHLTCreateInstance"
149
150 #ifdef __cplusplus
151 extern "C" {
152 #endif
153   typedef AliRawReader* (*AliRawReaderHLTCreateInstance_t)(AliRawReader* pParentReader, const char* options);
154
155   /**
156    * Create an instance of the AliRawReader class
157    */
158   AliRawReader* AliRawReaderHLTCreateInstance(AliRawReader* pParentReader, const char* options);
159 #ifdef __cplusplus
160 }
161 #endif
162 #endif