ATLAS Offline Software
Loading...
Searching...
No Matches
RatesGroup.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef RATESANALYSIS_RATESTGROUP_H
6#define RATESANALYSIS_RATESTGROUP_H 1
7
8#include "RatesTrigger.h"
9
14class RatesCPS {
15 public:
17 void setCoherentFactor(const double coherentFactor) { m_coherentFactor = coherentFactor; }
18 void execute(const double prescale);
19 double getWeight() const;
20
21 private:
22 double m_weight;
24};
25
29class RatesGroup : public RatesHistoBase {
30 public:
31
40 RatesGroup(const std::string& name, IMessageSvc* msgSvc, const bool doHistograms = true, const bool doExtrapolation = true);
41
42 virtual ~RatesGroup();
43
44 RatesGroup(const RatesGroup&) = delete;
45
46 RatesGroup& operator=(const RatesGroup&) = delete;
47
53 void addToGroup(const RatesTrigger* toAdd);
54
60 void removeFromGroup(const RatesTrigger* toRemove);
61
68 void removeOtherL1(const RatesTrigger* toKeep);
69
81
82 void setExpressGroup(const bool i);
83 void setDoCachedWeights(const bool i);
84 void setUseCachedWeights(const bool i);
85 void duplicateChildren(const RatesGroup* toDuplicate);
86 double getCachedWeight(const size_t l1Hash) const;
87 void setUniqueTrigger(RatesTrigger* trigger);
89
96 double getUniqueWeight(const double ratesDenominator) const;
97
98 const std::unordered_map<size_t, std::set<const RatesTrigger*>>& getChildren() const; //<! Return all triggers in the group, ordered by common L1
99
100 const std::string printConfig() const;
101
106 const std::string printRate(const double ratesDenominator) const;
107
108 private:
109
110 const std::string m_name;
111 const size_t m_nameHash;
112 public: //TODO remove this
117
119 std::unordered_map<size_t, double> m_cachedWeights;
124
126
127 std::unordered_map<size_t, std::set<const RatesTrigger*>> m_children; // Sets of triggers in this group, separated by their L1 seeds
128};
129
130#endif //> !RATESANALYSIS_RATESGROUP_H
131
ExtrapStrat_t
Extrapolation strategy to apply to each emulated trigger.
double m_coherentFactor
Definition RatesGroup.h:23
double getWeight() const
Return the union product (OR of many chains) coherently weighted by the coherent factor.
double m_weight
Definition RatesGroup.h:22
void execute(const double prescale)
Keep track of a union product (OR of many chains) excluding the coherent part.
Definition RatesGroup.cxx:8
void setCoherentFactor(const double coherentFactor)
Set a common prescale factor for this group.
Definition RatesGroup.h:17
bool m_useCachedWeights
Efficiency.
Definition RatesGroup.h:120
void setUseCachedWeights(const bool i)
Set to use cached weights from the Master group (need ptr to m_masterGroup)
double getCachedWeight(const size_t l1Hash) const
Get cached weight from triggers seeding from a given L1 item.
bool m_doCachedWeights
Used in the global rates group.
Definition RatesGroup.h:118
virtual ~RatesGroup()
RatesGroup & operator=(const RatesGroup &)=delete
void removeFromGroup(const RatesTrigger *toRemove)
Remove a trigger from this group.
void setDoCachedWeights(const bool i)
Flag group to cache weights.
double m_rateAccumulatorOR2
For stat error.
Definition RatesGroup.h:115
RatesTrigger * getUniqueTrigger()
Get the trigger I am doing unique rates for.
double m_rateAccumulatorAND
Numerator for the rate of the AND of all triggers.
Definition RatesGroup.h:114
const ExtrapStrat_t m_extrapolationStrategy
How this group is to scale with luminosity.
Definition RatesGroup.h:121
const std::string m_name
Name of the group.
Definition RatesGroup.h:110
const std::unordered_map< size_t, std::set< const RatesTrigger * > > & getChildren() const
void execute(const WeightingValuesSummary_t &weights)
Perform group rates evaluation.
void setExpressGroup(const bool i)
Flag this group as the express group (modifies group trigger's prescales)
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,...
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...
const std::string printConfig() const
Prints the RatesGroup's configuration.
void duplicateChildren(const RatesGroup *toDuplicate)
Copy in triggers from another group.
const std::string printRate(const double ratesDenominator) const
Prints the RatesGroup's rate.
RatesTrigger * m_uniqueTrigger
If not nullptr, then a trigger this group is calculating the unique rate for.
Definition RatesGroup.h:123
void setUniqueTrigger(RatesTrigger *trigger)
Set trigger I am doing unique rates for.
void addToGroup(const RatesTrigger *toAdd)
Add a trigger to this group.
RatesGroup(const RatesGroup &)=delete
const RatesGroup * m_masterGroup
If not nullptr, then use the cached weights info in this master group object.
Definition RatesGroup.h:122
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.
Definition RatesGroup.h:119
double m_rateAccumulatorAND2
For stat error.
Definition RatesGroup.h:116
double m_rateAccumulatorOR
Numerator for the rate of the OR of all triggers.
Definition RatesGroup.h:113
const size_t m_nameHash
Hash of the group's name.
Definition RatesGroup.h:111
bool m_isExpressGroup
If this group is calculating for the express stream - also include express prescales.
Definition RatesGroup.h:125
void removeOtherL1(const RatesTrigger *toKeep)
Remove from the groups mapping all triggers which have a dissimilar seed to the supplied trigger.
std::unordered_map< size_t, std::set< const RatesTrigger * > > m_children
Definition RatesGroup.h:127
bool doHistograms() const
If histogramming was enabled in this rates object.
RatesHistoBase(const std::string &name, IMessageSvc *msgSvc, const bool doHistograms=true)
Used to calculate the rate for a single trigger at L1 or the HLT.
Structure to hold per-event weights for distribution.