]>
Commit | Line | Data |
---|---|---|
5b4ed716 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | ***************************************************************************/ | |
15 | ||
16 | /* | |
17 | $Log: AliTOFDecoder.cxx,v $ | |
18 | Revision 1.4 2007/05/18 13:08:57 decaro | |
19 | Coding convention: RS1 violation -> suppression | |
20 | ||
21 | Revision 1.3 2007/05/08 11:56:05 arcelli | |
22 | improved verbosity in verbose mode (R.Preghenella) | |
23 | ||
24 | Revision 1.2 2007/05/03 11:34:43 decaro | |
25 | Coding convention: RS1 violation -> suppression | |
26 | ||
27 | Revision 1.1 2007/04/27 11:00:32 arcelli | |
28 | TOF Raw Data decoder | |
29 | ||
30 | author: Roberto Preghenella (R+), preghenella@bo.infn.it | |
31 | */ | |
32 | ||
33 | ||
34 | ////////////////////////////////////////////////////////////////////// | |
35 | // // | |
36 | // // | |
37 | // Class for raw data decoding // | |
38 | // // | |
39 | // // | |
40 | ////////////////////////////////////////////////////////////////////// | |
41 | ||
42 | ||
43 | #include "AliLog.h" | |
44 | #include "AliTOFDecoderV2.h" | |
45 | #include "AliTOFTDCHit.h" | |
46 | ||
47 | ClassImp(AliTOFDecoderV2) | |
48 | ||
49 | //_________________________________________________________________ | |
50 | ||
51 | AliTOFDecoderV2::AliTOFDecoderV2(AliRawReader *reader) : | |
52 | TObject(), | |
53 | fRawReader(reader), | |
54 | fVerbose(kFALSE), | |
55 | fLogErrors(kTRUE), | |
56 | fV2718Patch(kFALSE), | |
57 | fRecoverError(kTRUE), | |
58 | fRecoverErrorThr(0), | |
59 | fSpider(kTRUE), | |
60 | fRunNumber(0), | |
61 | fEventNumber(0), | |
62 | fEquipmentID(0), | |
63 | fDecoderSummaryData(0x0), | |
64 | fDRMSummaryData(0x0), | |
65 | fLTMSummaryData(0x0), | |
66 | fTRMSummaryData(0x0), | |
67 | fChainSummaryData(0x0), | |
68 | fTDCHitBuffer(0x0), | |
69 | fTDCPackedHitBuffer(0x0), | |
70 | fTDCErrorBuffer(0x0), | |
71 | fDRMGlobalHeader(0x0), | |
72 | fDRMGlobalTrailer(0x0), | |
73 | fDRMStatusHeader1(0x0), | |
74 | fDRMStatusHeader2(0x0), | |
75 | fDRMStatusHeader3(0x0), | |
76 | fDRMStatusHeader4(0x0), | |
77 | fDRMEventCRC(0x0), | |
78 | fLTMGlobalHeader(0x0), | |
79 | fLTMGlobalTrailer(0x0), | |
80 | fLTMPDLData(0x0), | |
81 | fLTMADCData(0x0), | |
82 | fLTMORData(0x0), | |
83 | fTRMGlobalHeader(0x0), | |
84 | fTRMGlobalTrailer(0x0), | |
85 | fTRMChainHeader(0x0), | |
86 | fTRMChainTrailer(0x0), | |
87 | fTDCPackedHit(0x0), | |
88 | fTDCUnpackedHit(0x0), | |
89 | fTRMTDCError(0x0), | |
90 | fTRMDiagnosticErrorWord1(0x0), | |
91 | fTRMDiagnosticErrorWord2(0x0), | |
92 | fSpiderTDCID(-1), | |
93 | fSpiderTDCPackedHitBuffer(0x0) | |
94 | { | |
95 | //default constructor | |
96 | if (fRawReader) | |
97 | fRawReader->Select("TOF", 0, 71); | |
98 | ||
99 | fDecoderSummaryData = new AliTOFDecoderSummaryData(); | |
100 | ||
101 | for (Int_t iChan = 0; iChan < N_CHANNEL; iChan++) | |
102 | fSpiderBufferFull[iChan] = kFALSE; | |
103 | } | |
104 | ||
105 | //_________________________________________________________________ | |
106 | ||
107 | AliTOFDecoderV2::AliTOFDecoderV2(const AliTOFDecoderV2 &source) : | |
108 | TObject(), | |
109 | fRawReader(source.fRawReader), | |
110 | fVerbose(source.fVerbose), | |
111 | fLogErrors(source.fLogErrors), | |
112 | fV2718Patch(source.fV2718Patch), | |
113 | fRecoverError(source.fRecoverError), | |
114 | fRecoverErrorThr(source.fRecoverErrorThr), | |
115 | fSpider(source.fSpider), | |
116 | fRunNumber(source.fRunNumber), | |
117 | fEventNumber(source.fEventNumber), | |
118 | fEquipmentID(source.fEquipmentID), | |
119 | fDecoderSummaryData(0x0), | |
120 | fDRMSummaryData(0x0), | |
121 | fLTMSummaryData(0x0), | |
122 | fTRMSummaryData(0x0), | |
123 | fChainSummaryData(0x0), | |
124 | fTDCHitBuffer(0x0), | |
125 | fTDCPackedHitBuffer(0x0), | |
126 | fTDCErrorBuffer(0x0), | |
127 | fDRMGlobalHeader(0x0), | |
128 | fDRMGlobalTrailer(0x0), | |
129 | fDRMStatusHeader1(0x0), | |
130 | fDRMStatusHeader2(0x0), | |
131 | fDRMStatusHeader3(0x0), | |
132 | fDRMStatusHeader4(0x0), | |
133 | fDRMEventCRC(0x0), | |
134 | fLTMGlobalHeader(0x0), | |
135 | fLTMGlobalTrailer(0x0), | |
136 | fLTMPDLData(0x0), | |
137 | fLTMADCData(0x0), | |
138 | fLTMORData(0x0), | |
139 | fTRMGlobalHeader(0x0), | |
140 | fTRMGlobalTrailer(0x0), | |
141 | fTRMChainHeader(0x0), | |
142 | fTRMChainTrailer(0x0), | |
143 | fTDCPackedHit(0x0), | |
144 | fTDCUnpackedHit(0x0), | |
145 | fTRMTDCError(0x0), | |
146 | fTRMDiagnosticErrorWord1(0x0), | |
147 | fTRMDiagnosticErrorWord2(0x0), | |
148 | fSpiderTDCID(-1), | |
149 | fSpiderTDCPackedHitBuffer(0x0) | |
150 | { | |
151 | //copy constructor | |
152 | fDecoderSummaryData = new AliTOFDecoderSummaryData(*source.fDecoderSummaryData); | |
153 | ||
154 | for (Int_t iChan = 0; iChan < N_CHANNEL; iChan++) | |
155 | fSpiderBufferFull[iChan] = kFALSE; | |
156 | } | |
157 | ||
158 | //_________________________________________________________________ | |
159 | ||
160 | AliTOFDecoderV2 & | |
161 | AliTOFDecoderV2::operator = (const AliTOFDecoderV2 &source) | |
162 | { | |
163 | //operator = | |
164 | fRawReader = source.fRawReader; | |
165 | fVerbose = source.fVerbose; | |
166 | fLogErrors = source.fLogErrors; | |
167 | fV2718Patch = source.fV2718Patch; | |
168 | fRecoverError = source.fRecoverError; | |
169 | fRecoverErrorThr = source.fRecoverErrorThr; | |
170 | fSpider = source.fSpider; | |
171 | fRunNumber = source.fRunNumber; | |
172 | fEventNumber = source.fEventNumber; | |
173 | fEquipmentID = source.fEquipmentID; | |
174 | *fDecoderSummaryData = *source.fDecoderSummaryData; | |
175 | return *this; | |
176 | } | |
177 | ||
178 | AliTOFDecoderV2::~AliTOFDecoderV2() | |
179 | { | |
180 | delete fDecoderSummaryData; | |
181 | } | |
182 | ||
183 | //_________________________________________________________________ | |
184 | ||
185 | Bool_t | |
186 | AliTOFDecoderV2::Decode(UInt_t *rawData, UInt_t nWords) | |
187 | { | |
188 | /* main decoding routine. | |
189 | * it loops over nWords 32-bit words | |
190 | * starting at *rawData and decodes them. | |
191 | * it also fills some buffers in order to | |
192 | * have the decoded data available for other | |
193 | * classes. | |
194 | */ | |
195 | ||
196 | //reset decoder summary data | |
197 | fDecoderSummaryData->Reset(); | |
198 | ||
199 | //fill decoder summary data | |
200 | fDecoderSummaryData->SetRunNumber(fRunNumber); | |
201 | fDecoderSummaryData->SetEventNumber(fEventNumber); | |
202 | fDecoderSummaryData->SetEquipmentID(fEquipmentID); | |
203 | fDecoderSummaryData->SetInputWords(nWords); | |
204 | fDecoderSummaryData->SetRecoverError(fRecoverError); | |
205 | fDecoderSummaryData->SetSpider(fSpider); | |
206 | ||
207 | AliTOFTDCHit hit; | |
208 | AliTOFTDCError error; | |
209 | ||
210 | //decoder status | |
211 | UShort_t decoderStatus = 0x0; | |
212 | ||
213 | //CRC variables | |
214 | UInt_t DRMCRC = 0x0; | |
215 | UInt_t LTMCRC = 0x0; | |
216 | UInt_t TRMCRC = 0x0; | |
217 | ||
218 | // error warning counter | |
219 | Int_t errorWarning = 0; | |
220 | ||
221 | if (fRecoverError && fVerbose) | |
222 | AliInfo("Recover error option enabled: potentially dangerous!"); | |
223 | ||
224 | /*** V2718 patch ***/ | |
225 | if (fV2718Patch){ | |
226 | decoderStatus = decoderStatus | DRM_BIT; | |
227 | fDecoderSummaryData->SetDecoderStatus(decoderStatus); | |
228 | fDecoderSummaryData->SetCurrentDRMID(0x0); | |
229 | fDecoderSummaryData->SetV2718Patch(kTRUE); | |
230 | fDRMSummaryData = fDecoderSummaryData->GetDRMSummaryData(); | |
231 | fDRMSummaryData->SetHeader(kTRUE); | |
232 | fDRMSummaryData->SetDRMID(0x0); | |
233 | if (fVerbose) | |
234 | AliInfo("DRM not present: - V2718 patch decoding -"); | |
235 | } | |
236 | /*** V2718 patch ***/ | |
237 | ||
238 | if (fVerbose) | |
239 | AliInfo("Start decoding"); | |
240 | ||
241 | if (fVerbose) | |
242 | AliInfo("Loop over the data and decode"); | |
243 | ||
244 | if (fVerbose) | |
245 | AliInfo(" St Hex Word \t Decoded Word"); | |
246 | ||
247 | //loop over raw data | |
248 | for (UInt_t iWord = 0; | |
249 | iWord < nWords; | |
250 | iWord++, rawData++, fDecoderSummaryData->SetDecodedWords(iWord)){ | |
251 | ||
252 | //try to recover error | |
253 | if (fDecoderSummaryData->GetRecoveringError() && fVerbose) | |
254 | AliInfo(Form(" %02x - 0x%08x",decoderStatus,*rawData)); | |
255 | ||
256 | //compute CRC with current data | |
257 | DRMCRC ^= *rawData; | |
258 | LTMCRC ^= *rawData; | |
259 | TRMCRC ^= *rawData; | |
260 | ||
261 | //switch word type | |
262 | switch (*rawData & WORD_TYPE_MASK){ | |
263 | ||
264 | case GLOBAL_HEADER: | |
265 | ||
266 | //switch slot ID | |
267 | switch (*rawData & SLOT_ID_MASK){ | |
268 | ||
269 | //DRM global header (slotID=1) | |
270 | case 1: | |
271 | //try to recover error | |
272 | if (fDecoderSummaryData->GetRecoveringError()) | |
273 | continue; | |
274 | //check decode status | |
275 | if ( decoderStatus != DRM_HEADER_STATUS ){ | |
276 | if (fLogErrors) | |
277 | AliError(Form(" %02x - 0x%08x [ERROR] Unexpected DRM global header (curslot=%d)",decoderStatus,*rawData,fDecoderSummaryData->GetCurrentSlotID())); | |
278 | fDecoderSummaryData->SetErrorDetected(kTRUE); | |
279 | fDecoderSummaryData->SetErrorSlotID(fDecoderSummaryData->GetCurrentSlotID()); | |
280 | errorWarning++; | |
281 | //try to recover error | |
282 | if (fRecoverError){ | |
283 | if (errorWarning > fRecoverErrorThr) { | |
284 | if (fVerbose) | |
285 | AliInfo("Trying to recover the error: searching for the next header"); | |
286 | fDecoderSummaryData->SetRecoveringError(kTRUE); | |
287 | continue; | |
288 | } | |
289 | else { | |
290 | if (fVerbose) | |
291 | AliInfo("Do not try to recover error yet, go on with decoding process"); | |
292 | continue; | |
293 | } | |
294 | } | |
295 | return(fDecoderSummaryData->GetErrorDetected()); | |
296 | } | |
297 | //decode status ok | |
298 | errorWarning = 0; | |
299 | //set DRM global header | |
300 | fDRMGlobalHeader = (AliTOFDRMGlobalHeader *)rawData; | |
301 | //reset DRM CRC | |
302 | DRMCRC = 0x0; | |
303 | //fill decoder summary data | |
304 | fDecoderSummaryData->SetCurrentDRMID(fDRMGlobalHeader->GetDRMID()); | |
305 | fDecoderSummaryData->SetCurrentSlotID(fDRMGlobalHeader->GetSlotID()); | |
306 | //get DRM summary data | |
307 | fDRMSummaryData = fDecoderSummaryData->GetDRMSummaryData(); | |
308 | //reset DRM summary data | |
309 | fDRMSummaryData->Reset(); | |
310 | //fill DRM summary data | |
311 | FillDRMSummaryData(fDRMGlobalHeader); | |
312 | //print verbose | |
313 | if (fVerbose) | |
314 | AliInfo(Form(" %02x - 0x%08x \t DRM global header",decoderStatus,*rawData)); | |
315 | //change decode status | |
316 | decoderStatus = decoderStatus | DRM_BIT; | |
317 | fDecoderSummaryData->SetDecoderStatus(decoderStatus); | |
318 | //decode DRM status headers | |
319 | for (Int_t i = 0; i < DRM_STATUS_HEADER_WORDS; i++){ | |
320 | iWord++; | |
321 | rawData++; | |
322 | DRMCRC ^= *rawData; | |
323 | ||
324 | switch (i){ | |
325 | case 0: //DRM status header 1 | |
326 | fDRMStatusHeader1 = (AliTOFDRMStatusHeader1 *)rawData; | |
327 | FillDRMSummaryData(fDRMStatusHeader1); | |
328 | if (fVerbose) | |
329 | AliInfo(Form(" %02x - 0x%08x \t DRM status header 1",decoderStatus,*rawData)); | |
330 | break; | |
331 | case 1: //DRM status header 2 | |
332 | fDRMStatusHeader2 = (AliTOFDRMStatusHeader2 *)rawData; | |
333 | FillDRMSummaryData(fDRMStatusHeader2); | |
334 | if (fVerbose) | |
335 | AliInfo(Form(" %02x - 0x%08x \t DRM status header 2",decoderStatus,*rawData)); | |
336 | break; | |
337 | case 2: //DRM status header 3 | |
338 | fDRMStatusHeader3 = (AliTOFDRMStatusHeader3 *)rawData; | |
339 | FillDRMSummaryData(fDRMStatusHeader3); | |
340 | if (fVerbose) | |
341 | AliInfo(Form(" %02x - 0x%08x \t DRM status header 3",decoderStatus,*rawData)); | |
342 | break; | |
343 | case 3: //DRM status header 4 | |
344 | fDRMStatusHeader4 = (AliTOFDRMStatusHeader4 *)rawData; | |
345 | FillDRMSummaryData(fDRMStatusHeader4); | |
346 | if (fVerbose) | |
347 | AliInfo(Form(" %02x - 0x%08x \t DRM status header 4",decoderStatus,*rawData)); | |
348 | break; | |
349 | } | |
350 | } | |
351 | //decode DRM event CRC | |
352 | iWord++; | |
353 | rawData++; | |
354 | DRMCRC ^= *rawData; | |
355 | //remove DRM event CRC from DRM CRC | |
356 | DRMCRC ^= *rawData; | |
357 | fDRMEventCRC = (AliTOFDRMEventCRC *)rawData; | |
358 | FillDRMSummaryData(fDRMEventCRC); | |
359 | if (fVerbose) | |
360 | AliInfo(Form(" %02x - 0x%08x \t DRM event CRC",decoderStatus,*rawData)); | |
361 | break; | |
362 | ||
363 | //LTM global header (slotID=2) | |
364 | case 2: | |
365 | //recover error | |
366 | if (fDecoderSummaryData->GetRecoveringError()){ | |
367 | //change decode status | |
368 | decoderStatus = LTM_HEADER_STATUS; | |
369 | fDecoderSummaryData->SetDecoderStatus(decoderStatus); | |
370 | fDecoderSummaryData->SetRecoveringError(kFALSE); | |
371 | if (fVerbose) | |
372 | AliInfo("LTM global header found: error probably recovered"); | |
373 | } | |
374 | //check decode status | |
375 | if ( decoderStatus != LTM_HEADER_STATUS ){ | |
376 | if (fLogErrors) | |
377 | AliError(Form(" %02x - 0x%08x [ERROR] Unexpected LTM global header (curslot=%d)",decoderStatus,*rawData,fDecoderSummaryData->GetCurrentSlotID())); | |
378 | fDecoderSummaryData->SetErrorDetected(kTRUE); | |
379 | fDecoderSummaryData->SetErrorSlotID(fDecoderSummaryData->GetCurrentSlotID()); | |
380 | errorWarning++; | |
381 | //try to recover error | |
382 | if (fRecoverError){ | |
383 | if (errorWarning > fRecoverErrorThr) { | |
384 | if (fVerbose) | |
385 | AliInfo("Trying to recover the error: searching for the next header"); | |
386 | fDecoderSummaryData->SetRecoveringError(kTRUE); | |
387 | continue; | |
388 | } | |
389 | else { | |
390 | if (fVerbose) | |
391 | AliInfo("Do not try to recover error yet, go on with decoding process"); | |
392 | continue; | |
393 | } | |
394 | } | |
395 | return(fDecoderSummaryData->GetErrorDetected()); | |
396 | } | |
397 | //decode status ok | |
398 | errorWarning = 0; | |
399 | //set LTM global header | |
400 | fLTMGlobalHeader = (AliTOFLTMGlobalHeader *)rawData; | |
401 | //reset LTM CRC | |
402 | LTMCRC = 0x0; | |
403 | //fill decoder summary data | |
404 | fDecoderSummaryData->SetCurrentSlotID(fLTMGlobalHeader->GetSlotID()); | |
405 | //get LTM summary data | |
406 | fLTMSummaryData = fDRMSummaryData->GetLTMSummaryData(); | |
407 | //reset LTM summary data | |
408 | fLTMSummaryData->Reset(); | |
409 | //fill LTM summary data | |
410 | FillLTMSummaryData(fLTMGlobalHeader); | |
411 | //set DRM slot enable mask bit | |
412 | fDRMSummaryData->SetDecoderSlotEnableMaskBit(fLTMGlobalHeader->GetSlotID() - 2); | |
413 | //print verbose | |
414 | if (fVerbose) | |
415 | AliInfo(Form(" %02x - 0x%08x \t LTM global header",decoderStatus,*rawData)); | |
416 | //change decode status | |
417 | decoderStatus = decoderStatus | LTM_BIT; | |
418 | fDecoderSummaryData->SetDecoderStatus(decoderStatus); | |
419 | ||
420 | //decode LTM PDL data | |
421 | for (Int_t iPDLWord = 0; iPDLWord < LTM_PDL_DATA_WORDS; iPDLWord++){ | |
422 | iWord++; | |
423 | rawData++; | |
424 | DRMCRC ^= *rawData; | |
425 | LTMCRC ^= *rawData; | |
426 | //set LTM PDL data | |
427 | fLTMPDLData = (AliTOFLTMPDLData *)rawData; | |
428 | //fill LTM summary data | |
429 | FillLTMSummaryData(fLTMPDLData, iPDLWord); | |
430 | //print verbose | |
431 | if (fVerbose) | |
432 | AliInfo(Form(" %02x - 0x%08x \t LTM PDL data \t\t PDL1=%03d PDL2=%03d PDL3=%03d PDL4=%03d",decoderStatus,*rawData,fLTMPDLData->GetPDLValue1(),fLTMPDLData->GetPDLValue2(),fLTMPDLData->GetPDLValue3(),fLTMPDLData->GetPDLValue4())); | |
433 | } | |
434 | //decode LTM ADC data | |
435 | for (Int_t iADCWord = 0; iADCWord < LTM_ADC_DATA_WORDS; iADCWord++){ | |
436 | iWord++; | |
437 | rawData++; | |
438 | DRMCRC ^= *rawData; | |
439 | LTMCRC ^= *rawData; | |
440 | //set LTM ADC data | |
441 | fLTMADCData = (AliTOFLTMADCData *)rawData; | |
442 | //fill LTM summary data | |
443 | FillLTMSummaryData(fLTMADCData, iADCWord); | |
444 | //print verbose | |
445 | if (fVerbose) | |
446 | AliInfo(Form(" %02x - 0x%08x \t LTM ADC data \t\t ADC1=%04d ADC2=%04d ADC3=%04d",decoderStatus,*rawData,fLTMADCData->GetADCValue1(),fLTMADCData->GetADCValue2(),fLTMADCData->GetADCValue3())); | |
447 | } | |
448 | //decode LTM OR data | |
449 | for (Int_t iORWord = 0; iORWord < LTM_OR_DATA_WORDS; iORWord++){ | |
450 | iWord++; | |
451 | rawData++; | |
452 | DRMCRC ^= *rawData; | |
453 | LTMCRC ^= *rawData; | |
454 | //set LTM OR data | |
455 | fLTMORData = (AliTOFLTMORData *)rawData; | |
456 | //fill LTM summary data | |
457 | FillLTMSummaryData(fLTMORData, iORWord); | |
458 | //print verbose | |
459 | if (fVerbose) | |
460 | AliInfo(Form(" %02x - 0x%08x \t LTM OR data \t\t ADC1=%04d ADC2=%04d ADC3=%04d",decoderStatus,*rawData,fLTMORData->GetORValue1(),fLTMORData->GetORValue2(),fLTMORData->GetORValue3())); | |
461 | } | |
462 | break; | |
463 | ||
464 | //TRM global header (slotID=3-12) | |
465 | case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: case 12: | |
466 | //recover error | |
467 | if (fDecoderSummaryData->GetRecoveringError()){ | |
468 | //change decode status | |
469 | decoderStatus = TRM_HEADER_STATUS; | |
470 | fDecoderSummaryData->SetDecoderStatus(decoderStatus); | |
471 | fDecoderSummaryData->SetRecoveringError(kFALSE); | |
472 | if (fVerbose) | |
473 | AliInfo("TRM global header found: error probably recovered"); | |
474 | } | |
475 | //check decode status | |
476 | if ( decoderStatus != TRM_HEADER_STATUS ){ | |
477 | if (fLogErrors) | |
478 | AliError(Form(" %02x - 0x%08x [ERROR] Unexpected TRM global header (curslot=%d)",decoderStatus,*rawData,fDecoderSummaryData->GetCurrentSlotID())); | |
479 | fDecoderSummaryData->SetErrorDetected(kTRUE); | |
480 | fDecoderSummaryData->SetErrorSlotID(fDecoderSummaryData->GetCurrentSlotID()); | |
481 | errorWarning++; | |
482 | //try to recover error | |
483 | if (fRecoverError){ | |
484 | if (errorWarning > fRecoverErrorThr) { | |
485 | if (fVerbose) | |
486 | AliInfo("Trying to recover the error: searching for the next header"); | |
487 | fDecoderSummaryData->SetRecoveringError(kTRUE); | |
488 | continue; | |
489 | } | |
490 | else { | |
491 | if (fVerbose) | |
492 | AliInfo("Do not try to recover error yet, go on with decoding process"); | |
493 | continue; | |
494 | } | |
495 | } | |
496 | return(fDecoderSummaryData->GetErrorDetected()); | |
497 | } | |
498 | //decode status ok | |
499 | errorWarning = 0; | |
500 | //set TRM global header | |
501 | fTRMGlobalHeader = (AliTOFTRMGlobalHeader *)rawData; | |
502 | //reset TRM CRC | |
503 | TRMCRC = 0x0; | |
504 | //fill decoder summary data | |
505 | fDecoderSummaryData->SetCurrentSlotID(fTRMGlobalHeader->GetSlotID()); | |
506 | //get TRM summary data | |
507 | fTRMSummaryData = fDRMSummaryData->GetTRMSummaryData(fTRMGlobalHeader->GetSlotID() - TRM_FIRST_SLOT_ID); | |
508 | //reset TRM summary data | |
509 | fTRMSummaryData->Reset(); | |
510 | //fill TRM summary data | |
511 | FillTRMSummaryData(fTRMGlobalHeader); | |
512 | //set DRM slot enable mask bit | |
513 | fDRMSummaryData->SetDecoderSlotEnableMaskBit(fTRMGlobalHeader->GetSlotID() - 2); | |
514 | //print verbose | |
515 | if (fVerbose) | |
516 | AliInfo(Form(" %02x - 0x%08x \t TRM global header \t slotID=%02d ACQ=%01d L=%01d",decoderStatus,*rawData,fTRMGlobalHeader->GetSlotID(),fTRMGlobalHeader->GetACQBits(),fTRMGlobalHeader->GetLBit())); | |
517 | //change decode status | |
518 | decoderStatus = decoderStatus | TRM_BIT; | |
519 | fDecoderSummaryData->SetDecoderStatus(decoderStatus); | |
520 | break; | |
521 | ||
522 | default: | |
523 | if (fLogErrors) | |
524 | AliError(Form(" %02x - 0x%08x [ERROR] Not valid slotID in global header (curslot=%d)",decoderStatus,*rawData,fDecoderSummaryData->GetCurrentSlotID())); | |
525 | fDecoderSummaryData->SetErrorDetected(kTRUE); | |
526 | fDecoderSummaryData->SetErrorSlotID(fDecoderSummaryData->GetCurrentSlotID()); | |
527 | //try to recover error | |
528 | if (fRecoverError){ | |
529 | if (errorWarning > fRecoverErrorThr) { | |
530 | if (fVerbose) | |
531 | AliInfo("Trying to recover the error: searching for the next header"); | |
532 | fDecoderSummaryData->SetRecoveringError(kTRUE); | |
533 | continue; | |
534 | } | |
535 | else { | |
536 | if (fVerbose) | |
537 | AliInfo("Do not try to recover error yet, go on with decoding process"); | |
538 | continue; | |
539 | } | |
540 | } | |
541 | return(fDecoderSummaryData->GetErrorDetected()); | |
542 | break; | |
543 | ||
544 | } | |
545 | //end switch slotID | |
546 | break; | |
547 | ||
548 | case GLOBAL_TRAILER: | |
549 | ||
550 | //switch slot ID | |
551 | switch (*rawData & SLOT_ID_MASK){ | |
552 | ||
553 | //DRM global trailer (slotID=1) | |
554 | case 1: | |
555 | //recover error | |
556 | if (fDecoderSummaryData->GetRecoveringError()){ | |
557 | //change decode status | |
558 | decoderStatus = DRM_TRAILER_STATUS; | |
559 | fDecoderSummaryData->SetDecoderStatus(decoderStatus); | |
560 | fDecoderSummaryData->SetRecoveringError(kFALSE); | |
561 | if (fVerbose) | |
562 | AliInfo("DRM global trailer found: error probably recovered"); | |
563 | } | |
564 | //check decode status | |
565 | if ( decoderStatus != DRM_TRAILER_STATUS ){ | |
566 | if (fLogErrors) | |
567 | AliError(Form(" %02x - 0x%08x [ERROR] Unexpected DRM global trailer (curslot=%d)",decoderStatus,*rawData,fDecoderSummaryData->GetCurrentSlotID())); | |
568 | fDecoderSummaryData->SetErrorDetected(kTRUE); | |
569 | fDecoderSummaryData->SetErrorSlotID(fDecoderSummaryData->GetCurrentSlotID()); | |
570 | errorWarning++; | |
571 | //try to recover error | |
572 | if (fRecoverError){ | |
573 | if (errorWarning > fRecoverErrorThr) { | |
574 | if (fVerbose) | |
575 | AliInfo("Trying to recover the error: searching for the next header"); | |
576 | fDecoderSummaryData->SetRecoveringError(kTRUE); | |
577 | continue; | |
578 | } | |
579 | else { | |
580 | if (fVerbose) | |
581 | AliInfo("Do not try to recover error yet, go on with decoding process"); | |
582 | continue; | |
583 | } | |
584 | } | |
585 | return(fDecoderSummaryData->GetErrorDetected()); | |
586 | } | |
587 | //decode status ok | |
588 | errorWarning = 0; | |
589 | //set DRM global trailer | |
590 | fDRMGlobalTrailer = (AliTOFDRMGlobalTrailer *)rawData; | |
591 | //remove global trailer from DRM CRC | |
592 | DRMCRC ^= *rawData; | |
593 | //fill DRM summary data | |
594 | FillDRMSummaryData(fDRMGlobalTrailer); | |
595 | fDRMSummaryData->SetDecoderCRC(COMPUTE_DRM_CRC(DRMCRC)); | |
596 | //print verbose | |
597 | if (fVerbose) | |
598 | AliInfo(Form(" %02x - 0x%08x \t DRM global trailer",decoderStatus,*rawData)); | |
599 | //change decode status | |
600 | decoderStatus = decoderStatus & ~DRM_BIT; | |
601 | fDecoderSummaryData->SetDecoderStatus(decoderStatus); | |
602 | break; | |
603 | ||
604 | //LTM global trailer (slotID=2) | |
605 | case 2: | |
606 | //try to recover error | |
607 | if (fDecoderSummaryData->GetRecoveringError()) | |
608 | continue; | |
609 | //check decode status | |
610 | if ( decoderStatus != LTM_TRAILER_STATUS ){ | |
611 | if (fLogErrors) | |
612 | AliError(Form(" %02x - 0x%08x [ERROR] Unexpected LTM global trailer (curslot=%d)",decoderStatus,*rawData,fDecoderSummaryData->GetCurrentSlotID())); | |
613 | fDecoderSummaryData->SetErrorDetected(kTRUE); | |
614 | fDecoderSummaryData->SetErrorSlotID(fDecoderSummaryData->GetCurrentSlotID()); | |
615 | errorWarning++; | |
616 | //try to recover error | |
617 | if (fRecoverError){ | |
618 | if (errorWarning > fRecoverErrorThr) { | |
619 | if (fVerbose) | |
620 | AliInfo("Trying to recover the error: searching for the next header"); | |
621 | fDecoderSummaryData->SetRecoveringError(kTRUE); | |
622 | continue; | |
623 | } | |
624 | else { | |
625 | if (fVerbose) | |
626 | AliInfo("Do not try to recover error yet, go on with decoding process"); | |
627 | continue; | |
628 | } | |
629 | } | |
630 | return(fDecoderSummaryData->GetErrorDetected()); | |
631 | } | |
632 | //decode status ok | |
633 | errorWarning = 0; | |
634 | //set LTM global trailer | |
635 | fLTMGlobalTrailer = (AliTOFLTMGlobalTrailer *)rawData; | |
636 | //remove global trailer from LTM CRC | |
637 | LTMCRC ^= *rawData; | |
638 | //fill LTM summary data | |
639 | FillLTMSummaryData(fLTMGlobalTrailer); | |
640 | fLTMSummaryData->SetDecoderCRC(COMPUTE_LTM_CRC(LTMCRC)); | |
641 | //print verbose | |
642 | if (fVerbose) | |
643 | AliInfo(Form(" %02x - 0x%08x \t LTM global trailer",decoderStatus,*rawData)); | |
644 | //change decode status | |
645 | decoderStatus = decoderStatus & ~LTM_BIT; | |
646 | fDecoderSummaryData->SetDecoderStatus(decoderStatus); | |
647 | break; | |
648 | ||
649 | //TRM global trailer (slotID=15) | |
650 | case 15: | |
651 | //try to recover error | |
652 | if (fDecoderSummaryData->GetRecoveringError()) | |
653 | continue; | |
654 | //check decode status | |
655 | if ( decoderStatus != TRM_TRAILER_STATUS ){ | |
656 | if (fLogErrors) | |
657 | AliError(Form(" %02x - 0x%08x [ERROR] Unexpected TRM global trailer (curslot=%d)",decoderStatus,*rawData,fDecoderSummaryData->GetCurrentSlotID())); | |
658 | fDecoderSummaryData->SetErrorDetected(kTRUE); | |
659 | fDecoderSummaryData->SetErrorSlotID(fDecoderSummaryData->GetCurrentSlotID()); | |
660 | errorWarning++; | |
661 | //try to recover error | |
662 | if (fRecoverError){ | |
663 | if (errorWarning > fRecoverErrorThr) { | |
664 | if (fVerbose) | |
665 | AliInfo("Trying to recover the error: searching for the next header"); | |
666 | fDecoderSummaryData->SetRecoveringError(kTRUE); | |
667 | continue; | |
668 | } | |
669 | else { | |
670 | if (fVerbose) | |
671 | AliInfo("Do not try to recover error yet, go on with decoding process"); | |
672 | continue; | |
673 | } | |
674 | } | |
675 | return(fDecoderSummaryData->GetErrorDetected()); | |
676 | } | |
677 | //decode status ok | |
678 | errorWarning = 0; | |
679 | //set TRM global trailer | |
680 | fTRMGlobalTrailer = (AliTOFTRMGlobalTrailer *)rawData; | |
681 | //remove global trailer from TRM CRC | |
682 | TRMCRC ^= *rawData; | |
683 | //fill TRM summary data | |
684 | FillTRMSummaryData(fTRMGlobalTrailer); | |
685 | fTRMSummaryData->SetDecoderCRC(COMPUTE_TRM_CRC(TRMCRC)); | |
686 | //print verbose | |
687 | if (fVerbose) | |
688 | AliInfo(Form(" %02x - 0x%08x \t TRM global trailer \t CRC=%04d eventCounter=%04d",decoderStatus,*rawData,fTRMGlobalTrailer->GetEventCRC(),fTRMGlobalTrailer->GetEventCounter())); | |
689 | //change decode status | |
690 | decoderStatus = decoderStatus & ~TRM_BIT; | |
691 | fDecoderSummaryData->SetDecoderStatus(decoderStatus); | |
692 | break; | |
693 | ||
694 | default: | |
695 | //try to recover error | |
696 | if (fDecoderSummaryData->GetRecoveringError()) | |
697 | continue; | |
698 | if (fLogErrors) | |
699 | AliError(Form(" %02x - 0x%08x [ERROR] Not valid slotID/pattern in global trailer (curslot=%d)",decoderStatus,*rawData,fDecoderSummaryData->GetCurrentSlotID())); | |
700 | fDecoderSummaryData->SetErrorDetected(kTRUE); | |
701 | fDecoderSummaryData->SetErrorSlotID(fDecoderSummaryData->GetCurrentSlotID()); | |
702 | errorWarning++; | |
703 | //try to recover error | |
704 | if (fRecoverError){ | |
705 | if (fVerbose) | |
706 | AliInfo("Trying to recover the error: searching for the next header"); | |
707 | fDecoderSummaryData->SetRecoveringError(kTRUE); | |
708 | continue; | |
709 | } | |
710 | return(fDecoderSummaryData->GetErrorDetected()); | |
711 | break; | |
712 | } | |
713 | break; | |
714 | ||
715 | case CHAIN_A_HEADER: | |
716 | ||
717 | //try to recover error | |
718 | if (fDecoderSummaryData->GetRecoveringError()) | |
719 | continue; | |
720 | //check decode status | |
721 | if ( decoderStatus != CHAIN_A_HEADER_STATUS && !fDecoderSummaryData->GetRecoveringError() ){ | |
722 | if (fLogErrors) | |
723 | AliError(Form(" %02x - 0x%08x [ERROR] Unexpected TRM chain A header (curslot=%d)",decoderStatus,*rawData,fDecoderSummaryData->GetCurrentSlotID())); | |
724 | fDecoderSummaryData->SetErrorDetected(kTRUE); | |
725 | fDecoderSummaryData->SetErrorSlotID(fDecoderSummaryData->GetCurrentSlotID()); | |
726 | errorWarning++; | |
727 | //try to recover error | |
728 | if (fRecoverError){ | |
729 | if (errorWarning > fRecoverErrorThr) { | |
730 | if (fVerbose) | |
731 | AliInfo("Trying to recover the error: searching for the next header"); | |
732 | fDecoderSummaryData->SetRecoveringError(kTRUE); | |
733 | continue; | |
734 | } | |
735 | else { | |
736 | if (fVerbose) | |
737 | AliInfo("Do not try to recover error yet, go on with decoding process"); | |
738 | continue; | |
739 | } | |
740 | } | |
741 | return(fDecoderSummaryData->GetErrorDetected()); | |
742 | } | |
743 | //decode status ok | |
744 | errorWarning = 0; | |
745 | //set TRM chain header | |
746 | fTRMChainHeader = (AliTOFTRMChainHeader *)rawData; | |
747 | //fill decoder summary data | |
748 | fDecoderSummaryData->SetCurrentChain(0); | |
749 | //get chain summary data | |
750 | fChainSummaryData = fTRMSummaryData->GetChainSummaryData(0); | |
751 | //reset chain summary data | |
752 | fChainSummaryData->Reset(); | |
753 | //fill chain summary data | |
754 | FillChainSummaryData(fTRMChainHeader); | |
755 | //get tdc hit buffer | |
756 | fTDCHitBuffer = fChainSummaryData->GetTDCHitBuffer(); | |
757 | //reset tdc hit buffer | |
758 | fTDCHitBuffer->Reset(); | |
759 | //get tdc packed hit buffer | |
760 | fTDCPackedHitBuffer = fChainSummaryData->GetTDCPackedHitBuffer(); | |
761 | //reset tdc packed hit buffer | |
762 | fTDCPackedHitBuffer->Reset(); | |
763 | //get tdc error buffer | |
764 | fTDCErrorBuffer = fChainSummaryData->GetTDCErrorBuffer(); | |
765 | //reset tdc error buffer | |
766 | fTDCErrorBuffer->Reset(); | |
767 | //print verbose | |
768 | if (fVerbose) | |
769 | AliInfo(Form(" %02x - 0x%08x \t TRM chain A header \t chain=%01d bunchID=%04d",decoderStatus,*rawData,0,fTRMChainHeader->GetBunchID())); | |
770 | //change decode status | |
771 | decoderStatus = decoderStatus | CHAIN_A_BIT; | |
772 | fDecoderSummaryData->SetDecoderStatus(decoderStatus); | |
773 | //reset spider | |
774 | if (fSpider) | |
775 | ResetSpider(); | |
776 | break; | |
777 | ||
778 | case CHAIN_A_TRAILER: | |
779 | ||
780 | //try to recover error | |
781 | if (fDecoderSummaryData->GetRecoveringError()) | |
782 | continue; | |
783 | //check decode status | |
784 | if ( decoderStatus != CHAIN_A_TRAILER_STATUS && !fDecoderSummaryData->GetRecoveringError()){ | |
785 | if (fLogErrors) | |
786 | AliError(Form(" %02x - 0x%08x [ERROR] Unexpected TRM chain A trailer (curslot=%d)",decoderStatus,*rawData,fDecoderSummaryData->GetCurrentSlotID())); | |
787 | fDecoderSummaryData->SetErrorDetected(kTRUE); | |
788 | fDecoderSummaryData->SetErrorSlotID(fDecoderSummaryData->GetCurrentSlotID()); | |
789 | errorWarning++; | |
790 | //try to recover error | |
791 | if (fRecoverError){ | |
792 | if (errorWarning > fRecoverErrorThr) { | |
793 | if (fVerbose) | |
794 | AliInfo("Trying to recover the error: searching for the next header"); | |
795 | fDecoderSummaryData->SetRecoveringError(kTRUE); | |
796 | continue; | |
797 | } | |
798 | else { | |
799 | if (fVerbose) | |
800 | AliInfo("Do not try to recover error yet, go on with decoding process"); | |
801 | continue; | |
802 | } | |
803 | } | |
804 | return(fDecoderSummaryData->GetErrorDetected()); | |
805 | } | |
806 | //decode status ok | |
807 | errorWarning = 0; | |
808 | //set TRM chain trailer | |
809 | fTRMChainTrailer = (AliTOFTRMChainTrailer *)rawData; | |
810 | //fill chain summary data | |
811 | FillChainSummaryData(fTRMChainTrailer); | |
812 | //print verbose | |
813 | if (fVerbose) | |
814 | AliInfo(Form(" %02x - 0x%08x \t TRM chain A trailer",decoderStatus,*rawData)); | |
815 | //change decode status | |
816 | decoderStatus = decoderStatus & ~CHAIN_A_BIT; | |
817 | fDecoderSummaryData->SetDecoderStatus(decoderStatus); | |
818 | break; | |
819 | ||
820 | case CHAIN_B_HEADER: | |
821 | ||
822 | //try to recover error | |
823 | if (fDecoderSummaryData->GetRecoveringError()) | |
824 | continue; | |
825 | //check decode status | |
826 | if ( decoderStatus != CHAIN_B_HEADER_STATUS && !fDecoderSummaryData->GetRecoveringError()){ | |
827 | if (fLogErrors) | |
828 | AliError(Form(" %02x - 0x%08x [ERROR] Unexpected TRM chain B header (curslot=%d)",decoderStatus,*rawData,fDecoderSummaryData->GetCurrentSlotID())); | |
829 | fDecoderSummaryData->SetErrorDetected(kTRUE); | |
830 | fDecoderSummaryData->SetErrorSlotID(fDecoderSummaryData->GetCurrentSlotID()); | |
831 | errorWarning++; | |
832 | //try to recover error | |
833 | if (fRecoverError){ | |
834 | if (errorWarning > fRecoverErrorThr) { | |
835 | if (fVerbose) | |
836 | AliInfo("Trying to recover the error: searching for the next header"); | |
837 | fDecoderSummaryData->SetRecoveringError(kTRUE); | |
838 | continue; | |
839 | } | |
840 | else { | |
841 | if (fVerbose) | |
842 | AliInfo("Do not try to recover error yet, go on with decoding process"); | |
843 | continue; | |
844 | } | |
845 | } | |
846 | return(fDecoderSummaryData->GetErrorDetected()); | |
847 | } | |
848 | //decode status ok | |
849 | errorWarning = 0; | |
850 | //set TRM chain header | |
851 | fTRMChainHeader = (AliTOFTRMChainHeader *)rawData; | |
852 | //fill decoder summary data | |
853 | fDecoderSummaryData->SetCurrentChain(1); | |
854 | //get chain summary data | |
855 | fChainSummaryData = fTRMSummaryData->GetChainSummaryData(1); | |
856 | //reset chain summary data | |
857 | fChainSummaryData->Reset(); | |
858 | //fill chain summary data | |
859 | FillChainSummaryData(fTRMChainHeader); | |
860 | //get tdc hit buffer | |
861 | fTDCHitBuffer = fChainSummaryData->GetTDCHitBuffer(); | |
862 | //reset tdc hit buffer | |
863 | fTDCHitBuffer->Reset(); | |
864 | //get tdc packed hit buffer | |
865 | fTDCPackedHitBuffer = fChainSummaryData->GetTDCPackedHitBuffer(); | |
866 | //reset tdc packed hit buffer | |
867 | fTDCPackedHitBuffer->Reset(); | |
868 | //get tdc error buffer | |
869 | fTDCErrorBuffer = fChainSummaryData->GetTDCErrorBuffer(); | |
870 | //reset tdc error buffer | |
871 | fTDCErrorBuffer->Reset(); | |
872 | //print verbose | |
873 | if (fVerbose) | |
874 | AliInfo(Form(" %02x - 0x%08x \t TRM chain B header \t chain=%01d bunchID=%04d",decoderStatus,*rawData,1,fTRMChainHeader->GetBunchID())); | |
875 | //change decode status | |
876 | decoderStatus = decoderStatus | CHAIN_B_BIT; | |
877 | fDecoderSummaryData->SetDecoderStatus(decoderStatus); | |
878 | //reset spider | |
879 | if (fSpider) | |
880 | ResetSpider(); | |
881 | break; | |
882 | ||
883 | case CHAIN_B_TRAILER: | |
884 | ||
885 | //try to recover error | |
886 | if (fDecoderSummaryData->GetRecoveringError()) | |
887 | continue; | |
888 | //check decode status | |
889 | if ( decoderStatus != CHAIN_B_TRAILER_STATUS && !fDecoderSummaryData->GetRecoveringError()){ | |
890 | if (fLogErrors) | |
891 | AliError(Form(" %02x - 0x%08x [ERROR] Unexpected TRM chain B trailer (curslot=%d)",decoderStatus,*rawData,fDecoderSummaryData->GetCurrentSlotID())); | |
892 | fDecoderSummaryData->SetErrorDetected(kTRUE); | |
893 | fDecoderSummaryData->SetErrorSlotID(fDecoderSummaryData->GetCurrentSlotID()); | |
894 | errorWarning++; | |
895 | //try to recover error | |
896 | if (fRecoverError){ | |
897 | if (errorWarning > fRecoverErrorThr) { | |
898 | if (fVerbose) | |
899 | AliInfo("Trying to recover the error: searching for the next header"); | |
900 | fDecoderSummaryData->SetRecoveringError(kTRUE); | |
901 | continue; | |
902 | } | |
903 | else { | |
904 | if (fVerbose) | |
905 | AliInfo("Do not try to recover error yet, go on with decoding process"); | |
906 | continue; | |
907 | } | |
908 | } | |
909 | return(fDecoderSummaryData->GetErrorDetected()); | |
910 | } | |
911 | //decode status ok | |
912 | errorWarning = 0; | |
913 | //set TRM chain trailer | |
914 | fTRMChainTrailer = (AliTOFTRMChainTrailer *)rawData; | |
915 | //fill chain summary data | |
916 | FillChainSummaryData(fTRMChainTrailer); | |
917 | //print verbose | |
918 | if (fVerbose) | |
919 | AliInfo(Form(" %02x - 0x%08x \t TRM chain B trailer",decoderStatus,*rawData)); | |
920 | //change decode status | |
921 | decoderStatus = decoderStatus & ~CHAIN_B_BIT; | |
922 | fDecoderSummaryData->SetDecoderStatus(decoderStatus); | |
923 | break; | |
924 | ||
925 | case ERROR: | |
926 | ||
927 | //try to recover error | |
928 | if (fDecoderSummaryData->GetRecoveringError()) | |
929 | continue; | |
930 | //decode TRM TDC error | |
931 | fTRMTDCError = (AliTOFTRMTDCError *)rawData; | |
932 | //check diagnostic word | |
933 | if (fTRMTDCError->GetTDCID() == 15) { | |
934 | if (fVerbose) | |
935 | AliInfo(Form(" %02x - 0x%08x \t Diagnostic error word",decoderStatus,*rawData)); | |
936 | break; | |
937 | } | |
938 | //set error data | |
939 | error.SetErrorFlags(fTRMTDCError->GetErrorFlags()); | |
940 | error.SetTDCID(fTRMTDCError->GetTDCID()); | |
941 | //fill TDC error buffer | |
942 | fTDCErrorBuffer->Add(error); | |
943 | if (fVerbose) | |
944 | AliInfo(Form(" %02x - 0x%08x \t TDC error",decoderStatus,*rawData)); | |
945 | break; | |
946 | ||
947 | case FILLER: | |
948 | ||
949 | //try to recover error | |
950 | if (fDecoderSummaryData->GetRecoveringError()) | |
951 | continue; | |
952 | if (fVerbose) | |
953 | AliInfo(Form(" %02x - 0x%08x \t Filler",decoderStatus,*rawData)); | |
954 | break; | |
955 | ||
956 | default: | |
957 | ||
958 | //try to recover error | |
959 | if (fDecoderSummaryData->GetRecoveringError()) | |
960 | continue; | |
961 | //check decode status | |
962 | if ( decoderStatus != CHAIN_A_TDC_HIT_STATUS && | |
963 | decoderStatus != CHAIN_B_TDC_HIT_STATUS && !fDecoderSummaryData->GetRecoveringError()){ | |
964 | if (fLogErrors) | |
965 | AliError(Form(" %02x - 0x%08x [ERROR] Unexpected or unknown word (curslot=%d)",decoderStatus,*rawData,fDecoderSummaryData->GetCurrentSlotID())); | |
966 | fDecoderSummaryData->SetErrorDetected(kTRUE); | |
967 | fDecoderSummaryData->SetErrorSlotID(fDecoderSummaryData->GetCurrentSlotID()); | |
968 | errorWarning++; | |
969 | //try to recover error | |
970 | if (fRecoverError){ | |
971 | if (errorWarning > fRecoverErrorThr) { | |
972 | if (fVerbose) | |
973 | AliInfo("Trying to recover the error: searching for the next header"); | |
974 | fDecoderSummaryData->SetRecoveringError(kTRUE); | |
975 | continue; | |
976 | } | |
977 | else { | |
978 | if (fVerbose) | |
979 | AliInfo("Do not try to recover error yet, go on with decoding process"); | |
980 | continue; | |
981 | } | |
982 | } | |
983 | return(fDecoderSummaryData->GetErrorDetected()); | |
984 | } | |
985 | //decode status ok | |
986 | errorWarning = 0; | |
987 | ||
988 | //switch TRM ACQ | |
989 | switch (fTRMSummaryData->GetACQBits()){ | |
990 | ||
991 | case PACKING_ENABLED_ACQ: | |
992 | //decode TDC packed/unpacked hit | |
993 | fTDCPackedHit = (AliTOFTDCPackedHit *)rawData; | |
994 | fTDCUnpackedHit = (AliTOFTDCUnpackedHit *)rawData; | |
995 | //set hit data | |
996 | hit.SetChan(fTDCUnpackedHit->GetChan()); | |
997 | hit.SetTDCID(fTDCUnpackedHit->GetTDCID()); | |
998 | hit.SetEBit(fTDCUnpackedHit->GetEBit()); | |
999 | hit.SetPSBits(fTDCUnpackedHit->GetPSBits()); | |
1000 | //switch PS bits | |
1001 | switch (hit.GetPSBits()){ | |
1002 | //packed hit or overflow hit | |
1003 | case PACKED_HIT_PS: case TOT_OVF_HIT_PS: | |
1004 | hit.SetHitTime(fTDCPackedHit->GetHitTime()); | |
1005 | hit.SetTOTWidth(fTDCPackedHit->GetTOTWidth()); | |
1006 | //add hit | |
1007 | fTDCHitBuffer->Add(hit); | |
1008 | fTDCPackedHitBuffer->Add(hit); | |
1009 | break; | |
1010 | //orphane leading | |
1011 | case LEADING_HIT_PS: | |
1012 | hit.SetHitTime(fTDCUnpackedHit->GetHitTime()); | |
1013 | hit.SetTOTWidth(0); | |
1014 | //add hit | |
1015 | fTDCHitBuffer->Add(hit); | |
1016 | fTDCPackedHitBuffer->Add(hit); | |
1017 | break; | |
1018 | //orphane trailing | |
1019 | case TRAILING_HIT_PS: | |
1020 | hit.SetHitTime(fTDCUnpackedHit->GetHitTime()); | |
1021 | hit.SetTOTWidth(0); | |
1022 | //add hit | |
1023 | fTDCHitBuffer->Add(hit); | |
1024 | break; | |
1025 | } | |
1026 | //end switch PS bits | |
1027 | //print verbose | |
1028 | if (fVerbose) | |
1029 | switch (hit.GetPSBits()){ | |
1030 | case PACKED_HIT_PS: | |
1031 | AliInfo(Form(" %02x - 0x%08x \t TDC hit [packed] \t PS=%1d TDC=%1d chan=%1d TOT=%3d time=%4d (%7.1f ns)",decoderStatus,*rawData,hit.GetPSBits(),hit.GetTDCID(),hit.GetChan(),hit.GetTOTWidth(),hit.GetHitTime(),hit.GetHitTime()*TIME_BIN_WIDTH)); | |
1032 | break; | |
1033 | case LEADING_HIT_PS: | |
1034 | AliInfo(Form(" %02x - 0x%08x \t TDC hit [orp.lead] \t PS=%1d TDC=%1d chan=%1d time=%4d (%7.1f ns)",decoderStatus,*rawData,hit.GetPSBits(),hit.GetTDCID(),hit.GetChan(),hit.GetHitTime(),hit.GetHitTime()*TIME_BIN_WIDTH)); | |
1035 | break; | |
1036 | case TRAILING_HIT_PS: | |
1037 | AliInfo(Form(" %02x - 0x%08x \t TDC hit [orp.trai] \t PS=%1d TDC=%1d chan=%1d time=%4d (%7.1f ns)",decoderStatus,*rawData,hit.GetPSBits(),hit.GetTDCID(),hit.GetChan(),hit.GetHitTime(),hit.GetHitTime()*TIME_BIN_WIDTH)); | |
1038 | break; | |
1039 | case TOT_OVF_HIT_PS: | |
1040 | AliInfo(Form(" %02x - 0x%08x \t TDC hit [TOT ovfl] \t PS=%1d TDC=%1d chan=%1d TOT=%3d time=%4d (%7.1f ns)",decoderStatus,*rawData,hit.GetPSBits(),hit.GetTDCID(),hit.GetChan(),hit.GetTOTWidth(),hit.GetHitTime(),hit.GetHitTime()*TIME_BIN_WIDTH)); | |
1041 | break; | |
1042 | } | |
1043 | break; | |
1044 | ||
1045 | case LEADING_ONLY_ACQ: case TRAILING_ONLY_ACQ: | |
1046 | //decode TDC unpacked hit | |
1047 | fTDCUnpackedHit = (AliTOFTDCUnpackedHit *)rawData; | |
1048 | //set hit data | |
1049 | hit.SetChan(fTDCUnpackedHit->GetChan()); | |
1050 | hit.SetTDCID(fTDCUnpackedHit->GetTDCID()); | |
1051 | hit.SetEBit(fTDCUnpackedHit->GetEBit()); | |
1052 | hit.SetPSBits(fTDCUnpackedHit->GetPSBits()); | |
1053 | hit.SetHitTime(fTDCUnpackedHit->GetHitTime()); | |
1054 | hit.SetTOTWidth(0); | |
1055 | //add hit | |
1056 | fTDCHitBuffer->Add(hit); | |
1057 | //print verbose | |
1058 | if (fVerbose) | |
1059 | switch (hit.GetPSBits()){ | |
1060 | case LEADING_HIT_PS: | |
1061 | AliInfo(Form(" %02x - 0x%08x \t TDC hit [leading] \t PS=%1d TDC=%1d chan=%1d time=%4d (%7.1f ns)",decoderStatus,*rawData,hit.GetPSBits(),hit.GetTDCID(),hit.GetChan(),hit.GetHitTime(),hit.GetHitTime()*TIME_BIN_WIDTH)); | |
1062 | break; | |
1063 | case TRAILING_HIT_PS: | |
1064 | AliInfo(Form(" %02x - 0x%08x \t TDC hit [trailing] \t PS=%1d TDC=%1d chan=%1d time=%4d (%7.1f ns)",decoderStatus,*rawData,hit.GetPSBits(),hit.GetTDCID(),hit.GetChan(),hit.GetHitTime(),hit.GetHitTime()*TIME_BIN_WIDTH)); | |
1065 | } | |
1066 | break; | |
1067 | ||
1068 | case PACKING_DISABLED_ACQ: | |
1069 | //decode TDC unpacked hit | |
1070 | fTDCUnpackedHit = (AliTOFTDCUnpackedHit *)rawData; | |
1071 | //set hit data | |
1072 | hit.SetChan(fTDCUnpackedHit->GetChan()); | |
1073 | hit.SetTDCID(fTDCUnpackedHit->GetTDCID()); | |
1074 | hit.SetEBit(fTDCUnpackedHit->GetEBit()); | |
1075 | hit.SetPSBits(fTDCUnpackedHit->GetPSBits()); | |
1076 | hit.SetHitTime(fTDCUnpackedHit->GetHitTime()); | |
1077 | hit.SetTOTWidth(0); | |
1078 | //add hit | |
1079 | fTDCHitBuffer->Add(hit); | |
1080 | //print verbose | |
1081 | if (fVerbose) | |
1082 | switch (hit.GetPSBits()){ | |
1083 | case LEADING_HIT_PS: | |
1084 | AliInfo(Form(" %02x - 0x%08x \t TDC hit [leading] \t PS=%1d TDC=%1d chan=%1d time=%4d (%7.1f ns)",decoderStatus,*rawData,hit.GetPSBits(),hit.GetTDCID(),hit.GetChan(),hit.GetHitTime(),hit.GetHitTime()*TIME_BIN_WIDTH)); | |
1085 | break; | |
1086 | case TRAILING_HIT_PS: | |
1087 | AliInfo(Form(" %02x - 0x%08x \t TDC hit [trailing] \t PS=%1d TDC=%1d chan=%1d time=%4d (%7.1f ns)",decoderStatus,*rawData,hit.GetPSBits(),hit.GetTDCID(),hit.GetChan(),hit.GetHitTime(),hit.GetHitTime()*TIME_BIN_WIDTH)); | |
1088 | } //print verbose | |
1089 | //spider | |
1090 | if (fSpider) | |
1091 | Spider(hit); | |
1092 | ||
1093 | break; | |
1094 | } | |
1095 | //end switch TRM ACQ | |
1096 | ||
1097 | break; | |
1098 | ||
1099 | } | |
1100 | ||
1101 | } | |
1102 | //end equipment data loop | |
1103 | ||
1104 | if (fVerbose) | |
1105 | AliInfo("End of data loop"); | |
1106 | ||
1107 | //reset spider | |
1108 | if (fSpider) | |
1109 | ResetSpider(); | |
1110 | ||
1111 | /*** V2718 patch ***/ | |
1112 | if (fV2718Patch){ | |
1113 | decoderStatus = decoderStatus & ~DRM_BIT; | |
1114 | fDecoderSummaryData->SetDecoderStatus(decoderStatus); | |
1115 | fDRMSummaryData->SetTrailer(kTRUE); | |
1116 | fDRMSummaryData->SetSlotEnableMask(fDRMSummaryData->GetDecoderSlotEnableMask()); | |
1117 | fDRMSummaryData->SetCBit(1); | |
1118 | fDRMSummaryData->SetLocalEventCounter(fTRMSummaryData->GetEventCounter()); | |
1119 | if (fVerbose) | |
1120 | AliInfo("DRM was not present: - V2718 end patch decoding -"); | |
1121 | } | |
1122 | /*** V2718 patch ***/ | |
1123 | ||
1124 | if (fVerbose) | |
1125 | AliInfo("Decoder is exiting succesfully."); | |
1126 | ||
1127 | return(fDecoderSummaryData->GetErrorDetected()); | |
1128 | } | |
1129 | ||
1130 | //_________________________________________________________________ | |
1131 | ||
1132 | void | |
1133 | AliTOFDecoderV2::FillDRMSummaryData(AliTOFDRMGlobalHeader *DRMGlobalHeader) | |
1134 | { | |
1135 | fDRMSummaryData->SetHeader(kTRUE); | |
1136 | fDRMSummaryData->SetSlotID(DRMGlobalHeader->GetSlotID()); | |
1137 | fDRMSummaryData->SetEventWords(DRMGlobalHeader->GetEventWords()); | |
1138 | fDRMSummaryData->SetDRMID(DRMGlobalHeader->GetDRMID()); | |
1139 | } | |
1140 | ||
1141 | //_________________________________________________________________ | |
1142 | ||
1143 | void | |
1144 | AliTOFDecoderV2::FillDRMSummaryData(AliTOFDRMGlobalTrailer *DRMGlobalTrailer) | |
1145 | { | |
1146 | fDRMSummaryData->SetTrailer(kTRUE); | |
1147 | fDRMSummaryData->SetLocalEventCounter(DRMGlobalTrailer->GetLocalEventCounter()); | |
1148 | } | |
1149 | ||
1150 | //_________________________________________________________________ | |
1151 | ||
1152 | void | |
1153 | AliTOFDecoderV2::FillDRMSummaryData(AliTOFDRMStatusHeader1 *DRMStatusHeader1) | |
1154 | { | |
1155 | fDRMSummaryData->SetPartecipatingSlotID(DRMStatusHeader1->GetPartecipatingSlotID()); | |
1156 | fDRMSummaryData->SetCBit(DRMStatusHeader1->GetCBit()); | |
1157 | fDRMSummaryData->SetVersID(DRMStatusHeader1->GetVersID()); | |
1158 | fDRMSummaryData->SetDRMhSize(DRMStatusHeader1->GetDRMhSize()); | |
1159 | } | |
1160 | ||
1161 | //_________________________________________________________________ | |
1162 | ||
1163 | void | |
1164 | AliTOFDecoderV2::FillDRMSummaryData(AliTOFDRMStatusHeader2 *DRMStatusHeader2) | |
1165 | { | |
1166 | fDRMSummaryData->SetSlotEnableMask(DRMStatusHeader2->GetSlotEnableMask()); | |
1167 | fDRMSummaryData->SetFaultID(DRMStatusHeader2->GetFaultID()); | |
1168 | fDRMSummaryData->SetRTOBit(DRMStatusHeader2->GetRTOBit()); | |
1169 | } | |
1170 | ||
1171 | //_________________________________________________________________ | |
1172 | ||
1173 | void | |
1174 | AliTOFDecoderV2::FillDRMSummaryData(AliTOFDRMStatusHeader3 *DRMStatusHeader3) | |
1175 | { | |
1176 | fDRMSummaryData->SetL0BCID(DRMStatusHeader3->GetL0BCID()); | |
1177 | fDRMSummaryData->SetRunTimeInfo(DRMStatusHeader3->GetRunTimeInfo()); | |
1178 | } | |
1179 | ||
1180 | //_________________________________________________________________ | |
1181 | ||
1182 | void | |
1183 | AliTOFDecoderV2::FillDRMSummaryData(AliTOFDRMStatusHeader4 *DRMStatusHeader4) | |
1184 | { | |
1185 | fDRMSummaryData->SetTemperature(DRMStatusHeader4->GetTemperature()); | |
1186 | fDRMSummaryData->SetACKBit(DRMStatusHeader4->GetACKBit()); | |
1187 | fDRMSummaryData->SetSensAD(DRMStatusHeader4->GetSensAD()); | |
1188 | } | |
1189 | ||
1190 | //_________________________________________________________________ | |
1191 | ||
1192 | void | |
1193 | AliTOFDecoderV2::FillDRMSummaryData(AliTOFDRMEventCRC *DRMEventCRC) | |
1194 | { | |
1195 | fDRMSummaryData->SetEventCRC(DRMEventCRC->GetEventCRC()); | |
1196 | } | |
1197 | ||
1198 | //_________________________________________________________________ | |
1199 | ||
1200 | void | |
1201 | AliTOFDecoderV2::FillLTMSummaryData(AliTOFLTMGlobalHeader *LTMGlobalHeader) | |
1202 | { | |
1203 | fLTMSummaryData->SetHeader(kTRUE); | |
1204 | fLTMSummaryData->SetSlotID(LTMGlobalHeader->GetSlotID()); | |
1205 | fLTMSummaryData->SetEventWords(LTMGlobalHeader->GetEventWords()); | |
1206 | fLTMSummaryData->SetCBit(LTMGlobalHeader->GetCBit()); | |
1207 | fLTMSummaryData->SetFault(LTMGlobalHeader->GetFault()); | |
1208 | } | |
1209 | ||
1210 | //_________________________________________________________________ | |
1211 | ||
1212 | void | |
1213 | AliTOFDecoderV2::FillLTMSummaryData(AliTOFLTMGlobalTrailer *LTMGlobalTrailer) | |
1214 | { | |
1215 | fLTMSummaryData->SetTrailer(kTRUE); | |
1216 | fLTMSummaryData->SetEventCRC(LTMGlobalTrailer->GetEventCRC()); | |
1217 | fLTMSummaryData->SetEventNumber(LTMGlobalTrailer->GetEventNumber()); | |
1218 | } | |
1219 | ||
1220 | //_________________________________________________________________ | |
1221 | ||
1222 | void | |
1223 | AliTOFDecoderV2::FillLTMSummaryData(AliTOFLTMPDLData *LTMPDLData, Int_t PDLWord) | |
1224 | { | |
1225 | fLTMSummaryData->SetPDL(4 * PDLWord + 0, LTMPDLData->GetPDLValue1()); | |
1226 | fLTMSummaryData->SetPDL(4 * PDLWord + 1, LTMPDLData->GetPDLValue2()); | |
1227 | fLTMSummaryData->SetPDL(4 * PDLWord + 2, LTMPDLData->GetPDLValue3()); | |
1228 | fLTMSummaryData->SetPDL(4 * PDLWord + 3, LTMPDLData->GetPDLValue4()); | |
1229 | } | |
1230 | ||
1231 | //_________________________________________________________________ | |
1232 | ||
1233 | void | |
1234 | AliTOFDecoderV2::FillLTMSummaryData(AliTOFLTMADCData *LTMADCData, Int_t ADCWord) | |
1235 | { | |
1236 | fLTMSummaryData->SetADC(3 * ADCWord + 0, LTMADCData->GetADCValue1()); | |
1237 | fLTMSummaryData->SetADC(3 * ADCWord + 1, LTMADCData->GetADCValue2()); | |
1238 | fLTMSummaryData->SetADC(3 * ADCWord + 2, LTMADCData->GetADCValue3()); | |
1239 | } | |
1240 | ||
1241 | //_________________________________________________________________ | |
1242 | ||
1243 | void | |
1244 | AliTOFDecoderV2::FillLTMSummaryData(AliTOFLTMORData *LTMORData, Int_t ORWord) | |
1245 | { | |
1246 | fLTMSummaryData->SetOR(3 * ORWord + 0, LTMORData->GetORValue1()); | |
1247 | fLTMSummaryData->SetOR(3 * ORWord + 1, LTMORData->GetORValue2()); | |
1248 | fLTMSummaryData->SetOR(3 * ORWord + 2, LTMORData->GetORValue3()); | |
1249 | } | |
1250 | ||
1251 | //_________________________________________________________________ | |
1252 | ||
1253 | void | |
1254 | AliTOFDecoderV2::FillTRMSummaryData(AliTOFTRMGlobalHeader *TRMGlobalHeader) | |
1255 | { | |
1256 | fTRMSummaryData->SetHeader(kTRUE); | |
1257 | fTRMSummaryData->SetSlotID(TRMGlobalHeader->GetSlotID()); | |
1258 | fTRMSummaryData->SetEventWords(TRMGlobalHeader->GetEventWords()); | |
1259 | fTRMSummaryData->SetACQBits(TRMGlobalHeader->GetACQBits()); | |
1260 | fTRMSummaryData->SetLBit(TRMGlobalHeader->GetLBit()); | |
1261 | fTRMSummaryData->SetEBit(TRMGlobalHeader->GetEBit()); | |
1262 | } | |
1263 | ||
1264 | //_________________________________________________________________ | |
1265 | ||
1266 | void | |
1267 | AliTOFDecoderV2::FillTRMSummaryData(AliTOFTRMGlobalTrailer *TRMGlobalTrailer) | |
1268 | { | |
1269 | fTRMSummaryData->SetTrailer(kTRUE); | |
1270 | fTRMSummaryData->SetEventCRC(TRMGlobalTrailer->GetEventCRC()); | |
1271 | fTRMSummaryData->SetEventCounter(TRMGlobalTrailer->GetEventCounter()); | |
1272 | } | |
1273 | ||
1274 | //_________________________________________________________________ | |
1275 | ||
1276 | void | |
1277 | AliTOFDecoderV2::FillChainSummaryData(AliTOFTRMChainHeader *TRMChainHeader) | |
1278 | { | |
1279 | fChainSummaryData->SetHeader(kTRUE); | |
1280 | switch (*(UInt_t *)TRMChainHeader & WORD_TYPE_MASK){ | |
1281 | case CHAIN_A_HEADER: | |
1282 | fChainSummaryData->SetChain(0); | |
1283 | break; | |
1284 | case CHAIN_B_HEADER: | |
1285 | fChainSummaryData->SetChain(1); | |
1286 | break; | |
1287 | } | |
1288 | fChainSummaryData->SetBunchID(TRMChainHeader->GetBunchID()); | |
1289 | fChainSummaryData->SetPB24Temp(TRMChainHeader->GetPB24Temp()); | |
1290 | fChainSummaryData->SetPB24ID(TRMChainHeader->GetPB24ID()); | |
1291 | fChainSummaryData->SetTSBit(TRMChainHeader->GetTSBit()); | |
1292 | } | |
1293 | ||
1294 | //_________________________________________________________________ | |
1295 | ||
1296 | void | |
1297 | AliTOFDecoderV2::FillChainSummaryData(AliTOFTRMChainTrailer *TRMChainTrailer) | |
1298 | { | |
1299 | fChainSummaryData->SetTrailer(kTRUE); | |
1300 | fChainSummaryData->SetStatus(TRMChainTrailer->GetStatus()); | |
1301 | fChainSummaryData->SetEventCounter(TRMChainTrailer->GetEventCounter()); | |
1302 | } | |
1303 | ||
1304 | //_________________________________________________________________ | |
1305 | ||
1306 | void | |
1307 | AliTOFDecoderV2::ResetSpider() | |
1308 | { | |
1309 | //reset condition | |
1310 | if (fVerbose) | |
1311 | AliInfo("Reset signal received, empty and reset buffer"); | |
1312 | for (Int_t iChan = 0; iChan < N_CHANNEL; iChan++){ | |
1313 | if (fSpiderBufferFull[iChan]) { | |
1314 | if (fVerbose) | |
1315 | AliInfo(Form("Spider buffer is full for channel %d", iChan)); | |
1316 | fSpiderTDCPackedHitBuffer->Add(fSpiderBuffer[iChan]); | |
1317 | } | |
1318 | fSpiderBufferFull[iChan] = kFALSE; | |
1319 | } | |
1320 | fSpiderTDCID = -1; | |
1321 | return; | |
1322 | } | |
1323 | ||
1324 | void | |
1325 | AliTOFDecoderV2::Spider(AliTOFTDCHit &hit){ | |
1326 | ||
1327 | if (fVerbose) | |
1328 | AliInfo("Hit has been received from decode main routine"); | |
1329 | ||
1330 | //check new TDC | |
1331 | if (fSpiderTDCID != hit.GetTDCID()){ | |
1332 | if (fVerbose) | |
1333 | AliInfo("Data coming from a new TDC, empty and reset buffer"); | |
1334 | for (Int_t iChan = 0; iChan < N_CHANNEL; iChan++){ | |
1335 | if (fSpiderBufferFull[iChan]) | |
1336 | fSpiderTDCPackedHitBuffer->Add(fSpiderBuffer[iChan]); | |
1337 | fSpiderBufferFull[iChan] = kFALSE; | |
1338 | } | |
1339 | fSpiderTDCPackedHitBuffer = fTDCPackedHitBuffer; | |
1340 | fSpiderTDCID = hit.GetTDCID(); | |
1341 | } | |
1342 | ||
1343 | //switch PS bits | |
1344 | switch(hit.GetPSBits()){ | |
1345 | //leading hit | |
1346 | case LEADING_HIT_PS: | |
1347 | //check buffer status | |
1348 | if (fSpiderBufferFull[hit.GetChan()]){ //buffer full | |
1349 | fSpiderTDCPackedHitBuffer->Add(fSpiderBuffer[hit.GetChan()]); //buffered hit is orphane | |
1350 | fSpiderBuffer[hit.GetChan()] = hit; //current hit into buffer | |
1351 | if (fVerbose) | |
1352 | AliInfo("Leading hit and buffer full, buffered hit is a orphane leading hit"); | |
1353 | } | |
1354 | else{ //buffer empty | |
1355 | fSpiderBuffer[hit.GetChan()] = hit; //current hit into buffer | |
1356 | fSpiderBufferFull[hit.GetChan()] = kTRUE; //set buffer full | |
1357 | } | |
1358 | break; | |
1359 | //trailing hit | |
1360 | case TRAILING_HIT_PS: | |
1361 | //check buffer status | |
1362 | if (fSpiderBufferFull[hit.GetChan()]){ //buffer full | |
1363 | fSpiderTDCPackedHitBuffer->Add(fSpiderBuffer[hit.GetChan()] << hit); //pack hits (Leading << Trailing) and save | |
1364 | fSpiderBufferFull[hit.GetChan()] = kFALSE; //unset buffer full | |
1365 | if (fVerbose) | |
1366 | AliInfo("Trailing hit and buffer full, pack leading and trailing hit"); | |
1367 | } | |
1368 | else{ //buffer empty | |
1369 | ; //do nothing | |
1370 | if (fVerbose) | |
1371 | AliInfo("Trailing hit and buffer empty, trow trailing hit away"); | |
1372 | } | |
1373 | break; | |
1374 | } //switch PS bits | |
1375 | ||
1376 | } | |
1377 | ||
1378 | //_________________________________________________________________ | |
1379 | ||
1380 | Bool_t | |
1381 | AliTOFDecoderV2::DecodeNext() | |
1382 | { | |
1383 | /* decode next */ | |
1384 | ||
1385 | if (!fRawReader || !fRawReader->ReadHeader()) | |
1386 | return kFALSE; | |
1387 | ||
1388 | const Int_t size = fRawReader->GetDataSize(); | |
1389 | UChar_t *data = new UChar_t[size]; | |
1390 | if (fRawReader->ReadNext(data, size) != 1) { | |
1391 | delete [] data; | |
1392 | return kFALSE; | |
1393 | } | |
1394 | ||
1395 | /* decode equipment data */ | |
1396 | SetEquipmentID(fRawReader->GetEquipmentId()); | |
1397 | Decode((UInt_t *)data, size / 4); | |
1398 | ||
1399 | delete [] data; | |
1400 | return kTRUE; | |
1401 | } |