ATLAS Offline Software
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
PrescalingEmulationTool Class Reference

#include <PrescalingEmulationTool.h>

Inheritance diagram for PrescalingEmulationTool:
Collaboration diagram for PrescalingEmulationTool:

Public Member Functions

 PrescalingEmulationTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual StatusCode initialize () override
 
virtual StatusCode prescaleChains (const EventContext &ctx, const HLT::IDVec &initiallyActive, HLT::IDVec &remainActive, bool forExpressStream=false) const override
 

Private Types

typedef std::map< HLT::Identifier, float > PrescalingInfo
 

Private Member Functions

 PrescalingEmulationTool ()
 

Private Attributes

Gaudi::Property< bool > m_keepUnknownChains
 
Gaudi::Property< std::vector< std::string > > m_prescalingConfig
 
ATHRNG::RNGWrapper m_RNGEngines
 
PrescalingInfo m_prescalingInfo
 

Detailed Description

Definition at line 30 of file PrescalingEmulationTool.h.

Member Typedef Documentation

◆ PrescalingInfo

typedef std::map<HLT::Identifier, float> PrescalingEmulationTool::PrescalingInfo
private

Definition at line 54 of file PrescalingEmulationTool.h.

Constructor & Destructor Documentation

◆ PrescalingEmulationTool() [1/2]

PrescalingEmulationTool::PrescalingEmulationTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 16 of file PrescalingEmulationTool.cxx.

19  : base_class(type, name, parent),

◆ PrescalingEmulationTool() [2/2]

PrescalingEmulationTool::PrescalingEmulationTool ( )
private

Member Function Documentation

◆ initialize()

StatusCode PrescalingEmulationTool::initialize ( )
overridevirtual

Definition at line 23 of file PrescalingEmulationTool.cxx.

23  {
24  for ( const std::string& confElement: m_prescalingConfig ) {
25  std::string chainName( confElement, 0, confElement.find(':') );
26  std::string psValue( confElement, confElement.find(':')+1 );
27  ATH_MSG_DEBUG( "Decoded part of the config " << chainName << " " << psValue );
28  m_prescalingInfo[HLT::Identifier( chainName ) ] = 1./std::stof( psValue );
29  }
30  return StatusCode::SUCCESS;
31 }

◆ prescaleChains()

StatusCode PrescalingEmulationTool::prescaleChains ( const EventContext &  ctx,
const HLT::IDVec initiallyActive,
HLT::IDVec remainActive,
bool  forExpressStream = false 
) const
overridevirtual

Definition at line 34 of file PrescalingEmulationTool.cxx.

37  {
38 
39  ATH_MSG_DEBUG("Express stream prescaling ignored in Emulation tool" << forExpressStream);
40 
41  if ( initiallyActive.empty() ) {
42  return StatusCode::SUCCESS;
43  }
44 
45  // obtain CTP time
46  remainActive.reserve( initiallyActive.size() );
47 
48  // create the seed from the event time
49  size_t seed = ctx.eventID().time_stamp() ^ ctx.eventID().time_stamp_ns_offset();
50  CLHEP::HepRandomEngine* engine = m_RNGEngines.getEngine( ctx );
51  engine->setSeed( seed, 0 );
52  for ( auto ch: initiallyActive ) {
53  PrescalingInfo::const_iterator chainPS = m_prescalingInfo.find( ch );
54  const bool decision = (chainPS != m_prescalingInfo.end()) ?
55  engine->flat() < chainPS->second :
57  ATH_MSG_DEBUG("Prescaling decision for chain " << ch << " " << decision );
58  if ( decision ) {
59  remainActive.push_back( ch );
60  }
61  }
62  return StatusCode::SUCCESS;
63 }

Member Data Documentation

◆ m_keepUnknownChains

Gaudi::Property<bool> PrescalingEmulationTool::m_keepUnknownChains
private
Initial value:
{
this, "KeepUnknownChains", true, "If True then chains for which prescaling information is not set are kept"}

Definition at line 46 of file PrescalingEmulationTool.h.

◆ m_prescalingConfig

Gaudi::Property< std::vector<std::string> > PrescalingEmulationTool::m_prescalingConfig
private
Initial value:
{
this, "Prescales", {}, "The prescaling info in the form: \"chainName:PSValue\""}

Definition at line 49 of file PrescalingEmulationTool.h.

◆ m_prescalingInfo

PrescalingInfo PrescalingEmulationTool::m_prescalingInfo
private

Definition at line 55 of file PrescalingEmulationTool.h.

◆ m_RNGEngines

ATHRNG::RNGWrapper PrescalingEmulationTool::m_RNGEngines
private

Definition at line 52 of file PrescalingEmulationTool.h.


The documentation for this class was generated from the following files:
sendEI_SPB.ch
ch
Definition: sendEI_SPB.py:35
PrescalingEmulationTool::m_RNGEngines
ATHRNG::RNGWrapper m_RNGEngines
Definition: PrescalingEmulationTool.h:52
PrescalingEmulationTool::m_keepUnknownChains
Gaudi::Property< bool > m_keepUnknownChains
Definition: PrescalingEmulationTool.h:46
Generate_dsid_ranseed.seed
seed
Definition: Generate_dsid_ranseed.py:10
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
HLT::Identifier
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:20
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
RanluxFactory
const std::function< CLHEP::HepRandomEngine *(void) > RanluxFactory
Definition: PrescalingEmulationTool.cxx:11
PrescalingEmulationTool::m_prescalingConfig
Gaudi::Property< std::vector< std::string > > m_prescalingConfig
Definition: PrescalingEmulationTool.h:49
ATHRNG::RNGWrapper::getEngine
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition: RNGWrapper.h:134
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
SG::getNSlots
size_t getNSlots()
Return the number of event slots.
Definition: SlotSpecificObj.cxx:64
python.TriggerAPI.TriggerAPISession.chainName
chainName
Definition: TriggerAPISession.py:426
PrescalingEmulationTool::m_prescalingInfo
PrescalingInfo m_prescalingInfo
Definition: PrescalingEmulationTool.h:55
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60