corrections to get the forwarding of requests to the raw reader working, still needs...
[u/mrichter/AliRoot.git] / HLT / rec / AliRawReaderHLT.cxx
CommitLineData
9c7b5023 1// $Id: AliRawReaderHLT.cxx,v 1.3 2007/11/15 18:12:44 szostak Exp $
2
3/**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
5 * ALICE Experiment at CERN, All rights reserved. *
6 * *
7 * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8 * for The ALICE HLT Project. *
9 * *
10 * Permission to use, copy, modify and distribute this software and its *
11 * documentation strictly for non-commercial purposes is hereby granted *
12 * without fee, provided that the above copyright notice appears in all *
13 * copies and that both the copyright notice and this permission notice *
14 * appear in the supporting documentation. The authors make no claims *
15 * about the suitability of this software for any purpose. It is *
16 * provided "as is" without express or implied warranty. *
17 **************************************************************************/
18
19/** @file AliRawReaderHLT.cxx
20 @author Matthias Richter
21 @date
22 @brief AliRawReader implementation which replaces original input of
23 detectors with the appropriate HLT output. */
24
25// see header file for class documentation
26// or
27// refer to README to build package
28// or
29// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
30
31#include "AliRawReaderHLT.h"
e3917543 32#include "AliLog.h"
9c7b5023 33
34/** ROOT macro for the implementation of ROOT specific class methods */
35ClassImp(AliRawReaderHLT)
36
37AliRawReaderHLT::AliRawReaderHLT(AliRawReader* pRawreader, const char* options)
38 :
39 AliRawReader(),
40 fpParentReader(pRawreader),
41 fOptions()
42{
43 // see header file for class documentation
44 // or
45 // refer to README to build package
46 // or
47 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
48 fOptions=options;
49}
50
51AliRawReaderHLT::~AliRawReaderHLT()
52{
53 // see header file for class documentation
54}
55
56UInt_t AliRawReaderHLT::GetType() const
57{
58 // see header file for class documentation
59 return fpParentReader->GetType();
60}
61
62UInt_t AliRawReaderHLT::GetRunNumber() const
63{
64 // see header file for class documentation
65 return fpParentReader->GetRunNumber();
66}
67
68const UInt_t* AliRawReaderHLT::GetEventId() const
69{
70 // see header file for class documentation
71 return fpParentReader->GetEventId();
72}
73
74const UInt_t* AliRawReaderHLT::GetTriggerPattern() const
75{
76 // see header file for class documentation
77 return fpParentReader->GetTriggerPattern();
78}
79
80const UInt_t* AliRawReaderHLT::GetDetectorPattern() const
81{
82 // see header file for class documentation
83 return fpParentReader->GetDetectorPattern();
84}
85
86const UInt_t* AliRawReaderHLT::GetAttributes() const
87{
88 // see header file for class documentation
89 return fpParentReader->GetAttributes();
90}
91
92const UInt_t* AliRawReaderHLT::GetSubEventAttributes() const
93{
94 // see header file for class documentation
95 return fpParentReader->GetSubEventAttributes();
96}
97
98UInt_t AliRawReaderHLT::GetLDCId() const
99{
100 // see header file for class documentation
101 return fpParentReader->GetLDCId();
102}
103
104UInt_t AliRawReaderHLT::GetGDCId() const
105{
106 // see header file for class documentation
107 return fpParentReader->GetGDCId();
108}
109
110UInt_t AliRawReaderHLT::GetTimestamp() const
111{
112 // see header file for class documentation
113 return fpParentReader->GetTimestamp();
114}
115
116const UInt_t* AliRawReaderHLT::GetEquipmentAttributes() const
117{
118 // see header file for class documentation
119 return fpParentReader->GetEquipmentAttributes();
120}
121
122Int_t AliRawReaderHLT::GetEquipmentElementSize() const
123{
124 // see header file for class documentation
125 return fpParentReader->GetEquipmentElementSize();
126}
127
128Int_t AliRawReaderHLT::GetEquipmentHeaderSize() const
129{
130 // see header file for class documentation
131 return fpParentReader->GetEquipmentHeaderSize();
132}
133
134Int_t AliRawReaderHLT::GetEquipmentSize() const
135{
136 // see header file for class documentation
137 return fpParentReader->GetEquipmentSize();
138}
139
140Int_t AliRawReaderHLT::GetEquipmentType() const
141{
142 // see header file for class documentation
143 return fpParentReader->GetEquipmentType();
144}
145
146Int_t AliRawReaderHLT::GetEquipmentId() const
147{
148 // see header file for class documentation
e3917543 149 Int_t id=fpParentReader->GetEquipmentId();
150 //AliInfo(Form("id=%d",id));
151 return id;
9c7b5023 152}
153
154Bool_t AliRawReaderHLT::ReadHeader()
155{
156 // see header file for class documentation
e3917543 157 Bool_t result=fpParentReader->ReadHeader();
158 fHeader=const_cast<AliRawDataHeader*>(GetDataHeader());
159 return result;
9c7b5023 160}
161
162Bool_t AliRawReaderHLT::ReadNextData(UChar_t*& data)
163{
164 // see header file for class documentation
e3917543 165 Bool_t result=fpParentReader->ReadNextData(data);
166 fHeader=const_cast<AliRawDataHeader*>(GetDataHeader());
167 return result;
9c7b5023 168}
169
170Bool_t AliRawReaderHLT::ReadNextInt(UInt_t& data)
171{
172 // see header file for class documentation
e3917543 173 Bool_t result=fpParentReader->ReadNextInt(data);
174 fHeader=const_cast<AliRawDataHeader*>(GetDataHeader());
175 return result;
9c7b5023 176}
177
178Bool_t AliRawReaderHLT::ReadNextShort(UShort_t& data)
179{
180 // see header file for class documentation
e3917543 181 Bool_t result=fpParentReader->ReadNextShort(data);
182 fHeader=const_cast<AliRawDataHeader*>(GetDataHeader());
183 return result;
9c7b5023 184}
185
186Bool_t AliRawReaderHLT::ReadNextChar(UChar_t& data)
187{
188 // see header file for class documentation
e3917543 189 Bool_t result=fpParentReader->ReadNextChar(data);
190 fHeader=const_cast<AliRawDataHeader*>(GetDataHeader());
191 return result;
9c7b5023 192}
193
194Bool_t AliRawReaderHLT::ReadNext(UChar_t* data, Int_t size)
195{
196 // see header file for class documentation
e3917543 197 Bool_t result=fpParentReader->ReadNext(data, size);
198 fHeader=const_cast<AliRawDataHeader*>(GetDataHeader());
199 return result;
9c7b5023 200}
201
202Bool_t AliRawReaderHLT::Reset()
203{
204 // see header file for class documentation
205 return fpParentReader->Reset();
206}
207
208Bool_t AliRawReaderHLT::NextEvent()
209{
210 // see header file for class documentation
e3917543 211 //AliInfo(Form("SelectEquipment: type=%d min=%d max=%d", fSelectEquipmentType, fSelectMinEquipmentId, fSelectMaxEquipmentId));
212 //fpParentReader->SelectEquipment(fSelectEquipmentType, fSelectMinEquipmentId, fSelectMaxEquipmentId);
213 Bool_t result=fpParentReader->NextEvent();
214 if (result) fEventNumber++;
215 AliInfo(Form("event %d", fEventNumber));
216 return result;
9c7b5023 217}
218
219Bool_t AliRawReaderHLT::RewindEvents()
220{
221 // see header file for class documentation
e3917543 222 fEventNumber=-1;
9c7b5023 223 return fpParentReader->RewindEvents();
224}
225
e3917543 226void AliRawReaderHLT::Select(Int_t detectorID, Int_t minDDLID, Int_t maxDDLID)
227{
228 AliRawReader::Select(detectorID, minDDLID, maxDDLID);
229 fpParentReader->Select(detectorID, minDDLID, maxDDLID);
230}
231
232// most likely we do not need this method since the base class directly forwards
233// to this method
234// void AliRawReaderHLT::Select(const char *detectorName, Int_t minDDLID, Int_t maxDDLID)
235// {
236// AliInfo(Form("detectorName=%s, minDDLID=%d, maxDDLID=%d", detectorName, minDDLID, maxDDLID));
237// AliRawReader::Select(detectorName, minDDLID, maxDDLID);
238// fpParentReader->Select(detectorName, minDDLID, maxDDLID);
239// }
240
241void AliRawReaderHLT::SelectEquipment(Int_t equipmentType, Int_t minEquipmentId, Int_t maxEquipmentId)
242{
243 AliInfo(Form("equipmentType=%d, minEquipmentId=%d, maxEquipmentId=%d", equipmentType, minEquipmentId, maxEquipmentId));
244 AliRawReader::Select(equipmentType, minEquipmentId, maxEquipmentId);
245 fpParentReader->Select(equipmentType, minEquipmentId, maxEquipmentId);
246}
247
248void AliRawReaderHLT::SkipInvalid(Bool_t skip)
249{
250 AliRawReader::SkipInvalid(skip);
251 fpParentReader->SkipInvalid(skip);
252}
253
254void AliRawReaderHLT::SelectEvents(Int_t type)
255{
256 AliInfo(Form("type=%d", type));
257 AliRawReader::SelectEvents(type);
258 fpParentReader->SelectEvents(type);
259}
260
9c7b5023 261AliRawReader* AliRawReaderHLTCreateInstance(AliRawReader* pParentReader, const char* options)
262{
263 // see header file for class documentation
e3917543 264 if (!pParentReader) return NULL;
9c7b5023 265 return new AliRawReaderHLT(pParentReader, options);
266}