|
ATLAS Offline Software
|
Go to the documentation of this file.
9 const std::string&
seedName,
const double seedPrescale,
const bool doHistograms,
14 m_seedsFromRandom(false),
15 m_rateAccumulator(0.),
16 m_rateAccumulator2(0.),
17 m_rateExpressAccumulator(0.),
18 m_rateExpressAccumulator2(0.),
21 m_uniqueGroup(nullptr),
24 m_nameHash(std::
hash<std::string>{}(
name)),
25 m_seedHash(std::hash<std::string>{}(
seedName)),
26 m_prescale(prescale < 1. ? -1 : prescale),
27 m_expressPrescale(expressPrescale < 1. ? -1 : expressPrescale),
28 m_seedPrescale(seedPrescale < 1. ? -1 : seedPrescale),
29 m_totalPrescaleWeight(1. / (m_prescale * m_seedPrescale)),
30 m_totalPrescaleWeightExpress(1. / (m_prescale * m_seedPrescale * m_expressPrescale)),
31 m_extrapolationStrategy(extrapolation)
38 if (
m_active && !
m_pass)
throw std::runtime_error(
"Cannot pass if not active");
46 if (
m_active && !
m_pass)
throw std::runtime_error(
"Cannot pass if not active");
100 ss << std::setfill(
' ')
101 <<
"Prescale:" << std::setw(11) << std::left <<
m_prescale
103 <<
" CPSID:" << std::setw(11) << std::left <<
m_CPSID
110 std::stringstream
ss;
111 ss << std::setfill(
' ');
113 <<
" +- " << std::setw(11) << std::left << sqrt(
m_rateAccumulator2)/ratesDenominator <<
" Hz";
119 ss <<
", Unique Rate: " << std::setw(11) << std::right << unique
120 <<
" +- " << std::setw(11) << std::left << uniqueErr <<
" Hz";
130 std::stringstream
ss;
131 ss << std::setfill(
' ');
void setPassedAndExecute(const bool passed, const bool active, const WeightingValuesSummary_t &weights)
Set the pass/fail bool and immediately call execute.
size_t getHash() const
Get the hash of the name of this trigger.
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.
size_t getSeedHash() const
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
Structure to hold per-event weights for distribution.
const double m_expressPrescale
My express stream prescale factor, gets applied on top of the regular prescale.
bool getActive() const
If the trigger passed in the event.
const std::string printExpressRate(const double ratesDenominator) const
Prints the RatesTrigger's express rate.
double m_rateExpressAccumulator2
Weighted express stream events squared.
static bool isNotPositive(double v)
void setUniqueGroup(const RatesGroup *unique)
If I have a group which is calculating my unique rate.
ExtrapStrat_t
Extrapolation strategy to apply to each emulated trigger.
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)
Used to calculate the rate for a group of RatesTrigger objects at L1 or the HLT.
virtual const std::string printRate(const double ratesDenominator) const
Prints the RatesTrigger's rate.
bool m_seedsFromRandom
Does this trigger seed from a random trigger? If so it should only be exposed to unbiased events.
void setSeedsFromRandom(const bool i)
Set if this trigger is to behave as if it seeds from a random L1 item.
virtual void reset()
If I was used in an event, reset me.
msgSvc
Provide convenience handles for various services.
double getExtrapolationFactor(const WeightingValuesSummary_t &weights, const ExtrapStrat_t strat) const
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)
const size_t m_seedHash
Has of my seed name.
size_t m_CPSID
If I'm in a coherent prescale group, my group's ID (hash of the group name)
const RatesGroup * m_uniqueGroup
Pointer to the group which is calculating my unique rate.
size_t getCPSID() const
Get the hash of my CPS group name.
@ kEXPRESS_BIN
Bin used to store the express rate.
TH1 * m_rateVsTrainCachedPtr
Cached, non-owning pointer.
bool getDisabled() const
If I or my seed were prescaled out.
TH1 * m_rateVsMuCachedPtr
Cached, non-owning pointer.
double m_rateAccumulator
Weighted events passed.
Basic base class for any common functionality between RatesTrigger and RatesGroup This means that eve...
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.
void setPassed(const bool passed=true, const bool active=true, const bool unbiasedEvent=false)
Set the pass/fail bool.
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 inf...
bool m_pass
Did the trigger pass or not?
const double m_seedPrescale
double getCoherentFactor() const
Get the lowest common prescale factor of all triggers in my CPS group.
@ kPASS_RAW_BIN
Bin used to store the raw total events in which the trigger passed.
double getPrescale(const bool includeExpress=false) const
Gets the triggers prescale.
void setCoherentFactor(const double lowestCommonPrescale)
If i'm in a CPS group, set the lowest commons PS factor of the group.
const ExtrapStrat_t m_extrapolationStrategy
How this trigger is to scale with luminosity.
double getSeedPrescale() const
Get the prescale of the seed of this trigger.
const std::string m_seed
My seed, "" if no seed.
@ kACTIVE_WEIGHTED_BIN
Bin used to store the weighted events in which the trigger was active.
const std::string & getName() const
Get the name of this trigger.
const size_t m_nameHash
Hash of my name.
const double m_totalPrescaleWeight
Equal to 1/m_seedPrescale*m_prescale.
const std::string & getSeedName() const
Get the name of the seed of this trigger.
bool getPassed() const
If the trigger passed in the event.
const std::string printConfig() const
Prints the RatesTrigger's configuration.
const std::string & getExtrapolationFactorString(ExtrapStrat_t strat) const