ATLAS Offline Software
Loading...
Searching...
No Matches
TimeBurner Class Reference

Hypo algorithm that burns/sleeps for some time per event and optionally accepts events with a configurable probability. More...

#include <TimeBurner.h>

Inheritance diagram for TimeBurner:
Collaboration diagram for TimeBurner:

Public Member Functions

 TimeBurner (const std::string &name, ISvcLocator *svcLoc)
 Standard constructor.
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &eventContext) const override
virtual StatusCode finalize () override
virtual StatusCode sysInitialize () override
 initialise this base class
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static StatusCode runtimeValidation (SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &outputHandle, MsgStream &msg, bool onlyValidateOneStep=true, bool runTwoConversion=false)
 Executes all individual runtime tests.

Protected Member Functions

const SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > & decisionInput () const
 methods for derived classes to access handles of the base class input other read/write handles may be implemented by derived classes
const SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > & decisionOutput () const
 methods for derived classes to access handles of the base class output other read/write handles may be implemented by derived classes
StatusCode hypoBaseOutputProcessing (SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &outputHandle, MSG::Level lvl=MSG::DEBUG) const
 Base class function to be called once slice specific code has finished. Handles debug printing and validation.
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

enum class  TimeDist { Fixed , Landau }
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode printDebugInformation (SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &outputHandle, MSG::Level lvl) const
 Common base function to print information on chains passed by objects considered in the hypo.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

TimeDist m_timeDist {TimeDist::Fixed}
Gaudi::Property< std::string > m_timeDistribution
Gaudi::Property< unsigned int > m_sleepTimeMillisec
Gaudi::Property< double > m_landauMPV
Gaudi::Property< double > m_landauSigma
Gaudi::Property< double > m_acceptFraction
Gaudi::Property< bool > m_burnCPU
Gaudi::Property< double > m_maxTimeMs
ServiceHandle< ICPUCrunchSvc > m_cpuCrunchSvc
ServiceHandle< IAthRNGSvcm_rngSvc
ToolHandleArray< IAlgTool > m_hypoTools {this, "HypoTools", {}}
std::atomic< unsigned long > m_nSeen {0}
std::atomic< unsigned long > m_nAccepted {0}
std::atomic< unsigned long > m_nRejected {0}
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainerm_input { this, "HypoInputDecisions", "UNSPECIFIED_INPUT", "Input Decision (implicit)" }
 input decisions
SG::WriteHandleKey< TrigCompositeUtils::DecisionContainerm_output { this, "HypoOutputDecisions", "UNSPECIFIED_OUTPUT", "Ouput Decision" }
 output decisions
Gaudi::Property< bool > m_runtimeValidation { this, "RuntimeValidation", false, "Enable detailed runtime validation of HypoAlg output, and upstream Decisions." }
 Enabling of detailed validation checks for use during development.
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Runtime validation methods

enum  LogicalFlowCheckMode { kRequireOne , kRequireAll }
static StatusCode validateHasLinks (const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg)
 Ensure all Decisions have the named ElementLink graph edges which they are required to by spec.
static StatusCode validateLogicalFlow (const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg, const LogicalFlowCheckMode mode)
 Ensure that all DecisionIDs have propagated correctly from their parent.
static StatusCode validateDuplicatedDecisionID (const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg)
 Ensure that no space is being wasted by duplicated DecisionIDs in any Decision objects.
static StatusCode validateDecisionIDs (const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg)
 Ensure that all present IDs correspond to configured chains.
static StatusCode validateParentLinking (const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg, bool runTwoConversion)
 Ensure that the Decision has at least one valid parent, unless it is a initial Decision from the HLTSeeding.
static StatusCode recursiveValidateGraph (const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg, bool onlyValidateOneStep, bool runTwoConversion, size_t callDepth, std::set< const TrigCompositeUtils::Decision * > &fullyExploredFrom)
 Execute all checks on one node in the graph, d, then recursive call self on all parent nodes up to L1.
static void printBangs (MsgStream &msg)
 Print header line.
static void printErrorHeader (const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg)
 A problem was found, print common output data.

Detailed Description

Hypo algorithm that burns/sleeps for some time per event and optionally accepts events with a configurable probability.

Per-event duration:

  • Selected by TimeDistribution:
    • "fixed": use the constant SleepTimeMillisec.
    • "landau": sample from a Landau distribution with parameters LandauMPV and LandauSigma (in ms), clipped at 0.
  • If MaxTimeMs > 0 (default 450000), the duration is capped at that value to avoid HLT timeouts.

How time is consumed:

  • If BurnCPU is true, busy-wait via Gaudi::CPUCrunchSvc (consumes CPU).
  • Otherwise, std::this_thread::sleep_for (CPU idle).

Per-event accept decision:

  • Event is accepted with probability AcceptFraction (default 0, i.e. reject all).

Definition at line 38 of file TimeBurner.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ LogicalFlowCheckMode

enum HypoBase::LogicalFlowCheckMode
privateinherited
Enumerator
kRequireOne 

Require all DecisionIDs to be present in at least one of my parent Decision objects.

kRequireAll 

Definition at line 52 of file HypoBase.h.

52 {
54 kRequireAll //<! Require all DecisionIDs to be present in all of my parent Decision objects
55 };
@ kRequireOne
Require all DecisionIDs to be present in at least one of my parent Decision objects.
Definition HypoBase.h:53
@ kRequireAll
Definition HypoBase.h:54

◆ TimeDist

enum class TimeBurner::TimeDist
strongprivate
Enumerator
Fixed 
Landau 

Definition at line 49 of file TimeBurner.h.

49{ Fixed, Landau };

Constructor & Destructor Documentation

◆ TimeBurner()

TimeBurner::TimeBurner ( const std::string & name,
ISvcLocator * svcLoc )

Standard constructor.

Definition at line 23 of file TimeBurner.cxx.

24: ::HypoBase(name, pSvcLocator) {}
HypoBase(const std::string &name, ISvcLocator *pSvcLocator)
constructor, to be called by sub-class constructors
Definition HypoBase.cxx:12

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

62{
63 return 0;
64}

◆ decisionInput()

const SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > & HypoBase::decisionInput ( ) const
protectedinherited

methods for derived classes to access handles of the base class input other read/write handles may be implemented by derived classes

Definition at line 18 of file HypoBase.cxx.

18 {
19 return m_input;
20}
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > m_input
input decisions
Definition HypoBase.h:101

◆ decisionOutput()

const SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > & HypoBase::decisionOutput ( ) const
protectedinherited

methods for derived classes to access handles of the base class output other read/write handles may be implemented by derived classes

Definition at line 22 of file HypoBase.cxx.

22 {
23 return m_output;
24}
SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > m_output
output decisions
Definition HypoBase.h:103

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode TimeBurner::execute ( const EventContext & eventContext) const
overridevirtual

Definition at line 74 of file TimeBurner.cxx.

74 {
75 using namespace TrigCompositeUtils;
76
77 ++m_nSeen;
78
79 // Determine the per-event duration and accept/reject roll.
80 ATHRNG::RNGWrapper* rngWrapper = m_rngSvc->getEngine(this);
81 rngWrapper->setSeed(name(), eventContext);
82 CLHEP::HepRandomEngine* engine = rngWrapper->getEngine(eventContext);
83
84 double sleepMs = 0.0;
85 switch (m_timeDist) {
87 // CLHEP::RandLandau samples the standard Landau. Transforming it to MVP and sigma from properties.
88 sleepMs = m_landauMPV + m_landauSigma * (CLHEP::RandLandau::shoot(engine) - s_standardLandauMPV);
89 break;
90 case TimeDist::Fixed:
91 sleepMs = static_cast<double>(m_sleepTimeMillisec);
92 break;
93 }
94
95 bool accept = false;
96 if (m_acceptFraction > 0.0) {
97 accept = (CLHEP::RandFlat::shoot(engine) < m_acceptFraction);
98 }
99
100 // Landau is unbounded below; clip to non-negative.
101 sleepMs = std::max(0.0, sleepMs);
102 // Optionally cap from above to avoid HLT timeouts.
103 if (m_maxTimeMs > 0.0) {
104 sleepMs = std::min(sleepMs, m_maxTimeMs.value());
105 }
106 const auto duration = std::chrono::duration<double, std::milli>(sleepMs);
107 if (m_burnCPU) {
108 ATH_MSG_DEBUG("Burning CPU for " << sleepMs << " ms");
109 m_cpuCrunchSvc->crunch_for(
110 std::chrono::duration_cast<std::chrono::milliseconds>(duration));
111 } else {
112 ATH_MSG_DEBUG("Sleeping for " << sleepMs << " ms");
113 std::this_thread::sleep_for(duration);
114 }
115
116 // Read the previous-step decisions and create the output decision container.
117 // Since TimeBurner does not produce its own physics object, reproduced
118 // PEBInfoWriterAlg behaviour: attach a dummy self-link into the output
119 // DecisionContainer as the feature, and disable downstream ComboHypo
120 // multiplicity checks.
121 SG::ReadHandle<DecisionContainer> previousDecisionsHandle(decisionInput(),
122 eventContext);
123 ATH_CHECK(previousDecisionsHandle.isValid());
124
125 SG::WriteHandle<DecisionContainer> outputHandle =
126 createAndStore(decisionOutput(), eventContext);
127 DecisionContainer* outputDecisions = outputHandle.ptr();
128 for (const Decision* previous : *previousDecisionsHandle) {
129 Decision* newD =
130 newDecisionIn(outputDecisions, previous, hypoAlgNodeName(), eventContext);
131
132 // Dummy self-link as feature, to satisfy navigation/runtimeValidation.
133 ElementLink<DecisionContainer> dummyLink(*outputDecisions,
134 outputDecisions->size() - 1,
135 eventContext);
136 newD->setObjectLink(featureString(), dummyLink);
137
138 // Disable ComboHypo checks on the output of this terminal step.
139 newD->setDetail<int32_t>("noCombo", 1);
140
141 if (accept) {
142 insertDecisionIDs(previous, newD);
143 }
144 }
145
146 if (accept) {
147 ++m_nAccepted;
148 ATH_MSG_DEBUG("Event accepted");
149 } else {
150 ++m_nRejected;
151 ATH_MSG_DEBUG("Event rejected");
152 }
153
154 ATH_CHECK(hypoBaseOutputProcessing(outputHandle));
155 return StatusCode::SUCCESS;
156}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
Decision * newDecisionIn(DecisionContainer *dc, const std::string &name="")
Helper method to create a Decision object, place it in the container and return a pointer to it.
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
const std::string & hypoAlgNodeName()
xAOD::TrigCompositeContainer DecisionContainer
const std::string & featureString()
void insertDecisionIDs(const Decision *src, Decision *dest)
Appends the decision IDs of src to the dest decision object.
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
Definition RNGWrapper.h:169
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition RNGWrapper.h:134
size_type size() const noexcept
Returns the number of elements in the collection.
const SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > & decisionInput() const
methods for derived classes to access handles of the base class input other read/write handles may be...
Definition HypoBase.cxx:18
const SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > & decisionOutput() const
methods for derived classes to access handles of the base class output other read/write handles may b...
Definition HypoBase.cxx:22
StatusCode hypoBaseOutputProcessing(SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &outputHandle, MSG::Level lvl=MSG::DEBUG) const
Base class function to be called once slice specific code has finished. Handles debug printing and va...
Definition HypoBase.cxx:35
pointer_type ptr()
Dereference the pointer.
Gaudi::Property< double > m_landauMPV
Definition TimeBurner.h:63
Gaudi::Property< unsigned int > m_sleepTimeMillisec
Definition TimeBurner.h:58
TimeDist m_timeDist
Definition TimeBurner.h:50
Gaudi::Property< double > m_maxTimeMs
Definition TimeBurner.h:85
Gaudi::Property< double > m_acceptFraction
Definition TimeBurner.h:75
ServiceHandle< IAthRNGSvc > m_rngSvc
Definition TimeBurner.h:97
Gaudi::Property< bool > m_burnCPU
Definition TimeBurner.h:80
std::atomic< unsigned long > m_nSeen
Definition TimeBurner.h:105
ServiceHandle< ICPUCrunchSvc > m_cpuCrunchSvc
Definition TimeBurner.h:91
std::atomic< unsigned long > m_nAccepted
Definition TimeBurner.h:106
Gaudi::Property< double > m_landauSigma
Definition TimeBurner.h:69
std::atomic< unsigned long > m_nRejected
Definition TimeBurner.h:107
bool setObjectLink(const std::string &name, const ElementLink< CONTAINER > &link)
Set the link to an object.
bool setDetail(const std::string &name, const TYPE &value)
Set an TYPE detail on the object.
StatusCode accept(const xAOD::Muon *mu)

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

88{
89 // If we didn't find any symlinks to add, just return the collection
90 // from the base class. Otherwise, return the extended collection.
91 if (!m_extendedExtraObjects.empty()) {
93 }
95}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ finalize()

StatusCode TimeBurner::finalize ( )
overridevirtual

Definition at line 158 of file TimeBurner.cxx.

158 {
159 ATH_MSG_INFO("Summary: seen=" << m_nSeen.load()
160 << " accepted=" << m_nAccepted.load()
161 << " rejected=" << m_nRejected.load());
162 return StatusCode::SUCCESS;
163}
#define ATH_MSG_INFO(x)

◆ hypoBaseOutputProcessing()

StatusCode HypoBase::hypoBaseOutputProcessing ( SG::WriteHandle< TrigCompositeUtils::DecisionContainer > & outputHandle,
MSG::Level lvl = MSG::DEBUG ) const
protectedinherited

Base class function to be called once slice specific code has finished. Handles debug printing and validation.

Definition at line 35 of file HypoBase.cxx.

35 {
36
37 ATH_CHECK( printDebugInformation(outputHandle, lvl) );
38
40 ATH_CHECK( runtimeValidation(outputHandle, msg()) );
41 }
42
43 return StatusCode::SUCCESS;
44}
StatusCode printDebugInformation(SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &outputHandle, MSG::Level lvl) const
Common base function to print information on chains passed by objects considered in the hypo.
Definition HypoBase.cxx:406
Gaudi::Property< bool > m_runtimeValidation
Enabling of detailed validation checks for use during development.
Definition HypoBase.h:105
static StatusCode runtimeValidation(SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &outputHandle, MsgStream &msg, bool onlyValidateOneStep=true, bool runTwoConversion=false)
Executes all individual runtime tests.
Definition HypoBase.cxx:47

◆ initialize()

StatusCode TimeBurner::initialize ( )
overridevirtual

Definition at line 26 of file TimeBurner.cxx.

26 {
28 ATH_MSG_ERROR("AcceptFraction must be in [0,1], got " << m_acceptFraction);
29 return StatusCode::FAILURE;
30 }
31
32 // Map the TimeDistribution string to the internal enum.
33 // This would make easy to add new distributions in the future.
34 if (m_timeDistribution == "fixed") {
36 } else if (m_timeDistribution == "landau") {
38 if (m_landauSigma <= 0.0) {
39 ATH_MSG_ERROR("LandauSigma must be > 0 for TimeDistribution=\"landau\", got "
40 << m_landauSigma);
41 return StatusCode::FAILURE;
42 }
43 } else {
44 ATH_MSG_ERROR("Unknown TimeDistribution \"" << m_timeDistribution
45 << "\". Allowed values: \"fixed\", \"landau\".");
46 return StatusCode::FAILURE;
47 }
48
49 // we don't actually need the HypoTool
50 for (auto& tool : m_hypoTools) tool.disable();
51
52 // Only retrieve the CPU cruncher if we actually use it.
53 if (m_burnCPU) {
54 ATH_CHECK(m_cpuCrunchSvc.retrieve());
55 }
56
57 ATH_CHECK(m_rngSvc.retrieve());
58
59 ATH_MSG_INFO("TimeDistribution = " << m_timeDistribution);
61 ATH_MSG_INFO("SleepTimeMillisec = " << m_sleepTimeMillisec << " ms");
62 } else {
63 ATH_MSG_INFO("LandauMPV = " << m_landauMPV << " ms");
64 ATH_MSG_INFO("LandauSigma = " << m_landauSigma << " ms");
65 }
66 ATH_MSG_INFO("AcceptFraction = " << m_acceptFraction);
67 ATH_MSG_INFO("BurnCPU = " << (m_burnCPU ? "true (busy-wait)" : "false (sleep)"));
68 ATH_MSG_INFO("MaxTimeMs = " << m_maxTimeMs << " ms"
69 << (m_maxTimeMs > 0.0 ? "" : " (cap disabled)"));
70
71 return StatusCode::SUCCESS;
72}
#define ATH_MSG_ERROR(x)
ToolHandleArray< IAlgTool > m_hypoTools
Definition TimeBurner.h:103
Gaudi::Property< std::string > m_timeDistribution
Definition TimeBurner.h:52

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ printBangs()

void HypoBase::printBangs ( MsgStream & msg)
staticprivateinherited

Print header line.

Definition at line 390 of file HypoBase.cxx.

390 {
391 msg << MSG::ERROR << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endmsg;
392}
#define endmsg

◆ printDebugInformation()

StatusCode HypoBase::printDebugInformation ( SG::WriteHandle< TrigCompositeUtils::DecisionContainer > & outputHandle,
MSG::Level lvl ) const
privateinherited

Common base function to print information on chains passed by objects considered in the hypo.

Definition at line 406 of file HypoBase.cxx.

406 {
407 if (msgLvl(lvl)) {
408 msg() << lvl;
409 msg() << "Exiting with " << outputHandle->size() <<" Decision objects" << endmsg;
410 size_t count = 0;
411 for (const Decision* d : *outputHandle){
412 DecisionIDContainer objDecisions;
413 decisionIDs( d, objDecisions );
414 msg() << "Number of positive decisions for Decision object #" << count++ << ": " << objDecisions.size() << endmsg;
415 for (const TrigCompositeUtils::DecisionID id : objDecisions ) {
416 msg() << " --- Passes: " << HLT::Identifier( id ) << endmsg;
417 }
418 }
419 }
420 return StatusCode::SUCCESS;
421}
bool msgLvl(const MSG::Level lvl) const
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:148
unsigned int DecisionID
std::set< DecisionID > DecisionIDContainer
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.

◆ printErrorHeader()

void HypoBase::printErrorHeader ( const ElementLink< TrigCompositeUtils::DecisionContainer > & dEL,
MsgStream & msg )
staticprivateinherited

A problem was found, print common output data.

Definition at line 395 of file HypoBase.cxx.

397{
399 msg << MSG::ERROR << "! RUNTIME TRIGGER NAVIGATION VALIDATION ERROR" << endmsg;
400 msg << MSG::ERROR << "! Caused by Decision with index:" << (*dEL)->index() << endmsg;
401 msg << MSG::ERROR << "! From collection:" << dEL.dataID() << endmsg;
402 msg << MSG::ERROR << "! " << **dEL << endmsg;
403}
static void printBangs(MsgStream &msg)
Print header line.
Definition HypoBase.cxx:390

◆ recursiveValidateGraph()

StatusCode HypoBase::recursiveValidateGraph ( const ElementLink< TrigCompositeUtils::DecisionContainer > & dEL,
MsgStream & msg,
bool onlyValidateOneStep,
bool runTwoConversion,
size_t callDepth,
std::set< const TrigCompositeUtils::Decision * > & fullyExploredFrom )
staticprivateinherited

Execute all checks on one node in the graph, d, then recursive call self on all parent nodes up to L1.

Definition at line 71 of file HypoBase.cxx.

77{
78 if (onlyValidateOneStep && callDepth > 0) {
79 if ((*dEL)->name() == hypoAlgNodeName()) {
80 // Validation is called from HypoAlg nodes. So if we have reached the _previous_ HypoAlg node, then we have already
81 // validated back from here in the past. Can stop at this point.
82 return StatusCode::SUCCESS;
83 }
84 }
85
86 // Check logical flow at this place in the graph
87 if ((*dEL)->name() == hypoAlgNodeName()) {
88 // Check that all Hypo Decisions produced here satisfy the more-strict all-parent logical flow
89 if ( validateLogicalFlow(dEL, msg, kRequireAll).isFailure() ) {
90 return StatusCode::FAILURE;
91 }
92 } else {
93 // (looser requirement of one-valid-parent-with-decision than we had when we knew that d corresponded to a HypoAlg output)
94 if ( validateLogicalFlow(dEL, msg, kRequireOne).isFailure() ) {
95 return StatusCode::FAILURE;
96 }
97 }
98
99 // Check my IDs
100 if ( validateDecisionIDs(dEL, msg).isFailure() ) {
101 return StatusCode::FAILURE;
102 }
103 if ( validateDuplicatedDecisionID(dEL, msg).isFailure() ) {
104 return StatusCode::FAILURE;
105 }
106
107 // Check my linking
108 if( validateParentLinking(dEL, msg, runTwoConversion).isFailure() ) {
109 return StatusCode::FAILURE;
110 }
111 if ( validateHasLinks(dEL, msg).isFailure() ) {
112 return StatusCode::FAILURE;
113 }
114
115 // Continue upstream
116 const std::vector<ElementLink<DecisionContainer>> seeds = (*dEL)->objectCollectionLinks<DecisionContainer>(seedString());
117 for (const ElementLink<DecisionContainer>& seed : seeds) {
118 if (fullyExploredFrom.count( (*seed) ) == 1) {
119 continue; // Already fully explored from this seed and up
120 }
121 if ( not seed.isValid() ) {
122 msg << MSG::ERROR << "Invalid seed element link in recursiveValidateGraph" << endmsg;
123 return StatusCode::FAILURE;
124 }
125 if ( recursiveValidateGraph(seed, msg, onlyValidateOneStep, runTwoConversion, callDepth + 1, fullyExploredFrom).isFailure() ) {
126 return StatusCode::FAILURE;
127 }
128 }
129
130 fullyExploredFrom.insert( *dEL );
131 return StatusCode::SUCCESS;
132}
static StatusCode validateDecisionIDs(const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg)
Ensure that all present IDs correspond to configured chains.
Definition HypoBase.cxx:209
static StatusCode validateParentLinking(const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg, bool runTwoConversion)
Ensure that the Decision has at least one valid parent, unless it is a initial Decision from the HLTS...
Definition HypoBase.cxx:135
static StatusCode recursiveValidateGraph(const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg, bool onlyValidateOneStep, bool runTwoConversion, size_t callDepth, std::set< const TrigCompositeUtils::Decision * > &fullyExploredFrom)
Execute all checks on one node in the graph, d, then recursive call self on all parent nodes up to L1...
Definition HypoBase.cxx:71
static StatusCode validateHasLinks(const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg)
Ensure all Decisions have the named ElementLink graph edges which they are required to by spec.
Definition HypoBase.cxx:338
static StatusCode validateDuplicatedDecisionID(const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg)
Ensure that no space is being wasted by duplicated DecisionIDs in any Decision objects.
Definition HypoBase.cxx:229
static StatusCode validateLogicalFlow(const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg, const LogicalFlowCheckMode mode)
Ensure that all DecisionIDs have propagated correctly from their parent.
Definition HypoBase.cxx:247
const std::string & hypoAlgNodeName()
const std::string & seedString()

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ runtimeValidation()

StatusCode HypoBase::runtimeValidation ( SG::WriteHandle< TrigCompositeUtils::DecisionContainer > & outputHandle,
MsgStream & msg,
bool onlyValidateOneStep = true,
bool runTwoConversion = false )
staticinherited

Executes all individual runtime tests.

Definition at line 47 of file HypoBase.cxx.

51{
52 // Detailed checks on the output container of this HypoAlg
53 std::set<const Decision*> fullyExploredFrom; // Cache used to avoid exploring regions of the graph more than once
54 for (const Decision* d : *outputHandle) {
55 const DecisionContainer* dContainer = dynamic_cast<const DecisionContainer*>( d->container() );
56 const ElementLink<DecisionContainer> dEL = ElementLink<DecisionContainer>(*dContainer, d->index());
57 if (not dEL.isValid()) {
58 msg << MSG::ERROR << "Invalid seed element link in recursiveValidateGraph" << endmsg;
59 return StatusCode::FAILURE;
60 }
61 // Check that we can reach L1 along all navigation paths up from each Decision
62 // and validate these Decisions on the way up too.
63 if (recursiveValidateGraph(dEL, msg, onlyValidateOneStep, runTwoConversion, 0, fullyExploredFrom).isFailure()) {
64 return StatusCode::FAILURE;
65 }
66 }
67 return StatusCode::SUCCESS;
68}

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

75{
76 return BaseAlg::sysExecute (ctx);
77}

◆ sysInitialize()

StatusCode HypoBase::sysInitialize ( )
overridevirtualinherited

initialise this base class

Reimplemented from AthCommonReentrantAlgorithm< Gaudi::Algorithm >.

Definition at line 26 of file HypoBase.cxx.

26 {
27 CHECK( AthReentrantAlgorithm::sysInitialize() ); // initialise base class
28 CHECK( m_input.initialize() );
29 ATH_MSG_DEBUG("HypoBase::sysInitialize() Will consume decision: " << m_input.key() );
30 CHECK( m_output.initialize() );
31 ATH_MSG_DEBUG("HypoBase::sysInitialize() And produce decision: " << m_output.key() );
32 return StatusCode::SUCCESS;
33}
#define CHECK(...)
Evaluate an expression and check for errors.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

◆ validateDecisionIDs()

StatusCode HypoBase::validateDecisionIDs ( const ElementLink< TrigCompositeUtils::DecisionContainer > & dEL,
MsgStream & msg )
staticprivateinherited

Ensure that all present IDs correspond to configured chains.

Definition at line 209 of file HypoBase.cxx.

211{
212 // All numeric IDs must correspond to a know, configured, HLT chain
213 DecisionIDContainer decisionIDSet;
214 decisionIDs(*dEL, decisionIDSet);
215 for (const DecisionID id : decisionIDSet) {
216 const std::string chain = HLT::Identifier( id ).name();
217 if (!isChainId(chain) and !isLegId(chain)) {
218 printErrorHeader(dEL, msg);
219 msg << MSG::ERROR << "! Decision contains an ID which does not correspond to a configured chain or a configured chain-leg: " << HLT::Identifier( id ) << endmsg;
220 msg << MSG::ERROR << "! SOLUTION: Locate the producer of the collection, investigate how this bad ID could have been added." << endmsg;
222 return StatusCode::FAILURE;
223 }
224 }
225 return StatusCode::SUCCESS;
226}
static void printErrorHeader(const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg)
A problem was found, print common output data.
Definition HypoBase.cxx:395
bool isChainId(const HLT::Identifier &chainIdentifier)
Recognise whether the HLT identifier corresponds to a whole chain.
bool isLegId(const HLT::Identifier &legIdentifier)
Recognise whether the chain ID is a leg ID.

◆ validateDuplicatedDecisionID()

StatusCode HypoBase::validateDuplicatedDecisionID ( const ElementLink< TrigCompositeUtils::DecisionContainer > & dEL,
MsgStream & msg )
staticprivateinherited

Ensure that no space is being wasted by duplicated DecisionIDs in any Decision objects.

Definition at line 229 of file HypoBase.cxx.

231{
232 // Persistent vector storage does not guarantee against duplicate entries
233 DecisionIDContainer decisionIDSet;
234 decisionIDs(*dEL, decisionIDSet);
235 if (decisionIDSet.size() != (*dEL)->decisions().size()) {
236 printErrorHeader(dEL, msg);
237 msg << MSG::ERROR << "! Decision contains duplicate DecisionIDs." << endmsg;
238 msg << MSG::ERROR << "! SOLUTION: If combining DecisionIDs from multiple parents, de-duplicate the internal std::vector<DecisionID> of 'Decision* d' with:" << endmsg;
239 msg << MSG::ERROR << "! TrigCompositeUtils::insertDecisionIDs(DecisionIDContainer(), d);" << endmsg;
241 return StatusCode::FAILURE;
242 }
243 return StatusCode::SUCCESS;
244}

◆ validateHasLinks()

StatusCode HypoBase::validateHasLinks ( const ElementLink< TrigCompositeUtils::DecisionContainer > & dEL,
MsgStream & msg )
staticprivateinherited

Ensure all Decisions have the named ElementLink graph edges which they are required to by spec.

Definition at line 338 of file HypoBase.cxx.

340{
341 const std::string& name = (*dEL)->name();
342 if (name == hypoAlgNodeName()) {
343
344 // Check that I have a "feature"
345 if ((*dEL)->hasObjectLink( featureString() )) {
346 return StatusCode::SUCCESS;
347 }
348 printErrorHeader(dEL, msg);
349 msg << MSG::ERROR << "! Decision has no '" << featureString() << "' ElementLink." << endmsg;
350 msg << MSG::ERROR << "! Every Decision created by a HypoAlg must correspond to some physics object, and be linked to the object." << endmsg;
351 msg << MSG::ERROR << "! SOLUTION: Ensure that all produced Decision objects are assigned their feature:" << endmsg;
352 msg << MSG::ERROR << "! SOLUTION: decision->setObjectLink<MY_FEATURE_CONTANER_TYPE>(featureString(), MY_FEATURE_ELEMENT_LINK);" << endmsg;
354 return StatusCode::FAILURE;
355
356 } else if (name == inputMakerNodeName()) {
357
358 // This requirement is dropped for empty input makers to avoid unnecessary graph clutter.
359 bool exempt = false;
360 if ((*dEL)->hasDetail<int32_t>("isEmpty") and (*dEL)->getDetail<int32_t>("isEmpty") == 1) {
361 exempt = true;
362 }
363
364 if (not (*dEL)->hasObjectLink( roiString() ) and not exempt) {
365 printErrorHeader(dEL, msg);
366 msg << MSG::ERROR << "! Decision has no '" << roiString() << "' ElementLink." << endmsg;
367 msg << MSG::ERROR << "! Every Decision created by a InputMaker must link to the ROI which reconstruction will run on for that Decision object in this Step." << endmsg;
368 msg << MSG::ERROR << "! It can be the FullScan ROI created by the HLTSeeding (FSNOSEED) if no other suitable ROI exists." << endmsg;
369 msg << MSG::ERROR << "! SOLUTION: Check the configuration of InputMakerForRoI or EventViewCreatorAlgorithm responsible for creating this Decision Object" << endmsg;
370 msg << MSG::ERROR << "! SOLUTION: The algorithm must have an ROITool which must attach an '"<< roiString() <<"' link to each Decision Object" << endmsg;
372 }
373
374 } else if (name == hltSeedingNodeName()) {
375
376 if (not (*dEL)->hasObjectLink( initialRoIString() )) {
377 printErrorHeader(dEL, msg);
378 msg << MSG::ERROR << "! Decision has no '" << initialRoIString() << "' ElementLink." << endmsg;
379 msg << MSG::ERROR << "! Every Decision created by the HLTSeeding must link to the initial ROI which caused it to be created." << endmsg;
380 msg << MSG::ERROR << "! This includes the Decision Object created to represent the Full-Scan/NoSeed (FSNOSEED) ROI." << endmsg;
381 msg << MSG::ERROR << "! SOLUTION: Check the configuration of the HLTSeeding tool responsible for creating this Decision Object" << endmsg;
383 }
384
385 }
386 return StatusCode::SUCCESS;
387}
const std::string & inputMakerNodeName()
const std::string & roiString()
const std::string & featureString()
const std::string & initialRoIString()
const std::string & hltSeedingNodeName()

◆ validateLogicalFlow()

StatusCode HypoBase::validateLogicalFlow ( const ElementLink< TrigCompositeUtils::DecisionContainer > & dEL,
MsgStream & msg,
const LogicalFlowCheckMode mode )
staticprivateinherited

Ensure that all DecisionIDs have propagated correctly from their parent.

Definition at line 247 of file HypoBase.cxx.

250{
251 // Do not need to validate for L1 Decisions as these have no parents
252 if ((*dEL)->name() == hltSeedingNodeName()) {
253 return StatusCode::SUCCESS;
254 }
255
256 // Get all my passed DecisionIDs
257 DecisionIDContainer decisionIDSet;
258 decisionIDs(*dEL, decisionIDSet);
259 const std::vector<ElementLink<DecisionContainer>> seeds = (*dEL)->objectCollectionLinks<DecisionContainer>(seedString());
260 for (const DecisionID id : decisionIDSet) {
261 // For each chain that I'm passing, check how many of my parents were also passing the chain
262 size_t parentsWithDecision = 0;
263 for (const ElementLink<DecisionContainer>& seed : seeds) {
264 if ( not seed.isValid() ) {
265 msg << MSG::ERROR << "Invalid seed element link in recursiveValidateGraph" << endmsg;
266 return StatusCode::FAILURE;
267 }
268 DecisionIDContainer seedIDSet;
269 decisionIDs(*seed, seedIDSet);
270 // Id may be a chain-ID (represents a whole chain) or a leg-ID (represents just a single leg of a multi-leg chain)
271 // Is ID is in this parent's set of passed IDs?
272 // Or, (if ID is a leg-ID) is the chain-ID of leg-ID in the parent's set of passed IDs?
273 if (passed(id, seedIDSet) or passed(getIDFromLeg(id).numeric(), seedIDSet)) {
274 ++parentsWithDecision;
275 }
276 else{ // Or, for each of the seed IDs, if the seed ID is a leg-ID, is the seed chain-ID of the seed leg-ID the same as ID?
277 for (auto sid: seedIDSet){
278 if (getIDFromLeg(sid).numeric() == id){
279 ++parentsWithDecision;
280 break;
281 }
282 }
283 }
284 }
285
286 if (mode == kRequireOne && parentsWithDecision == 0) {
287 // InputMakers may merge multiple of their input collections in order to run reconstruction on a common set of ROI (for example)
288 // So the DecisionIDs may have come from any one or more of the inputs. But zero is not allowed.
289 printErrorHeader(dEL, msg);
290 msg << MSG::ERROR << "! This Decision object is not respecting logical flow of DecisionIDs for chain: " << HLT::Identifier( id ) << endmsg;
291 msg << MSG::ERROR << "! This chain's DecisionID can not be found in any parents of this Decision object:" << endmsg;
292 size_t seed_n = 0;
293 for (const ElementLink<DecisionContainer>& seed : seeds) {
294 msg << MSG::ERROR << "! Index:" << (*seed)->index() << " from collection:" << seed.dataID() << endmsg;
295 msg << MSG::ERROR << "! " << **seed << endmsg;
296 DecisionIDContainer objDecisions;
297 decisionIDs(*seed, objDecisions);
298 for (const TrigCompositeUtils::DecisionID id : objDecisions ) {
299 msg << "! --- Passing in parent #" << seed_n << ": " << HLT::Identifier( id ) << endmsg;
300 }
301 ++seed_n;
302 }
303 msg << MSG::ERROR << "! SOLUTION: Ensure that the producer of this Decision object only adds DecisionIDs"
304 " which were present in at least one of its parents." << endmsg;
306 return StatusCode::FAILURE;
307 } else if (mode == kRequireAll && parentsWithDecision != seeds.size()) {
308 // HypoAlgs may form a new physics object from multiple objects in the previous step
309 // (think a BPhysics object whose parents are two Decisions which each correspond to a different L1 MU RoI,
310 // both ROI need to be in active state for the chain, if the chain's HypoTool considers the BPhysics object)
311 // This case requires *all* of the physics objects which are being combined together to be active for the chain
312 // in order to preserve logical flow
313 printErrorHeader(dEL, msg);
314 msg << MSG::ERROR << "! This Decision object is not respecting logical flow of DecisionIDs for chain: " << HLT::Identifier( id ) << endmsg;
315 msg << MSG::ERROR << "! As this Decision object represents the output of a HypoAlg, it must respect logical flow on all "
316 << seeds.size() << " of its parent(s):" << endmsg;
317 size_t seed_n = 0;
318 for (const ElementLink<DecisionContainer>& seed : seeds) {
319 msg << MSG::ERROR << "! Index:" << (*seed)->index() << " from collection:" << seed.dataID() << endmsg;
320 msg << MSG::ERROR << "! " << **seed << endmsg;
321 DecisionIDContainer objDecisions;
322 decisionIDs(*seed, objDecisions);
323 for (const TrigCompositeUtils::DecisionID id : objDecisions ) {
324 msg << "! --- Passing in parent #" << seed_n << ": " << HLT::Identifier( id ) << endmsg;
325 }
326 ++seed_n;
327 }
328 msg << MSG::ERROR << "! SOLUTION: Ensure that the HypoTool responsible for " << HLT::Identifier( id )
329 << " in this HypoAlg only runs if this ID is present in all parent decisions." << endmsg;
331 return StatusCode::FAILURE;
332 }
333 }
334 return StatusCode::SUCCESS;
335}
HLT::Identifier getIDFromLeg(const HLT::Identifier &legIdentifier)
Generate the HLT::Identifier which corresponds to the chain name from the leg name.
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container

◆ validateParentLinking()

StatusCode HypoBase::validateParentLinking ( const ElementLink< TrigCompositeUtils::DecisionContainer > & dEL,
MsgStream & msg,
bool runTwoConversion )
staticprivateinherited

Ensure that the Decision has at least one valid parent, unless it is a initial Decision from the HLTSeeding.

Definition at line 135 of file HypoBase.cxx.

138{
139 const std::vector<ElementLink<DecisionContainer>> seeds = (*dEL)->objectCollectionLinks<DecisionContainer>(seedString());
140 // All Decision object must have at least one parent, unless they are the initial set of objects created by the HLTSeeding
141 const std::string& name = (*dEL)->name();
142 if (seeds.size() == 0 && name != hltSeedingNodeName()) {
143 printErrorHeader(dEL, msg);
144 msg << MSG::ERROR << "! Decision has zero parents. This is only allowed for the initial Decisions created by the HLTSeeding." << endmsg;
145 msg << MSG::ERROR << "! SOLUTION: Attach parent Decision(s) with TrigCompositeUtils::linkToPrevious" << endmsg;
147 return StatusCode::FAILURE;
148 }
149
150 if (name == hltSeedingNodeName()) {
151 if (seeds.size() > 0) {
152 printErrorHeader(dEL, msg);
153 msg << MSG::ERROR << "! Decision has parents. This is not allowed for the initial Decisions created by the HLTSeeding." << endmsg;
154 msg << MSG::ERROR << "! SOLUTION: Check HLTSeeding, no where should it be adding a parent link." << endmsg;
156 return StatusCode::FAILURE;
157 }
158 return StatusCode::SUCCESS;
159 }
160
161 static const std::set<std::string> expectedParentsFilter = {hypoAlgNodeName(), comboHypoAlgNodeName(), hltSeedingNodeName()};
162 static const std::set<std::string> expectedParentsInputMaker = {filterNodeName()};
163 static const std::set<std::string> expectedParentsHypoAlg = {inputMakerNodeName()};
164 static const std::set<std::string> expectedParentsComboHypoAlg = {hypoAlgNodeName(), inputMakerNodeName(), hltSeedingNodeName()}; // TODO check hltSeedingNodeName(), needed for newJO
165 static const std::set<std::string> expectedParentsSummaryFilter = {hypoAlgNodeName(), comboHypoAlgNodeName(), hltSeedingNodeName()};
166 static const std::set<std::string> expectedParentsSummaryPassed = {summaryFilterNodeName()};
167
168 const std::set<std::string>* expectedParentsPtr = nullptr;
169 if (name == filterNodeName()) {
170 expectedParentsPtr = &expectedParentsFilter;
171 } else if (name == inputMakerNodeName() and !runTwoConversion) {
172 expectedParentsPtr = &expectedParentsInputMaker;
173 } else if (name == inputMakerNodeName() and runTwoConversion) {
174 expectedParentsPtr = &expectedParentsFilter; // We don't have Filter nodes in the R2->R3 conversion
175 } else if (name == hypoAlgNodeName()) {
176 expectedParentsPtr = &expectedParentsHypoAlg;
177 } else if (name == comboHypoAlgNodeName()) {
178 expectedParentsPtr = &expectedParentsComboHypoAlg;
179 } else if (name == summaryFilterNodeName()) {
180 expectedParentsPtr = &expectedParentsSummaryFilter;
181 } else if (name == summaryPassNodeName()) {
182 expectedParentsPtr = &expectedParentsSummaryPassed;
183 } else {
184 printErrorHeader(dEL, msg);
185 msg << MSG::ERROR << "! Invalid Node name '" << name << "'." << endmsg;
186 msg << MSG::ERROR << "! SOLUTION: Find the alg which made a node with this name. Allowed named may be found in TrigCompositeUtils.h, See:'Constant string literals used within the HLT'." << endmsg;
188 return StatusCode::FAILURE;
189 }
190
191 for (const ElementLink<DecisionContainer>& seed : seeds) {
192 if (!expectedParentsPtr->contains( (*seed)->name() )) {
193 printErrorHeader(dEL, msg);
194 msg << MSG::ERROR << "! Invalid linking from node with name '" << name << "' to one with name '"<< (*seed)->name() << "'." << endmsg;
195 msg << MSG::ERROR << "! Allowed seed names are:" << endmsg;
196 for (const std::string& allowed : *expectedParentsPtr) {
197 msg << MSG::ERROR << "! " << allowed << endmsg;
198 }
199 msg << MSG::ERROR << "! SOLUTION: Find where this invalid parent was added and correct it." << endmsg;
201 return StatusCode::FAILURE;
202 }
203 }
204
205 return StatusCode::SUCCESS;
206}
const std::string & summaryFilterNodeName()
const std::string & filterNodeName()
const std::string & comboHypoAlgNodeName()
const std::string & summaryPassNodeName()

Member Data Documentation

◆ m_acceptFraction

Gaudi::Property<double> TimeBurner::m_acceptFraction
private
Initial value:
{
this, "AcceptFraction", 0.0,
"Probability in [0,1] of accepting an event. Default 0 = reject all."
}

Definition at line 75 of file TimeBurner.h.

75 {
76 this, "AcceptFraction", 0.0,
77 "Probability in [0,1] of accepting an event. Default 0 = reject all."
78 };

◆ m_burnCPU

Gaudi::Property<bool> TimeBurner::m_burnCPU
private
Initial value:
{
this, "BurnCPU", false,
"If true, busy-wait (via Gaudi::CPUCrunchSvc) instead of sleeping."
}

Definition at line 80 of file TimeBurner.h.

80 {
81 this, "BurnCPU", false,
82 "If true, busy-wait (via Gaudi::CPUCrunchSvc) instead of sleeping."
83 };

◆ m_cpuCrunchSvc

ServiceHandle<ICPUCrunchSvc> TimeBurner::m_cpuCrunchSvc
private
Initial value:
{
this, "CPUCrunchSvc", "CPUCrunchSvc",
"Handle to Gaudi CPUCrunchSvc (used when BurnCPU is true)."
}

Definition at line 91 of file TimeBurner.h.

91 {
92 this, "CPUCrunchSvc", "CPUCrunchSvc",
93 "Handle to Gaudi CPUCrunchSvc (used when BurnCPU is true)."
94 };

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_hypoTools

ToolHandleArray<IAlgTool> TimeBurner::m_hypoTools {this, "HypoTools", {}}
private

Definition at line 103 of file TimeBurner.h.

103{this, "HypoTools", {}};

◆ m_input

SG::ReadHandleKey<TrigCompositeUtils::DecisionContainer> HypoBase::m_input { this, "HypoInputDecisions", "UNSPECIFIED_INPUT", "Input Decision (implicit)" }
privateinherited

input decisions

Definition at line 101 of file HypoBase.h.

101{ this, "HypoInputDecisions", "UNSPECIFIED_INPUT", "Input Decision (implicit)" };

◆ m_landauMPV

Gaudi::Property<double> TimeBurner::m_landauMPV
private
Initial value:
{
this, "LandauMPV", 105.0,
"MPV of the Landau distribution [ms]. "
"Used when TimeDistribution == \"landau\"."
}

Definition at line 63 of file TimeBurner.h.

63 {
64 this, "LandauMPV", 105.0,
65 "MPV of the Landau distribution [ms]. "
66 "Used when TimeDistribution == \"landau\"."
67 };

◆ m_landauSigma

Gaudi::Property<double> TimeBurner::m_landauSigma
private
Initial value:
{
this, "LandauSigma", 66.0,
"Sigma of the Landau distribution [ms]. "
"Used when TimeDistribution == \"landau\"."
}

Definition at line 69 of file TimeBurner.h.

69 {
70 this, "LandauSigma", 66.0,
71 "Sigma of the Landau distribution [ms]. "
72 "Used when TimeDistribution == \"landau\"."
73 };

◆ m_maxTimeMs

Gaudi::Property<double> TimeBurner::m_maxTimeMs
private
Initial value:
{
this, "MaxTimeMs", 450000.0,
"Upper bound on the per-event time [ms]. Set to <= 0 to disable the cap (e.g. to deliberately generate HLT timeouts)."
}

Definition at line 85 of file TimeBurner.h.

85 {
86 this, "MaxTimeMs", 450000.0,
87 "Upper bound on the per-event time [ms]. Set to <= 0 to disable the cap (e.g. to deliberately generate HLT timeouts)."
88 };

◆ m_nAccepted

std::atomic<unsigned long> TimeBurner::m_nAccepted {0}
mutableprivate

Definition at line 106 of file TimeBurner.h.

106{0};

◆ m_nRejected

std::atomic<unsigned long> TimeBurner::m_nRejected {0}
mutableprivate

Definition at line 107 of file TimeBurner.h.

107{0};

◆ m_nSeen

std::atomic<unsigned long> TimeBurner::m_nSeen {0}
mutableprivate

Definition at line 105 of file TimeBurner.h.

105{0};

◆ m_output

SG::WriteHandleKey<TrigCompositeUtils::DecisionContainer> HypoBase::m_output { this, "HypoOutputDecisions", "UNSPECIFIED_OUTPUT", "Ouput Decision" }
privateinherited

output decisions

Definition at line 103 of file HypoBase.h.

103{ this, "HypoOutputDecisions", "UNSPECIFIED_OUTPUT", "Ouput Decision" };

◆ m_rngSvc

ServiceHandle<IAthRNGSvc> TimeBurner::m_rngSvc
private
Initial value:
{
this, "AthRNGSvc", "AthRNGSvc",
"Handle to the slot-local random number service."
}

Definition at line 97 of file TimeBurner.h.

97 {
98 this, "AthRNGSvc", "AthRNGSvc",
99 "Handle to the slot-local random number service."
100 };

◆ m_runtimeValidation

Gaudi::Property<bool> HypoBase::m_runtimeValidation { this, "RuntimeValidation", false, "Enable detailed runtime validation of HypoAlg output, and upstream Decisions." }
privateinherited

Enabling of detailed validation checks for use during development.

Definition at line 105 of file HypoBase.h.

105{ this, "RuntimeValidation", false, "Enable detailed runtime validation of HypoAlg output, and upstream Decisions." };

◆ m_sleepTimeMillisec

Gaudi::Property<unsigned int> TimeBurner::m_sleepTimeMillisec
private
Initial value:
{
this, "SleepTimeMillisec", 0,
"Fixed per-event time [ms]. Used when TimeDistribution == \"fixed\"."
}

Definition at line 58 of file TimeBurner.h.

58 {
59 this, "SleepTimeMillisec", 0,
60 "Fixed per-event time [ms]. Used when TimeDistribution == \"fixed\"."
61 };

◆ m_timeDist

TimeDist TimeBurner::m_timeDist {TimeDist::Fixed}
private

Definition at line 50 of file TimeBurner.h.

◆ m_timeDistribution

Gaudi::Property<std::string> TimeBurner::m_timeDistribution
private
Initial value:
{
this, "TimeDistribution", "fixed",
"Distribution used to sample the per-event time. Allowed values: "
"\"fixed\" (use SleepTimeMillisec), \"landau\" (use LandauMPV/LandauSigma)."
}

Definition at line 52 of file TimeBurner.h.

52 {
53 this, "TimeDistribution", "fixed",
54 "Distribution used to sample the per-event time. Allowed values: "
55 "\"fixed\" (use SleepTimeMillisec), \"landau\" (use LandauMPV/LandauSigma)."
56 };

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: