ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAlgorithms
TrigGenericAlgs
src
TimeBurner.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef TRIGGENERICALGS_TimeBurner_h
6
#define TRIGGENERICALGS_TimeBurner_h
7
8
#include "
AthenaKernel/IAthRNGSvc.h
"
9
#include "
DecisionHandling/HypoBase.h
"
10
#include "GaudiKernel/IAlgTool.h"
11
#include "GaudiKernel/ICPUCrunchSvc.h"
12
#include "GaudiKernel/ServiceHandle.h"
13
14
#include <atomic>
15
#include <string>
16
38
class
TimeBurner
:
public
HypoBase
{
39
public
:
41
TimeBurner
(
const
std::string& name, ISvcLocator* svcLoc);
42
43
virtual
StatusCode
initialize
()
override
;
44
virtual
StatusCode
execute
(
const
EventContext& eventContext)
const override
;
45
virtual
StatusCode
finalize
()
override
;
46
47
private
:
48
// Internal enum mapped from the TimeDistribution string property.
49
enum class
TimeDist
{
Fixed
,
Landau
};
50
TimeDist
m_timeDist
{
TimeDist::Fixed
};
51
52
Gaudi::Property<std::string>
m_timeDistribution
{
53
this
,
"TimeDistribution"
,
"fixed"
,
54
"Distribution used to sample the per-event time. Allowed values: "
55
"\"fixed\" (use SleepTimeMillisec), \"landau\" (use LandauMPV/LandauSigma)."
56
};
57
58
Gaudi::Property<unsigned int>
m_sleepTimeMillisec
{
59
this
,
"SleepTimeMillisec"
, 0,
60
"Fixed per-event time [ms]. Used when TimeDistribution == \"fixed\"."
61
};
62
63
Gaudi::Property<double>
m_landauMPV
{
64
this
,
"LandauMPV"
, 105.0,
65
"MPV of the Landau distribution [ms]. "
66
"Used when TimeDistribution == \"landau\"."
67
};
68
69
Gaudi::Property<double>
m_landauSigma
{
70
this
,
"LandauSigma"
, 66.0,
71
"Sigma of the Landau distribution [ms]. "
72
"Used when TimeDistribution == \"landau\"."
73
};
74
75
Gaudi::Property<double>
m_acceptFraction
{
76
this
,
"AcceptFraction"
, 0.0,
77
"Probability in [0,1] of accepting an event. Default 0 = reject all."
78
};
79
80
Gaudi::Property<bool>
m_burnCPU
{
81
this
,
"BurnCPU"
,
false
,
82
"If true, busy-wait (via Gaudi::CPUCrunchSvc) instead of sleeping."
83
};
84
85
Gaudi::Property<double>
m_maxTimeMs
{
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
};
89
90
// Gaudi service that does a calibrated CPU-burning loop.
91
ServiceHandle<ICPUCrunchSvc>
m_cpuCrunchSvc
{
92
this
,
"CPUCrunchSvc"
,
"CPUCrunchSvc"
,
93
"Handle to Gaudi CPUCrunchSvc (used when BurnCPU is true)."
94
};
95
96
// Slot-local random engines (thread-safe by construction).
97
ServiceHandle<IAthRNGSvc>
m_rngSvc
{
98
this
,
"AthRNGSvc"
,
"AthRNGSvc"
,
99
"Handle to the slot-local random number service."
100
};
101
102
// Unused dummy property to pass duck-test of HypoAlgs
103
ToolHandleArray<IAlgTool>
m_hypoTools
{
this
,
"HypoTools"
, {}};
104
105
mutable
std::atomic<unsigned long>
m_nSeen
{0};
106
mutable
std::atomic<unsigned long>
m_nAccepted
{0};
107
mutable
std::atomic<unsigned long>
m_nRejected
{0};
108
};
109
110
#endif
// TRIGGENERICALGS_TimeBurner_h
HypoBase.h
IAthRNGSvc.h
HypoBase::HypoBase
HypoBase(const std::string &name, ISvcLocator *pSvcLocator)
constructor, to be called by sub-class constructors
Definition
HypoBase.cxx:12
ServiceHandle
Definition
ClusterMakerTool.h:36
TimeBurner::TimeBurner
TimeBurner(const std::string &name, ISvcLocator *svcLoc)
Standard constructor.
Definition
TimeBurner.cxx:23
TimeBurner::m_landauMPV
Gaudi::Property< double > m_landauMPV
Definition
TimeBurner.h:63
TimeBurner::TimeDist
TimeDist
Definition
TimeBurner.h:49
TimeBurner::TimeDist::Fixed
@ Fixed
Definition
TimeBurner.h:49
TimeBurner::TimeDist::Landau
@ Landau
Definition
TimeBurner.h:49
TimeBurner::execute
virtual StatusCode execute(const EventContext &eventContext) const override
Definition
TimeBurner.cxx:74
TimeBurner::m_sleepTimeMillisec
Gaudi::Property< unsigned int > m_sleepTimeMillisec
Definition
TimeBurner.h:58
TimeBurner::m_timeDist
TimeDist m_timeDist
Definition
TimeBurner.h:50
TimeBurner::m_maxTimeMs
Gaudi::Property< double > m_maxTimeMs
Definition
TimeBurner.h:85
TimeBurner::m_acceptFraction
Gaudi::Property< double > m_acceptFraction
Definition
TimeBurner.h:75
TimeBurner::m_rngSvc
ServiceHandle< IAthRNGSvc > m_rngSvc
Definition
TimeBurner.h:97
TimeBurner::m_burnCPU
Gaudi::Property< bool > m_burnCPU
Definition
TimeBurner.h:80
TimeBurner::m_hypoTools
ToolHandleArray< IAlgTool > m_hypoTools
Definition
TimeBurner.h:103
TimeBurner::m_nSeen
std::atomic< unsigned long > m_nSeen
Definition
TimeBurner.h:105
TimeBurner::finalize
virtual StatusCode finalize() override
Definition
TimeBurner.cxx:158
TimeBurner::m_cpuCrunchSvc
ServiceHandle< ICPUCrunchSvc > m_cpuCrunchSvc
Definition
TimeBurner.h:91
TimeBurner::m_timeDistribution
Gaudi::Property< std::string > m_timeDistribution
Definition
TimeBurner.h:52
TimeBurner::m_nAccepted
std::atomic< unsigned long > m_nAccepted
Definition
TimeBurner.h:106
TimeBurner::initialize
virtual StatusCode initialize() override
Definition
TimeBurner.cxx:26
TimeBurner::m_landauSigma
Gaudi::Property< double > m_landauSigma
Definition
TimeBurner.h:69
TimeBurner::m_nRejected
std::atomic< unsigned long > m_nRejected
Definition
TimeBurner.h:107
Generated on
for ATLAS Offline Software by
1.17.0