AliRoot Core  v5-06-30 (35d6c57)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONRawStreamTrackerHP.h
Go to the documentation of this file.
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 */
6 
7 /* $Id$*/
8 
15 
16 #ifndef ROOT_TObject
17 # include "TObject.h"
18 #endif
20 
21 #include <cstring>
22 
23 class AliMUONDDLTracker;
24 class AliRawReader;
25 class AliMUONLogger;
26 
27 class AliMUONRawStreamTrackerHP : public TObject
28 {
29 public:
30  class AliDspHeader;
31  class AliBusPatch;
32 
35  {
39  };
40 
43 
45  AliMUONRawStreamTrackerHP(AliRawReader* rawReader);
46 
49 
51  virtual AliRawReader* GetReader() { return fRawReader; }
52 
54  void SetReader(AliRawReader* reader) { fRawReader = reader; }
55 
57  virtual void First();
58 
60  virtual Bool_t NextDDL();
61 
63  virtual Bool_t IsDone() const;
64 
66  virtual Bool_t Next(Int_t& busPatchId,
67  UShort_t& manuId, UChar_t& manuChannel,
68  UShort_t& adc) { return Next(busPatchId,manuId,manuChannel,adc,kTRUE); }
69 
71  virtual Bool_t Next(Int_t& busPatchId,
72  UShort_t& manuId,
73  UChar_t& manuChannel,
74  UShort_t& adc,
75  Bool_t skipParityErrors);
76 
78  virtual AliMUONDDLTracker* GetDDLTracker() const;
79 
81  const AliBusPatch* Next();
82 
84  virtual Int_t GetMaxBlock() const { return (Int_t) fDecoder.MaxBlocks(); }
86  virtual Int_t GetMaxDsp() const { return (Int_t) fDecoder.MaxDSPs(); }
88  virtual Int_t GetMaxBus() const { return (Int_t) fDecoder.MaxBusPatches(); }
89 
91  virtual void SetMaxBlock(Int_t blk);
93  virtual void SetMaxDsp(Int_t dsp);
95  virtual void SetMaxBus(Int_t bus);
96 
98  virtual Int_t GetDDL() const { return fDDL - 1; }
99 
101  virtual Bool_t IsErrorMessage() const { return fHadError; }
102 
104  Int_t GetParityErrors() const
105  {
106  return (Int_t) fDecoder.GetHandler().ParityErrorCount();
107  }
108 
110  Int_t GetGlitchErrors() const
111  {
112  return (Int_t) fDecoder.GetHandler().GlitchErrorCount();
113  }
114 
116  Int_t GetPaddingErrors() const
117  {
118  return (Int_t) fDecoder.GetHandler().PaddingErrorCount();
119  }
120 
122  Int_t GetTokenLostErrors() const
123  {
124  return (Int_t) fDecoder.GetHandler().TokenLostCount();
125  }
126 
128  void DisableWarnings() { fWarnings = kFALSE; }
130  void EnableWarnings() { fWarnings = kTRUE; }
131 
133  Bool_t IsWarningsEnabled() const { return fWarnings; }
134 
136  Bool_t TryRecover() const { return Bool_t(fDecoder.TryRecover()); }
137 
141  void TryRecover(Bool_t value) { fDecoder.TryRecover(bool(value)); }
142 
144  Bool_t AutoDetectTrailer() const { return Bool_t(fDecoder.AutoDetectTrailer()); }
145 
150  void AutoDetectTrailer(Bool_t value) { fDecoder.AutoDetectTrailer(bool(value)); }
151 
155  Bool_t CheckForTrailer() const { return Bool_t(fDecoder.CheckForTrailer()); }
156 
159  void CheckForTrailer(Bool_t value) { fDecoder.CheckForTrailer(bool(value)); }
160 
163  {
164  public:
167  AliDspHeader* dspArray = NULL,
168  const AliMUONBlockHeaderStruct* header = NULL
169  )
170  : fNext(NULL), fDspCount(0), fFirstDsp(dspArray), fHeader(header)
171  {
172  }
173 
177  {
178  }
179 
182  {
183  memcpy(this, &object, sizeof(AliBlockHeader));
184  return *this;
185  }
186 
189 
191  Int_t GetDataKey() const {assert(fHeader != NULL); return fHeader->fDataKey;}
193  Int_t GetTotalLength() const {assert(fHeader != NULL); return fHeader->fTotalLength;}
195  Int_t GetLength() const {assert(fHeader != NULL); return fHeader->fLength;}
197  Int_t GetDspId() const {assert(fHeader != NULL); return fHeader->fDSPId;}
199  Int_t GetL0Trigger() const {assert(fHeader != NULL); return fHeader->fL0Trigger;}
201  Int_t GetMiniEventId() const {assert(fHeader != NULL); return fHeader->fMiniEventId;}
203  Int_t GetEventId1() const {assert(fHeader != NULL); return fHeader->fEventId1;}
205  Int_t GetEventId2() const {assert(fHeader != NULL); return fHeader->fEventId2;}
206 
208  const AliMUONBlockHeaderStruct* GetHeader() const {return fHeader;}
209 
211  const AliBlockHeader* Next() const { return fNext; }
212 
214  const AliDspHeader* GetFirstDspHeader() const { return fFirstDsp; }
215 
217  UInt_t GetDspCount() const { return fDspCount; }
218 
220  const AliDspHeader* GetDspHeader(UInt_t i) const
221  {
222  return i < fDspCount ? GetFirstDspHeader() + i : NULL;
223  }
224 
226  void SetNext(const AliBlockHeader* next) { fNext = next; }
227 
229  void IncDspCount() { fDspCount++; };
230 
232  void Print() const;
233 
234  private:
235 
237  UInt_t fDspCount;
240  };
241 
244  {
245  public:
248  const AliBlockHeader* block = NULL,
249  const AliBusPatch* busPatchArray = NULL,
250  const AliMUONDSPHeaderStruct* header = NULL
251  ) :
252  fBlock(block), fNext(NULL), fBusPatchCount(0),
253  fFirstBusPatch(busPatchArray), fHeader(header)
254  {
255  }
256 
261  {
262  }
263 
266  {
267  memcpy(this, &object, sizeof(AliDspHeader));
268  return *this;
269  }
270 
273 
275  Int_t GetDataKey() const {assert(fHeader != NULL); return fHeader->fDataKey;}
277  Int_t GetTotalLength() const {assert(fHeader != NULL); return fHeader->fTotalLength;}
279  Int_t GetLength() const {assert(fHeader != NULL); return fHeader->fLength;}
281  Int_t GetDspId() const {assert(fHeader != NULL); return fHeader->fDSPId;}
283  Int_t GetBlkL1ATrigger() const {assert(fHeader != NULL); return fHeader->fBlkL1ATrigger;}
285  Int_t GetMiniEventId() const {assert(fHeader != NULL); return fHeader->fMiniEventId;}
287  Int_t GetL1ATrigger() const {assert(fHeader != NULL); return fHeader->fL1ATrigger;}
289  Int_t GetL1RTrigger() const {assert(fHeader != NULL); return fHeader->fL1RTrigger;}
291  UInt_t GetPaddingWord() const {assert(fHeader != NULL); return fHeader->fPaddingWord;}
293  Int_t GetErrorWord() const {assert(fHeader != NULL); return fHeader->fErrorWord;}
294 
296  const AliMUONDSPHeaderStruct* GetHeader() const { return fHeader; }
297 
299  const AliBlockHeader* GetBlockHeader() const { return fBlock; }
300 
302  const AliDspHeader* Next() const { return fNext; }
303 
305  const AliBusPatch* GetFirstBusPatch() const { return fFirstBusPatch; }
306 
308  UInt_t GetBusPatchCount() const { return fBusPatchCount; }
309 
311  const AliBusPatch* GetBusPatch(UInt_t i) const
312  {
313  return i < fBusPatchCount ? GetFirstBusPatch() + i : NULL;
314  }
315 
317  void SetNext(const AliDspHeader* next) { fNext = next; }
318 
321 
323  void Print() const;
324 
325  private:
326 
329  UInt_t fBusPatchCount;
332  };
333 
336  {
337  public:
340  const AliDspHeader* dsp = NULL,
341  const AliMUONBusPatchHeaderStruct* header = NULL,
342  const UInt_t* data = NULL,
343  const Bool_t* parityOk = NULL
344  ) :
345  fDSP(dsp),
346  fNext(NULL),
347  fHeader(header),
348  fData(data),
349  fParityOk(parityOk)
350  {
351  }
352 
355  fDSP(o.fDSP),
356  fNext(o.fNext),
357  fHeader(o.fHeader),
358  fData(o.fData),
360  {
361  }
362 
365  {
366  memcpy(this, &object, sizeof(AliBusPatch));
367  return *this;
368  }
369 
372 
374  Int_t GetDataKey() const {assert(fHeader != NULL); return fHeader->fDataKey;}
376  Int_t GetTotalLength() const {assert(fHeader != NULL); return fHeader->fTotalLength;}
378  Int_t GetLength() const {assert(fHeader != NULL); return fHeader->fLength;}
380  Int_t GetBusPatchId() const {assert(fHeader != NULL); return fHeader->fBusPatchId;}
381 
385  const UInt_t* GetData() const {return fData;}
387  UInt_t GetDataCount() const { return (UInt_t)GetLength(); }
388 
390  Char_t GetParity(UInt_t n) const
391  {
392  assert( fHeader != NULL && n < fHeader->fLength );
393  return (Char_t)(fData[n] >> 31) & 0x1;
394  }
395 
397  UShort_t GetManuId(UInt_t n) const
398  {
399  assert( fHeader != NULL && n < fHeader->fLength );
400  return (UShort_t)(fData[n] >> 18) & 0x7FF;
401  }
402 
404  UChar_t GetChannelId(UInt_t n) const
405  {
406  assert( fHeader != NULL && n < fHeader->fLength );
407  return (Char_t)(fData[n] >> 12) & 0x3F;
408  }
409 
411  UShort_t GetCharge(UInt_t n) const
412  {
413  assert( fHeader != NULL && n < fHeader->fLength );
414  return (UShort_t)(fData[n] & 0xFFF);
415  }
416 
418  UInt_t GetData(UInt_t n) const
419  {
420  assert( fHeader != NULL && n < fHeader->fLength );
421  return fData[n];
422  }
423 
426  Bool_t IsParityOk(UInt_t n) const
427  {
428  assert( fHeader != NULL && n < fHeader->fLength );
429  return fParityOk[n];
430  }
431 
434  Bool_t GetData(UInt_t n, UShort_t& manuId, UChar_t& channelId, UShort_t& adc) const
435  {
436  assert( fHeader != NULL && n < fHeader->fLength );
437  AliMUONTrackerDDLDecoderEventHandler::UnpackADC(fData[n], manuId, channelId, adc);
438  return fParityOk[n];
439  }
440 
442  const AliDspHeader* GetDspHeader() const { return fDSP; }
443 
445  const AliBusPatch* Next() const { return fNext; }
446 
448  void SetNext(const AliBusPatch* next) { fNext = next; }
449 
451  void Print(const Option_t* opt = "") const;
452 
453  private:
454 
458  const UInt_t* fData;
459  const Bool_t* fParityOk;
460  };
461 
463  UInt_t GetBlockCount() const
464  {
465  return fDecoder.GetHandler().BlockCount();
466  }
467 
470  {
471  return fDecoder.GetHandler().BlockHeader(0);
472  }
473 
475  const AliBlockHeader* GetBlockHeader(UInt_t i) const
476  {
477  return fDecoder.GetHandler().BlockHeader(i);
478  }
479 
481  UInt_t GetDspCount(UInt_t block) const
482  {
483  const AliBlockHeader* b = GetBlockHeader(block);
484  return b != NULL ? b->GetDspCount() : 0;
485  }
486 
488  const AliDspHeader* GetDspHeader(UInt_t block, UInt_t i) const
489  {
490  const AliBlockHeader* b = GetBlockHeader(block);
491  return b != NULL ? b->GetDspHeader(i) : NULL;
492  }
493 
495  UInt_t GetBusPatchCount(UInt_t block, UInt_t dsp) const
496  {
497  const AliDspHeader* d = GetDspHeader(block, dsp);
498  return d != NULL ? d->GetBusPatchCount() : 0;
499  }
500 
502  const AliBusPatch* GetBusPatch(UInt_t block, UInt_t dsp, UInt_t i) const
503  {
504  const AliDspHeader* d = GetDspHeader(block, dsp);
505  return d != NULL ? d->GetBusPatch(i) : NULL;
506  }
507 
510  {
511  return (fkCurrentBusPatch != fDecoder.GetHandler().EndOfBusPatch()) ?
512  fkCurrentBusPatch : NULL;
513  }
514 
517  {
518  const AliBusPatch* busPatch = CurrentBusPatch();
519  return (busPatch != NULL) ? busPatch->GetDspHeader() : NULL;
520  }
521 
524  {
525  const AliDspHeader* dsp = CurrentDspHeader();
526  return (dsp != NULL) ? dsp->GetBlockHeader() : NULL;
527  }
528 
531 
534 
537 
540 
543 
546 
549 
551  const AliMUONLogger* GetMUONErrorLogger() const { return fLogger; }
552 
555 
557  void SetMUONErrorLogger(AliMUONLogger* logger) { fLogger = logger; }
558 
561 
564 
567 
570 
573 
576 
578  Bool_t HasGlitchError() const { return NumberOfGlitchErrors() > 0; }
579 
581  Bool_t HasPaddingError() const { return NumberOfPaddingErrors() > 0; }
582 
584  Bool_t HasParityError() const { return NumberOfParityErrors() > 0; }
585 
587  Bool_t HasTokenLostError() const { return NumberOfTokenLostErrors() > 0; }
588 
589 private:
590 
591  // Do not allow copying of this class.
596 
598  Int_t GetMaxDDL() const { return fgkMaxDDL; }
599 
601  virtual void Swap(UInt_t* buffer, Int_t size) const;
602 
607  {
608  public:
609 
613  virtual ~AliDecoderEventHandler();
614 
616  void SetMaxStructs(UInt_t maxBlocks, UInt_t maxDsps, UInt_t maxBusPatches);
617 
619  void SetRawStream(AliMUONRawStreamTrackerHP* rawStream) { fRawStream = rawStream; }
620 
622  UInt_t BlockCount() const { return fBlockCount; };
623 
625  const AliBlockHeader* BlockHeader(UInt_t i) const
626  {
627  return i < fBlockCount ? &fBlocks[i] : NULL;
628  }
629 
631  const AliBusPatch* FirstBusPatch() const { return fBusPatches; }
632 
634  const AliBusPatch* EndOfBusPatch() const { return fEndOfBusPatches; }
635 
637  UInt_t ParityErrorCount() const { return fParityErrors; }
639  UInt_t GlitchErrorCount() const { return fGlitchErrors; }
641  UInt_t PaddingErrorCount() const { return fPaddingErrors; }
643  UInt_t TokenLostCount() const { return fTokenLostErrors; }
644 
645  // The following methods are inherited from AliMUONTrackerDDLDecoderEventHandler:
646 
648  void OnNewBuffer(const void* buffer, UInt_t bufferSize);
649 
651  void OnEndOfBuffer(const void* /*buffer*/, UInt_t /*bufferSize*/)
652  {
654  }
655 
659  void OnNewBlock(const AliMUONBlockHeaderStruct* header, const void* /*data*/);
660 
664  void OnNewDSP(const AliMUONDSPHeaderStruct* header, const void* /*data*/);
665 
669  void OnNewBusPatch(const AliMUONBusPatchHeaderStruct* header, const void* data);
670 
672  void OnData(UInt_t /*data*/, bool parityError)
673  {
675  *(++fCurrentParityOkFlag) = Bool_t(not parityError);
676  }
677 
679  void OnError(ErrorCode error, const void* location);
680 
681  private:
682 
683  // Do not allow copying of this class.
688 
690  const void* fBufferStart;
691  UInt_t fBlockCount;
696  UInt_t fMaxChannels;
697  Bool_t* fParityOk;
702  UInt_t fParityErrors;
703  UInt_t fGlitchErrors;
704  UInt_t fPaddingErrors;
706  UInt_t fMaxBlocks;
707  UInt_t fMaxDsps;
708  UInt_t fMaxBusPatches;
709  };
710 
711  AliRawReader* fRawReader;
716  Bool_t fWarnings;
718  Int_t fDDL;
719  Int_t fBufferSize;
720  UChar_t* fBuffer;
722  const UInt_t* fkCurrentData;
723  const UInt_t* fkEndOfData;
724  Bool_t fHadError;
725  Bool_t fDone;
731 
732  static const Int_t fgkMaxDDL;
733 
734  ClassDef(AliMUONRawStreamTrackerHP, 0) // High performance decoder for reading MUON raw digits from tracking chamber DDL data.
735 };
736 
738 
740 {
742  if (fkCurrentBusPatch == NULL) return NULL;
743  do {
744  if (fkCurrentBusPatch != fDecoder.GetHandler().EndOfBusPatch())
745  return fkCurrentBusPatch++;
746  } while (NextDDL());
747  return NULL;
748 }
749 
751  const AliMUONBlockHeaderStruct* header, const void* /*data*/
752  )
753 {
757 
758  assert( header != NULL );
759  assert( fBlockCount < fMaxBlocks );
760  // Link the block unless it is the first one.
762  *(++fCurrentBlock) = AliBlockHeader(fCurrentDSP+1, header);
763  fBlockCount++;
764 }
765 
767  const AliMUONDSPHeaderStruct* header, const void* /*data*/
768  )
769 {
773 
774  assert( header != NULL );
775  assert( fCurrentBlock->GetDspCount() < fMaxDsps );
776  // Link the DSP unless it is the first one.
777  if (fCurrentBlock->GetDspCount() > 0) fCurrentDSP->SetNext(fCurrentDSP+1);
778  *(++fCurrentDSP) = AliDspHeader(fCurrentBlock, fCurrentBusPatch+1, header);
779  fCurrentBlock->IncDspCount();
780 }
781 
783  const AliMUONBusPatchHeaderStruct* header, const void* data
784  )
785 {
789 
790  assert( header != NULL );
791  assert( data != NULL );
792  assert( fCurrentDSP->GetBusPatchCount() < fMaxBusPatches );
793  // Link the bus patch unless it is the first one.
794  if (fCurrentDSP->GetBusPatchCount() > 0) fCurrentBusPatch->SetNext(fCurrentBusPatch+1);
795  *(++fCurrentBusPatch) = AliBusPatch(
796  fCurrentDSP,
797  header,
798  reinterpret_cast<const UInt_t*>(data),
799  fCurrentParityOkFlag+1
800  );
801  fCurrentDSP->IncBusPatchCount();
802 }
803 
804 #endif // ALIMUONRAWSTREAMTRACKERHP_H
805 
A high performance decoder class for MUON tracking DDL data.
virtual Int_t GetMaxDsp() const
Return maximum number of Dsp per block allowed.
const AliDspHeader * CurrentDspHeader() const
Returns the current DSP being decoded or NULL if none found.
virtual void EnabbleErrorLogger()
Enable error logging to the raw reader.
A high performance stream decoder for muon tracking DDL streams.
AliDspHeader & operator=(const AliDspHeader &object)
Implement shallow copying in the assignment operator.
static const Int_t fgkMaxDDL
! max number of tracker DDLs
The DSP header structure of the Tracker DDL payload.
virtual Int_t GetMaxBlock() const
Return maximum number of blocks per DDL allowed.
const AliMUONBlockHeaderStruct * GetHeader() const
Return the header's raw data.
const AliMUONBusPatchHeaderStruct * GetHeader() const
Return raw data of header.
const AliMUONLogger * GetMUONErrorLogger() const
Returns the logger object. (constant version)
void DisableRawReaderErrorLogger()
Disable logging to the raw reader.
AliBlockHeader(AliDspHeader *dspArray=NULL, const AliMUONBlockHeaderStruct *header=NULL)
Default constructor.
const AliBlockHeader * BlockHeader(UInt_t i) const
Return the i'th block structure.
const AliBusPatch * EndOfBusPatch() const
Returns the marker to the end of bus patches. i.e. one position past the last bus patch...
AliDspHeader(const AliDspHeader &o)
Implement shallow copying in the copy constructor.
UInt_t fDataKey
Data key word for bus patch header.
UInt_t NumberOfParityErrors() const
Number of parity errors since First() was called.
void OnEndOfBuffer(const void *, UInt_t)
End of buffer handler marks the end of bus patches.
Bool_t IsWarningsEnabled() const
Returns the flag indicating if we should generate a warning for errors.
const AliBusPatch * Next()
Returns the next batch of decoded channel data.
void EnableWarnings()
Set warnings flag to enable warnings on data errors.
UInt_t BlockCount() const
Return the number of blocks found in the payload.
Bool_t HasParityError() const
Whether we got parity errors or not.
MUON DDL tracker.
UInt_t GetBusPatchCount(UInt_t block, UInt_t dsp) const
Returns the number of bus patches for the given block and dsp number.
void EnableRawReaderErrorLogger()
Enable error info logging to raw reader.
UInt_t NumberOfTokenLostErrors() const
Number of token lost errors since First() was called.
virtual AliMUONDDLTracker * GetDDLTracker() const
Construct and return a pointer to the DDL payload object.
UInt_t fParityErrors
! Number of parity errors found in DDL.
void Print(const Option_t *opt="") const
Print the contents of the bus patch to screen.
UChar_t * fBuffer
! This is the buffer in which we store the DDL payload read from AliRawReader.
Bool_t fEnableRawReaderErrorLogger
! whether or not we log errors to the raw reader.
Logs a medium level of detail in the error messages.
AliDspHeader * fCurrentDSP
! Current DSP in fDSPs.
UInt_t fPaddingErrors
! Number of padding errors found in DDL.
const void * fBufferStart
! Pointer to the start of the current DDL payload buffer.
EDetailLevel GetLoggingDetailLevel() const
Returns the level of detail used in the error messages.
const AliMUONDSPHeaderStruct * GetHeader() const
Return raw data of header.
UInt_t fTokenLostErrors
! Number of token lost errors found in DDL.
const AliBlockHeader * GetBlockHeader() const
Return the parent block header.
const AliMUONDSPHeaderStruct * fHeader
Pointer to header in DDL payload.
const UInt_t * fkCurrentData
! The current data word to return by Next().
The bus patch header structure of the Tracker DDL payload.
const AliDspHeader * GetDspHeader(UInt_t block, UInt_t i) const
Returns the i'th DSP header for the given block number or NULL if not found.
AliMUONDDLTracker * fDDLObject
! Temporary DDL object used by GetDDLTracker() for caching.
UInt_t ParityErrorCount() const
Returns the number of parity errors found in the DDL.
virtual void SetMaxBus(Int_t bus)
Set maximum number of Buspatch per Dsp allowed.
AliDspHeader(const AliBlockHeader *block=NULL, const AliBusPatch *busPatchArray=NULL, const AliMUONDSPHeaderStruct *header=NULL)
Default constructor.
UInt_t fBlkL1ATrigger
L1 accept in Block Structure (CRT)
Int_t GetTotalLength() const
Return total length of buspatch structure.
UInt_t GetBusPatchCount() const
Returns the number of bus patches within this DSP.
Int_t GetTokenLostErrors() const
Get number of token lost errors in the DDL last decoded.
UInt_t fDspCount
The number of AliDspHeader objects found in the array pointed to by fFirstDsp.
Bool_t * fCurrentParityOkFlag
! Current parity flag to be set in fParityOk.
UInt_t GetDataCount() const
Returns the number of raw data words within this bus patch.
UInt_t fEventId2
Event Id in orbit number.
const AliDspHeader * fNext
Pointer to next DSP.
const AliBusPatch * fFirstBusPatch
The first bus patch of this DSP.
AliBusPatch(const AliBusPatch &o)
Implement shallow copying in the copy constructor.
UInt_t fTotalLength
total length of block structure
void OnNewBusPatch(const AliMUONBusPatchHeaderStruct *header, const void *data)
AliDspHeader * fDSPs
! Array of DSPs. [0..fMaxDsps*fMaxBlocks-1]
Int_t GetL0Trigger() const
Return L0 trigger word.
void SetNext(const AliBusPatch *next)
Sets the next bus patch.
Light weight interface class to the block header data.
AliBusPatch * fCurrentBusPatch
! Current bus patch in fBusPatches.
const AliDspHeader * GetFirstDspHeader() const
Returns the first AliDspHeader class in this block.
EDetailLevel
Values indicating the logging detail level to use for error messages.
Int_t GetLength() const
Return length of raw data.
UInt_t fMaxBusPatches
! max number of buspatches per dsp
Int_t GetErrorWord() const
Return Error word.
UInt_t fTotalNumberOfGlitchErrors
! number of glitch errors since First() was called
UInt_t GetData(UInt_t n) const
Returns the n'th raw data word.
void SetLoggingDetailLevel(EDetailLevel level)
Sets the level of detail used in the error messages.
virtual ~AliMUONRawStreamTrackerHP()
Default destructor.
Bool_t IsMUONErrorLoggerEnabled() const
Check if the AliMUONLogger is enabled for error logging.
void Print() const
Print the contents of the header to screen.
const AliBusPatch * GetBusPatch(UInt_t block, UInt_t dsp, UInt_t i) const
Returns the i'th bus patch for the given block and dsp.
void DisableWarnings()
Set warnings flag to disable warnings on data errors.
AliMUONLogger * GetMUONErrorLogger()
Returns the logger object.
UInt_t fMaxChannels
! Maximum number of elements that can be stored in fParityOk.
AliMUONLogger * fLogger
! Logger object to store error messages.
void SetMaxStructs(UInt_t maxBlocks, UInt_t maxDsps, UInt_t maxBusPatches)
Sets the internal arrays based on the maximum number of structures allowed.
const Bool_t * fParityOk
Array of flags indicating if the parity of the given data word in fData is good or not...
AliBusPatch & operator=(const AliBusPatch &object)
Implement shallow copying in the assignment operator.
const AliBlockHeader * fBlock
Pointer to parent block structure.
UInt_t fDataKey
Data key word for CRT header.
UInt_t fL1RTrigger
Number of L1 reject in DSP Structure (FRT)
void OnNewDSP(const AliMUONDSPHeaderStruct *header, const void *)
AliBusPatch * fBusPatches
! Array of bus patches. [0..fMaxBusPatches*fMaxDsps*fMaxBlocks-1]
void SetNext(const AliBlockHeader *next)
Sets the next block header.
AliMUONRawStreamTrackerHP()
Default constructor.
const AliDspHeader * fFirstDsp
The first DSP associated with this block.
AliBlockHeader * fCurrentBlock
! Current block in fBlocks.
Light weight interface class to the DSP header data.
A logger that keeps track of the number of times a message appeared.
Definition: AliMUONLogger.h:29
const AliBlockHeader * CurrentBlockHeader() const
Returns the current block header being decoded or NULL if none found.
Bool_t TryRecover() const
Returns the "try to recover from errors" flag.
Bool_t fEnableMUONErrorLogger
! whether or not we log errors to AliMUONLogger
static void UnpackADC(UInt_t data, UShort_t &manuId, UChar_t &channelId, UShort_t &adc)
const UInt_t * fData
Pointer to the bus patch data.
Implementation of a high performance DDL decoder for the muon tracking stations.
Int_t GetBlkL1ATrigger() const
Return L1 accept in Block Structure (CRT)
Bool_t HasPaddingError() const
Whether we got padding errors or not.
Int_t GetBusPatchId() const
Return bus patch id.
Int_t GetDataKey() const
Return data key word for CRT header.
void SetMUONErrorLogger(AliMUONLogger *logger)
Sets the logger object to use. Ownership of the logger object remains with the caller.
Bool_t * fParityOk
! Array of flags for indicating if the parity is good for a raw data word.
Int_t fBufferSize
! This is the buffer size in bytes of fBuffer.
void OnData(UInt_t, bool parityError)
Raw data word handler.
AliMUONRawStreamTrackerHP * fRawStream
! Pointer to the parent raw stream object.
virtual Bool_t IsDone() const
Whether the iteration is finished or not.
const UInt_t * GetData() const
Return raw digit data.
void OnNewBlock(const AliMUONBlockHeaderStruct *header, const void *)
void SetNext(const AliDspHeader *next)
Sets the next DSP header.
virtual Bool_t IsErrorMessage() const
check error/Warning presence
virtual Int_t GetDDL() const
Return number of the current DDL being processed in the range [0..19] or -1 if no DDL set...
UInt_t fBlockCount
! Number of blocks filled in fBlocks.
const AliDspHeader * fDSP
The DSP this bus patch belongs to.
const AliBusPatch * GetBusPatch(UInt_t i) const
Return the i'th bus patch in this DSP.
Int_t GetTotalLength() const
Return total length of block structure (w/o padding word)
void OnNewBuffer(const void *buffer, UInt_t bufferSize)
New buffer handler.
UInt_t fTotalNumberOfTokenLostErrors
! number of token lost errors since First() was called
AliBlockHeader & operator=(const AliBlockHeader &object)
Implement shallow copying in the assignment operator.
Int_t GetDataKey() const
Return Data key word for FRT header.
Int_t GetEventId2() const
Return Event Id in orbit number.
UInt_t fTotalLength
total length of block structure (w/o padding word)
const AliDspHeader * Next() const
Return the next DSP header.
Int_t GetMiniEventId() const
Return Bunch Crossing for mini-event id (see TDR chapter 8)
Int_t GetPaddingErrors() const
Get number of padding word errors in the DDL last decoded.
const AliBusPatch * GetFirstBusPatch() const
Returns the first AliBusPatch class in this DSP.
Int_t GetLength() const
Return length of raw data.
Int_t GetTotalLength() const
Return total length of block structure.
void IncBusPatchCount()
Increments the bus patch count.
Int_t GetParityErrors() const
Get number of parity errors in the DDL last decoded.
Bool_t fDone
! Flag indicating if the iteration is done or not.
Logs minimal information in the error messages.
UInt_t fTotalNumberOfPaddingErrors
! number of padding errors since First() was called
UInt_t fBusPatchCount
The number of AliDspHeader objects found in the array pointed to by fFirstBusPatch.
Int_t GetL1ATrigger() const
Return Number of L1 accept in DSP Structure (FRT)
UInt_t fGlitchErrors
! Number of glitch errors found in DDL.
AliRawReader * fRawReader
! Pointer to the raw reader
void SetRawStream(AliMUONRawStreamTrackerHP *rawStream)
Sets the raw stream object which should be the parent of this class.
virtual void SetMaxDsp(Int_t dsp)
Set maximum number of Dsp per block allowed.
virtual void Swap(UInt_t *buffer, Int_t size) const
swap method for Power PC
UInt_t fTotalLength
total length of bus patch structure
UShort_t GetManuId(UInt_t n) const
Returns the MANU ID of the n'th raw data word.
void DisableMUONErrorLogger()
Disable logging to AliMUONLogger.
Int_t GetEventId1() const
Return Event Id in bunch crossing.
UInt_t TokenLostCount() const
Returns the number of token lost errors found in the DDL.
Int_t GetMaxDDL() const
Return max number of tracker DDLs.
Bool_t HasTokenLostError() const
Whether we got token lost errors or not.
EDetailLevel fDetailLevel
! The logging detail level used in the error messages generated in OnError.
void SetReader(AliRawReader *reader)
Set the raw reader.
UShort_t GetCharge(UInt_t n) const
Returns the charge/signal of the n'th raw data word.
The block header structure of the Tracker DDL payload.
UInt_t GetDspCount() const
Returns the number of DSPs within this block.
const AliBusPatch * fNext
Next bus patch object in the DSP.
Bool_t HasGlitchError() const
Whether we got glitch errors or not.
UInt_t GetDspCount(UInt_t block) const
Returns the number of DSPs for the given block number.
virtual void First()
Initialize iterator.
UInt_t GetPaddingWord() const
Return padding dummy word for 64 bits transfer.
virtual Int_t GetMaxBus() const
Return maximum number of Buspatch per Dsp allowed.
AliMUONTrackerDDLDecoder< AliDecoderEventHandler > fDecoder
! The decoder for the DDL payload.
Light weight interface class to the bus patch data.
const UInt_t * fkEndOfData
! The last data word in the current bus patch.
const AliMUONBlockHeaderStruct * fHeader
Pointer to header in DDL payload.
void OnError(ErrorCode error, const void *location)
Error handler.
UInt_t fEventId1
Event Id in bunch crossing.
UInt_t fL1ATrigger
Number of L1 accept in DSP Structure (FRT)
Int_t GetGlitchErrors() const
Get number of glitch errors in the DDL last decoded.
const AliBlockHeader * Next() const
Return the next block header.
Int_t GetMiniEventId() const
Return Mini Event Id in bunch crossing.
Int_t fDDL
! The current DDL number being handled.
Bool_t fWarnings
! Flag indicating if we should generate a warning for errors.
Bool_t fHadError
! Flag indicating if there was a decoding error or not.
virtual AliRawReader * GetReader()
Get object for reading the raw data.
const AliDspHeader * GetDspHeader(UInt_t i) const
Return the i'th DSP in this block.
Bool_t IsRawReaderErrorLoggerEnabled() const
Check if the AliMUONLogger is enabled for error logging.
void Print() const
Print the contents of the header to screen.
Int_t GetLength() const
Return length of raw data.
Int_t GetDataKey() const
Return Data key word for bus patch header.
UInt_t GetBlockCount() const
Return the number of blocks in the DDL payload.
Char_t GetParity(UInt_t n) const
Returns the parity bit of the n'th raw data word.
Int_t GetL1RTrigger() const
Return Number of L1 reject in DSP Structure (FRT)
const AliBlockHeader * GetFirstBlockHeader() const
Return the first block header.
Callback event handler class for the AliMUONTrackerDDLDecoder.
AliDecoderEventHandler & operator=(const AliDecoderEventHandler &)
Not implemented.
void EnableMUONErrorLogger()
Enable error info logging to AliMUONLogger.
const AliBusPatch * FirstBusPatch() const
Return the first bus patch decoded.
UChar_t GetChannelId(UInt_t n) const
Returns the channel ID of the n'th raw data word.
UInt_t GlitchErrorCount() const
Returns the number of glitch errors found in the DDL.
AliMUONRawStreamTrackerHP & operator=(const AliMUONRawStreamTrackerHP &stream)
Not implemented.
virtual void SetMaxBlock(Int_t blk)
Set maximum number of blocks per DDL allowed.
AliBlockHeader * fBlocks
! Array of blocks. [0..fMaxBlocks-1]
const AliBusPatch * Next() const
Return the next bus patch header.
Bool_t AutoDetectTrailer() const
Returns the auto-detect trailer words flag.
const AliDspHeader * GetDspHeader() const
Return the parent block header.
UInt_t fMiniEventId
Bunch Crossing for mini-event id (see TDR chapter 8)
AliBusPatch * fEndOfBusPatches
! Marks the last bus patch.
virtual Bool_t Next(Int_t &busPatchId, UShort_t &manuId, UChar_t &manuChannel, UShort_t &adc)
Advance one step in the iteration. Returns false if finished.
Bool_t GetData(UInt_t n, UShort_t &manuId, UChar_t &channelId, UShort_t &adc) const
const AliMUONBusPatchHeaderStruct * fHeader
Pointer to bus patch in DDL payload.
AliBlockHeader(const AliBlockHeader &o)
Implement shallow copying in the copy constructor.
const AliBlockHeader * fNext
Pointer to next block.
UInt_t PaddingErrorCount() const
Returns the number of padding errors found in the DDL.
UInt_t NumberOfPaddingErrors() const
Number of padding errors since First() was called.
UInt_t NumberOfGlitchErrors() const
Number of glitch errors since First() was called.
const AliBusPatch * fkCurrentBusPatch
! The current bus patch being handled by Next().
AliBusPatch(const AliDspHeader *dsp=NULL, const AliMUONBusPatchHeaderStruct *header=NULL, const UInt_t *data=NULL, const Bool_t *parityOk=NULL)
Default constructor.
UInt_t fMiniEventId
Mini Event Id in bunch crossing.
virtual Bool_t NextDDL()
DDL iterator.
const AliBlockHeader * GetBlockHeader(UInt_t i) const
Return the i'th block header or NULL if not found.
const AliBusPatch * CurrentBusPatch() const
Returns the current bus patch being decoded or NULL if none found.
UInt_t fTotalNumberOfParityErrors
! number of parity errors since First() was called
UInt_t fPaddingWord
padding dummy word for 64 bits transfer
UInt_t fDataKey
Data key word for FRT header.
ErrorCode
All the possible error codes for the parsing.