]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/rec/AliRawReaderHLT.cxx
several bugfixes in the HLTOUT simulation
[u/mrichter/AliRoot.git] / HLT / rec / AliRawReaderHLT.cxx
1 // $Id$
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"
32 #include "AliLog.h"
33
34 /** ROOT macro for the implementation of ROOT specific class methods */
35 ClassImp(AliRawReaderHLT)
36
37 AliRawReaderHLT::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
51 AliRawReaderHLT::~AliRawReaderHLT()
52 {
53   // see header file for class documentation
54 }
55
56 UInt_t AliRawReaderHLT::GetType() const
57 {
58   // see header file for class documentation
59   return fpParentReader->GetType();
60 }
61
62 UInt_t AliRawReaderHLT::GetRunNumber() const
63 {
64   // see header file for class documentation
65   return fpParentReader->GetRunNumber();
66 }
67
68 const UInt_t* AliRawReaderHLT::GetEventId() const
69 {
70   // see header file for class documentation
71   return fpParentReader->GetEventId();
72 }
73
74 const UInt_t* AliRawReaderHLT::GetTriggerPattern() const
75 {
76   // see header file for class documentation
77   return fpParentReader->GetTriggerPattern();
78 }
79
80 const UInt_t* AliRawReaderHLT::GetDetectorPattern() const
81 {
82   // see header file for class documentation
83   return fpParentReader->GetDetectorPattern();
84 }
85
86 const UInt_t* AliRawReaderHLT::GetAttributes() const
87 {
88   // see header file for class documentation
89   return fpParentReader->GetAttributes();
90 }
91
92 const UInt_t* AliRawReaderHLT::GetSubEventAttributes() const
93 {
94   // see header file for class documentation
95   return fpParentReader->GetSubEventAttributes();
96 }
97
98 UInt_t AliRawReaderHLT::GetLDCId() const
99 {
100   // see header file for class documentation
101   return fpParentReader->GetLDCId();
102 }
103
104 UInt_t AliRawReaderHLT::GetGDCId() const
105 {
106   // see header file for class documentation
107   return fpParentReader->GetGDCId();
108 }
109
110 UInt_t AliRawReaderHLT::GetTimestamp() const
111 {
112   // see header file for class documentation
113   return fpParentReader->GetTimestamp();
114 }
115
116 const UInt_t* AliRawReaderHLT::GetEquipmentAttributes() const
117 {
118   // see header file for class documentation
119   return fpParentReader->GetEquipmentAttributes();
120 }
121
122 Int_t    AliRawReaderHLT::GetEquipmentElementSize() const
123 {
124   // see header file for class documentation
125   return fpParentReader->GetEquipmentElementSize();
126 }
127
128 Int_t    AliRawReaderHLT::GetEquipmentHeaderSize() const
129 {
130   // see header file for class documentation
131   return fpParentReader->GetEquipmentHeaderSize();
132 }
133
134 Int_t    AliRawReaderHLT::GetEquipmentSize() const
135 {
136   // see header file for class documentation
137   return fpParentReader->GetEquipmentSize();
138 }
139
140 Int_t    AliRawReaderHLT::GetEquipmentType() const
141 {
142   // see header file for class documentation
143   return fpParentReader->GetEquipmentType();
144 }
145
146 Int_t    AliRawReaderHLT::GetEquipmentId() const
147 {
148   // see header file for class documentation
149   Int_t id=fpParentReader->GetEquipmentId();
150   //AliInfo(Form("id=%d",id));
151   return id;
152 }
153
154 Bool_t   AliRawReaderHLT::ReadHeader()
155 {
156   // see header file for class documentation
157   Bool_t result=fpParentReader->ReadHeader();
158   fHeader=const_cast<AliRawDataHeader*>(fpParentReader->GetDataHeader());
159   return result;
160 }
161
162 Bool_t   AliRawReaderHLT::ReadNextData(UChar_t*& data)
163 {
164   // see header file for class documentation
165   Bool_t result=fpParentReader->ReadNextData(data);
166   fHeader=const_cast<AliRawDataHeader*>(fpParentReader->GetDataHeader());
167   return result;
168 }
169
170 Bool_t   AliRawReaderHLT::ReadNextInt(UInt_t& data)
171 {
172   // see header file for class documentation
173   Bool_t result=fpParentReader->ReadNextInt(data);
174   fHeader=const_cast<AliRawDataHeader*>(fpParentReader->GetDataHeader());
175   return result;
176 }
177
178 Bool_t   AliRawReaderHLT::ReadNextShort(UShort_t& data)
179 {
180   // see header file for class documentation
181   Bool_t result=fpParentReader->ReadNextShort(data);
182   fHeader=const_cast<AliRawDataHeader*>(fpParentReader->GetDataHeader());
183   return result;
184 }
185
186 Bool_t   AliRawReaderHLT::ReadNextChar(UChar_t& data)
187 {
188   // see header file for class documentation
189   Bool_t result=fpParentReader->ReadNextChar(data);
190   fHeader=const_cast<AliRawDataHeader*>(fpParentReader->GetDataHeader());
191   return result;
192 }
193
194 Bool_t   AliRawReaderHLT::ReadNext(UChar_t* data, Int_t size)
195 {
196   // see header file for class documentation
197   Bool_t result=fpParentReader->ReadNext(data, size);
198   fHeader=const_cast<AliRawDataHeader*>(fpParentReader->GetDataHeader());
199   return result;
200 }
201
202 Bool_t   AliRawReaderHLT::Reset()
203 {
204   // see header file for class documentation
205   return fpParentReader->Reset();
206 }
207
208 Bool_t   AliRawReaderHLT::NextEvent()
209 {
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));
216   return result;
217 }
218
219 Bool_t   AliRawReaderHLT::RewindEvents()
220 {
221   // see header file for class documentation
222   fEventNumber=-1;
223   return fpParentReader->RewindEvents();
224 }
225
226 void 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
241 void 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
248 void AliRawReaderHLT::SkipInvalid(Bool_t skip)
249 {
250   AliRawReader::SkipInvalid(skip);
251   fpParentReader->SkipInvalid(skip);
252 }
253
254 void AliRawReaderHLT::SelectEvents(Int_t type)
255 {
256   //AliInfo(Form("type=%d", type));
257   AliRawReader::SelectEvents(type);
258   fpParentReader->SelectEvents(type);
259 }
260
261 AliRawReader* AliRawReaderHLTCreateInstance(AliRawReader* pParentReader, const char* options)
262 {
263   // see header file for class documentation
264   if (!pParentReader) return NULL;
265   return new AliRawReaderHLT(pParentReader, options);
266 }