|
ATLAS Offline Software
|
Go to the documentation of this file.
19 m_nameHash(std::
hash<std::string>{}(
name)),
20 m_rateAccumulatorOR(0.),
21 m_rateAccumulatorAND(0.),
22 m_rateAccumulatorOR2(0.),
23 m_rateAccumulatorAND2(0.),
24 m_doCachedWeights(
false),
26 m_useCachedWeights(
false),
28 m_masterGroup(
nullptr),
29 m_uniqueTrigger(
nullptr),
30 m_isExpressGroup(
false),
40 if (child.first != std::hash<std::string>{}(
""))
ss <<
"\t" << (**(child.second.begin())).getSeedName() <<
" ->" << std::endl;
41 for (
const auto&
chain : child.second) {
42 ss <<
"\t\t" <<
chain->getName() << std::endl;
51 <<
" +- " << std::setw(11) << std::left << sqrt(
m_rateAccumulatorOR2)/ratesDenominator <<
" Hz, "
61 m_children.insert( std::make_pair(
toAdd->getSeedHash(), std::set<const RatesTrigger*>() ) );
83 double weightOR = 1., weightAND = 1.;
92 const std::set<const RatesTrigger*>&
triggers = element.second;
95 double weightHLT_OR = 1.;
96 double weightHLT_AND = 1.;
97 std::unordered_map<size_t, RatesCPS> weightHLT_CPS;
99 for (
const auto& trigger :
triggers) {
100 if (trigger->getPassed()) {
102 const double trigPrescaleReciprocal = 1. / trigger->getPrescale(
m_isExpressGroup );
104 weightL1 = 1. / trigger->getSeedPrescale();
105 weightHLT_AND *= trigPrescaleReciprocal;
107 const size_t CPSID = trigger->getCPSID();
109 weightHLT_OR *= 1. - trigPrescaleReciprocal;
111 RatesCPS& cps = weightHLT_CPS[CPSID];
113 cps.
execute( 1. / trigPrescaleReciprocal );
123 if (
isZero(weightHLT_OR) &&
isZero(weightHLT_AND))
break;
127 for (
const auto& cps : weightHLT_CPS) weightHLT_OR *= 1. - cps.second.getWeight();
129 weightOR *= 1. - (weightL1 * (1. - weightHLT_OR));
130 weightAND *= weightL1 * weightHLT_AND;
137 if (cacheElement.first == element.first)
continue;
138 cacheElement.second *= 1. - (weightL1 * (1. - weightHLT_OR));
153 const double wOR =
w * (1. - weightOR);
154 const double wAND =
w * weightAND;
181 return diff / ratesDenominator;
JetConstituentVector::iterator iterator
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,...
void removeFromGroup(const RatesTrigger *toRemove)
Remove a trigger from this group.
@ kUNIQUE_BIN
Bin used to store data needed to get the unique rate.
size_t getSeedHash() const
RatesTrigger * m_uniqueTrigger
If not nullptr, then a trigger this group is calculating the unique rate for.
TH1 * m_dataCachedPtr
Cached, non-owning pointer.
Structure to hold per-event weights for distribution.
bool m_isExpressGroup
If this group is calculating for the express stream - also include express prescales.
const std::string m_name
Name of the group.
void setUseCachedWeights(const bool i)
Set to use cached weights from the Master group (need ptr to m_masterGroup)
RatesGroup(const std::string &name, IMessageSvc *msgSvc, const bool doHistograms=true, const bool doExtrapolation=true)
Construct new RatesGroup to enumerate the combined union (OR) and intersection (AND) rate of a set of...
double m_rateAccumulatorAND2
For stat error.
const ExtrapStrat_t m_extrapolationStrategy
How this group is to scale with luminosity.
void setExpressGroup(const bool i)
Flag this group as the express group (modifies group trigger's prescales)
double getCachedWeight(const size_t l1Hash) const
Get cached weight from triggers seeding from a given L1 item.
const RatesGroup * m_masterGroup
If not nullptr, then use the cached weights info in this master group object.
std::unordered_map< size_t, std::set< const RatesTrigger * > > m_children
Used to calculate the rate for a single trigger at L1 or the HLT.
@ 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.
void setCoherentFactor(const double coherentFactor)
Set a common prescale factor for this group.
@ kLINEAR
Scale trigger linearly with luminosity.
msgSvc
Provide convenience handles for various services.
double getExtrapolationFactor(const WeightingValuesSummary_t &weights, const ExtrapStrat_t strat) const
const std::string printRate(const double ratesDenominator) const
Prints the RatesGroup's rate.
void setDoCachedWeights(const bool i)
Flag group to cache weights.
const std::string printConfig() const
Prints the RatesGroup's configuration.
TH1 * m_rateVsTrainCachedPtr
Cached, non-owning pointer.
void removeOtherL1(const RatesTrigger *toKeep)
Remove from the groups mapping all triggers which have a dissimilar seed to the supplied trigger.
bool m_doCachedWeights
Used in the global rates group.
bool getDisabled() const
If I or my seed were prescaled out.
TH1 * m_rateVsMuCachedPtr
Cached, non-owning pointer.
double m_rateAccumulatorOR2
For stat error.
@ kPASS_WEIGHTED_AND_BIN
Bin used to store the total rate (AND)
Basic base class for any common functionality between RatesTrigger and RatesGroup This means that eve...
static bool isZero(double v)
void execute(const double prescale)
Keep track of a union product (OR of many chains) excluding the coherent part.
void execute(const WeightingValuesSummary_t &weights)
Perform group rates evaluation.
void setUniqueTrigger(RatesTrigger *trigger)
Set trigger I am doing unique rates for.
const std::unordered_map< size_t, std::set< const RatesTrigger * > > & getChildren() const
void addToGroup(const RatesTrigger *toAdd)
Add a trigger to this group.
double m_rateAccumulatorOR
Numerator for the rate of the OR of all triggers.
double m_rateAccumulatorAND
Numerator for the rate of the AND of all triggers.
RatesTrigger * getUniqueTrigger()
Get the trigger I am doing unique rates for.
std::unordered_map< size_t, double > m_cachedWeights
Cached weight of the OR of all triggers except for the L1 seed-hash of the key here.
double getWeight() const
Return the union product (OR of many chains) coherently weighted by the coherent factor.
Helper class to keep track of coherent prescales between chains in a group This class knows about its...
bool m_useCachedWeights
Efficiency.
void duplicateChildren(const RatesGroup *toDuplicate)
Copy in triggers from another group.
const std::string & getExtrapolationFactorString(ExtrapStrat_t strat) const
@ kNONE
Do not scale this trigger for changes in luminosity.