![]() |
ATLAS Offline Software
|
Used to calculate the rate for a single trigger at L1 or the HLT. More...
#include <RatesTrigger.h>
Public Member Functions | |
| 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. | |
| ~RatesTrigger () | |
| RatesTrigger (const RatesTrigger &)=delete | |
| RatesTrigger & | operator= (const RatesTrigger &)=delete |
| virtual void | reset () |
| If I was used in an event, reset me. | |
| void | setSeedsFromRandom (const bool i) |
| Set if this trigger is to behave as if it seeds from a random L1 item. | |
| void | setPassed (const bool passed=true, const bool active=true, const bool unbiasedEvent=false) |
| Set the pass/fail bool. | |
| void | setPassedAndExecute (const bool passed, const bool active, const WeightingValuesSummary_t &weights) |
| Set the pass/fail bool and immediately call execute. | |
| virtual void | execute (const WeightingValuesSummary_t &weights) |
| Execute trigger rate emulation. | |
| size_t | getSeedHash () const |
| const std::string & | getSeedName () const |
| Get the name of the seed of this trigger. | |
| double | getSeedPrescale () const |
| Get the prescale of the seed of this trigger. | |
| size_t | getHash () const |
| Get the hash of the name of this trigger. | |
| const std::string & | getName () const |
| Get the name of this trigger. | |
| double | getPrescale (const bool includeExpress=false) const |
| Gets the triggers prescale. | |
| bool | getPassed () const |
| If the trigger passed in the event. | |
| bool | getActive () const |
| If the trigger passed in the event. | |
| bool | getDisabled () const |
| If I or my seed were prescaled out. | |
| void | setUniqueGroup (const RatesGroup *unique) |
| If I have a group which is calculating my unique rate. | |
| void | setCoherentFactor (const double lowestCommonPrescale) |
| If i'm in a CPS group, set the lowest commons PS factor of the group. | |
| 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) | |
| size_t | getCPSID () const |
| Get the hash of my CPS group name. | |
| double | getCoherentFactor () const |
| Get the lowest common prescale factor of all triggers in my CPS group. | |
| const std::string | printConfig () const |
| Prints the RatesTrigger's configuration. | |
| virtual const std::string | printRate (const double ratesDenominator) const |
| Prints the RatesTrigger's rate. | |
| double | getTotalPrescaleWeight () const |
| const std::string | printExpressRate (const double ratesDenominator) const |
| Prints the RatesTrigger's express rate. | |
| 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. | |
| TH1 * | getDataHist () |
| bool | doHistograms () const |
| If histogramming was enabled in this rates object. | |
| const std::string & | getExtrapolationFactorString (ExtrapStrat_t strat) const |
| double | getExtrapolationFactor (const WeightingValuesSummary_t &weights, const ExtrapStrat_t strat) const |
| void | setDataName (const std::string &newName) |
| void | setRateVsMuName (const std::string &newName) |
| void | setRateVsTrainName (const std::string &newName) |
| bool | msgLvl (const MSG::Level lvl) const |
| Test the output level. | |
| MsgStream & | msg () const |
| The standard message stream. | |
| MsgStream & | msg (const MSG::Level lvl) const |
| The standard message stream. | |
| void | setLevel (MSG::Level lvl) |
| Change the current logging level. | |
Static Public Member Functions | |
| static bool | isZero (double v) |
| static bool | isNotPositive (double v) |
Protected Attributes | |
| bool | m_pass |
| Did the trigger pass or not? | |
| bool | m_active |
| Was the trigger active? | |
| bool | m_seedsFromRandom |
| Does this trigger seed from a random trigger? | |
| double | m_rateAccumulator |
| Weighted events passed. | |
| double | m_rateAccumulator2 |
| Weighted events passed squared. | |
| double | m_rateExpressAccumulator |
| Weighted express stream events. | |
| double | m_rateExpressAccumulator2 |
| Weighted express stream events squared. | |
| double | m_ratesActive |
| double | m_ratesActive2 |
| size_t | m_CPSID |
| If I'm in a coherent prescale group, my group's ID (hash of the group name) | |
| double | m_coherentFactor |
| If I'm in a coherent prescale group, the prescale of the lowest non-disabled chain in the group. | |
| const RatesGroup * | m_uniqueGroup |
| Pointer to the group which is calculating my unique rate. | |
| const std::string | m_name |
| My name. | |
| const std::string | m_seed |
| My seed, "" if no seed. | |
| const size_t | m_nameHash |
| Hash of my name. | |
| const size_t | m_seedHash |
| Has of my seed name. | |
| const double | m_prescale |
| My prescale factor. | |
| const double | m_expressPrescale |
| My express stream prescale factor, gets applied on top of the regular prescale. | |
| const double | m_seedPrescale |
| const double | m_totalPrescaleWeight |
| Equal to 1/m_seedPrescale*m_prescale. | |
| const double | m_totalPrescaleWeightExpress |
| Equal to 1/m_seedPrescale*m_prescale*m_expressPrescale. | |
| const ExtrapStrat_t | m_extrapolationStrategy |
| How this trigger is to scale with luminosity. | |
| bool | m_doHistograms |
| If histogramming is switched on. | |
| std::unique_ptr< TH1 > | m_rateVsMu |
| Histogram of rate as a fn. | |
| std::unique_ptr< TH1 > | m_rateVsTrain |
| Histogram of rate as a fn. | |
| std::unique_ptr< TH1 > | m_data |
| Histogram of raw rates quantites, for when we need to normalise offline (e.g. | |
| TH1 * | m_rateVsMuCachedPtr {} |
| Cached, non-owning pointer. | |
| TH1 * | m_rateVsTrainCachedPtr {} |
| Cached, non-owning pointer. | |
| TH1 * | m_dataCachedPtr {} |
| Cached, non-owning pointer. | |
Private Member Functions | |
| void | initMessaging () const |
| Initialize our message level and MessageSvc. | |
Private Attributes | |
| std::string | m_nm |
| Message source name. | |
| boost::thread_specific_ptr< MsgStream > | m_msg_tls |
| MsgStream instance (a std::cout like with print-out levels) | |
| std::atomic< IMessageSvc * > | m_imsg { nullptr } |
| MessageSvc pointer. | |
| std::atomic< MSG::Level > | m_lvl { MSG::NIL } |
| Current logging level. | |
| std::atomic_flag m_initialized | ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
| Messaging initialized (initMessaging) | |
Used to calculate the rate for a single trigger at L1 or the HLT.
Definition at line 15 of file RatesTrigger.h.
| RatesTrigger::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.
| 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 | ( | ) |
Definition at line 36 of file RatesTrigger.cxx.
|
delete |
|
inherited |
In some jobs we don't want to do the rates vs.
position in train
Definition at line 76 of file RatesHistoBase.cxx.
|
inlineinherited |
If histogramming was enabled in this rates object.
Definition at line 99 of file RatesHistoBase.h.
|
virtual |
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
| weights | Summary of all event weights which may be used by this trigger |
Reimplemented in RatesScanTrigger.
Definition at line 56 of file RatesTrigger.cxx.
| bool RatesTrigger::getActive | ( | ) | const |
| double RatesTrigger::getCoherentFactor | ( | ) | const |
Get the lowest common prescale factor of all triggers in my CPS group.
Definition at line 175 of file RatesTrigger.cxx.
| size_t RatesTrigger::getCPSID | ( | ) | const |
|
inherited |
Definition at line 82 of file RatesHistoBase.cxx.
| bool RatesTrigger::getDisabled | ( | ) | const |
|
inherited |
Definition at line 96 of file RatesHistoBase.cxx.
|
inherited |
Definition at line 87 of file RatesHistoBase.cxx.
| size_t RatesTrigger::getHash | ( | ) | const |
| const std::string & RatesTrigger::getName | ( | ) | const |
| bool RatesTrigger::getPassed | ( | ) | const |
| double RatesTrigger::getPrescale | ( | const bool | includeExpress = false | ) | const |
Gets the triggers prescale.
| includeExpress | If true, the items express prescale is added on top of its regular prescale |
Definition at line 99 of file RatesTrigger.cxx.
| size_t RatesTrigger::getSeedHash | ( | ) | const |
Definition at line 151 of file RatesTrigger.cxx.
| const std::string & RatesTrigger::getSeedName | ( | ) | const |
| double RatesTrigger::getSeedPrescale | ( | ) | const |
| double RatesTrigger::getTotalPrescaleWeight | ( | ) | const |
Definition at line 95 of file RatesTrigger.cxx.
|
inherited |
Definition at line 66 of file RatesHistoBase.cxx.
|
inherited |
Definition at line 46 of file RatesHistoBase.cxx.
|
inherited |
Definition at line 56 of file RatesHistoBase.cxx.
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
|
inlinestaticinherited |
Definition at line 104 of file RatesHistoBase.h.
|
inlinestaticinherited |
Definition at line 103 of file RatesHistoBase.h.
|
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 163 of file AthMessaging.h.
|
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 178 of file AthMessaging.h.
|
inlineinherited |
Test the output level.
| lvl | The message level to test against |
| true | Messages at level "lvl" will be printed |
Definition at line 151 of file AthMessaging.h.
|
delete |
| const std::string RatesTrigger::printConfig | ( | ) | const |
Prints the RatesTrigger's configuration.
Definition at line 104 of file RatesTrigger.cxx.
| const std::string RatesTrigger::printExpressRate | ( | const double | ratesDenominator | ) | const |
Prints the RatesTrigger's express rate.
| ratesDenominator | The walltime for the run, needed to normalise from integrated weighted counts to a rate. |
Definition at line 135 of file RatesTrigger.cxx.
|
virtual |
Prints the RatesTrigger's rate.
| ratesDenominator | The walltime for the run, needed to normalise from integrated weighted counts to a rate. |
Reimplemented in RatesScanTrigger.
Definition at line 115 of file RatesTrigger.cxx.
|
virtual |
If I was used in an event, reset me.
Reimplemented in RatesScanTrigger.
Definition at line 147 of file RatesTrigger.cxx.
| 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 169 of file RatesTrigger.cxx.
| 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 171 of file RatesTrigger.cxx.
|
inherited |
Definition at line 92 of file RatesHistoBase.cxx.
|
inherited |
Change the current logging level.
Use this rather than msg().setLevel() for proper operation with MT.
Definition at line 28 of file AthMessaging.cxx.
| 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.
| void RatesTrigger::setPassedAndExecute | ( | const bool | passed, |
| const bool | active, | ||
| const WeightingValuesSummary_t & | weights ) |
Set the pass/fail bool and immediately call execute.
Should only be done once per event.
| 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.
|
inherited |
Definition at line 93 of file RatesHistoBase.cxx.
|
inherited |
Definition at line 94 of file RatesHistoBase.cxx.
| 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 149 of file RatesTrigger.cxx.
| void RatesTrigger::setUniqueGroup | ( | const RatesGroup * | unique | ) |
If I have a group which is calculating my unique rate.
Definition at line 167 of file RatesTrigger.cxx.
|
mutableprivateinherited |
Messaging initialized (initMessaging)
Definition at line 141 of file AthMessaging.h.
|
protected |
|
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.
|
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.
|
protectedinherited |
Histogram of raw rates quantites, for when we need to normalise offline (e.g.
grid processing)
Definition at line 115 of file RatesHistoBase.h.
|
protectedinherited |
|
protectedinherited |
If histogramming is switched on.
Definition at line 112 of file RatesHistoBase.h.
|
protected |
My express stream prescale factor, gets applied on top of the regular prescale.
Definition at line 134 of file RatesTrigger.h.
|
protected |
How this trigger is to scale with luminosity.
Definition at line 139 of file RatesTrigger.h.
|
mutableprivateinherited |
|
mutableprivateinherited |
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
|
protected |
My name.
Definition at line 129 of file RatesTrigger.h.
|
protected |
Hash of my name.
Definition at line 131 of file RatesTrigger.h.
|
privateinherited |
Message source name.
Definition at line 129 of file AthMessaging.h.
|
protected |
Did the trigger pass or not?
Definition at line 114 of file RatesTrigger.h.
|
protected |
My prescale factor.
Definition at line 133 of file RatesTrigger.h.
|
protected |
Weighted events passed.
Definition at line 117 of file RatesTrigger.h.
|
protected |
Weighted events passed squared.
Definition at line 118 of file RatesTrigger.h.
|
protected |
Weighted express stream events.
Definition at line 119 of file RatesTrigger.h.
|
protected |
Weighted express stream events squared.
Definition at line 120 of file RatesTrigger.h.
|
protected |
Definition at line 121 of file RatesTrigger.h.
|
protected |
Definition at line 122 of file RatesTrigger.h.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
Histogram of rate as a fn.
of position in bunch train
Definition at line 114 of file RatesHistoBase.h.
|
protectedinherited |
|
protected |
My seed, "" if no seed.
Definition at line 130 of file RatesTrigger.h.
|
protected |
Has of my seed name.
Definition at line 132 of file RatesTrigger.h.
|
protected |
Definition at line 135 of file RatesTrigger.h.
|
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.
|
protected |
Equal to 1/m_seedPrescale*m_prescale.
Definition at line 136 of file RatesTrigger.h.
|
protected |
Equal to 1/m_seedPrescale*m_prescale*m_expressPrescale.
Definition at line 137 of file RatesTrigger.h.
|
protected |
Pointer to the group which is calculating my unique rate.
Definition at line 127 of file RatesTrigger.h.