1 #ifndef ALIMUONRAWSTREAMTRIGGERHP_H
2 #define ALIMUONRAWSTREAMTRIGGERHP_H
41 virtual Bool_t
IsDone()
const;
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);
57 const AliLocalStruct*
Next();
135 UInt_t darcHeader = 0,
155 memcpy(
this, &
object,
sizeof(
AliHeader));
419 return (reinterpret_cast<const UInt_t*>(
fLocalStruct))[n];
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())};
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())};
571 return fDecoder.GetHandler().RegionalHeaderCount();
577 return fDecoder.GetHandler().RegionalHeader(0);
583 return fDecoder.GetHandler().RegionalHeader(i);
639 void SetMaxStructs(UInt_t maxRegionals, UInt_t maxLocals);
653 return i < fRegionalsCount ? &fRegionals[i] : NULL;
683 void OnNewBuffer(
const void* buffer, UInt_t bufferSize);
688 fEndOfLocals = fCurrentLocal+1;
696 fDarcHeader = header;
697 fDarcScalars = scalars;
705 fHeaders =
AliHeader(fDarcHeader, fDarcScalars, header, scalars);
709 void OnNewRegionalStructV2(UInt_t iReg,
715 void OnLocalStructV2(UInt_t iLoc,
720 void OnError(ErrorCode error,
const void* location);
794 assert( header != NULL );
795 assert( iReg < fRegionalsCount );
797 fCurrentRegional = fRegionals+iReg;
801 if (iReg+1 < fRegionalsCount)
803 fCurrentRegional->SetNext(fCurrentRegional+1);
820 assert( localStruct != NULL );
821 assert( fCurrentLocal != NULL );
822 assert( fCurrentRegional != NULL );
823 assert( fCurrentRegional->GetLocalStructCount() < (UInt_t)fRawStream->GetMaxLoc() );
826 if (fCurrentRegional->GetLocalStructCount() > 0)
828 fCurrentLocal->SetNext(fCurrentLocal+1);
832 *fCurrentLocal =
AliLocalStruct(fCurrentRegional, localStruct, scalars);
833 fCurrentLocal->SetCalculatedId(iLoc);
834 fCurrentRegional->IncLocalStructCount();
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
UChar_t GetYPos() const
Return Upos.
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.
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
UInt_t fHold
Regional hold (dead time)
Int_t fBufferSize
! This is the buffer size in bytes of fBuffer.
AliRegionalHeader * fCurrentRegional
! Current regional header position.
static UChar_t GetRegionalId(const AliMUONRegionalHeaderStruct *header)
Return Id.
UShort_t GetX2() const
Return X2.
static bool GetRegionalRamNotEmptyFlag(const AliMUONRegionalHeaderStruct *header)
Return RamNotEmptyFlag.
static bool GetDarcCTPTrig(UInt_t header)
UInt_t GetLocalStructCount(UInt_t reg) const
UInt_t fL2R
DARC L2 reject.
void SetNext(const AliLocalStruct *next)
Sets the next local trigger structure.
UShort_t GetX3() const
Return X3.
const AliLocalStruct * fNext
Next local structure object in the regional structure.
UInt_t GetRegEoWErrors() const
Get number of end of regional word errors.
const AliLocalStruct * Next()
Returns the next local trigger structure.
static UShort_t GetLocalY3(const AliMUONLocalInfoStruct *local)
Return Y3.
Optional regional card scalars.
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.
UChar_t GetId() const
Return Id.
UInt_t GetL0() const
Return local L0.
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().
virtual Bool_t NextDDL()
DDL iterator.
UInt_t GetLocalEoWErrors() const
Get number of end of local word errors in the DDL last decoded.
UShort_t GetY4() const
Return Y4.
static UChar_t GetLocalXDev(const AliMUONLocalInfoStruct *local)
Get X deviation.
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.
UShort_t GetY1() const
Return Y1.
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.
void TryRecover(Bool_t value)
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.
virtual void AddErrorMessage()
Callback event handler class for the AliMUONTriggerDDLDecoder. This class is the base class defining ...
UInt_t fSpare
Global spare word.
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
Local card trigger scalars.
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.
void OnLocalStructV2(UInt_t iLoc, const AliMUONLocalInfoStruct *localStruct, const AliMUONLocalScalarsStruct *scalars)
Handler for new local card structures.
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.
AliMUONVRawStreamTrigger * fRawStream
! Pointer to the parent raw stream object.
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().
static bool GetDarcDAQFlag(UInt_t header)
Bool_t HasGlobalEoWError() const
Whether we got any end of global word errors or not since calling First().
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.
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.
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.
static bool GetRegionalL0Status(const AliMUONRegionalHeaderStruct *header)
Return L0Status.
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.
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.
static UChar_t GetDarcEventType(UInt_t header)
Base class for reading MUON raw trigger data.
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 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.
~AliLocalStruct()
Default destructor.
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]
UShort_t GetX1() const
Return X1.
static bool GetOverrideIdFlag()
Returns the override flag indicating if the GetId method should return the calculated Id value or not...
static UChar_t GetDarcRegPattern(UInt_t header)
UInt_t fL1S
DARC L1 software.
UShort_t GetXY4(Int_t n) const
Return XY4.
Bool_t Warnings() const
Returns the warnings flag.
UChar_t GetXDev() const
Get X deviation.
const AliRegionalHeader * GetFirstRegionalHeader() const
Return the first regional structure header.
UInt_t fHold
local hold (dead time)
const AliLocalStruct * FirstLocalStruct() const
Return the first local structure decoded.
UShort_t GetY3() const
Return Y3.
UInt_t fL0
local number of L0 triggers.
static bool GetDarcGlobalFlag(UInt_t header)
UShort_t GetSwitch() const
Return switch.
The optional global card scalars.
static UChar_t GetDarcVersion(UInt_t header)
UShort_t GetY2() const
Return Y2.
static UChar_t GetDarcSerialNb(UInt_t header)
static bool fgOverrideId
! Flag indicating if we should return a calculated number in the GetId method.
virtual ~AliMUONRawStreamTriggerHP()
UInt_t NumberOfRegEoWErrors() const
Number of end of regional word errors since First() was called.
UInt_t fL2A
DARC L2 accept.
Bool_t GetSXDev() const
Get Sign of X deviation.
const AliLocalStruct * EndOfLocalStructs() const
void Warnings(Bool_t value)
Sets the warnings flag.
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).
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.
static bool GetRegionalPhysFlag(const AliMUONRegionalHeaderStruct *header)
Return RegPhysFlag.
void Print() const
Print the contents of the local trigger structure and contents to screen.
static UChar_t GetRegionalEventInRam(const AliMUONRegionalHeaderStruct *header)
Return EventInRam.
static UChar_t GetDarcType(UInt_t header)
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...
AliMUONRawStreamTriggerHP()
void GetYPattern(TArrayS &array) const
return Y pattern array
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.
UChar_t GetXPos() const
Return Xpos.
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.
static bool GetDarcVMETrig(UInt_t header)
virtual void EnableWarnings()
Set warnings flag to enable warnings on data errors.
UInt_t fScaler[8]
Regional ouput scalars.
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().
Bool_t GetTriggerY() const
Return TriggerY.
static UInt_t DarcVadorhType()
Returns value of Vadorh DARC type.
UChar_t GetHpt() const
Return HPT.
AliLocalStruct * fEndOfLocals
! Marker indicating the position just passed the last filled element in fLocals.
static bool GetRegionalPresentFlag(const AliMUONRegionalHeaderStruct *header)
Return PresentFlag.
static bool GetLocalTriggerX(const AliMUONLocalInfoStruct *local)
Return TriggerX.
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.
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.
Bool_t GetTrigY() const
Return TrigY.
UInt_t GetClock() const
Return local clock.
UInt_t fL1P
DARC L1 physics.
const AliLocalStruct * Next() const
Return the next local trigger structure.
const AliRegionalHeader * fRegional
The regional structure this local trigger structure belongs to.
UShort_t GetX4() const
Return X4.
const AliMUONLocalInfoStruct * fLocalStruct
Pointer to the local trigger structure data in the DDL payload.
UChar_t GetComptXY() const
Return ComptXY.
Int_t fDDL
! The current DDL number being handled.
UChar_t GetDec() const
Return Dec.
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
Bool_t GetTriggerX() const
Return TriggerX.
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.
static UChar_t GetRegionalVersion(const AliMUONRegionalHeaderStruct *header)
Return Version.
static UShort_t GetRegionalMask(const AliMUONRegionalHeaderStruct *header)
Return mask.
UInt_t fHold
DARC hold (dead time)
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 RegionalHeaderCount() const
Returns the number of regional headers.
UChar_t GetLpt() const
Return LPT.
static UShort_t GetLocalY1(const AliMUONLocalInfoStruct *local)
Return Y1.