#include "AliMUONTriggerDDLDecoder.h"
#include "TArrayS.h"
+class AliMUONDDLTrigger;
+
class AliMUONRawStreamTriggerHP : public AliMUONVRawStreamTrigger
{
UChar_t& xPos, Bool_t& triggerY, Bool_t& triggerX,
TArrayS& xPattern, TArrayS& yPattern);
+ /// Construct and return a pointer to the DDL payload object.
+ virtual AliMUONDDLTrigger* GetDDLTrigger() const;
+
/// Returns the next local trigger structure.
const AliLocalStruct* Next();
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(); }
-
- /// Return maximum allowed number of regional cards in the DDL.
- virtual Int_t GetMaxRegAllowed() const { return (Int_t) fDecoder.MaxRegionals(); }
+ virtual Int_t GetMaxReg() 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
/// Returns the current local struct being decoded or NULL if none found.
const AliLocalStruct* CurrentLocalStruct() const
{
- return (fCurrentLocalStruct != fDecoder.GetHandler().EndOfLocalStructs()) ?
- fCurrentLocalStruct : NULL;
+ return (fkCurrentLocalStruct != fDecoder.GetHandler().EndOfLocalStructs()) ?
+ fkCurrentLocalStruct : NULL;
}
/// Returns the current regional structure being decoded
}
/// 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,
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.
Int_t fDDL; //!< The current DDL number being handled.
Int_t fBufferSize; //!< This is the buffer size in bytes of fBuffer.
UChar_t* fBuffer; //!< This is the buffer in which we store the DDL payload read from AliRawReader.
- const AliLocalStruct* fCurrentLocalStruct; //!< The current local trigger structure being handled by Next().
+ const AliLocalStruct* fkCurrentLocalStruct; //!< The current local trigger structure being handled by Next().
Bool_t fHadError; //!< Flag indicating if there was a decoding error or not.
Bool_t fDone; //!< Flag indicating if the iteration is done or not.
+ mutable AliMUONDDLTrigger* fDDLObject; //!< Temporary DDL object used by GetDDLTrigger() for caching.
static const Int_t fgkMaxDDL; //!< Maximum number of DDLs
/// When no more local triggers are found then NULL is returned.
do {
- if (fCurrentLocalStruct != fDecoder.GetHandler().EndOfLocalStructs())
- return fCurrentLocalStruct++;
+ if (fkCurrentLocalStruct != fDecoder.GetHandler().EndOfLocalStructs())
+ return fkCurrentLocalStruct++;
} while (NextDDL());
return NULL;
}
-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 );
- // Link the previous regional structure unless it is the first one.
- if (fRegionalsCount > 0)
+ fCurrentRegional = fRegionals+iReg;
+ *fCurrentRegional = AliRegionalHeader(fCurrentLocal+1, header, scalars);
+
+ // 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++;
}