3 /**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
5 * ALICE Experiment at CERN, All rights reserved. *
7 * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8 * for The ALICE HLT Project. *
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 **************************************************************************/
19 /** @file AliRawReaderHLT.cxx
20 @author Matthias Richter
22 @brief AliRawReader implementation which replaces original input of
23 detectors with the appropriate HLT output. */
25 // see header file for class documentation
27 // refer to README to build package
29 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
31 #include "AliRawReaderHLT.h"
34 /** ROOT macro for the implementation of ROOT specific class methods */
35 ClassImp(AliRawReaderHLT)
37 AliRawReaderHLT::AliRawReaderHLT(AliRawReader* pRawreader, const char* options)
40 fpParentReader(pRawreader),
43 // see header file for class documentation
45 // refer to README to build package
47 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
51 AliRawReaderHLT::~AliRawReaderHLT()
53 // see header file for class documentation
56 UInt_t AliRawReaderHLT::GetType() const
58 // see header file for class documentation
59 return fpParentReader->GetType();
62 UInt_t AliRawReaderHLT::GetRunNumber() const
64 // see header file for class documentation
65 return fpParentReader->GetRunNumber();
68 const UInt_t* AliRawReaderHLT::GetEventId() const
70 // see header file for class documentation
71 return fpParentReader->GetEventId();
74 const UInt_t* AliRawReaderHLT::GetTriggerPattern() const
76 // see header file for class documentation
77 return fpParentReader->GetTriggerPattern();
80 const UInt_t* AliRawReaderHLT::GetDetectorPattern() const
82 // see header file for class documentation
83 return fpParentReader->GetDetectorPattern();
86 const UInt_t* AliRawReaderHLT::GetAttributes() const
88 // see header file for class documentation
89 return fpParentReader->GetAttributes();
92 const UInt_t* AliRawReaderHLT::GetSubEventAttributes() const
94 // see header file for class documentation
95 return fpParentReader->GetSubEventAttributes();
98 UInt_t AliRawReaderHLT::GetLDCId() const
100 // see header file for class documentation
101 return fpParentReader->GetLDCId();
104 UInt_t AliRawReaderHLT::GetGDCId() const
106 // see header file for class documentation
107 return fpParentReader->GetGDCId();
110 UInt_t AliRawReaderHLT::GetTimestamp() const
112 // see header file for class documentation
113 return fpParentReader->GetTimestamp();
116 const UInt_t* AliRawReaderHLT::GetEquipmentAttributes() const
118 // see header file for class documentation
119 return fpParentReader->GetEquipmentAttributes();
122 Int_t AliRawReaderHLT::GetEquipmentElementSize() const
124 // see header file for class documentation
125 return fpParentReader->GetEquipmentElementSize();
128 Int_t AliRawReaderHLT::GetEquipmentHeaderSize() const
130 // see header file for class documentation
131 return fpParentReader->GetEquipmentHeaderSize();
134 Int_t AliRawReaderHLT::GetEquipmentSize() const
136 // see header file for class documentation
137 return fpParentReader->GetEquipmentSize();
140 Int_t AliRawReaderHLT::GetEquipmentType() const
142 // see header file for class documentation
143 return fpParentReader->GetEquipmentType();
146 Int_t AliRawReaderHLT::GetEquipmentId() const
148 // see header file for class documentation
149 Int_t id=fpParentReader->GetEquipmentId();
150 //AliInfo(Form("id=%d",id));
154 Bool_t AliRawReaderHLT::ReadHeader()
156 // see header file for class documentation
157 Bool_t result=fpParentReader->ReadHeader();
158 fHeader=const_cast<AliRawDataHeader*>(fpParentReader->GetDataHeader());
162 Bool_t AliRawReaderHLT::ReadNextData(UChar_t*& data)
164 // see header file for class documentation
165 Bool_t result=fpParentReader->ReadNextData(data);
166 fHeader=const_cast<AliRawDataHeader*>(fpParentReader->GetDataHeader());
170 Bool_t AliRawReaderHLT::ReadNextInt(UInt_t& data)
172 // see header file for class documentation
173 Bool_t result=fpParentReader->ReadNextInt(data);
174 fHeader=const_cast<AliRawDataHeader*>(fpParentReader->GetDataHeader());
178 Bool_t AliRawReaderHLT::ReadNextShort(UShort_t& data)
180 // see header file for class documentation
181 Bool_t result=fpParentReader->ReadNextShort(data);
182 fHeader=const_cast<AliRawDataHeader*>(fpParentReader->GetDataHeader());
186 Bool_t AliRawReaderHLT::ReadNextChar(UChar_t& data)
188 // see header file for class documentation
189 Bool_t result=fpParentReader->ReadNextChar(data);
190 fHeader=const_cast<AliRawDataHeader*>(fpParentReader->GetDataHeader());
194 Bool_t AliRawReaderHLT::ReadNext(UChar_t* data, Int_t size)
196 // see header file for class documentation
197 Bool_t result=fpParentReader->ReadNext(data, size);
198 fHeader=const_cast<AliRawDataHeader*>(fpParentReader->GetDataHeader());
202 Bool_t AliRawReaderHLT::Reset()
204 // see header file for class documentation
205 return fpParentReader->Reset();
208 Bool_t AliRawReaderHLT::NextEvent()
210 // see header file for class documentation
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));
219 Bool_t AliRawReaderHLT::RewindEvents()
221 // see header file for class documentation
223 return fpParentReader->RewindEvents();
226 void AliRawReaderHLT::Select(Int_t detectorID, Int_t minDDLID, Int_t maxDDLID)
228 AliRawReader::Select(detectorID, minDDLID, maxDDLID);
229 fpParentReader->Select(detectorID, minDDLID, maxDDLID);
232 // most likely we do not need this method since the base class directly forwards
234 // void AliRawReaderHLT::Select(const char *detectorName, Int_t minDDLID, Int_t maxDDLID)
236 // AliInfo(Form("detectorName=%s, minDDLID=%d, maxDDLID=%d", detectorName, minDDLID, maxDDLID));
237 // AliRawReader::Select(detectorName, minDDLID, maxDDLID);
238 // fpParentReader->Select(detectorName, minDDLID, maxDDLID);
241 void AliRawReaderHLT::SelectEquipment(Int_t equipmentType, Int_t minEquipmentId, Int_t maxEquipmentId)
243 //AliInfo(Form("equipmentType=%d, minEquipmentId=%d, maxEquipmentId=%d", equipmentType, minEquipmentId, maxEquipmentId));
244 AliRawReader::Select(equipmentType, minEquipmentId, maxEquipmentId);
245 fpParentReader->Select(equipmentType, minEquipmentId, maxEquipmentId);
248 void AliRawReaderHLT::SkipInvalid(Bool_t skip)
250 AliRawReader::SkipInvalid(skip);
251 fpParentReader->SkipInvalid(skip);
254 void AliRawReaderHLT::SelectEvents(Int_t type)
256 //AliInfo(Form("type=%d", type));
257 AliRawReader::SelectEvents(type);
258 fpParentReader->SelectEvents(type);
261 AliRawReader* AliRawReaderHLTCreateInstance(AliRawReader* pParentReader, const char* options)
263 // see header file for class documentation
264 if (!pParentReader) return NULL;
265 return new AliRawReaderHLT(pParentReader, options);