virtual Int_t GetMaxDDL() const { return fgkMaxDDL; }
/// Return maximum number of regional cards in the DDL.
- virtual Int_t GetMaxReg() const { return (Int_t) fDecoder.RegionalsDecoded(); }
+ virtual Int_t GetMaxReg() const { return (Int_t) fDecoder.MaxRegionals(); }
- /// Return maximum allowed number of regional cards in the DDL.
- virtual Int_t GetMaxRegAllowed() const { return (Int_t) fDecoder.MaxRegionals(); }
-
- /// Set the maximum allowed number of regional cards in the DDL.
- virtual void SetMaxRegAllowed(Int_t reg);
+ /// Set the maximum number of regional cards in the DDL.
+ virtual void SetMaxReg(Int_t reg);
/// Return maximum number of local cards in the DDL.
virtual Int_t GetMaxLoc() const { return (Int_t) fDecoder.MaxLocals(); }
/// Return first word
UInt_t GetWord() const {return GetDarcHeader();}
/// Return global input
- Int_t GetGlobalInput(Int_t n) const {return fGlobalHeader->fInput[n];}
+ UInt_t GetGlobalInput(Int_t n) const {return fGlobalHeader->fInput[n];}
/// Return global output
UChar_t GetGlobalOutput() const {return AliMUONTriggerDDLDecoderEventHandler::GetGlobalOutput(fGlobalHeader);}
/// Return global config
const AliMUONLocalScalarsStruct* scalars = NULL
) :
fRegional(regionalHeader), fNext(NULL),
- fLocalStruct(localStruct), fScalars(scalars)
+ fLocalStruct(localStruct), fScalars(scalars),
+ fCalculatedId(0)
{
}
/// Implement shallow copying in the copy constructor.
AliLocalStruct(const AliLocalStruct& o) :
fRegional(o.fRegional), fNext(o.fNext),
- fLocalStruct(o.fLocalStruct), fScalars(o.fScalars)
+ fLocalStruct(o.fLocalStruct), fScalars(o.fScalars),
+ fCalculatedId(o.fCalculatedId)
{
}
}
/// Return Id
- UChar_t GetId() const {return AliMUONTriggerDDLDecoderEventHandler::GetLocalId(fLocalStruct);}
+ UChar_t GetId() const {return fgOverrideId ? fCalculatedId : AliMUONTriggerDDLDecoderEventHandler::GetLocalId(fLocalStruct);}
/// Return Dec
UChar_t GetDec() const {return AliMUONTriggerDDLDecoderEventHandler::GetLocalDec(fLocalStruct);}
/// Return TrigY
/// Sets the next local trigger structure.
void SetNext(const AliLocalStruct* next) { fNext = next; }
+
+ /// Sets the calculated ID value to be returned by GetId if fgOverrideId is true.
+ void SetCalculatedId(UChar_t id) { fCalculatedId = id; }
/// Print the contents of the local trigger structure and contents to screen.
void Print() const;
+
+ /// Returns the override flag indicating if the GetId method should return the calculated Id value or not.
+ static bool GetOverrideIdFlag() { return fgOverrideId; }
+
+ /// Sets the override flag to control what value the GetId method returns.
+ static void SetOverrideIdFlag(bool value) { fgOverrideId = value; }
private:
const AliLocalStruct* fNext; ///< Next local structure object in the regional structure.
const AliMUONLocalInfoStruct* fLocalStruct; ///< Pointer to the local trigger structure data in the DDL payload.
const AliMUONLocalScalarsStruct* fScalars; ///< Pointer to the local trigger scalars data in the DDL payload.
+ UChar_t fCalculatedId; ///< Calculated ID value returned by GetId() if fgOverrideId == true.
+ static bool fgOverrideId; //!< Flag indicating if we should return a calculated number in the GetId method.
};
/// Returns the DARC and global headers plus scalars if they exist.
}
/// Handler for new regional card structures.
- void OnNewRegionalStruct(const AliMUONRegionalHeaderStruct* header,
- const AliMUONRegionalScalarsStruct* scalars,
- const void* data);
+ void OnNewRegionalStructV2(UInt_t iReg,
+ const AliMUONRegionalHeaderStruct* header,
+ const AliMUONRegionalScalarsStruct* scalars,
+ const void* data);
/// Handler for new local card structures.
- void OnLocalStruct(const AliMUONLocalInfoStruct* localStruct,
- const AliMUONLocalScalarsStruct* scalars);
+ void OnLocalStructV2(UInt_t iLoc,
+ const AliMUONLocalInfoStruct* localStruct,
+ const AliMUONLocalScalarsStruct* scalars);
/// Error handler.
void OnError(ErrorCode error, const void* location);
UInt_t fRegEoWErrors; //!< Number of end of regional word errors.
UInt_t fLocalEoWErrors; //!< Number of end of local word errors.
Bool_t fWarnings; //!< Flag indicating if we should generate a warning for errors.
+
+ static const AliMUONRegionalHeaderStruct fgkEmptyHeader; //!< Empty header for skipped regional structures.
};
AliMUONTriggerDDLDecoder<AliDecoderEventHandler> fDecoder; //!< The decoder for the DDL payload.
}
-inline void AliMUONRawStreamTriggerHP::AliDecoderEventHandler::OnNewRegionalStruct(
+inline void AliMUONRawStreamTriggerHP::AliDecoderEventHandler::OnNewRegionalStructV2(
+ UInt_t iReg,
const AliMUONRegionalHeaderStruct* header,
const AliMUONRegionalScalarsStruct* scalars,
const void* /*data*/
/// the appropriate counters.
assert( header != NULL );
- assert( fCurrentRegional != NULL );
- assert( fRegionalsCount < (UInt_t)fRawStream->GetMaxReg() );
+ assert( iReg < fRegionalsCount );
+
+ fCurrentRegional = fRegionals+iReg;
+ *fCurrentRegional = AliRegionalHeader(fCurrentLocal+1, header, scalars);
- // Link the previous regional structure unless it is the first one.
- if (fRegionalsCount > 0)
+ // Link to the next regional structure unless this is the last one.
+ if (iReg+1 < fRegionalsCount)
{
fCurrentRegional->SetNext(fCurrentRegional+1);
}
-
- fCurrentRegional++;
- *fCurrentRegional = AliRegionalHeader(fCurrentLocal+1, header, scalars);
- fRegionalsCount++;
}
-inline void AliMUONRawStreamTriggerHP::AliDecoderEventHandler::OnLocalStruct(
+inline void AliMUONRawStreamTriggerHP::AliDecoderEventHandler::OnLocalStructV2(
+ UInt_t iLoc,
const AliMUONLocalInfoStruct* localStruct,
const AliMUONLocalScalarsStruct* scalars
)
fCurrentLocal++;
*fCurrentLocal = AliLocalStruct(fCurrentRegional, localStruct, scalars);
+ fCurrentLocal->SetCalculatedId(iLoc);
fCurrentRegional->IncLocalStructCount();
}