AliRoot Core  v5-06-15 (45dab64)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONRawStreamTriggerHP.h
Go to the documentation of this file.
1 #ifndef ALIMUONRAWSTREAMTRIGGERHP_H
2 #define ALIMUONRAWSTREAMTRIGGERHP_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 
13 // This provides a streamer interface to the high performance decoder which
14 // is required for AliRoot.
15 //
16 // Author Artur Szostak <artursz@iafrica.com>
17 
20 #include "TArrayS.h"
21 
22 class AliMUONDDLTrigger;
23 
24 
26 {
27 public:
28  class AliLocalStruct;
29 
31  AliMUONRawStreamTriggerHP(AliRawReader* rawReader);
33 
35  virtual void First();
36 
38  virtual Bool_t NextDDL();
39 
41  virtual Bool_t IsDone() const;
42 
45  virtual void AddErrorMessage() { };
46 
48  virtual Bool_t Next(UChar_t& id, UChar_t& dec, Bool_t& trigY,
49  UChar_t& yPos, UChar_t& sXDev, UChar_t& xDev,
50  UChar_t& xPos, Bool_t& triggerY, Bool_t& triggerX,
51  TArrayS& xPattern, TArrayS& yPattern);
52 
54  virtual AliMUONDDLTrigger* GetDDLTrigger() const;
55 
57  const AliLocalStruct* Next();
58 
60  virtual Int_t GetMaxDDL() const { return fgkMaxDDL; }
61 
63  virtual Int_t GetMaxReg() const { return (Int_t) fDecoder.MaxRegionals(); }
64 
66  virtual void SetMaxReg(Int_t reg);
67 
69  virtual Int_t GetMaxLoc() const { return (Int_t) fDecoder.MaxLocals(); }
70 
72  virtual void SetMaxLoc(Int_t loc);
73 
75  virtual Int_t GetDDL() const { return fDDL - 1; }
76 
78  virtual Bool_t IsErrorMessage() const { return fHadError; }
79 
81  virtual void DisableWarnings() { fDecoder.GetHandler().Warnings(kFALSE); }
83  virtual void EnableWarnings() { fDecoder.GetHandler().Warnings(kTRUE); }
84 
86  UInt_t GetDarcEoWErrors() const {return fDecoder.GetHandler().GetDarcEoWErrors();}
87 
89  UInt_t GetGlobalEoWErrors() const {return fDecoder.GetHandler().GetGlobalEoWErrors();}
90 
92  UInt_t GetRegEoWErrors() const {return fDecoder.GetHandler().GetRegEoWErrors();}
93 
95  UInt_t GetLocalEoWErrors() const {return fDecoder.GetHandler().GetLocalEoWErrors();}
96 
99 
102 
105 
108 
110  Bool_t HasDarcEoWError() const { return NumberOfDarcEoWErrors() > 0; }
111 
113  Bool_t HasGlobalEoWError() const { return NumberOfGlobalEoWErrors() > 0; }
114 
116  Bool_t HasRegEoWError() const { return NumberOfRegEoWErrors() > 0; }
117 
119  Bool_t HasLocalEoWError() const { return NumberOfLocalEoWErrors() > 0; }
120 
122  Bool_t TryRecover() const { return Bool_t(fDecoder.TryRecover()); }
123 
127  void TryRecover(Bool_t value) { fDecoder.TryRecover(bool(value)); }
128 
130  class AliHeader
131  {
132  public:
135  UInt_t darcHeader = 0,
136  const AliMUONDarcScalarsStruct* darcScalars = NULL,
137  const AliMUONGlobalHeaderStruct* globalHeader = NULL,
138  const AliMUONGlobalScalarsStruct* globalScalars = NULL
139  ) :
140  fDarcHeader(darcHeader), fDarcScalars(darcScalars),
141  fGlobalHeader(globalHeader), fGlobalScalars(globalScalars)
142  {
143  }
144 
146  AliHeader(const AliHeader& o) :
149  {
150  }
151 
154  {
155  memcpy(this, &object, sizeof(AliHeader));
156  return *this;
157  }
158 
161 
163  UInt_t GetWord() const {return GetDarcHeader();}
165  UInt_t GetGlobalInput(Int_t n) const {return fGlobalHeader->fInput[n];}
170 
174  Bool_t IsPhysicsEvent() const {return GetEventType() == 0x1;}
191 
192  // DARC get methods
194  UInt_t GetDarcL0R() const {return (fDarcScalars != NULL) ? fDarcScalars->fL0R : 0;}
196  UInt_t GetDarcL1P() const {return (fDarcScalars != NULL) ? fDarcScalars->fL1P : 0;}
198  UInt_t GetDarcL1S() const {return (fDarcScalars != NULL) ? fDarcScalars->fL1S : 0;}
200  UInt_t GetDarcL2A() const {return (fDarcScalars != NULL) ? fDarcScalars->fL2A : 0;}
202  UInt_t GetDarcL2R() const {return (fDarcScalars != NULL) ? fDarcScalars->fL2R : 0;}
204  UInt_t GetDarcClock() const {return (fDarcScalars != NULL) ? fDarcScalars->fClk : 0;}
206  UInt_t GetDarcHold() const {return (fDarcScalars != NULL) ? fDarcScalars->fHold : 0;}
207 
208  // global get methods
210  UInt_t GetGlobalL0() const {return (fGlobalScalars != NULL) ? fGlobalScalars->fL0 : 0;}
212  UInt_t GetGlobalClock() const {return (fGlobalScalars != NULL) ? fGlobalScalars->fClk : 0;}
214  const UInt_t* GetGlobalScaler() const {return (fGlobalScalars != NULL) ? &fGlobalScalars->fScaler[0] : NULL;}
216  UInt_t GetGlobalHold() const {return (fGlobalScalars != NULL) ? fGlobalScalars->fHold : 0;}
218  UInt_t GetGlobalSpare() const {return (fGlobalScalars != NULL) ? fGlobalScalars->fSpare : 0;}
219 
224 
226  UInt_t GetDarcHeader() const {return fDarcHeader;}
227 
230 
233 
236 
238  void Print() const;
239 
240  private:
241 
242  UInt_t fDarcHeader;
246  };
247 
250  {
251  public:
254  const AliLocalStruct* localsArray = NULL,
255  const AliMUONRegionalHeaderStruct* header = NULL,
256  const AliMUONRegionalScalarsStruct* scalars = NULL
257  ) :
258  fNext(NULL), fLocalsCount(0), fFirstLocal(localsArray),
259  fHeader(header), fScalars(scalars)
260  {
261  }
262 
267  fScalars(o.fScalars)
268  {
269  }
270 
273  {
274  memcpy(this, &object, sizeof(AliRegionalHeader));
275  return *this;
276  }
277 
280 
282  UInt_t GetDarcWord() const {return fHeader->fDarcWord;}
284  UInt_t GetWord() const {return fHeader->fWord;}
286  UInt_t GetInput(Int_t n) const {assert(n < 2); return fHeader->fInput[n];}
291 
292  //word: phys type:1, reset: 6, serialNb:5, Id:4, version: 8, regional output:8
293  //true for phys, false for soft
306 
307  //Darc Status: error:10, #fpag:3, MBZ:3, phys type:1, present:1, not_full:1
308  // not_empty:1, L2Rej:1, L2Acc:1, L1:1, L0:1, #evt:4, busy:4
333 
334  // scalar methods
336  UInt_t GetClock() const {return (fScalars != NULL) ? fScalars->fClk : 0;}
338  const UInt_t* GetScaler() const {return (fScalars != NULL) ? &fScalars->fScaler[0] : NULL;}
340  UInt_t GetHold() const {return (fScalars != NULL) ? fScalars->fHold : 0;}
341 
343  const AliMUONRegionalHeaderStruct* GetHeader() const { return fHeader; }
344 
347 
349  const AliRegionalHeader* Next() const { return fNext; }
350 
352  const AliLocalStruct* GetFirstLocalStruct() const { return fFirstLocal; }
353 
355  UInt_t GetLocalStructCount() const { return fLocalsCount; }
356 
358  const AliLocalStruct* GetLocalStruct(UInt_t i) const
359  {
360  return i < fLocalsCount ? GetFirstLocalStruct() + i : NULL;
361  }
362 
364  void SetNext(const AliRegionalHeader* next) { fNext = next; }
365 
368 
370  void Print() const;
371 
372  private:
373 
375  UInt_t fLocalsCount;
379  };
380 
383  {
384  public:
387  const AliRegionalHeader* regionalHeader = NULL,
388  const AliMUONLocalInfoStruct* localStruct = NULL,
389  const AliMUONLocalScalarsStruct* scalars = NULL
390  ) :
391  fRegional(regionalHeader), fNext(NULL),
392  fLocalStruct(localStruct), fScalars(scalars),
393  fCalculatedId(0)
394  {
395  }
396 
402  {
403  }
404 
407  {
408  memcpy(this, &object, sizeof(AliLocalStruct));
409  return *this;
410  }
411 
414 
416  UInt_t GetData(Int_t n) const
417  {
418  assert(n < 5);
419  return (reinterpret_cast<const UInt_t*>(fLocalStruct))[n];
420  }
421 
430 
439 
441  void GetXPattern(TArrayS& array) const
442  {
443  Short_t vec[4] = {static_cast<Short_t>(GetX1()), static_cast<Short_t>(GetX2()), static_cast<Short_t>(GetX3()), static_cast<Short_t>(GetX4())};
444  array.Set(4, vec);
445  }
446 
448  void GetYPattern(TArrayS& array) const
449  {
450  Short_t vec[4] = {static_cast<Short_t>(GetY1()), static_cast<Short_t>(GetY2()), static_cast<Short_t>(GetY3()), static_cast<Short_t>(GetY4())};
451  array.Set(4, vec);
452  }
453 
476 
477  // Scaler methods
479  UInt_t GetL0() const {return (fScalars != NULL) ? fScalars->fL0 : 0;}
481  UInt_t GetHold() const {return (fScalars != NULL) ? fScalars->fHold : 0;}
483  UInt_t GetClock() const {return (fScalars != NULL) ? fScalars->fClk : 0;}
484 
486  UShort_t GetSwitch() const
487  {
488  return (fScalars != NULL) ?
490  }
491 
493  UChar_t GetComptXY() const
494  {
495  return (fScalars != NULL) ?
497  }
498 
500  UShort_t GetXY1(Int_t n) const
501  {
502  return (fScalars != NULL) ?
504  }
505 
507  UShort_t GetXY2(Int_t n) const
508  {
509  return (fScalars != NULL) ?
511  }
512 
514  UShort_t GetXY3(Int_t n) const
515  {
516  return (fScalars != NULL) ?
518  }
519 
521  UShort_t GetXY4(Int_t n) const
522  {
523  return (fScalars != NULL) ?
525  }
526 
528  const AliMUONLocalInfoStruct* GetData() const {return fLocalStruct;}
529 
533 
535  const AliRegionalHeader* GetRegionalHeader() const { return fRegional; }
536 
538  const AliLocalStruct* Next() const { return fNext; }
539 
541  void SetNext(const AliLocalStruct* next) { fNext = next; }
542 
544  void SetCalculatedId(UChar_t id) { fCalculatedId = id; }
545 
547  void Print() const;
548 
550  static bool GetOverrideIdFlag() { return fgOverrideId; }
551 
553  static void SetOverrideIdFlag(bool value) { fgOverrideId = value; }
554 
555  private:
556 
561  UChar_t fCalculatedId;
562  static bool fgOverrideId;
563  };
564 
566  const AliHeader* GetHeaders() const { return fDecoder.GetHandler().GetHeaders(); }
567 
569  UInt_t GetRegionalHeaderCount() const
570  {
571  return fDecoder.GetHandler().RegionalHeaderCount();
572  }
573 
576  {
577  return fDecoder.GetHandler().RegionalHeader(0);
578  }
579 
581  const AliRegionalHeader* GetRegionalHeader(UInt_t i) const
582  {
583  return fDecoder.GetHandler().RegionalHeader(i);
584  }
585 
588  UInt_t GetLocalStructCount(UInt_t reg) const
589  {
590  const AliRegionalHeader* r = GetRegionalHeader(reg);
591  return r != NULL ? r->GetLocalStructCount() : 0;
592  }
593 
596  const AliLocalStruct* GetLocalStruct(UInt_t reg, UInt_t i) const
597  {
598  const AliRegionalHeader* r = GetRegionalHeader(reg);
599  return r != NULL ? r->GetLocalStruct(i) : NULL;
600  }
601 
604  {
605  return (fkCurrentLocalStruct != fDecoder.GetHandler().EndOfLocalStructs()) ?
606  fkCurrentLocalStruct : NULL;
607  }
608 
612  {
613  const AliLocalStruct* local = CurrentLocalStruct();
614  return (local != NULL) ? local->GetRegionalHeader() : NULL;
615  }
616 
617 private:
622 
623 
630  {
631  public:
632 
636  virtual ~AliDecoderEventHandler();
637 
639  void SetMaxStructs(UInt_t maxRegionals, UInt_t maxLocals);
640 
642  void SetRawStream(AliMUONVRawStreamTrigger* rawStream) { fRawStream = rawStream; }
643 
645  const AliHeader* GetHeaders() const { return &fHeaders; }
646 
648  UInt_t RegionalHeaderCount() const { return fRegionalsCount; }
649 
651  const AliRegionalHeader* RegionalHeader(UInt_t i) const
652  {
653  return i < fRegionalsCount ? &fRegionals[i] : NULL;
654  }
655 
657  const AliLocalStruct* FirstLocalStruct() const { return fLocals; }
658 
661  const AliLocalStruct* EndOfLocalStructs() const { return fEndOfLocals; }
662 
664  UInt_t GetDarcEoWErrors() const {return fDarcEoWErrors;}
665 
667  UInt_t GetGlobalEoWErrors() const {return fGlobalEoWErrors;}
668 
670  UInt_t GetRegEoWErrors() const {return fRegEoWErrors;}
671 
673  UInt_t GetLocalEoWErrors() const {return fLocalEoWErrors;}
674 
676  Bool_t Warnings() const { return fWarnings; }
678  void Warnings(Bool_t value) { fWarnings = value; }
679 
680  // The following methods are inherited from AliMUONTriggerDDLDecoderEventHandler:
681 
683  void OnNewBuffer(const void* buffer, UInt_t bufferSize);
684 
686  void OnEndOfBuffer(const void* /*buffer*/, UInt_t /*bufferSize*/)
687  {
688  fEndOfLocals = fCurrentLocal+1;
689  }
690 
692  void OnDarcHeader(UInt_t header,
693  const AliMUONDarcScalarsStruct* scalars,
694  const void* /*data*/)
695  {
696  fDarcHeader = header;
697  fDarcScalars = scalars;
698  }
699 
702  const AliMUONGlobalScalarsStruct* scalars,
703  const void* /*data*/)
704  {
705  fHeaders = AliHeader(fDarcHeader, fDarcScalars, header, scalars);
706  }
707 
709  void OnNewRegionalStructV2(UInt_t iReg,
710  const AliMUONRegionalHeaderStruct* header,
711  const AliMUONRegionalScalarsStruct* scalars,
712  const void* data);
713 
715  void OnLocalStructV2(UInt_t iLoc,
716  const AliMUONLocalInfoStruct* localStruct,
717  const AliMUONLocalScalarsStruct* scalars);
718 
720  void OnError(ErrorCode error, const void* location);
721 
722  private:
723 
724  // Do not allow copying of this class.
729 
731  const void* fBufferStart;
732  UInt_t fDarcHeader;
741  UInt_t fDarcEoWErrors;
743  UInt_t fRegEoWErrors;
745  Bool_t fWarnings;
746 
748  };
749 
751  Int_t fDDL;
752  Int_t fBufferSize;
753  UChar_t* fBuffer;
755  Bool_t fHadError;
756  Bool_t fDone;
762 
763  static const Int_t fgkMaxDDL;
764 
765  ClassDef(AliMUONRawStreamTriggerHP, 0) // Higher performance decoder class for MUON trigger rawdata.
766 };
767 
769 
771 {
774 
775  do {
776  if (fkCurrentLocalStruct != fDecoder.GetHandler().EndOfLocalStructs())
777  return fkCurrentLocalStruct++;
778  } while (NextDDL());
779  return NULL;
780 }
781 
782 
784  UInt_t iReg,
785  const AliMUONRegionalHeaderStruct* header,
786  const AliMUONRegionalScalarsStruct* scalars,
787  const void* /*data*/
788  )
789 {
793 
794  assert( header != NULL );
795  assert( iReg < fRegionalsCount );
796 
797  fCurrentRegional = fRegionals+iReg;
798  *fCurrentRegional = AliRegionalHeader(fCurrentLocal+1, header, scalars);
799 
800  // Link to the next regional structure unless this is the last one.
801  if (iReg+1 < fRegionalsCount)
802  {
803  fCurrentRegional->SetNext(fCurrentRegional+1);
804  }
805 }
806 
807 
809  UInt_t iLoc,
810  const AliMUONLocalInfoStruct* localStruct,
811  const AliMUONLocalScalarsStruct* scalars
812  )
813 {
819 
820  assert( localStruct != NULL );
821  assert( fCurrentLocal != NULL );
822  assert( fCurrentRegional != NULL );
823  assert( fCurrentRegional->GetLocalStructCount() < (UInt_t)fRawStream->GetMaxLoc() );
824 
825  // Link the previous local structure unless it is the first one.
826  if (fCurrentRegional->GetLocalStructCount() > 0)
827  {
828  fCurrentLocal->SetNext(fCurrentLocal+1);
829  }
830 
831  fCurrentLocal++;
832  *fCurrentLocal = AliLocalStruct(fCurrentRegional, localStruct, scalars);
833  fCurrentLocal->SetCalculatedId(iLoc);
834  fCurrentRegional->IncLocalStructCount();
835 }
836 
837 #endif // ALIMUONRAWSTREAMTRIGGERHP_H
static UShort_t GetLocalXY4(const AliMUONLocalScalarsStruct *scalars, UInt_t n)
Return XY4.
UInt_t fScaler[6]
Global card ouput scalars.
void GetXPattern(TArrayS &array) const
return X pattern array
const AliMUONRegionalScalarsStruct * GetScalars() const
Return the raw data of the regional scalars or NULL if none exist.
const AliHeader * GetHeaders() const
Returns the DARC and global headers plus scalars if they exist.
Light weight interface class to the local trigger card data.
AliLocalStruct & operator=(const AliLocalStruct &object)
Implement shallow copying in the assignment operator.
AliRegionalHeader(const AliRegionalHeader &o)
Implement shallow copying in the copy constructor.
The optional DARC board scalars.
UInt_t GetGlobalEoWErrors() const
Get number of end of Global word errors in the DDL last decoded.
static const Int_t fgkMaxDDL
! Maximum number of DDLs
Int_t fBufferSize
! This is the buffer size in bytes of fBuffer.
AliRegionalHeader * fCurrentRegional
! Current regional header position.
UChar_t GetEventType() const
Return event type.
static UChar_t GetRegionalId(const AliMUONRegionalHeaderStruct *header)
Return Id.
static bool GetRegionalRamNotEmptyFlag(const AliMUONRegionalHeaderStruct *header)
Return RamNotEmptyFlag.
UInt_t GetLocalStructCount(UInt_t reg) const
const AliMUONRegionalHeaderStruct * GetHeader() const
Return raw data of regional header.
const AliLocalStruct * fFirstLocal
The first local trigger structure of this regional structure.
void SetNext(const AliLocalStruct *next)
Sets the next local trigger structure.
AliHeader & operator=(const AliHeader &object)
Implement shallow copying in the assignment operator.
const AliLocalStruct * fNext
Next local structure object in the regional structure.
Bool_t GetGlobalFlag() const
Return global flag.
UInt_t GetRegEoWErrors() const
Get number of end of regional word errors.
const AliLocalStruct * Next()
Returns the next local trigger structure.
const AliMUONDarcScalarsStruct * GetDarcScalars() const
Return the DARC scalars raw data or NULL if none exist.
UInt_t GetClock() const
Return regional clock.
UInt_t GetDarcL1S() const
Return DARC L1 software.
static UShort_t GetLocalY3(const AliMUONLocalInfoStruct *local)
Return Y3.
TVectorD vec
Definition: AnalyzeLaser.C:8
static bool GetRegionalL2AccStatus(const AliMUONRegionalHeaderStruct *header)
Return L2AccStatus.
void SetCalculatedId(UChar_t id)
Sets the calculated ID value to be returned by GetId if fgOverrideId is true.
static UChar_t GetLocalXPos(const AliMUONLocalInfoStruct *local)
Return Xpos.
AliHeader(const AliHeader &o)
Implement shallow copying in the copy constructor.
static bool GetRegionalDarcPhysFlag(const AliMUONRegionalHeaderStruct *header)
Return DarcPhysFlag.
AliLocalStruct(const AliLocalStruct &o)
Implement shallow copying in the copy constructor.
A high performance decoder class for MUON trigger DDL data.
UInt_t NumberOfGlobalEoWErrors() const
Number of end of global word errors since First() was called.
Bool_t HasDarcEoWError() const
Whether we got any end of DARC word errors or not since calling First().
The global input and output words just after the DARC header.
virtual Bool_t NextDDL()
DDL iterator.
UInt_t GetInput(Int_t n) const
Return regional input.
Light weight interface class to the DARC and global header data.
void SetNext(const AliRegionalHeader *next)
Sets the next regional structure header.
UInt_t GetLocalEoWErrors() const
Get number of end of local word errors in the DDL last decoded.
static UChar_t GetLocalXDev(const AliMUONLocalInfoStruct *local)
Get X deviation.
Bool_t IsPhysicsEvent() const
Returns true if this was a physics event.
const UInt_t * GetGlobalScaler() const
Return global scalars or NULL if none exist.
const AliRegionalHeader * GetRegionalHeader(UInt_t i) const
Return the i'th regional header or NULL if not found.
Bool_t HasRegEoWError() const
Whether we got any end of regional word errors or not since calling First().
static UChar_t GetLocalLpt(const AliMUONLocalInfoStruct *local)
Return LPT.
UInt_t GetDarcEoWErrors() const
Get number of end of DARC word errors.
Bool_t GetDarcPhysFlag() const
Return DarcPhysFlag.
const AliMUONGlobalHeaderStruct * GetGlobalHeader() const
Return the global header's raw data.
Higher performance decoder stream class for reading MUON raw trigger data.
virtual void SetMaxReg(Int_t reg)
Set the maximum number of regional cards in the DDL.
static UShort_t GetLocalXY3(const AliMUONLocalScalarsStruct *scalars, UInt_t n)
Return XY3.
Bool_t GetL2RejStatus() const
Return L2RejStatus.
static UShort_t GetLocalXY1(const AliMUONLocalScalarsStruct *scalars, UInt_t n)
Return XY1.
const AliRegionalHeader * GetRegionalHeader() const
Return the parent regional header.
Local card trigger information.
Callback event handler class for the AliMUONTriggerDDLDecoder. This class is the base class defining ...
UInt_t fClk
Regional number of clock cycles.
virtual void DisableWarnings()
Set warnings flag to disable warnings on data errors.
static UChar_t GetRegionalResetNb(const AliMUONRegionalHeaderStruct *header)
Return ResetNb.
virtual Bool_t IsErrorMessage() const
check error/Warning presence
UInt_t fL0R
DARC L0 received and used.
UInt_t fDarcEoWErrors
! Number of end of DARC word errors.
static UInt_t DarcDefaultType()
Returns value of default DARC type.
static UChar_t GetLocalId(const AliMUONLocalInfoStruct *local)
Return Id.
AliRegionalHeader & operator=(const AliRegionalHeader &object)
Implement shallow copying in the assignment operator.
void OnLocalStructV2(UInt_t iLoc, const AliMUONLocalInfoStruct *localStruct, const AliMUONLocalScalarsStruct *scalars)
Handler for new local card structures.
AliRegionalHeader(const AliLocalStruct *localsArray=NULL, const AliMUONRegionalHeaderStruct *header=NULL, const AliMUONRegionalScalarsStruct *scalars=NULL)
Default constructor.
const AliMUONGlobalHeaderStruct * fGlobalHeader
Pointer to global header in DDL payload.
virtual Int_t GetMaxReg() const
Return maximum number of regional cards in the DDL.
AliHeader fHeaders
! Headers of the DDL payload.
static UChar_t GetRegionalSerialNb(const AliMUONRegionalHeaderStruct *header)
Return SerialNb.
UShort_t GetErrorBits() const
Return ErrorBits.
const AliLocalStruct * GetLocalStruct(UInt_t i) const
Return the i'th local trigger structure in this regional structure.
AliMUONVRawStreamTrigger * fRawStream
! Pointer to the parent raw stream object.
TObjArray * array
Definition: AnalyzeLaser.C:12
UShort_t GetXY1(Int_t n) const
Return XY1.
static bool GetLocalTrigY(const AliMUONLocalInfoStruct *local)
Return TrigY.
Bool_t HasLocalEoWError() const
Whether we got any end of local word errors or not since calling First().
Bool_t HasGlobalEoWError() const
Whether we got any end of global word errors or not since calling First().
Bool_t DarcIsVadohrType() const
Return true if type for DARC is Vadorh.
UInt_t fRegionalsCount
! Number of regional headers filled in fRegionals.
UInt_t fRegEoWErrors
! Number of end of regional word errors.
UShort_t GetXY2(Int_t n) const
Return XY2.
Bool_t GetRegPhysFlag() const
Return RegPhysFlag.
UInt_t GetDarcHeader() const
Return the DARC header's raw data.
UInt_t GetLocalEoWErrors() const
Get number of end of local word errors.
UInt_t NumberOfDarcEoWErrors() const
Number of end of DARC word errors since First() was called.
const AliMUONLocalScalarsStruct * fScalars
Pointer to the local trigger scalars data in the DDL payload.
UInt_t fLocalEoWErrors
! Number of end of local word errors.
const AliRegionalHeader * RegionalHeader(UInt_t i) const
Return the i'th regional structure header.
Bool_t GetRamNotFullFlag() const
Return RamNotFullFlag.
static UShort_t GetRegionalL0(const AliMUONRegionalHeaderStruct *header)
Return L0.
const void * fBufferStart
! Pointer to the start of the current DDL payload buffer.
static UShort_t GetLocalX2(const AliMUONLocalInfoStruct *local)
Return X2.
Implementation of a high performance DDL decoder for the muon trigger.
static bool GetRegionalRamNotFullFlag(const AliMUONRegionalHeaderStruct *header)
Return RamNotFullFlag.
UChar_t GetSerialNb() const
Return serial number.
static bool GetRegionalL0Status(const AliMUONRegionalHeaderStruct *header)
Return L0Status.
UInt_t GetGlobalHold() const
Return global hold (dead time)
AliLocalStruct * fCurrentLocal
! Current local trigger structure.
UInt_t fClk
Global number of clock cycles.
static bool GetLocalSXDev(const AliMUONLocalInfoStruct *local)
Get Sign of X deviation.
UInt_t GetGlobalSpare() const
Return global spare.
const AliMUONLocalInfoStruct * GetData() const
Return raw data of the local trigger structure.
static UChar_t GetLocalDec(const AliMUONLocalInfoStruct *local)
Return Dec.
UInt_t GetGlobalEoWErrors() const
Get number of end of Global word errors.
UInt_t fDarcHeader
! Currently decoded DARC header.
static UChar_t GetRegionalOutput(const AliMUONRegionalHeaderStruct *header)
Return Output.
void OnNewRegionalStructV2(UInt_t iReg, const AliMUONRegionalHeaderStruct *header, const AliMUONRegionalScalarsStruct *scalars, const void *data)
Handler for new regional card structures.
Base class for reading MUON raw trigger data.
UShort_t GetGlobalConfig() const
Return global config.
static UShort_t GetLocalY4(const AliMUONLocalInfoStruct *local)
Return Y4.
UInt_t fGlobalEoWErrors
! Number of end of global word errors.
static bool GetRegionalL1Status(const AliMUONRegionalHeaderStruct *header)
Return L1Status.
UInt_t GetHold() const
Return regional hold (dead time)
UInt_t fHold
Global number of hold (dead time)
static UShort_t GetLocalXY2(const AliMUONLocalScalarsStruct *scalars, UInt_t n)
Return XY2.
static UShort_t GetRegionalErrorBits(const AliMUONRegionalHeaderStruct *header)
Return ErrorBits.
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.
UChar_t GetGlobalOutput() const
Return global output.
static UChar_t GetRegionalFPGANumber(const AliMUONRegionalHeaderStruct *header)
Return FPGANumber.
UInt_t fL0
Global number of L0 triggers.
AliRegionalHeader * fRegionals
! Array of regional headers. [0..fMaxRegionals-1]
UInt_t fLocalsCount
The number of AliLocalStruct objects found in the array pointed to by fFirstLocal.
static bool GetOverrideIdFlag()
Returns the override flag indicating if the GetId method should return the calculated Id value or not...
UInt_t GetDarcL1P() const
Return DARC L1 physics.
UInt_t GetDarcL0R() const
Return DARC L0 received and used.
UChar_t GetVersion() const
Return version.
UShort_t GetXY4(Int_t n) const
Return XY4.
Bool_t Warnings() const
Returns the warnings flag.
const AliLocalStruct * GetFirstLocalStruct() const
Returns the first AliLocalStruct class in this regional structure.
const AliRegionalHeader * GetFirstRegionalHeader() const
Return the first regional structure header.
const AliLocalStruct * FirstLocalStruct() const
Return the first local structure decoded.
const AliRegionalHeader * fNext
Pointer to next regional header.
UInt_t fL0
local number of L0 triggers.
The optional global card scalars.
Bool_t DarcIsDefaultType() const
Return true if type for DARC is default.
UInt_t GetWord() const
Return first reg word.
Bool_t GetPresentFlag() const
Return PresentFlag.
static bool fgOverrideId
! Flag indicating if we should return a calculated number in the GetId method.
UInt_t NumberOfRegEoWErrors() const
Number of end of regional word errors since First() was called.
Bool_t GetSXDev() const
Get Sign of X deviation.
void Warnings(Bool_t value)
Sets the warnings flag.
const UInt_t * GetScaler() const
Return regional ouput.
UInt_t fClk
local number of clock cycles
virtual Int_t GetMaxLoc() const
Return maximum number of local cards in the DDL.
virtual void SetMaxLoc(Int_t loc)
Sets the maximum number of local cards in the DDL.
UInt_t NumberOfLocalEoWErrors() const
Number of end of local word errors since First() was called.
const AliHeader * GetHeaders() const
Returns the decoded DARC and global headers (and scalars if they exist).
Light weight interface class to the regional card header data.
UInt_t GetGlobalClock() const
Return global clock.
static UChar_t GetLocalComptXY(const AliMUONLocalScalarsStruct *scalars)
Return ComptXY.
UInt_t fTotalNumberOfLocalEoWErrors
! The total number of end of local word errors since the last call to First().
AliMUONTriggerDDLDecoder< AliDecoderEventHandler > fDecoder
! The decoder for the DDL payload.
static const AliMUONRegionalHeaderStruct fgkEmptyHeader
! Empty header for skipped regional structures.
UInt_t GetHold() const
Return local hold (dead time)
Bool_t TryRecover() const
Returns the "try to recover from errors" flag.
Bool_t fDone
! Flag indicating if the iteration is done or not.
static bool GetLocalTriggerY(const AliMUONLocalInfoStruct *local)
Return TriggerY.
Bool_t GetL2AccStatus() const
Return L2AccStatus.
const AliMUONRegionalScalarsStruct * fScalars
Pointer to the regional scalars in the DDL payload.
static bool GetRegionalPhysFlag(const AliMUONRegionalHeaderStruct *header)
Return RegPhysFlag.
void Print() const
Print the contents of the local trigger structure and contents to screen.
Bool_t GetDAQFlag() const
Return DAQ flag.
UInt_t GetDarcL2A() const
Return DARC L2 accept.
static UChar_t GetRegionalEventInRam(const AliMUONRegionalHeaderStruct *header)
Return EventInRam.
UShort_t GetXY3(Int_t n) const
Return XY3.
virtual Int_t GetDDL() const
Return number of the current DDL being handled in the range [0..1] and -1 if no DDL set...
void GetYPattern(TArrayS &array) const
return Y pattern array
Bool_t GetCTPTrig() const
Return CPT trigger.
void SetRawStream(AliMUONVRawStreamTrigger *rawStream)
Sets the raw stream object which should be the parent of this class.
void OnDarcHeader(UInt_t header, const AliMUONDarcScalarsStruct *scalars, const void *)
Handler for the DARC header which just remembers the pointers for later.
static void SetOverrideIdFlag(bool value)
Sets the override flag to control what value the GetId method returns.
static UChar_t GetGlobalOutput(const AliMUONGlobalHeaderStruct *header)
const AliLocalStruct * GetLocalStruct(UInt_t reg, UInt_t i) const
UInt_t fTotalNumberOfDarcEoWErrors
! The total number of end of DARC word errors since the last call to First().
const AliLocalStruct * CurrentLocalStruct() const
Returns the current local struct being decoded or NULL if none found.
void Print() const
Print the contents of the regional header and scalars to screen.
UInt_t GetDarcL2R() const
Return DARC L2 reject.
virtual void EnableWarnings()
Set warnings flag to enable warnings on data errors.
const AliRegionalHeader * Next() const
Return the next regional structure header.
const AliMUONGlobalScalarsStruct * GetGlobalScalars() const
Return the global scalars raw data or NULL if none exist.
UInt_t fScaler[8]
Regional ouput scalars.
Bool_t GetVMETrig() const
Return VME trig.
virtual Int_t GetMaxDDL() const
Return maximum number of DDLs.
const AliMUONDarcScalarsStruct * fDarcScalars
! Currently decoded DARC scalars.
static UChar_t GetRegionalBusy(const AliMUONRegionalHeaderStruct *header)
Return Busy.
const AliLocalStruct * fkCurrentLocalStruct
! The current local trigger structure being handled by Next().
UInt_t fDarcHeader
Pointer to DARC header in DDL payload.
UChar_t GetEventInRam() const
Return EventInRam.
static UInt_t DarcVadorhType()
Returns value of Vadorh DARC type.
UChar_t GetFPGANumber() const
Return FPGANumber.
UInt_t GetDarcHold() const
Return DARC hold (dead time)
const AliMUONRegionalHeaderStruct * fHeader
Pointer to the regional header in the DDL payload.
AliLocalStruct * fEndOfLocals
! Marker indicating the position just passed the last filled element in fLocals.
void Print() const
Print the contents of the headers to screen.
static bool GetRegionalPresentFlag(const AliMUONRegionalHeaderStruct *header)
Return PresentFlag.
UInt_t GetDarcClock() const
Return DARC clock.
static bool GetLocalTriggerX(const AliMUONLocalInfoStruct *local)
Return TriggerX.
UInt_t fInput[4]
Global input. 8-bit words comming from the each of the 16 regional controlers.
AliHeader(UInt_t darcHeader=0, const AliMUONDarcScalarsStruct *darcScalars=NULL, const AliMUONGlobalHeaderStruct *globalHeader=NULL, const AliMUONGlobalScalarsStruct *globalScalars=NULL)
Default constructor.
UChar_t * fBuffer
! This is the buffer in which we store the DDL payload read from AliRawReader.
const AliMUONLocalScalarsStruct * GetScalars() const
virtual Bool_t IsDone() const
Whether the iteration is finished or not.
AliLocalStruct * fLocals
! Array of decoded local structured. [0..fMaxRegionals*fMaxLocals-1]
UChar_t fCalculatedId
Calculated ID value returned by GetId() if fgOverrideId == true.
void OnGlobalHeader(const AliMUONGlobalHeaderStruct *header, const AliMUONGlobalScalarsStruct *scalars, const void *)
Handler for the global header which stores the pointer to the headers.
UInt_t GetRegionalHeaderCount() const
Return the number of regional structures in the DDL payload.
static UShort_t GetLocalX3(const AliMUONLocalInfoStruct *local)
Return X3.
void IncLocalStructCount()
Increments the local trigger structure count.
UInt_t GetGlobalInput(Int_t n) const
Return global input.
static UShort_t GetLocalY2(const AliMUONLocalInfoStruct *local)
Return Y2.
static UShort_t GetLocalSwitch(const AliMUONLocalScalarsStruct *scalars)
Return switch.
static UShort_t GetLocalX4(const AliMUONLocalInfoStruct *local)
Return X4.
static bool GetRegionalL2RejStatus(const AliMUONRegionalHeaderStruct *header)
Return L2RejStatus.
static UChar_t GetLocalHpt(const AliMUONLocalInfoStruct *local)
Return HPT.
AliMUONDDLTrigger * fDDLObject
! Temporary DDL object used by GetDDLTrigger() for caching.
UInt_t GetClock() const
Return local clock.
const AliLocalStruct * Next() const
Return the next local trigger structure.
UChar_t GetRegPattern() const
Return reg pattern.
const AliRegionalHeader * fRegional
The regional structure this local trigger structure belongs to.
const AliMUONLocalInfoStruct * fLocalStruct
Pointer to the local trigger structure data in the DDL payload.
Int_t fDDL
! The current DDL number being handled.
UInt_t GetDarcEoWErrors() const
Get number of end of DARC word errors in the DDL last decoded.
virtual AliMUONDDLTrigger * GetDDLTrigger() const
Construct and return a pointer to the DDL payload object.
const AliRegionalHeader * CurrentRegionalHeader() const
MUON DDL Trigger.
UInt_t GetData(Int_t n) const
Return local data.
void OnEndOfBuffer(const void *, UInt_t)
End of buffer handler marks the end of local trigger structures.
UInt_t fTotalNumberOfRegEoWErrors
! The total number of end of regional word errors since the last call to First(). ...
virtual void First()
Initialize iterator.
AliLocalStruct(const AliRegionalHeader *regionalHeader=NULL, const AliMUONLocalInfoStruct *localStruct=NULL, const AliMUONLocalScalarsStruct *scalars=NULL)
Default constructor.
UInt_t fTotalNumberOfGlobalEoWErrors
! The total number of end of global word errors since the last call to First().
static UShort_t GetGlobalConfig(const AliMUONGlobalHeaderStruct *header)
static UChar_t GetLocalYPos(const AliMUONLocalInfoStruct *local)
Return Upos.
const AliMUONDarcScalarsStruct * fDarcScalars
Pointer to DARC scalars in DDL payload.
UChar_t GetDarcType() const
Return Darc type.
Bool_t GetRamNotEmptyFlag() const
Return RamNotEmptyFlag.
static UChar_t GetRegionalVersion(const AliMUONRegionalHeaderStruct *header)
Return Version.
UInt_t GetGlobalL0() const
Return global L0.
static UShort_t GetRegionalMask(const AliMUONRegionalHeaderStruct *header)
Return mask.
static UShort_t GetLocalX1(const AliMUONLocalInfoStruct *local)
Return X1.
UInt_t GetRegEoWErrors() const
Get number of end of regional word errors in the DDL last decoded.
UInt_t GetLocalStructCount() const
Returns the number of local trigger structures within this regional structure.
UInt_t RegionalHeaderCount() const
Returns the number of regional headers.
const AliMUONGlobalScalarsStruct * fGlobalScalars
Pointer to global scalars in DDL payload.
UInt_t GetWord() const
Return first word.
static UShort_t GetLocalY1(const AliMUONLocalInfoStruct *local)
Return Y1.