10#include "CLHEP/Random/RandFlat.h"
11#include "CLHEP/Random/RandLandau.h"
12#include "CLHEP/Random/RandomEngine.h"
20 constexpr double s_standardLandauMPV = -0.22278298;
29 return StatusCode::FAILURE;
39 ATH_MSG_ERROR(
"LandauSigma must be > 0 for TimeDistribution=\"landau\", got "
41 return StatusCode::FAILURE;
45 <<
"\". Allowed values: \"fixed\", \"landau\".");
46 return StatusCode::FAILURE;
71 return StatusCode::SUCCESS;
81 rngWrapper->
setSeed(name(), eventContext);
82 CLHEP::HepRandomEngine* engine = rngWrapper->
getEngine(eventContext);
101 sleepMs = std::max(0.0, sleepMs);
106 const auto duration = std::chrono::duration<double, std::milli>(sleepMs);
110 std::chrono::duration_cast<std::chrono::milliseconds>(duration));
113 std::this_thread::sleep_for(duration);
128 for (
const Decision* previous : *previousDecisionsHandle) {
134 outputDecisions->
size() - 1,
155 return StatusCode::SUCCESS;
162 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
xAOD::TrigComposite Decision
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.
A wrapper class for event-slot-local random engines.
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
size_type size() const noexcept
Returns the number of elements in the collection.
ElementLink implementation for ROOT usage.
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...
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...
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...
HypoBase(const std::string &name, ISvcLocator *pSvcLocator)
constructor, to be called by sub-class constructors
virtual bool isValid() override final
Can the handle be successfully dereferenced?
pointer_type ptr()
Dereference the pointer.
TimeBurner(const std::string &name, ISvcLocator *svcLoc)
Standard constructor.
Gaudi::Property< double > m_landauMPV
virtual StatusCode execute(const EventContext &eventContext) const override
Gaudi::Property< unsigned int > m_sleepTimeMillisec
Gaudi::Property< double > m_maxTimeMs
Gaudi::Property< double > m_acceptFraction
ServiceHandle< IAthRNGSvc > m_rngSvc
Gaudi::Property< bool > m_burnCPU
ToolHandleArray< IAlgTool > m_hypoTools
std::atomic< unsigned long > m_nSeen
virtual StatusCode finalize() override
ServiceHandle< ICPUCrunchSvc > m_cpuCrunchSvc
Gaudi::Property< std::string > m_timeDistribution
std::atomic< unsigned long > m_nAccepted
virtual StatusCode initialize() override
Gaudi::Property< double > m_landauSigma
std::atomic< unsigned long > m_nRejected
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.