1 #ifndef ALIMUONRAWSTREAMTRACKERHP_H
2 #define ALIMUONRAWSTREAMTRACKERHP_H
3 /* This file is property of and copyright by the ALICE HLT Project *
4 * ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
10 /// \file AliMUONRawStreamTrackerHP.h
11 /// \author Artur Szostak <artursz@iafrica.com>
13 /// \brief Declaration of the high performance decoder for muon trigger chamber raw streams.
16 #include "AliMUONVRawStreamTracker.h"
17 #include "AliMUONTrackerDDLDecoder.h"
21 class AliMUONDDLTracker;
24 class AliMUONRawStreamTrackerHP : public AliMUONVRawStreamTracker
30 /// Default constructor.
31 AliMUONRawStreamTrackerHP();
33 /// Constructor for setting the raw reader.
34 AliMUONRawStreamTrackerHP(AliRawReader* rawReader);
36 /// Default destructor.
37 virtual ~AliMUONRawStreamTrackerHP();
39 // The following public methods are all inherited from AliMUONVRawStreamTracker:
41 /// Initialize iterator
45 virtual Bool_t NextDDL();
47 /// Whether the iteration is finished or not
48 virtual Bool_t IsDone() const;
50 /// Nothing is actually done in the AddErrorMessage method because we log
51 /// the error messages as we find them in AliDecoderEventHandler::OnError().
52 virtual void AddErrorMessage() { };
54 /// Advance one step in the iteration. Returns false if finished.
55 virtual Bool_t Next(Int_t& busPatchId,
56 UShort_t& manuId, UChar_t& manuChannel,
57 UShort_t& adc) { return Next(busPatchId,manuId,manuChannel,adc,kTRUE); }
59 /// Advance one step in the iteration. Returns false if finished.
60 virtual Bool_t Next(Int_t& busPatchId,
61 UShort_t& manuId, UChar_t& manuChannel,
62 UShort_t& adc, Bool_t skipParityErrors);
64 /// Construct and return a pointer to the DDL payload object.
65 virtual AliMUONDDLTracker* GetDDLTracker() const;
67 /// Returns the next batch of decoded channel data.
68 const AliBusPatch* Next();
70 /// Return maximum number of blocks per DDL allowed.
71 virtual Int_t GetMaxBlock() const { return (Int_t) fDecoder.MaxBlocks(); }
72 /// Return maximum number of Dsp per block allowed.
73 virtual Int_t GetMaxDsp() const { return (Int_t) fDecoder.MaxDSPs(); }
74 /// Return maximum number of Buspatch per Dsp allowed.
75 virtual Int_t GetMaxBus() const { return (Int_t) fDecoder.MaxBusPatches(); }
77 /// Set maximum number of blocks per DDL allowed.
78 virtual void SetMaxBlock(Int_t blk);
79 /// Set maximum number of Dsp per block allowed.
80 virtual void SetMaxDsp(Int_t dsp);
81 /// Set maximum number of Buspatch per Dsp allowed.
82 virtual void SetMaxBus(Int_t bus);
84 /// Return number of the current DDL.
85 virtual Int_t GetDDL() const { return fDDL - 1; }
87 /// check error/Warning presence
88 virtual Bool_t IsErrorMessage() const { return fHadError; }
90 /// Get number of parity errors
91 Int_t GetParityErrors() const
93 return (Int_t) fDecoder.GetHandler().ParityErrorCount();
96 /// Get number of glitch errors
97 Int_t GetGlitchErrors() const
99 return (Int_t) fDecoder.GetHandler().GlitchErrorCount();
102 /// Get number of padding word errors
103 Int_t GetPaddingErrors() const
105 return (Int_t) fDecoder.GetHandler().PaddingErrorCount();
108 /// Set warnings flag to disable warnings on data errors.
109 void DisableWarnings() { fDecoder.GetHandler().Warnings(kFALSE); }
110 /// Set warnings flag to enable warnings on data errors.
111 void EnableWarnings() { fDecoder.GetHandler().Warnings(kTRUE); }
113 /// Returns the "try to recover from errors" flag.
114 Bool_t TryRecover() const { return Bool_t(fDecoder.TryRecover()); }
116 /// Sets the "try to recover from errors" flag.
117 /// i.e. should the decoder try to recover from errors found in the
119 void TryRecover(Bool_t value) { fDecoder.TryRecover(bool(value)); }
121 /// Returns the auto-detect trailer words flag.
122 Bool_t AutoDetectTrailer() const { return Bool_t(fDecoder.AutoDetectTrailer()); }
124 /// Sets the auto-detect trailer words flag.
125 /// When set to true the decoder will try to detect if the end of DDL
126 /// keys are in the trailer words or not. These are generated by the
127 /// detector but not the older versions of AliRoot simulations.
128 void AutoDetectTrailer(Bool_t value) { fDecoder.AutoDetectTrailer(bool(value)); }
130 /// Returns the flag indicating if the data is expected to have the
131 /// end of DDL keys in the trailer. This flag is ignored if AutoDetectTrailer()
133 Bool_t CheckForTrailer() const { return Bool_t(fDecoder.CheckForTrailer()); }
135 /// Sets the flag indicating if the trailer words should contain the
137 void CheckForTrailer(Bool_t value) { fDecoder.CheckForTrailer(bool(value)); }
139 /// Light weight interface class to the block header data.
143 /// Default constructor.
145 AliDspHeader* dspArray = NULL,
146 const AliMUONBlockHeaderStruct* header = NULL
148 : fNext(NULL), fDspCount(0), fFirstDsp(dspArray), fHeader(header)
152 /// Implement shallow copying in the copy constructor.
153 AliBlockHeader(const AliBlockHeader& o) :
154 fNext(o.fNext), fDspCount(o.fDspCount), fFirstDsp(o.fFirstDsp), fHeader(o.fHeader)
158 /// Implement shallow copying in the assignment operator.
159 AliBlockHeader& operator = (const AliBlockHeader& object)
161 memcpy(this, &object, sizeof(AliBlockHeader));
165 /// Default destructor.
166 ~AliBlockHeader() {};
168 /// Return data key word for CRT header
169 Int_t GetDataKey() const {assert(fHeader != NULL); return fHeader->fDataKey;}
170 /// Return total length of block structure (w/o padding word)
171 Int_t GetTotalLength() const {assert(fHeader != NULL); return fHeader->fTotalLength;}
172 /// Return length of raw data
173 Int_t GetLength() const {assert(fHeader != NULL); return fHeader->fLength;}
175 Int_t GetDspId() const {assert(fHeader != NULL); return fHeader->fDSPId;}
176 /// Return L0 trigger word
177 Int_t GetL0Trigger() const {assert(fHeader != NULL); return fHeader->fL0Trigger;}
178 /// Return Bunch Crossing for mini-event id (see TDR chapter 8)
179 Int_t GetMiniEventId() const {assert(fHeader != NULL); return fHeader->fMiniEventId;}
180 /// Return Event Id in bunch crossing
181 Int_t GetEventId1() const {assert(fHeader != NULL); return fHeader->fEventId1;}
182 /// Return Event Id in orbit number
183 Int_t GetEventId2() const {assert(fHeader != NULL); return fHeader->fEventId2;}
185 /// Return the header's raw data.
186 const AliMUONBlockHeaderStruct* GetHeader() const {return fHeader;}
188 /// Return the next block header.
189 const AliBlockHeader* Next() const { return fNext; }
191 /// Returns the first AliDspHeader class in this block.
192 const AliDspHeader* GetFirstDspHeader() const { return fFirstDsp; }
194 /// Returns the number of DSPs within this block.
195 UInt_t GetDspCount() const { return fDspCount; }
197 /// Return the i'th DSP in this block.
198 const AliDspHeader* GetDspHeader(UInt_t i) const
200 return i < fDspCount ? GetFirstDspHeader() + i : NULL;
203 /// Sets the next block header.
204 void SetNext(const AliBlockHeader* next) { fNext = next; }
206 /// Increments the DSP count.
207 void IncDspCount() { fDspCount++; };
209 /// Print the contents of the header to screen.
214 const AliBlockHeader* fNext; ///< Pointer to next block.
215 UInt_t fDspCount; ///< The number of AliDspHeader objects found in the array pointed to by fFirstDsp.
216 const AliDspHeader* fFirstDsp; ///< The first DSP associated with this block.
217 const AliMUONBlockHeaderStruct* fHeader; ///< Pointer to header in DDL payload.
220 /// Light weight interface class to the DSP header data.
224 /// Default constructor.
226 const AliBlockHeader* block = NULL,
227 const AliBusPatch* busPatchArray = NULL,
228 const AliMUONDSPHeaderStruct* header = NULL
230 fBlock(block), fNext(NULL), fBusPatchCount(0),
231 fFirstBusPatch(busPatchArray), fHeader(header)
235 /// Implement shallow copying in the copy constructor.
236 AliDspHeader(const AliDspHeader& o) :
237 fBlock(o.fBlock), fNext(o.fNext), fBusPatchCount(o.fBusPatchCount),
238 fFirstBusPatch(o.fFirstBusPatch), fHeader(o.fHeader)
242 /// Implement shallow copying in the assignment operator.
243 AliDspHeader& operator = (const AliDspHeader& object)
245 memcpy(this, &object, sizeof(AliDspHeader));
249 /// Default destructor.
252 /// Return Data key word for FRT header
253 Int_t GetDataKey() const {assert(fHeader != NULL); return fHeader->fDataKey;}
254 /// Return total length of block structure
255 Int_t GetTotalLength() const {assert(fHeader != NULL); return fHeader->fTotalLength;}
256 /// Return length of raw data
257 Int_t GetLength() const {assert(fHeader != NULL); return fHeader->fLength;}
259 Int_t GetDspId() const {assert(fHeader != NULL); return fHeader->fDSPId;}
260 /// Return L1 accept in Block Structure (CRT)
261 Int_t GetBlkL1ATrigger() const {assert(fHeader != NULL); return fHeader->fBlkL1ATrigger;}
262 /// Return Mini Event Id in bunch crossing
263 Int_t GetMiniEventId() const {assert(fHeader != NULL); return fHeader->fMiniEventId;}
264 /// Return Number of L1 accept in DSP Structure (FRT)
265 Int_t GetL1ATrigger() const {assert(fHeader != NULL); return fHeader->fL1ATrigger;}
266 /// Return Number of L1 reject in DSP Structure (FRT)
267 Int_t GetL1RTrigger() const {assert(fHeader != NULL); return fHeader->fL1RTrigger;}
268 /// Return padding dummy word for 64 bits transfer
269 UInt_t GetPaddingWord() const {assert(fHeader != NULL); return fHeader->fPaddingWord;}
270 /// Return Error word
271 Int_t GetErrorWord() const {assert(fHeader != NULL); return fHeader->fErrorWord;}
273 /// Return raw data of header
274 const AliMUONDSPHeaderStruct* GetHeader() const { return fHeader; }
276 /// Return the parent block header.
277 const AliBlockHeader* GetBlockHeader() const { return fBlock; }
279 /// Return the next DSP header.
280 const AliDspHeader* Next() const { return fNext; }
282 /// Returns the first AliBusPatch class in this DSP.
283 const AliBusPatch* GetFirstBusPatch() const { return fFirstBusPatch; }
285 /// Returns the number of bus patches within this DSP.
286 UInt_t GetBusPatchCount() const { return fBusPatchCount; }
288 /// Return the i'th bus patch in this DSP.
289 const AliBusPatch* GetBusPatch(UInt_t i) const
291 return i < fBusPatchCount ? GetFirstBusPatch() + i : NULL;
294 /// Sets the next DSP header.
295 void SetNext(const AliDspHeader* next) { fNext = next; }
297 /// Increments the bus patch count.
298 void IncBusPatchCount() { fBusPatchCount++; };
300 /// Print the contents of the header to screen.
305 const AliBlockHeader* fBlock; ///< Pointer to parent block structure.
306 const AliDspHeader* fNext; ///< Pointer to next DSP.
307 UInt_t fBusPatchCount; ///< The number of AliDspHeader objects found in the array pointed to by fFirstBusPatch
308 const AliBusPatch* fFirstBusPatch; ///< The first bus patch of this DSP.
309 const AliMUONDSPHeaderStruct* fHeader; ///< Pointer to header in DDL payload.
312 /// Light weight interface class to the bus patch data.
316 /// Default constructor.
318 const AliDspHeader* dsp = NULL,
319 const AliMUONBusPatchHeaderStruct* header = NULL,
320 const UInt_t* data = NULL,
321 const Bool_t* parityOk = NULL
331 /// Implement shallow copying in the copy constructor.
332 AliBusPatch(const AliBusPatch& o) :
337 fParityOk(o.fParityOk)
341 /// Implement shallow copying in the assignment operator.
342 AliBusPatch& operator = (const AliBusPatch& object)
344 memcpy(this, &object, sizeof(AliBusPatch));
348 /// Default destructor.
351 /// Return Data key word for bus patch header.
352 Int_t GetDataKey() const {assert(fHeader != NULL); return fHeader->fDataKey;}
353 /// Return total length of buspatch structure
354 Int_t GetTotalLength() const {assert(fHeader != NULL); return fHeader->fTotalLength;}
355 /// Return length of raw data
356 Int_t GetLength() const {assert(fHeader != NULL); return fHeader->fLength;}
357 /// Return bus patch id
358 Int_t GetBusPatchId() const {assert(fHeader != NULL); return fHeader->fBusPatchId;}
360 /// Return raw data of header
361 const AliMUONBusPatchHeaderStruct* GetHeader() const {return fHeader;}
362 /// Return raw digit data
363 const UInt_t* GetData() const {return fData;}
364 /// Returns the number of raw data words within this bus patch.
365 UInt_t GetDataCount() const { return (UInt_t)GetLength(); }
367 /// Returns the parity bit of the n'th raw data word.
368 Char_t GetParity(UInt_t n) const
370 assert( fHeader != NULL && n < fHeader->fLength );
371 return (Char_t)(fData[n] >> 31) & 0x1;
374 /// Returns the MANU ID of the n'th raw data word.
375 UShort_t GetManuId(UInt_t n) const
377 assert( fHeader != NULL && n < fHeader->fLength );
378 return (UShort_t)(fData[n] >> 18) & 0x7FF;
381 /// Returns the channel ID of the n'th raw data word.
382 UChar_t GetChannelId(UInt_t n) const
384 assert( fHeader != NULL && n < fHeader->fLength );
385 return (Char_t)(fData[n] >> 12) & 0x3F;
388 /// Returns the charge/signal of the n'th raw data word.
389 UShort_t GetCharge(UInt_t n) const
391 assert( fHeader != NULL && n < fHeader->fLength );
392 return (UShort_t)(fData[n] & 0xFFF);
395 /// Returns the n'th raw data word.
396 UInt_t GetData(UInt_t n) const
398 assert( fHeader != NULL && n < fHeader->fLength );
402 /// Returns kTRUE if the parity of the n'th raw data word is OK
403 /// and kFALSE otherwise.
404 Bool_t IsParityOk(UInt_t n) const
406 assert( fHeader != NULL && n < fHeader->fLength );
410 /// Unpacks and returns the fields of the n'th raw data word. kTRUE
411 /// is returned if the data word's parity was OK and kFALSE otherwise.
412 Bool_t GetData(UInt_t n, UShort_t& manuId, UChar_t& channelId, UShort_t& adc) const
414 assert( fHeader != NULL && n < fHeader->fLength );
415 AliMUONTrackerDDLDecoderEventHandler::UnpackADC(fData[n], manuId, channelId, adc);
419 /// Return the parent block header.
420 const AliDspHeader* GetDspHeader() const { return fDSP; }
422 /// Return the next bus patch header.
423 const AliBusPatch* Next() const { return fNext; }
425 /// Sets the next bus patch.
426 void SetNext(const AliBusPatch* next) { fNext = next; }
428 /// Print the contents of the bus patch to screen.
429 void Print(const Option_t* opt = "") const;
433 const AliDspHeader* fDSP; ///< The DSP this bus patch belongs to.
434 const AliBusPatch* fNext; ///< Next bus patch object in the DSP.
435 const AliMUONBusPatchHeaderStruct* fHeader; ///< Pointer to bus patch in DDL payload.
436 const UInt_t* fData; ///< Pointer to the bus patch data.
437 const Bool_t* fParityOk; ///< Array of flags indicating if the parity of the given data word in fData is good or not.
440 /// Return the number of blocks in the DDL payload.
441 UInt_t GetBlockCount() const
443 return fDecoder.GetHandler().BlockCount();
446 /// Return the first block header.
447 const AliBlockHeader* GetFirstBlockHeader() const
449 return fDecoder.GetHandler().BlockHeader(0);
452 /// Return the i'th block header or NULL if not found.
453 const AliBlockHeader* GetBlockHeader(UInt_t i) const
455 return fDecoder.GetHandler().BlockHeader(i);
458 /// Returns the number of DSPs for the given block number.
459 UInt_t GetDspCount(UInt_t block) const
461 const AliBlockHeader* b = GetBlockHeader(block);
462 return b != NULL ? b->GetDspCount() : 0;
465 /// Returns the i'th DSP header for the given block number or NULL if not found.
466 const AliDspHeader* GetDspHeader(UInt_t block, UInt_t i) const
468 const AliBlockHeader* b = GetBlockHeader(block);
469 return b != NULL ? b->GetDspHeader(i) : NULL;
472 /// Returns the number of bus patches for the given block and dsp number.
473 UInt_t GetBusPatchCount(UInt_t block, UInt_t dsp) const
475 const AliDspHeader* d = GetDspHeader(block, dsp);
476 return d != NULL ? d->GetBusPatchCount() : 0;
479 /// Returns the i'th bus patch for the given block and dsp.
480 const AliBusPatch* GetBusPatch(UInt_t block, UInt_t dsp, UInt_t i) const
482 const AliDspHeader* d = GetDspHeader(block, dsp);
483 return d != NULL ? d->GetBusPatch(i) : NULL;
486 /// Returns the current bus patch being decoded or NULL if none found.
487 const AliBusPatch* CurrentBusPatch() const
489 return (fkCurrentBusPatch != fDecoder.GetHandler().EndOfBusPatch()) ?
490 fkCurrentBusPatch : NULL;
493 /// Returns the current DSP being decoded or NULL if none found.
494 const AliDspHeader* CurrentDspHeader() const
496 const AliBusPatch* busPatch = CurrentBusPatch();
497 return (busPatch != NULL) ? busPatch->GetDspHeader() : NULL;
500 /// Returns the current block header being decoded or NULL if none found.
501 const AliBlockHeader* CurrentBlockHeader() const
503 const AliDspHeader* dsp = CurrentDspHeader();
504 return (dsp != NULL) ? dsp->GetBlockHeader() : NULL;
509 // Do not allow copying of this class.
511 AliMUONRawStreamTrackerHP(const AliMUONRawStreamTrackerHP& stream);
513 AliMUONRawStreamTrackerHP& operator = (const AliMUONRawStreamTrackerHP& stream);
515 /// This is the custom event handler (callback interface) class which
516 /// unpacks raw data words and fills an internal buffer with decoded digits
517 /// as they are decoded by the high performance decoder.
518 /// Any errors are logged to the parent AliMUONVRawStreamTracker, so one
519 /// must set this pointer appropriately before decoding and DDL payload.
520 class AliDecoderEventHandler : public AliMUONTrackerDDLDecoderEventHandler
524 /// Default constructor.
525 AliDecoderEventHandler();
526 /// Default destructor.
527 virtual ~AliDecoderEventHandler();
529 /// Sets the internal arrays based on the maximum number of structures allowed.
530 void SetMaxStructs(UInt_t maxBlocks, UInt_t maxDsps, UInt_t maxBusPatches);
532 /// Sets the raw stream object which should be the parent of this class.
533 void SetRawStream(AliMUONVRawStreamTracker* rawStream) { fRawStream = rawStream; }
535 /// Return the number of blocks found in the payload.
536 UInt_t BlockCount() const { return fBlockCount; };
538 /// Return the i'th block structure.
539 const AliBlockHeader* BlockHeader(UInt_t i) const
541 return i < fBlockCount ? &fBlocks[i] : NULL;
544 /// Return the first bus patch decoded.
545 const AliBusPatch* FirstBusPatch() const { return fBusPatches; }
547 /// Returns the marker to the end of bus patches. i.e. one position past the last bus patch.
548 const AliBusPatch* EndOfBusPatch() const { return fEndOfBusPatches; }
550 /// Returns the number of parity errors found in the DDL.
551 UInt_t ParityErrorCount() const { return fParityErrors; }
552 /// Returns the number of glitch errors found in the DDL.
553 UInt_t GlitchErrorCount() const { return fGlitchErrors; }
554 /// Returns the number of padding errors found in the DDL.
555 UInt_t PaddingErrorCount() const { return fPaddingErrors; }
557 /// Returns the warnings flag.
558 Bool_t Warnings() const { return fWarnings; }
559 /// Sets the warnings flag.
560 void Warnings(Bool_t value) { fWarnings = value; }
562 // The following methods are inherited from AliMUONTrackerDDLDecoderEventHandler:
564 /// New buffer handler.
565 void OnNewBuffer(const void* buffer, UInt_t bufferSize);
567 /// End of buffer handler marks the end of bus patches.
568 void OnEndOfBuffer(const void* /*buffer*/, UInt_t /*bufferSize*/)
570 fEndOfBusPatches = fCurrentBusPatch+1;
573 /// New block handler is called by the decoder whenever a new block
574 /// structure is found. We just mark the new block and increment the
575 /// internal counter.
576 void OnNewBlock(const AliMUONBlockHeaderStruct* header, const void* /*data*/);
578 /// New DSP handler is called by the decoder whenever a new DSP
579 /// structure is found. We just mark the DSP and increment the
580 /// appropriate counters.
581 void OnNewDSP(const AliMUONDSPHeaderStruct* header, const void* /*data*/);
583 /// New bus patch handler.
584 /// This is called by the high performance decoder when a new bus patch
585 /// is found within the DDL payload.
586 void OnNewBusPatch(const AliMUONBusPatchHeaderStruct* header, const void* data);
588 /// Raw data word handler.
589 void OnData(UInt_t /*data*/, bool parityError)
591 assert( fCurrentParityOkFlag < fParityOk + fMaxChannels );
592 *(++fCurrentParityOkFlag) = Bool_t(not parityError);
596 void OnError(ErrorCode error, const void* location);
600 // Do not allow copying of this class.
602 AliDecoderEventHandler(const AliDecoderEventHandler& /*obj*/);
604 AliDecoderEventHandler& operator = (const AliDecoderEventHandler& /*obj*/);
606 AliMUONVRawStreamTracker* fRawStream; //!< Pointer to the parent raw stream object.
607 const void* fBufferStart; //!< Pointer to the start of the current DDL payload buffer.
608 UInt_t fBlockCount; //!< Number of blocks filled in fBlocks.
609 AliBlockHeader* fBlocks; //!< Array of blocks. [0..fMaxBlocks-1]
610 AliDspHeader* fDSPs; //!< Array of DSPs. [0..fMaxDsps*fMaxBlocks-1]
611 AliBusPatch* fBusPatches; //!< Array of bus patches. [0..fMaxBusPatches*fMaxDsps*fMaxBlocks-1]
612 AliBusPatch* fEndOfBusPatches; //!< Marks the last bus patch.
613 UInt_t fMaxChannels; //!< Maximum number of elements that can be stored in fParityOk.
614 Bool_t* fParityOk; //!< Array of flags for indicating if the parity is good for a raw data word.
615 AliBlockHeader* fCurrentBlock; //!< Current block in fBlocks.
616 AliDspHeader* fCurrentDSP; //!< Current DSP in fDSPs.
617 AliBusPatch* fCurrentBusPatch; //!< Current bus patch in fBusPatches.
618 Bool_t* fCurrentParityOkFlag; //!< Current parity flag to be set in fParityOk.
619 UInt_t fParityErrors; //!< Number of parity errors found in DDL.
620 UInt_t fGlitchErrors; //!< Number of glitch errors found in DDL.
621 UInt_t fPaddingErrors; //!< Number of padding errors found in DDL.
622 Bool_t fWarnings; //!< Flag indicating if we should generate a warning for errors.
625 AliMUONTrackerDDLDecoder<AliDecoderEventHandler> fDecoder; //!< The decoder for the DDL payload.
626 Int_t fDDL; //!< The current DDL number being handled.
627 Int_t fBufferSize; //!< This is the buffer size in bytes of fBuffer.
628 UChar_t* fBuffer; //!< This is the buffer in which we store the DDL payload read from AliRawReader.
629 const AliBusPatch* fkCurrentBusPatch; //!< The current bus patch being handled by Next().
630 const UInt_t* fkCurrentData; //!< The current data word to return by Next().
631 const UInt_t* fkEndOfData; //!< The last data word in the current bus patch.
632 Bool_t fHadError; //!< Flag indicating if there was a decoding error or not.
633 Bool_t fDone; //!< Flag indicating if the iteration is done or not.
634 mutable AliMUONDDLTracker* fDDLObject; //!< Temporary DDL object used by GetDDLTracker() for caching.
636 ClassDef(AliMUONRawStreamTrackerHP, 0) // High performance decoder for reading MUON raw digits from tracking chamber DDL data.
639 ////////////////////////////////////////////////////////////////////////////////
641 inline const AliMUONRawStreamTrackerHP::AliBusPatch* AliMUONRawStreamTrackerHP::Next()
643 /// Returns the next batch of decoded channel data.
644 if (fkCurrentBusPatch == NULL) return NULL;
646 if (fkCurrentBusPatch != fDecoder.GetHandler().EndOfBusPatch())
647 return fkCurrentBusPatch++;
652 inline void AliMUONRawStreamTrackerHP::AliDecoderEventHandler::OnNewBlock(
653 const AliMUONBlockHeaderStruct* header, const void* /*data*/
656 /// New block handler is called by the decoder whenever a new block
657 /// structure is found. We just mark the new block and increment the
658 /// internal counter.
660 assert( header != NULL );
661 assert( fBlockCount < (UInt_t)fRawStream->GetMaxBlock() );
662 // Link the block unless it is the first one.
663 if (fBlockCount > 0) fCurrentBlock->SetNext(fCurrentBlock+1);
664 *(++fCurrentBlock) = AliBlockHeader(fCurrentDSP+1, header);
668 inline void AliMUONRawStreamTrackerHP::AliDecoderEventHandler::OnNewDSP(
669 const AliMUONDSPHeaderStruct* header, const void* /*data*/
672 /// New DSP handler is called by the decoder whenever a new DSP
673 /// structure is found. We just mark the DSP and increment the
674 /// appropriate counters.
676 assert( header != NULL );
677 assert( fCurrentBlock->GetDspCount() < (UInt_t)fRawStream->GetMaxDsp() );
678 // Link the DSP unless it is the first one.
679 if (fCurrentBlock->GetDspCount() > 0) fCurrentDSP->SetNext(fCurrentDSP+1);
680 *(++fCurrentDSP) = AliDspHeader(fCurrentBlock, fCurrentBusPatch+1, header);
681 fCurrentBlock->IncDspCount();
684 inline void AliMUONRawStreamTrackerHP::AliDecoderEventHandler::OnNewBusPatch(
685 const AliMUONBusPatchHeaderStruct* header, const void* data
688 /// New bus patch handler.
689 /// This is called by the high performance decoder when a new bus patch
690 /// is found within the DDL payload.
692 assert( header != NULL );
693 assert( data != NULL );
694 assert( fCurrentDSP->GetBusPatchCount() < (UInt_t)fRawStream->GetMaxBus() );
695 // Link the bus patch unless it is the first one.
696 if (fCurrentDSP->GetBusPatchCount() > 0) fCurrentBusPatch->SetNext(fCurrentBusPatch+1);
697 *(++fCurrentBusPatch) = AliBusPatch(
700 reinterpret_cast<const UInt_t*>(data),
701 fCurrentParityOkFlag+1
703 fCurrentDSP->IncBusPatchCount();
706 #endif // ALIMUONRAWSTREAMTRACKERHP_H