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,
59 /// Construct and return a pointer to the DDL payload object.
60 virtual AliMUONDDLTracker* GetDDLTracker() const;
62 /// Returns the next batch of decoded channel data.
63 const AliBusPatch* Next();
65 /// Return maximum number of blocks per DDL allowed.
66 virtual Int_t GetMaxBlock() const { return (Int_t) fDecoder.MaxBlocks(); }
67 /// Return maximum number of Dsp per block allowed.
68 virtual Int_t GetMaxDsp() const { return (Int_t) fDecoder.MaxDSPs(); }
69 /// Return maximum number of Buspatch per Dsp allowed.
70 virtual Int_t GetMaxBus() const { return (Int_t) fDecoder.MaxBusPatches(); }
72 /// Set maximum number of blocks per DDL allowed.
73 virtual void SetMaxBlock(Int_t blk);
74 /// Set maximum number of Dsp per block allowed.
75 virtual void SetMaxDsp(Int_t dsp);
76 /// Set maximum number of Buspatch per Dsp allowed.
77 virtual void SetMaxBus(Int_t bus);
79 /// Return number of the current DDL.
80 virtual Int_t GetDDL() const { return fDDL - 1; }
82 /// check error/Warning presence
83 virtual Bool_t IsErrorMessage() const { return fHadError; }
85 /// Get number of parity errors
86 Int_t GetParityErrors() const
88 return (Int_t) fDecoder.GetHandler().ParityErrorCount();
91 /// Get number of glitch errors
92 Int_t GetGlitchErrors() const
94 return (Int_t) fDecoder.GetHandler().GlitchErrorCount();
97 /// Get number of padding word errors
98 Int_t GetPaddingErrors() const
100 return (Int_t) fDecoder.GetHandler().PaddingErrorCount();
103 /// Set warnings flag to disable warnings on data errors.
104 void DisableWarnings() { fDecoder.GetHandler().Warnings(kFALSE); }
105 /// Set warnings flag to enable warnings on data errors.
106 void EnableWarnings() { fDecoder.GetHandler().Warnings(kTRUE); }
108 /// Returns the "try to recover from errors" flag.
109 Bool_t TryRecover() const { return Bool_t(fDecoder.TryRecover()); }
111 /// Sets the "try to recover from errors" flag.
112 /// i.e. should the decoder try to recover from errors found in the
114 void TryRecover(Bool_t value) { fDecoder.TryRecover(bool(value)); }
116 /// Returns the auto-detect trailer words flag.
117 Bool_t AutoDetectTrailer() const { return Bool_t(fDecoder.AutoDetectTrailer()); }
119 /// Sets the auto-detect trailer words flag.
120 /// When set to true the decoder will try to detect if the end of DDL
121 /// keys are in the trailer words or not. These are generated by the
122 /// detector but not the older versions of AliRoot simulations.
123 void AutoDetectTrailer(Bool_t value) { fDecoder.AutoDetectTrailer(bool(value)); }
125 /// Returns the flag indicating if the data is expected to have the
126 /// end of DDL keys in the trailer. This flag is ignored if AutoDetectTrailer()
128 Bool_t CheckForTrailer() const { return Bool_t(fDecoder.CheckForTrailer()); }
130 /// Sets the flag indicating if the trailer words should contain the
132 void CheckForTrailer(Bool_t value) { fDecoder.CheckForTrailer(bool(value)); }
134 /// Light weight interface class to the block header data.
138 /// Default constructor.
140 AliDspHeader* dspArray = NULL,
141 const AliMUONBlockHeaderStruct* header = NULL
143 : fNext(NULL), fDspCount(0), fFirstDsp(dspArray), fHeader(header)
147 /// Implement shallow copying in the copy constructor.
148 AliBlockHeader(const AliBlockHeader& o) :
149 fNext(o.fNext), fDspCount(o.fDspCount), fFirstDsp(o.fFirstDsp), fHeader(o.fHeader)
153 /// Implement shallow copying in the assignment operator.
154 AliBlockHeader& operator = (const AliBlockHeader& object)
156 memcpy(this, &object, sizeof(AliBlockHeader));
160 /// Default destructor.
161 ~AliBlockHeader() {};
163 /// Return data key word for CRT header
164 Int_t GetDataKey() const {assert(fHeader != NULL); return fHeader->fDataKey;}
165 /// Return total length of block structure (w/o padding word)
166 Int_t GetTotalLength() const {assert(fHeader != NULL); return fHeader->fTotalLength;}
167 /// Return length of raw data
168 Int_t GetLength() const {assert(fHeader != NULL); return fHeader->fLength;}
170 Int_t GetDspId() const {assert(fHeader != NULL); return fHeader->fDSPId;}
171 /// Return L0 trigger word
172 Int_t GetL0Trigger() const {assert(fHeader != NULL); return fHeader->fL0Trigger;}
173 /// Return Bunch Crossing for mini-event id (see TDR chapter 8)
174 Int_t GetMiniEventId() const {assert(fHeader != NULL); return fHeader->fMiniEventId;}
175 /// Return Event Id in bunch crossing
176 Int_t GetEventId1() const {assert(fHeader != NULL); return fHeader->fEventId1;}
177 /// Return Event Id in orbit number
178 Int_t GetEventId2() const {assert(fHeader != NULL); return fHeader->fEventId2;}
180 /// Return the header's raw data.
181 const AliMUONBlockHeaderStruct* GetHeader() const {return fHeader;}
183 /// Return the next block header.
184 const AliBlockHeader* Next() const { return fNext; }
186 /// Returns the first AliDspHeader class in this block.
187 const AliDspHeader* GetFirstDspHeader() const { return fFirstDsp; }
189 /// Returns the number of DSPs within this block.
190 UInt_t GetDspCount() const { return fDspCount; }
192 /// Return the i'th DSP in this block.
193 const AliDspHeader* GetDspHeader(UInt_t i) const
195 return i < fDspCount ? GetFirstDspHeader() + i : NULL;
198 /// Sets the next block header.
199 void SetNext(const AliBlockHeader* next) { fNext = next; }
201 /// Increments the DSP count.
202 void IncDspCount() { fDspCount++; };
204 /// Print the contents of the header to screen.
209 const AliBlockHeader* fNext; ///< Pointer to next block.
210 UInt_t fDspCount; ///< The number of AliDspHeader objects found in the array pointed to by fFirstDsp.
211 const AliDspHeader* fFirstDsp; ///< The first DSP associated with this block.
212 const AliMUONBlockHeaderStruct* fHeader; ///< Pointer to header in DDL payload.
215 /// Light weight interface class to the DSP header data.
219 /// Default constructor.
221 const AliBlockHeader* block = NULL,
222 const AliBusPatch* busPatchArray = NULL,
223 const AliMUONDSPHeaderStruct* header = NULL
225 fBlock(block), fNext(NULL), fBusPatchCount(0),
226 fFirstBusPatch(busPatchArray), fHeader(header)
230 /// Implement shallow copying in the copy constructor.
231 AliDspHeader(const AliDspHeader& o) :
232 fBlock(o.fBlock), fNext(o.fNext), fBusPatchCount(o.fBusPatchCount),
233 fFirstBusPatch(o.fFirstBusPatch), fHeader(o.fHeader)
237 /// Implement shallow copying in the assignment operator.
238 AliDspHeader& operator = (const AliDspHeader& object)
240 memcpy(this, &object, sizeof(AliDspHeader));
244 /// Default destructor.
247 /// Return Data key word for FRT header
248 Int_t GetDataKey() const {assert(fHeader != NULL); return fHeader->fDataKey;}
249 /// Return total length of block structure
250 Int_t GetTotalLength() const {assert(fHeader != NULL); return fHeader->fTotalLength;}
251 /// Return length of raw data
252 Int_t GetLength() const {assert(fHeader != NULL); return fHeader->fLength;}
254 Int_t GetDspId() const {assert(fHeader != NULL); return fHeader->fDSPId;}
255 /// Return L1 accept in Block Structure (CRT)
256 Int_t GetBlkL1ATrigger() const {assert(fHeader != NULL); return fHeader->fBlkL1ATrigger;}
257 /// Return Mini Event Id in bunch crossing
258 Int_t GetMiniEventId() const {assert(fHeader != NULL); return fHeader->fMiniEventId;}
259 /// Return Number of L1 accept in DSP Structure (FRT)
260 Int_t GetL1ATrigger() const {assert(fHeader != NULL); return fHeader->fL1ATrigger;}
261 /// Return Number of L1 reject in DSP Structure (FRT)
262 Int_t GetL1RTrigger() const {assert(fHeader != NULL); return fHeader->fL1RTrigger;}
263 /// Return padding dummy word for 64 bits transfer
264 UInt_t GetPaddingWord() const {assert(fHeader != NULL); return fHeader->fPaddingWord;}
265 /// Return Error word
266 Int_t GetErrorWord() const {assert(fHeader != NULL); return fHeader->fErrorWord;}
268 /// Return raw data of header
269 const AliMUONDSPHeaderStruct* GetHeader() const { return fHeader; }
271 /// Return the parent block header.
272 const AliBlockHeader* GetBlockHeader() const { return fBlock; }
274 /// Return the next DSP header.
275 const AliDspHeader* Next() const { return fNext; }
277 /// Returns the first AliBusPatch class in this DSP.
278 const AliBusPatch* GetFirstBusPatch() const { return fFirstBusPatch; }
280 /// Returns the number of bus patches within this DSP.
281 UInt_t GetBusPatchCount() const { return fBusPatchCount; }
283 /// Return the i'th bus patch in this DSP.
284 const AliBusPatch* GetBusPatch(UInt_t i) const
286 return i < fBusPatchCount ? GetFirstBusPatch() + i : NULL;
289 /// Sets the next DSP header.
290 void SetNext(const AliDspHeader* next) { fNext = next; }
292 /// Increments the bus patch count.
293 void IncBusPatchCount() { fBusPatchCount++; };
295 /// Print the contents of the header to screen.
300 const AliBlockHeader* fBlock; ///< Pointer to parent block structure.
301 const AliDspHeader* fNext; ///< Pointer to next DSP.
302 UInt_t fBusPatchCount; ///< The number of AliDspHeader objects found in the array pointed to by fFirstBusPatch
303 const AliBusPatch* fFirstBusPatch; ///< The first bus patch of this DSP.
304 const AliMUONDSPHeaderStruct* fHeader; ///< Pointer to header in DDL payload.
307 /// Light weight interface class to the bus patch data.
311 /// Default constructor.
313 const AliDspHeader* dsp = NULL,
314 const AliMUONBusPatchHeaderStruct* header = NULL,
315 const UInt_t* data = NULL,
316 const Bool_t* parityOk = NULL
326 /// Implement shallow copying in the copy constructor.
327 AliBusPatch(const AliBusPatch& o) :
332 fParityOk(o.fParityOk)
336 /// Implement shallow copying in the assignment operator.
337 AliBusPatch& operator = (const AliBusPatch& object)
339 memcpy(this, &object, sizeof(AliBusPatch));
343 /// Default destructor.
346 /// Return Data key word for bus patch header.
347 Int_t GetDataKey() const {assert(fHeader != NULL); return fHeader->fDataKey;}
348 /// Return total length of buspatch structure
349 Int_t GetTotalLength() const {assert(fHeader != NULL); return fHeader->fTotalLength;}
350 /// Return length of raw data
351 Int_t GetLength() const {assert(fHeader != NULL); return fHeader->fLength;}
352 /// Return bus patch id
353 Int_t GetBusPatchId() const {assert(fHeader != NULL); return fHeader->fBusPatchId;}
355 /// Return raw data of header
356 const AliMUONBusPatchHeaderStruct* GetHeader() const {return fHeader;}
357 /// Return raw digit data
358 const UInt_t* GetData() const {return fData;}
359 /// Returns the number of raw data words within this bus patch.
360 UInt_t GetDataCount() const { return (UInt_t)GetLength(); }
362 /// Returns the parity bit of the n'th raw data word.
363 Char_t GetParity(UInt_t n) const
365 assert( fHeader != NULL && n < fHeader->fLength );
366 return (Char_t)(fData[n] >> 31) & 0x1;
369 /// Returns the MANU ID of the n'th raw data word.
370 UShort_t GetManuId(UInt_t n) const
372 assert( fHeader != NULL && n < fHeader->fLength );
373 return (UShort_t)(fData[n] >> 18) & 0x7FF;
376 /// Returns the channel ID of the n'th raw data word.
377 UChar_t GetChannelId(UInt_t n) const
379 assert( fHeader != NULL && n < fHeader->fLength );
380 return (Char_t)(fData[n] >> 12) & 0x3F;
383 /// Returns the charge/signal of the n'th raw data word.
384 UShort_t GetCharge(UInt_t n) const
386 assert( fHeader != NULL && n < fHeader->fLength );
387 return (UShort_t)(fData[n] & 0xFFF);
390 /// Returns the n'th raw data word.
391 UInt_t GetData(UInt_t n) const
393 assert( fHeader != NULL && n < fHeader->fLength );
397 /// Returns kTRUE if the parity of the n'th raw data word is OK
398 /// and kFALSE otherwise.
399 Bool_t IsParityOk(UInt_t n) const
401 assert( fHeader != NULL && n < fHeader->fLength );
405 /// Unpacks and returns the fields of the n'th raw data word. kTRUE
406 /// is returned if the data word's parity was OK and kFALSE otherwise.
407 Bool_t GetData(UInt_t n, UShort_t& manuId, UChar_t& channelId, UShort_t& adc) const
409 assert( fHeader != NULL && n < fHeader->fLength );
410 AliMUONTrackerDDLDecoderEventHandler::UnpackADC(fData[n], manuId, channelId, adc);
414 /// Return the parent block header.
415 const AliDspHeader* GetDspHeader() const { return fDSP; }
417 /// Return the next bus patch header.
418 const AliBusPatch* Next() const { return fNext; }
420 /// Sets the next bus patch.
421 void SetNext(const AliBusPatch* next) { fNext = next; }
423 /// Print the contents of the bus patch to screen.
424 void Print(const Option_t* opt = "") const;
428 const AliDspHeader* fDSP; ///< The DSP this bus patch belongs to.
429 const AliBusPatch* fNext; ///< Next bus patch object in the DSP.
430 const AliMUONBusPatchHeaderStruct* fHeader; ///< Pointer to bus patch in DDL payload.
431 const UInt_t* fData; ///< Pointer to the bus patch data.
432 const Bool_t* fParityOk; ///< Array of flags indicating if the parity of the given data word in fData is good or not.
435 /// Return the number of blocks in the DDL payload.
436 UInt_t GetBlockCount() const
438 return fDecoder.GetHandler().BlockCount();
441 /// Return the first block header.
442 const AliBlockHeader* GetFirstBlockHeader() const
444 return fDecoder.GetHandler().BlockHeader(0);
447 /// Return the i'th block header or NULL if not found.
448 const AliBlockHeader* GetBlockHeader(UInt_t i) const
450 return fDecoder.GetHandler().BlockHeader(i);
453 /// Returns the number of DSPs for the given block number.
454 UInt_t GetDspCount(UInt_t block) const
456 const AliBlockHeader* b = GetBlockHeader(block);
457 return b != NULL ? b->GetDspCount() : 0;
460 /// Returns the i'th DSP header for the given block number or NULL if not found.
461 const AliDspHeader* GetDspHeader(UInt_t block, UInt_t i) const
463 const AliBlockHeader* b = GetBlockHeader(block);
464 return b != NULL ? b->GetDspHeader(i) : NULL;
467 /// Returns the number of bus patches for the given block and dsp number.
468 UInt_t GetBusPatchCount(UInt_t block, UInt_t dsp) const
470 const AliDspHeader* d = GetDspHeader(block, dsp);
471 return d != NULL ? d->GetBusPatchCount() : 0;
474 /// Returns the i'th bus patch for the given block and dsp.
475 const AliBusPatch* GetBusPatch(UInt_t block, UInt_t dsp, UInt_t i) const
477 const AliDspHeader* d = GetDspHeader(block, dsp);
478 return d != NULL ? d->GetBusPatch(i) : NULL;
481 /// Returns the current bus patch being decoded or NULL if none found.
482 const AliBusPatch* CurrentBusPatch() const
484 return (fkCurrentBusPatch != fDecoder.GetHandler().EndOfBusPatch()) ?
485 fkCurrentBusPatch : NULL;
488 /// Returns the current DSP being decoded or NULL if none found.
489 const AliDspHeader* CurrentDspHeader() const
491 const AliBusPatch* busPatch = CurrentBusPatch();
492 return (busPatch != NULL) ? busPatch->GetDspHeader() : NULL;
495 /// Returns the current block header being decoded or NULL if none found.
496 const AliBlockHeader* CurrentBlockHeader() const
498 const AliDspHeader* dsp = CurrentDspHeader();
499 return (dsp != NULL) ? dsp->GetBlockHeader() : NULL;
504 // Do not allow copying of this class.
506 AliMUONRawStreamTrackerHP(const AliMUONRawStreamTrackerHP& stream);
508 AliMUONRawStreamTrackerHP& operator = (const AliMUONRawStreamTrackerHP& stream);
510 /// This is the custom event handler (callback interface) class which
511 /// unpacks raw data words and fills an internal buffer with decoded digits
512 /// as they are decoded by the high performance decoder.
513 /// Any errors are logged to the parent AliMUONVRawStreamTracker, so one
514 /// must set this pointer appropriately before decoding and DDL payload.
515 class AliDecoderEventHandler : public AliMUONTrackerDDLDecoderEventHandler
519 /// Default constructor.
520 AliDecoderEventHandler();
521 /// Default destructor.
522 virtual ~AliDecoderEventHandler();
524 /// Sets the internal arrays based on the maximum number of structures allowed.
525 void SetMaxStructs(UInt_t maxBlocks, UInt_t maxDsps, UInt_t maxBusPatches);
527 /// Sets the raw stream object which should be the parent of this class.
528 void SetRawStream(AliMUONVRawStreamTracker* rawStream) { fRawStream = rawStream; }
530 /// Return the number of blocks found in the payload.
531 UInt_t BlockCount() const { return fBlockCount; };
533 /// Return the i'th block structure.
534 const AliBlockHeader* BlockHeader(UInt_t i) const
536 return i < fBlockCount ? &fBlocks[i] : NULL;
539 /// Return the first bus patch decoded.
540 const AliBusPatch* FirstBusPatch() const { return fBusPatches; }
542 /// Returns the marker to the end of bus patches. i.e. one position past the last bus patch.
543 const AliBusPatch* EndOfBusPatch() const { return fEndOfBusPatches; }
545 /// Returns the number of parity errors found in the DDL.
546 UInt_t ParityErrorCount() const { return fParityErrors; }
547 /// Returns the number of glitch errors found in the DDL.
548 UInt_t GlitchErrorCount() const { return fGlitchErrors; }
549 /// Returns the number of padding errors found in the DDL.
550 UInt_t PaddingErrorCount() const { return fPaddingErrors; }
552 /// Returns the warnings flag.
553 Bool_t Warnings() const { return fWarnings; }
554 /// Sets the warnings flag.
555 void Warnings(Bool_t value) { fWarnings = value; }
557 // The following methods are inherited from AliMUONTrackerDDLDecoderEventHandler:
559 /// New buffer handler.
560 void OnNewBuffer(const void* buffer, UInt_t bufferSize);
562 /// End of buffer handler marks the end of bus patches.
563 void OnEndOfBuffer(const void* /*buffer*/, UInt_t /*bufferSize*/)
565 fEndOfBusPatches = fCurrentBusPatch+1;
568 /// New block handler is called by the decoder whenever a new block
569 /// structure is found. We just mark the new block and increment the
570 /// internal counter.
571 void OnNewBlock(const AliMUONBlockHeaderStruct* header, const void* /*data*/);
573 /// New DSP handler is called by the decoder whenever a new DSP
574 /// structure is found. We just mark the DSP and increment the
575 /// appropriate counters.
576 void OnNewDSP(const AliMUONDSPHeaderStruct* header, const void* /*data*/);
578 /// New bus patch handler.
579 /// This is called by the high performance decoder when a new bus patch
580 /// is found within the DDL payload.
581 void OnNewBusPatch(const AliMUONBusPatchHeaderStruct* header, const void* data);
583 /// Raw data word handler.
584 void OnData(UInt_t /*data*/, bool parityError)
586 assert( fCurrentParityOkFlag < fParityOk + fMaxChannels );
587 *(++fCurrentParityOkFlag) = Bool_t(not parityError);
591 void OnError(ErrorCode error, const void* location);
595 // Do not allow copying of this class.
597 AliDecoderEventHandler(const AliDecoderEventHandler& /*obj*/);
599 AliDecoderEventHandler& operator = (const AliDecoderEventHandler& /*obj*/);
601 AliMUONVRawStreamTracker* fRawStream; //!< Pointer to the parent raw stream object.
602 const void* fBufferStart; //!< Pointer to the start of the current DDL payload buffer.
603 UInt_t fBlockCount; //!< Number of blocks filled in fBlocks.
604 AliBlockHeader* fBlocks; //!< Array of blocks. [0..fMaxBlocks-1]
605 AliDspHeader* fDSPs; //!< Array of DSPs. [0..fMaxDsps*fMaxBlocks-1]
606 AliBusPatch* fBusPatches; //!< Array of bus patches. [0..fMaxBusPatches*fMaxDsps*fMaxBlocks-1]
607 AliBusPatch* fEndOfBusPatches; //!< Marks the last bus patch.
608 UInt_t fMaxChannels; //!< Maximum number of elements that can be stored in fParityOk.
609 Bool_t* fParityOk; //!< Array of flags for indicating if the parity is good for a raw data word.
610 AliBlockHeader* fCurrentBlock; //!< Current block in fBlocks.
611 AliDspHeader* fCurrentDSP; //!< Current DSP in fDSPs.
612 AliBusPatch* fCurrentBusPatch; //!< Current bus patch in fBusPatches.
613 Bool_t* fCurrentParityOkFlag; //!< Current parity flag to be set in fParityOk.
614 UInt_t fParityErrors; //!< Number of parity errors found in DDL.
615 UInt_t fGlitchErrors; //!< Number of glitch errors found in DDL.
616 UInt_t fPaddingErrors; //!< Number of padding errors found in DDL.
617 Bool_t fWarnings; //!< Flag indicating if we should generate a warning for errors.
620 AliMUONTrackerDDLDecoder<AliDecoderEventHandler> fDecoder; //!< The decoder for the DDL payload.
621 Int_t fDDL; //!< The current DDL number being handled.
622 Int_t fBufferSize; //!< This is the buffer size in bytes of fBuffer.
623 UChar_t* fBuffer; //!< This is the buffer in which we store the DDL payload read from AliRawReader.
624 const AliBusPatch* fkCurrentBusPatch; //!< The current bus patch being handled by Next().
625 const UInt_t* fkCurrentData; //!< The current data word to return by Next().
626 const UInt_t* fkEndOfData; //!< The last data word in the current bus patch.
627 Bool_t fHadError; //!< Flag indicating if there was a decoding error or not.
628 Bool_t fDone; //!< Flag indicating if the iteration is done or not.
629 mutable AliMUONDDLTracker* fDDLObject; //!< Temporary DDL object used by GetDDLTracker() for caching.
631 ClassDef(AliMUONRawStreamTrackerHP, 0) // High performance decoder for reading MUON raw digits from tracking chamber DDL data.
634 ////////////////////////////////////////////////////////////////////////////////
636 inline const AliMUONRawStreamTrackerHP::AliBusPatch* AliMUONRawStreamTrackerHP::Next()
638 /// Returns the next batch of decoded channel data.
639 if (fkCurrentBusPatch == NULL) return NULL;
641 if (fkCurrentBusPatch != fDecoder.GetHandler().EndOfBusPatch())
642 return fkCurrentBusPatch++;
647 inline void AliMUONRawStreamTrackerHP::AliDecoderEventHandler::OnNewBlock(
648 const AliMUONBlockHeaderStruct* header, const void* /*data*/
651 /// New block handler is called by the decoder whenever a new block
652 /// structure is found. We just mark the new block and increment the
653 /// internal counter.
655 assert( header != NULL );
656 assert( fBlockCount < (UInt_t)fRawStream->GetMaxBlock() );
657 // Link the block unless it is the first one.
658 if (fBlockCount > 0) fCurrentBlock->SetNext(fCurrentBlock+1);
659 *(++fCurrentBlock) = AliBlockHeader(fCurrentDSP+1, header);
663 inline void AliMUONRawStreamTrackerHP::AliDecoderEventHandler::OnNewDSP(
664 const AliMUONDSPHeaderStruct* header, const void* /*data*/
667 /// New DSP handler is called by the decoder whenever a new DSP
668 /// structure is found. We just mark the DSP and increment the
669 /// appropriate counters.
671 assert( header != NULL );
672 assert( fCurrentBlock->GetDspCount() < (UInt_t)fRawStream->GetMaxDsp() );
673 // Link the DSP unless it is the first one.
674 if (fCurrentBlock->GetDspCount() > 0) fCurrentDSP->SetNext(fCurrentDSP+1);
675 *(++fCurrentDSP) = AliDspHeader(fCurrentBlock, fCurrentBusPatch+1, header);
676 fCurrentBlock->IncDspCount();
679 inline void AliMUONRawStreamTrackerHP::AliDecoderEventHandler::OnNewBusPatch(
680 const AliMUONBusPatchHeaderStruct* header, const void* data
683 /// New bus patch handler.
684 /// This is called by the high performance decoder when a new bus patch
685 /// is found within the DDL payload.
687 assert( header != NULL );
688 assert( data != NULL );
689 assert( fCurrentDSP->GetBusPatchCount() < (UInt_t)fRawStream->GetMaxBus() );
690 // Link the bus patch unless it is the first one.
691 if (fCurrentDSP->GetBusPatchCount() > 0) fCurrentBusPatch->SetNext(fCurrentBusPatch+1);
692 *(++fCurrentBusPatch) = AliBusPatch(
695 reinterpret_cast<const UInt_t*>(data),
696 fCurrentParityOkFlag+1
698 fCurrentDSP->IncBusPatchCount();
701 #endif // ALIMUONRAWSTREAMTRACKERHP_H