]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/rec/AliRawReaderHLT.h
Adding AliTPCcalibV0 to the Makefile (Marian)
[u/mrichter/AliRoot.git] / HLT / rec / AliRawReaderHLT.h
CommitLineData
9c7b5023 1//-*- Mode: C++ -*-
7e914051 2// $Id$
9c7b5023 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
13b78f4c 22#include "AliHLTDataTypes.h"
23#include "AliRawReader.h" // RAW, base class
a3ef3c1d 24#include "AliHLTReconstructorBase.h"
9c7b5023 25#include "TString.h"
13b78f4c 26#include <vector>
9c7b5023 27
13b78f4c 28class AliHLTOUT;
626bfcc1 29class AliHLTOUTHandler;
30
9c7b5023 31/**
32 * @class AliRawReaderHLT
33 * Handler of HLTOUT data for AliRawReader input.
34 */
a3ef3c1d 35class AliRawReaderHLT : public AliRawReader, public AliHLTReconstructorBase {
9c7b5023 36 public:
37 /** constructor */
38 AliRawReaderHLT(AliRawReader* pParentReader, const char* options=NULL);
39 /** destructor */
40 virtual ~AliRawReaderHLT();
41
42 // interface methods of AliRawReader
e3917543 43 void Select(Int_t detectorID,
44 Int_t minDDLID = -1, Int_t maxDDLID = -1);
45// void Select(const char *detectorName,
46// Int_t minDDLID = -1, Int_t maxDDLID = -1);
b0914d2e 47
48 using AliRawReader::Select;
49
e3917543 50 void SelectEquipment(Int_t equipmentType,
51 Int_t minEquipmentId = -1,
52 Int_t maxEquipmentId = -1);
53 void SkipInvalid(Bool_t skip = kTRUE);
54 void SelectEvents(Int_t type);
55
9c7b5023 56 UInt_t GetType() const;
57 UInt_t GetRunNumber() const;
58 const UInt_t* GetEventId() const;
59 const UInt_t* GetTriggerPattern() const;
60 const UInt_t* GetDetectorPattern() const;
61 const UInt_t* GetAttributes() const;
62 const UInt_t* GetSubEventAttributes() const;
63 UInt_t GetLDCId() const;
64 UInt_t GetGDCId() const;
65 UInt_t GetTimestamp() const;
66
67 const UInt_t* GetEquipmentAttributes() const;
68 Int_t GetEquipmentElementSize() const;
69 Int_t GetEquipmentHeaderSize() const;
70
71 Int_t GetEquipmentSize() const;
72 Int_t GetEquipmentType() const;
73 Int_t GetEquipmentId() const;
74 Bool_t ReadHeader();
75 Bool_t ReadNextData(UChar_t*& data);
76 Bool_t ReadNextInt(UInt_t& data);
77 Bool_t ReadNextShort(UShort_t& data);
78 Bool_t ReadNextChar(UChar_t& data);
79 Bool_t ReadNext(UChar_t* data, Int_t size);
80
81 Bool_t Reset();
82
83 Bool_t NextEvent();
84 Bool_t RewindEvents();
85
86 protected:
87
88 private:
89 /** standard constructor prohibited */
90 AliRawReaderHLT();
91 /** copy constructor prohibited */
92 AliRawReaderHLT(const AliRawReaderHLT&);
93 /** assignment operator prohibited */
94 AliRawReaderHLT& operator=(const AliRawReaderHLT&);
95
13b78f4c 96 /**
97 * Scan the options.
98 * Set the ids for the specified detectors in the detector
99 * list. Currently, no other options are available.
100 */
101 int ScanOptions(const char* options);
102
103 /**
104 * Read the next data block from the HLT stream
105 */
106 Bool_t ReadNextHLTData();
107
108 /**
109 * Check if a ddlid is part of the ones which are selected for
110 * input replacement.
111 */
112 Bool_t IsHLTInput(int ddlid);
113
d3833f99 114 /**
115 * Check if redirection is enabled for at least one detector in the
116 * selected range.
117 * Set the fbHaveHLTData variable
118 * @return true if data has to be read from the HLT stream.
119 */
120 Bool_t EvaluateSelection();
121
122 /**
123 * Release the current HLT data.
124 * Releases the current buffer of either the active HLTOUT data
125 * block handler or the HLTOUT instance. The latter implies a
126 * reset of the reader concerning the HLT data blocks.
127 * @param bReleaseHLTOUT release HLTOUT instance if \em true
128 * only current data buffer if \em false
129 * @return neg. error code if failed
130 */
131 int ReleaseHLTData(bool bReleaseHLTOUT=true);
132
9c7b5023 133 /** the rawreader */
134 AliRawReader* fpParentReader; //!transient
135
136 /** options */
137 TString fOptions; //!transient
13b78f4c 138
a3ef3c1d 139 /** system options = options w/o detector strings */
140 TString fSystemOptions; //!transient
141
13b78f4c 142 /** current data set, either extracted from the HLT stream or parent raw reader */
143 const AliHLTUInt8_t* fpData; // !transient
144
145 /** size of the current data set */
146 int fDataSize; // !transient
147
148 /** current stream offset in the data set */
149 int fOffset; // !transient
150
d3833f99 151 /** current stream position for the ReadNextData function */
152 int fPosition; // !transient
153
13b78f4c 154 /** equipment id of the current data set, >0 indicates data set from HLT stream */
155 int fEquipmentId; // !transient
156
157 /** indicates the availibility of data from the HLT stream */
158 bool fbHaveHLTData; // !transient
159
160 /** list of detectors for which data will be taken from HLT stream */
161 vector<int> fDetectors; // !transient
162
163 /** instance of the HLTOUT handler */
164 AliHLTOUT* fpHLTOUT; // !transient
165
626bfcc1 166 /** instance of the data handler providing the current data buffer */
167 AliHLTOUTHandler* fpDataHandler; // !transient
168
a3ef3c1d 169 ClassDef(AliRawReaderHLT, 3)
9c7b5023 170};
171
172#define ALIHLTREC_LIBRARY "libHLTrec.so"
173#define ALIHLTREC_LIBRARY_VERSION 0
174#define ALIRAWREADERHLT_CREATE_INSTANCE "AliRawReaderHLTCreateInstance"
175
176#ifdef __cplusplus
177extern "C" {
178#endif
179 typedef AliRawReader* (*AliRawReaderHLTCreateInstance_t)(AliRawReader* pParentReader, const char* options);
180
181 /**
182 * Create an instance of the AliRawReader class
183 */
184 AliRawReader* AliRawReaderHLTCreateInstance(AliRawReader* pParentReader, const char* options);
185#ifdef __cplusplus
186}
187#endif
188#endif