|
ATLAS Offline Software
|
Used to calculate the rate for a single trigger at L1 or the HLT.
More...
#include <RatesTrigger.h>
|
| RatesTrigger (const std::string &name, IMessageSvc *log, const double prescale=1., const double expressPrescale=-1, const std::string &seedName="", const double seedPrecale=1., const bool doHistograms=true, const ExtrapStrat_t extrapolation=ExtrapStrat_t::kLINEAR) |
| Construct new RatesTrigger to enumerate the rate for a single L1 or HLT trigger Provide pass/fail information to RatesGroups which this trigger is part of. More...
|
|
| ~RatesTrigger () |
|
| RatesTrigger (const RatesTrigger &)=delete |
|
RatesTrigger & | operator= (const RatesTrigger &)=delete |
|
virtual void | reset () |
| If I was used in an event, reset me. More...
|
|
void | setSeedsFromRandom (const bool i) |
| Set if this trigger is to behave as if it seeds from a random L1 item. More...
|
|
void | setPassed (const bool passed=true, const bool active=true, const bool unbiasedEvent=false) |
| Set the pass/fail bool. More...
|
|
void | setPassedAndExecute (const bool passed, const bool active, const WeightingValuesSummary_t &weights) |
| Set the pass/fail bool and immediately call execute. More...
|
|
virtual void | execute (const WeightingValuesSummary_t &weights) |
| Execute trigger rate emulation. More...
|
|
size_t | getSeedHash () const |
|
const std::string & | getSeedName () const |
| Get the name of the seed of this trigger. More...
|
|
double | getSeedPrescale () const |
| Get the prescale of the seed of this trigger. More...
|
|
size_t | getHash () const |
| Get the hash of the name of this trigger. More...
|
|
const std::string & | getName () const |
| Get the name of this trigger. More...
|
|
double | getPrescale (const bool includeExpress=false) const |
| Gets the triggers prescale. More...
|
|
bool | getPassed () const |
| If the trigger passed in the event. More...
|
|
bool | getActive () const |
| If the trigger passed in the event. More...
|
|
bool | getDisabled () const |
| If I or my seed were prescaled out. More...
|
|
void | setUniqueGroup (const RatesGroup *unique) |
| If I have a group which is calculating my unique rate. More...
|
|
void | setCoherentFactor (const double lowestCommonPrescale) |
| If i'm in a CPS group, set the lowest commons PS factor of the group. More...
|
|
void | setCPS (const std::string &group) |
| If I'm in a CPS group, set the group name (I'll keep a copy of the hash) More...
|
|
size_t | getCPSID () const |
| Get the hash of my CPS group name. More...
|
|
double | getCoherentFactor () const |
| Get the lowest common prescale factor of all triggers in my CPS group. More...
|
|
const std::string | printConfig () const |
| Prints the RatesTrigger's configuration. More...
|
|
virtual const std::string | printRate (const double ratesDenominator) const |
| Prints the RatesTrigger's rate. More...
|
|
const std::string | printExpressRate (const double ratesDenominator) const |
| Prints the RatesTrigger's express rate. More...
|
|
StatusCode | giveMuHist (const ServiceHandle< ITHistSvc > &svc, const std::string &name) |
|
StatusCode | giveTrainHist (const ServiceHandle< ITHistSvc > &svc, const std::string &name) |
|
StatusCode | giveDataHist (const ServiceHandle< ITHistSvc > &svc, const std::string &name) |
|
void | clearTrainHist () |
| In some jobs we don't want to do the rates vs. More...
|
|
TH1 * | getDataHist () |
|
bool | doHistograms () const |
| If histogramming was enabled in this rates object. More...
|
|
const std::string & | getExtrapolationFactorString (ExtrapStrat_t strat) const |
|
double | getExtrapolationFactor (const WeightingValuesSummary_t &weights, const ExtrapStrat_t strat) const |
|
bool | msgLvl (const MSG::Level lvl) const |
| Test the output level. More...
|
|
MsgStream & | msg () const |
| The standard message stream. More...
|
|
MsgStream & | msg (const MSG::Level lvl) const |
| The standard message stream. More...
|
|
void | setLevel (MSG::Level lvl) |
| Change the current logging level. More...
|
|
|
std::string | m_nm |
| Message source name. More...
|
|
boost::thread_specific_ptr< MsgStream > | m_msg_tls |
| MsgStream instance (a std::cout like with print-out levels) More...
|
|
std::atomic< IMessageSvc * > | m_imsg { nullptr } |
| MessageSvc pointer. More...
|
|
std::atomic< MSG::Level > | m_lvl { MSG::NIL } |
| Current logging level. More...
|
|
std::atomic_flag m_initialized | ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
| Messaging initialized (initMessaging) More...
|
|
Used to calculate the rate for a single trigger at L1 or the HLT.
Definition at line 15 of file RatesTrigger.h.
◆ RatesTrigger() [1/2]
Construct new RatesTrigger to enumerate the rate for a single L1 or HLT trigger Provide pass/fail information to RatesGroups which this trigger is part of.
- Parameters
-
name | Name of the trigger |
msgSvc | Reference to message service |
prescale | The prescale of the trigger. Anything < 1 is considered disabled |
expressPrescale | If the trigger is HLT and in the express group, its express prescale. Otherwise set = 0 |
seedName | The name of any L1 seed the trigger has, leave blank if L1 item / no L1 seed. |
seedPrescale | The prescale of any L1 seed. Leave = 1 if no L1 seed. |
doHistograms | Flag to mint histograms or not |
extrapolation | The luminosity extrapolation strategy to be applied to this trigger |
Definition at line 8 of file RatesTrigger.cxx.
◆ ~RatesTrigger()
RatesTrigger::~RatesTrigger |
( |
| ) |
|
◆ RatesTrigger() [2/2]
◆ clearTrainHist()
void RatesHistoBase::clearTrainHist |
( |
| ) |
|
|
inherited |
In some jobs we don't want to do the rates vs.
position in train
Definition at line 76 of file RatesHistoBase.cxx.
◆ doHistograms()
bool RatesHistoBase::doHistograms |
( |
| ) |
const |
|
inlineinherited |
If histogramming was enabled in this rates object.
Definition at line 99 of file RatesHistoBase.h.
◆ execute()
Execute trigger rate emulation.
If the trigger passed, add to its rate the effective number of events it is accepting. Also keep track of any express prescale rate
- Parameters
-
weights | Summary of all event weights which may be used by this trigger |
Reimplemented in RatesScanTrigger.
Definition at line 56 of file RatesTrigger.cxx.
◆ getActive()
bool RatesTrigger::getActive |
( |
| ) |
const |
◆ getCoherentFactor()
double RatesTrigger::getCoherentFactor |
( |
| ) |
const |
Get the lowest common prescale factor of all triggers in my CPS group.
Definition at line 171 of file RatesTrigger.cxx.
◆ getCPSID()
size_t RatesTrigger::getCPSID |
( |
| ) |
const |
◆ getDataHist()
TH1 * RatesHistoBase::getDataHist |
( |
| ) |
|
|
inherited |
- Returns
- cached, non-owning, histogram pointer or nullptr. Does not cause error
Definition at line 82 of file RatesHistoBase.cxx.
◆ getDisabled()
bool RatesTrigger::getDisabled |
( |
| ) |
const |
◆ getExtrapolationFactor()
◆ getExtrapolationFactorString()
const std::string & RatesHistoBase::getExtrapolationFactorString |
( |
ExtrapStrat_t |
strat | ) |
const |
|
inherited |
Definition at line 87 of file RatesHistoBase.cxx.
88 static const std::vector<std::string>
values{
"LINEAR_L",
"LINEAR_BUNCH_EXPO_MU",
"LINEAR_BUNCHES",
"LINEAR_MU",
"NONE"};
89 return values.at(
static_cast<size_t>(strat));
◆ getHash()
size_t RatesTrigger::getHash |
( |
| ) |
const |
◆ getName()
const std::string & RatesTrigger::getName |
( |
| ) |
const |
◆ getPassed()
bool RatesTrigger::getPassed |
( |
| ) |
const |
◆ getPrescale()
double RatesTrigger::getPrescale |
( |
const bool |
includeExpress = false | ) |
const |
Gets the triggers prescale.
- Parameters
-
includeExpress | If true, the items express prescale is added on top of its regular prescale |
Definition at line 95 of file RatesTrigger.cxx.
◆ getSeedHash()
size_t RatesTrigger::getSeedHash |
( |
| ) |
const |
◆ getSeedName()
const std::string & RatesTrigger::getSeedName |
( |
| ) |
const |
◆ getSeedPrescale()
double RatesTrigger::getSeedPrescale |
( |
| ) |
const |
◆ giveDataHist()
Definition at line 66 of file RatesHistoBase.cxx.
68 ATH_MSG_ERROR(
"RatesHistoBase::giveDataHist Warning requested histograms when histograming is OFF here.");
69 return StatusCode::FAILURE;
72 return StatusCode::SUCCESS;
◆ giveMuHist()
Definition at line 46 of file RatesHistoBase.cxx.
48 ATH_MSG_ERROR(
"RatesHistoBase::giveMuHist Warning requested histograms when histograming is OFF here.");
49 return StatusCode::FAILURE;
52 return StatusCode::SUCCESS;
◆ giveTrainHist()
Definition at line 56 of file RatesHistoBase.cxx.
58 ATH_MSG_ERROR(
"RatesHistoBase::giveTrainHist Warning requested histograms when histograming is OFF here.");
59 return StatusCode::FAILURE;
62 return StatusCode::SUCCESS;
◆ initMessaging()
void AthMessaging::initMessaging |
( |
| ) |
const |
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
◆ isNotPositive()
static bool RatesHistoBase::isNotPositive |
( |
double |
v | ) |
|
|
inlinestaticinherited |
◆ isZero()
static bool RatesHistoBase::isZero |
( |
double |
v | ) |
|
|
inlinestaticinherited |
◆ msg() [1/2]
MsgStream & AthMessaging::msg |
( |
| ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 164 of file AthMessaging.h.
◆ msg() [2/2]
MsgStream & AthMessaging::msg |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 179 of file AthMessaging.h.
180 {
return msg() << lvl; }
◆ msgLvl()
bool AthMessaging::msgLvl |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
Test the output level.
- Parameters
-
lvl | The message level to test against |
- Returns
- boolean Indicating if messages at given level will be printed
- Return values
-
true | Messages at level "lvl" will be printed |
Definition at line 151 of file AthMessaging.h.
◆ operator=()
◆ printConfig()
const std::string RatesTrigger::printConfig |
( |
| ) |
const |
Prints the RatesTrigger's configuration.
Definition at line 100 of file RatesTrigger.cxx.
101 std::stringstream
ss;
102 ss << std::setfill(
' ')
103 <<
"Prescale:" << std::setw(11) << std::left <<
m_prescale
105 <<
" CPSID:" << std::setw(11) << std::left <<
m_CPSID
◆ printExpressRate()
const std::string RatesTrigger::printExpressRate |
( |
const double |
ratesDenominator | ) |
const |
Prints the RatesTrigger's express rate.
- Parameters
-
ratesDenominator | The walltime for the run, needed to normalise from integrated weighted counts to a rate. |
- Returns
- The information to be printed
Definition at line 131 of file RatesTrigger.cxx.
132 std::stringstream
ss;
133 ss << std::setfill(
' ');
◆ printRate()
const std::string RatesTrigger::printRate |
( |
const double |
ratesDenominator | ) |
const |
|
virtual |
Prints the RatesTrigger's rate.
- Parameters
-
ratesDenominator | The walltime for the run, needed to normalise from integrated weighted counts to a rate. |
- Returns
- The information to be printed
Reimplemented in RatesScanTrigger.
Definition at line 111 of file RatesTrigger.cxx.
112 std::stringstream
ss;
113 ss << std::setfill(
' ');
115 <<
" +- " << std::setw(11) << std::left << sqrt(
m_rateAccumulator2)/ratesDenominator <<
" Hz";
121 ss <<
", Unique Rate: " << std::setw(11) << std::right <<
unique
122 <<
" +- " << std::setw(11) << std::left << uniqueErr <<
" Hz";
◆ reset()
void RatesTrigger::reset |
( |
| ) |
|
|
virtual |
◆ setCoherentFactor()
void RatesTrigger::setCoherentFactor |
( |
const double |
lowestCommonPrescale | ) |
|
If i'm in a CPS group, set the lowest commons PS factor of the group.
Definition at line 165 of file RatesTrigger.cxx.
◆ setCPS()
void RatesTrigger::setCPS |
( |
const std::string & |
group | ) |
|
If I'm in a CPS group, set the group name (I'll keep a copy of the hash)
Definition at line 167 of file RatesTrigger.cxx.
◆ setLevel()
void AthMessaging::setLevel |
( |
MSG::Level |
lvl | ) |
|
|
inherited |
◆ setPassed()
void RatesTrigger::setPassed |
( |
const bool |
passed = true , |
|
|
const bool |
active = true , |
|
|
const bool |
unbiasedEvent = false |
|
) |
| |
Set the pass/fail bool.
Execute needs to be called separately afterwards.
Definition at line 38 of file RatesTrigger.cxx.
40 if (
m_active && !
m_pass)
throw std::runtime_error(
"Cannot pass if not active");
◆ setPassedAndExecute()
Set the pass/fail bool and immediately call execute.
Should only be done once per event.
- Parameters
-
i | If the trigger passed or failed the event @weights Struct of weighting information for the event |
Definition at line 45 of file RatesTrigger.cxx.
48 if (
m_active && !
m_pass)
throw std::runtime_error(
"Cannot pass if not active");
◆ setSeedsFromRandom()
void RatesTrigger::setSeedsFromRandom |
( |
const bool |
i | ) |
|
Set if this trigger is to behave as if it seeds from a random L1 item.
Definition at line 145 of file RatesTrigger.cxx.
◆ setUniqueGroup()
If I have a group which is calculating my unique rate.
Definition at line 163 of file RatesTrigger.cxx.
◆ ATLAS_THREAD_SAFE
std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
|
mutableprivateinherited |
◆ m_active
bool RatesTrigger::m_active |
|
protected |
◆ m_coherentFactor
double RatesTrigger::m_coherentFactor |
|
protected |
If I'm in a coherent prescale group, the prescale of the lowest non-disabled chain in the group.
Definition at line 125 of file RatesTrigger.h.
◆ m_CPSID
size_t RatesTrigger::m_CPSID |
|
protected |
If I'm in a coherent prescale group, my group's ID (hash of the group name)
Definition at line 124 of file RatesTrigger.h.
◆ m_data
std::unique_ptr<TH1> RatesHistoBase::m_data |
|
protectedinherited |
Histogram of raw rates quantites, for when we need to normalise offline (e.g.
grid processing)
Definition at line 112 of file RatesHistoBase.h.
◆ m_dataCachedPtr
TH1* RatesHistoBase::m_dataCachedPtr {} |
|
protectedinherited |
◆ m_doHistograms
bool RatesHistoBase::m_doHistograms |
|
protectedinherited |
◆ m_expressPrescale
const double RatesTrigger::m_expressPrescale |
|
protected |
My express stream prescale factor, gets applied on top of the regular prescale.
Definition at line 134 of file RatesTrigger.h.
◆ m_extrapolationStrategy
How this trigger is to scale with luminosity.
Definition at line 139 of file RatesTrigger.h.
◆ m_imsg
std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_lvl
std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL } |
|
mutableprivateinherited |
◆ m_msg_tls
boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls |
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
◆ m_name
const std::string RatesTrigger::m_name |
|
protected |
◆ m_nameHash
const size_t RatesTrigger::m_nameHash |
|
protected |
◆ m_nm
std::string AthMessaging::m_nm |
|
privateinherited |
◆ m_pass
bool RatesTrigger::m_pass |
|
protected |
◆ m_prescale
const double RatesTrigger::m_prescale |
|
protected |
◆ m_rateAccumulator
double RatesTrigger::m_rateAccumulator |
|
protected |
◆ m_rateAccumulator2
double RatesTrigger::m_rateAccumulator2 |
|
protected |
◆ m_rateExpressAccumulator
double RatesTrigger::m_rateExpressAccumulator |
|
protected |
◆ m_rateExpressAccumulator2
double RatesTrigger::m_rateExpressAccumulator2 |
|
protected |
Weighted express stream events squared.
Definition at line 120 of file RatesTrigger.h.
◆ m_ratesActive
double RatesTrigger::m_ratesActive |
|
protected |
◆ m_ratesActive2
double RatesTrigger::m_ratesActive2 |
|
protected |
◆ m_rateVsMu
std::unique_ptr<TH1> RatesHistoBase::m_rateVsMu |
|
protectedinherited |
Histogram of rate as a fn.
of the input event's mu
Definition at line 110 of file RatesHistoBase.h.
◆ m_rateVsMuCachedPtr
TH1* RatesHistoBase::m_rateVsMuCachedPtr {} |
|
protectedinherited |
◆ m_rateVsTrain
std::unique_ptr<TH1> RatesHistoBase::m_rateVsTrain |
|
protectedinherited |
Histogram of rate as a fn.
of position in bunch train
Definition at line 111 of file RatesHistoBase.h.
◆ m_rateVsTrainCachedPtr
TH1* RatesHistoBase::m_rateVsTrainCachedPtr {} |
|
protectedinherited |
◆ m_seed
const std::string RatesTrigger::m_seed |
|
protected |
◆ m_seedHash
const size_t RatesTrigger::m_seedHash |
|
protected |
◆ m_seedPrescale
const double RatesTrigger::m_seedPrescale |
|
protected |
◆ m_seedsFromRandom
bool RatesTrigger::m_seedsFromRandom |
|
protected |
Does this trigger seed from a random trigger? If so it should only be exposed to unbiased events.
Definition at line 116 of file RatesTrigger.h.
◆ m_totalPrescaleWeight
const double RatesTrigger::m_totalPrescaleWeight |
|
protected |
◆ m_totalPrescaleWeightExpress
const double RatesTrigger::m_totalPrescaleWeightExpress |
|
protected |
Equal to 1/m_seedPrescale*m_prescale*m_expressPrescale.
Definition at line 137 of file RatesTrigger.h.
◆ m_uniqueGroup
Pointer to the group which is calculating my unique rate.
Definition at line 127 of file RatesTrigger.h.
The documentation for this class was generated from the following files:
std::atomic< MSG::Level > m_lvl
Current logging level.
const double m_prescale
My prescale factor.
bool m_active
Was the trigger active? (Did it run)
@ kACTIVE_RAW_BIN
Bin used to store the raw total events in which the trigger was active.
double getUniqueWeight(const double ratesDenominator) const
Get the unique rate of a unique-rate group For a group being used to get a unique rate,...
const std::string m_name
My name.
TH1 * m_dataCachedPtr
Cached, non-owning pointer.
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
const double m_expressPrescale
My express stream prescale factor, gets applied on top of the regular prescale.
@ kMU_SCALING
Scale trigger linearly but only in the change in <mu>
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
double m_rateExpressAccumulator2
Weighted express stream events squared.
IMessageSvc * getMessageSvc(bool quiet=false)
static bool isNotPositive(double v)
double m_coherentFactor
If I'm in a coherent prescale group, the prescale of the lowest non-disabled chain in the group.
@ kPASS_WEIGHTED_OR_BIN
Bin used to store the total rate (OR)
bool m_seedsFromRandom
Does this trigger seed from a random trigger? If so it should only be exposed to unbiased events.
@ kLINEAR
Scale trigger linearly with luminosity.
msgSvc
Provide convenience handles for various services.
std::unique_ptr< TH1 > m_data
Histogram of raw rates quantites, for when we need to normalise offline (e.g.
double getExtrapolationFactor(const WeightingValuesSummary_t &weights, const ExtrapStrat_t strat) const
@ kEXPO_MU
Scale trigger linearly in bunches and exponentially in mu.
const size_t m_seedHash
Has of my seed name.
std::unique_ptr< TH1 > m_rateVsMu
Histogram of rate as a fn.
std::unique_ptr< TH1 > m_rateVsTrain
Histogram of rate as a fn.
size_t m_CPSID
If I'm in a coherent prescale group, my group's ID (hash of the group name)
@ kBUNCH_SCALING
Scale trigger linearly but only in the number of bunches.
const RatesGroup * m_uniqueGroup
Pointer to the group which is calculating my unique rate.
@ kEXPRESS_BIN
Bin used to store the express rate.
AthROOTErrorHandlerSvc * svc
TH1 * m_rateVsTrainCachedPtr
Cached, non-owning pointer.
MsgStream & msg() const
The standard message stream.
RatesHistoBase(const std::string &name, IMessageSvc *msgSvc, const bool doHistograms=true)
bool getDisabled() const
If I or my seed were prescaled out.
TH1 * m_rateVsMuCachedPtr
Cached, non-owning pointer.
double m_rateAccumulator
Weighted events passed.
double m_rateExpressAccumulator
Weighted express stream events.
static bool isZero(double v)
double m_rateAccumulator2
Weighted events passed squared.
const double m_totalPrescaleWeightExpress
Equal to 1/m_seedPrescale*m_prescale*m_expressPrescale.
virtual void execute(const WeightingValuesSummary_t &weights)
Execute trigger rate emulation.
bool doHistograms() const
If histogramming was enabled in this rates object.
DataModel_detail::iterator< DVL > unique(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of unique for DataVector/List.
bool m_pass
Did the trigger pass or not?
const double m_seedPrescale
std::string m_nm
Message source name.
@ kPASS_RAW_BIN
Bin used to store the raw total events in which the trigger passed.
const ExtrapStrat_t m_extrapolationStrategy
How this trigger is to scale with luminosity.
const std::string m_seed
My seed, "" if no seed.
void initMessaging() const
Initialize our message level and MessageSvc.
@ kACTIVE_WEIGHTED_BIN
Bin used to store the weighted events in which the trigger was active.
const size_t m_nameHash
Hash of my name.
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
const double m_totalPrescaleWeight
Equal to 1/m_seedPrescale*m_prescale.
const std::string & getExtrapolationFactorString(ExtrapStrat_t strat) const
@ kNONE
Do not scale this trigger for changes in luminosity.