5#ifndef TRIGGENERICALGS_TimeBurner_h
6#define TRIGGENERICALGS_TimeBurner_h
10#include "GaudiKernel/IAlgTool.h"
11#include "GaudiKernel/ICPUCrunchSvc.h"
12#include "GaudiKernel/ServiceHandle.h"
41 TimeBurner(
const std::string& name, ISvcLocator* svcLoc);
44 virtual StatusCode
execute(
const EventContext& eventContext)
const override;
45 virtual StatusCode
finalize()
override;
53 this,
"TimeDistribution",
"fixed",
54 "Distribution used to sample the per-event time. Allowed values: "
55 "\"fixed\" (use SleepTimeMillisec), \"landau\" (use LandauMPV/LandauSigma)."
59 this,
"SleepTimeMillisec", 0,
60 "Fixed per-event time [ms]. Used when TimeDistribution == \"fixed\"."
64 this,
"LandauMPV", 105.0,
65 "MPV of the Landau distribution [ms]. "
66 "Used when TimeDistribution == \"landau\"."
70 this,
"LandauSigma", 66.0,
71 "Sigma of the Landau distribution [ms]. "
72 "Used when TimeDistribution == \"landau\"."
76 this,
"AcceptFraction", 0.0,
77 "Probability in [0,1] of accepting an event. Default 0 = reject all."
81 this,
"BurnCPU",
false,
82 "If true, busy-wait (via Gaudi::CPUCrunchSvc) instead of sleeping."
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)."
92 this,
"CPUCrunchSvc",
"CPUCrunchSvc",
93 "Handle to Gaudi CPUCrunchSvc (used when BurnCPU is true)."
98 this,
"AthRNGSvc",
"AthRNGSvc",
99 "Handle to the slot-local random number service."
105 mutable std::atomic<unsigned long>
m_nSeen{0};
HypoBase(const std::string &name, ISvcLocator *pSvcLocator)
constructor, to be called by sub-class constructors
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