ATLAS Offline Software
Loading...
Searching...
No Matches
RatesGroup Class Reference

Used to calculate the rate for a group of RatesTrigger objects at L1 or the HLT. More...

#include <RatesGroup.h>

Inheritance diagram for RatesGroup:
Collaboration diagram for RatesGroup:

Public Member Functions

 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 trigger at L1 or the HLT.
virtual ~RatesGroup ()
 RatesGroup (const RatesGroup &)=delete
RatesGroupoperator= (const RatesGroup &)=delete
void addToGroup (const RatesTrigger *toAdd)
 Add a trigger to this group.
void removeFromGroup (const RatesTrigger *toRemove)
 Remove a trigger from this group.
void removeOtherL1 (const RatesTrigger *toKeep)
 Remove from the groups mapping all triggers which have a dissimilar seed to the supplied trigger.
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)
void setDoCachedWeights (const bool i)
 Flag group to cache weights.
void setUseCachedWeights (const bool i)
 Set to use cached weights from the Master group (need ptr to m_masterGroup)
void duplicateChildren (const RatesGroup *toDuplicate)
 Copy in triggers from another group.
double getCachedWeight (const size_t l1Hash) const
 Get cached weight from triggers seeding from a given L1 item.
void setUniqueTrigger (RatesTrigger *trigger)
 Set trigger I am doing unique rates for.
RatesTriggergetUniqueTrigger ()
 Get the trigger I am doing unique rates for.
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, we need to subtract the rate of this group of N-1 chains from the master group of N chains.
const std::unordered_map< size_t, std::set< const RatesTrigger * > > & getChildren () const
const std::string printConfig () const
 Prints the RatesGroup's configuration.
const std::string printRate (const double ratesDenominator) const
 Prints the RatesGroup's 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)

Public Attributes

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.
double m_rateAccumulatorOR2
 For stat error.
double m_rateAccumulatorAND2
 For stat error.
bool m_doCachedWeights
 Used in the global rates group.
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.
bool m_useCachedWeights
 Efficiency.
const ExtrapStrat_t m_extrapolationStrategy
 How this group is to scale with luminosity.
const RatesGroupm_masterGroup
 If not nullptr, then use the cached weights info in this master group object.
RatesTriggerm_uniqueTrigger
 If not nullptr, then a trigger this group is calculating the unique rate for.
bool m_isExpressGroup
 If this group is calculating for the express stream - also include express prescales.
std::unordered_map< size_t, std::set< const RatesTrigger * > > m_children

Protected Attributes

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

const std::string m_name
 Name of the group.
const size_t m_nameHash
 Hash of the group's name.
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)

Detailed Description

Used to calculate the rate for a group of RatesTrigger objects at L1 or the HLT.

Definition at line 29 of file RatesGroup.h.

Constructor & Destructor Documentation

◆ RatesGroup() [1/2]

RatesGroup::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 trigger at L1 or the HLT.

Parameters
nameName of the group
msgSvcReference to message service
prescalePrescale to apply to the whole group
doHistogramsFlag to mint histograms or not
doExtrapolationFlag to switch on or off extrapolation within the group

Definition at line 16 of file RatesGroup.cxx.

16 :
17 RatesHistoBase(name, msgSvc, doHistograms),
18 m_name(name),
19 m_nameHash(std::hash<std::string>{}(name)),
24 m_doCachedWeights(false),
26 m_useCachedWeights(false),
28 m_masterGroup(nullptr),
29 m_uniqueTrigger(nullptr),
30 m_isExpressGroup(false),
32 {}
@ kLINEAR
Scale trigger linearly with luminosity.
@ kNONE
Do not scale this trigger for changes in luminosity.
bool m_useCachedWeights
Efficiency.
Definition RatesGroup.h:120
bool m_doCachedWeights
Used in the global rates group.
Definition RatesGroup.h:118
double m_rateAccumulatorOR2
For stat error.
Definition RatesGroup.h:115
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
RatesTrigger * m_uniqueTrigger
If not nullptr, then a trigger this group is calculating the unique rate for.
Definition RatesGroup.h:123
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
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)

◆ ~RatesGroup()

RatesGroup::~RatesGroup ( )
virtual

Definition at line 34 of file RatesGroup.cxx.

34{}

◆ RatesGroup() [2/2]

RatesGroup::RatesGroup ( const RatesGroup & )
delete

Member Function Documentation

◆ addToGroup()

void RatesGroup::addToGroup ( const RatesTrigger * toAdd)

Add a trigger to this group.

It will be stored in a set mapped to its L1 seed. 'All L1' items are mapped under an empty string.

Parameters
toAddPointer to a trigger to add to this group.

Definition at line 59 of file RatesGroup.cxx.

59 {
60 if (m_children.count(toAdd->getSeedHash()) == 0) {
61 m_children.insert( std::make_pair(toAdd->getSeedHash(), std::set<const RatesTrigger*>() ) );
62 m_cachedWeights.insert( std::make_pair(toAdd->getSeedHash(), 1.) );
63 }
64 m_children.at(toAdd->getSeedHash()).insert(toAdd);
65}

◆ 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.

76 {
77 m_rateVsTrain.reset();
78 m_rateVsTrainCachedPtr = nullptr;
79}
TH1 * m_rateVsTrainCachedPtr
Cached, non-owning pointer.
std::unique_ptr< TH1 > m_rateVsTrain
Histogram of rate as a fn.

◆ doHistograms()

bool RatesHistoBase::doHistograms ( ) const
inlineinherited

If histogramming was enabled in this rates object.

Definition at line 99 of file RatesHistoBase.h.

◆ duplicateChildren()

void RatesGroup::duplicateChildren ( const RatesGroup * toDuplicate)

Copy in triggers from another group.

Sets my master

Definition at line 190 of file RatesGroup.cxx.

190 {
191 m_children = toDuplicate->getChildren(); m_masterGroup = toDuplicate;
192}
const std::unordered_map< size_t, std::set< const RatesTrigger * > > & getChildren() const

◆ execute()

void RatesGroup::execute ( const WeightingValuesSummary_t & weights)

Perform group rates evaluation.

We force all HLT chains to only have a single L1 seed, however L1 items may seed many HLT chains. This allows for a factorising algorithm to be utilised. The union (OR) and intercept (AND) are calculated. If this is the master group (the "Main" group of HLT chains) then the sub-weights from all L1 seeds is cached If this is a chain's unique rate group then the cached info from the Main group is used to speed up the calculation Coherent prescales are taken into consideration.

Parameters
weightsStruct of all weighting data which may be required in the calculation

Definition at line 82 of file RatesGroup.cxx.

82 {
83 double weightOR = 1., weightAND = 1.;
84 if (m_doCachedWeights == true) { // Reset cache
85 for (auto& cacheElement : m_cachedWeights) cacheElement.second = 1.;
86 }
87
88 // Need a check for an empty group. Otherwise the "AND" logic will
89 if (m_children.size() == 0) weightAND = 0;
90
91 for (const auto& element : m_children) { // Loop over all children, partitioned by L1 seed
92 const std::set<const RatesTrigger*>& triggers = element.second; // I'm the set of triggers seeded off this item
93
94 double weightL1 = 0;
95 double weightHLT_OR = 1.;
96 double weightHLT_AND = 1.;
97 std::unordered_map<size_t, RatesCPS> weightHLT_CPS; // Map of CPS-group-hash to RatesCPS accumulators
98
99 for (const auto& trigger : triggers) { //
100 if (trigger->getPassed()) {
101
102 const double trigPrescaleReciprocal = 1. / trigger->getPrescale( m_isExpressGroup );
103
104 weightL1 = 1. / trigger->getSeedPrescale();
105 weightHLT_AND *= trigPrescaleReciprocal; // TODO - check that CPS doesn't affect AND
106
107 const size_t CPSID = trigger->getCPSID();
108 if (CPSID == 0) { // No CPS
109 weightHLT_OR *= 1. - trigPrescaleReciprocal;
110 } else { // Keep track for each CPS group
111 RatesCPS& cps = weightHLT_CPS[CPSID];
112 cps.setCoherentFactor( trigger->getCoherentFactor() );
113 cps.execute( 1. / trigPrescaleReciprocal );
114 }
115
116 } else { // Trigger FAILED
117 weightHLT_AND *= 0;
118 }
119
120 // Efficiency check.
121 // If any PS=1 chain passes, the weightHLT_OR = (1 - 1/1) = 0 [which gets inverted to 1 in weightOR below]
122 // If any chain fails, weightHLT_AND = 0
123 if (isZero(weightHLT_OR) && isZero(weightHLT_AND)) break;
124 }
125
126 // Include the CPS chain's contributions
127 for (const auto& cps : weightHLT_CPS) weightHLT_OR *= 1. - cps.second.getWeight();
128
129 weightOR *= 1. - (weightL1 * (1. - weightHLT_OR));
130 weightAND *= weightL1 * weightHLT_AND;
131
132 //if (m_name == "Main") std::cout << "|M|weightL1:" << weightL1 << ",weightHLT_OR:" << weightHLT_OR << ",weightOR:" << weightOR;
133
134 // If we are caching this result for use by the Unique groups
135 if (m_doCachedWeights) {
136 for (auto& cacheElement : m_cachedWeights) {
137 if (cacheElement.first == element.first) continue; // This is the one L1 seed in the combination we're excluding from this cache
138 cacheElement.second *= 1. - (weightL1 * (1. - weightHLT_OR));
139 }
140 }
141
142 }
143
144 // If we are a unique group then we only actually have one element above - the set of L1 items which have
145 // a common seed with our unique trigger. Everything else is identical to the global rate calc so we can fetch it from the cache
146 if (m_useCachedWeights == true) {
147 size_t myOneAndOnlyL1SeedHash = (m_children.begin())->first;
148 weightOR *= m_masterGroup->getCachedWeight( myOneAndOnlyL1SeedHash );
149 }
150
151 //TODO - we currently only let groups scale linearly. Should change this.
152 const double w = weights.m_enhancedBiasWeight * getExtrapolationFactor(weights, m_extrapolationStrategy);
153 const double wOR = w * (1. - weightOR);
154 const double wAND = w * weightAND;
155
156 m_rateAccumulatorOR += wOR;
157 m_rateAccumulatorAND += wAND;
158 m_rateAccumulatorOR2 += wOR * wOR;
159 m_rateAccumulatorAND2 += wAND * wAND;
160
161 if (m_rateVsMuCachedPtr != nullptr) {
162 m_rateVsMuCachedPtr->Fill(weights.m_eventMu, wOR);
163 }
164 if (m_rateVsTrainCachedPtr != nullptr) {
165 m_rateVsTrainCachedPtr->Fill(weights.m_distanceInTrain, wOR);
166 }
167 if (m_dataCachedPtr != nullptr) {
170 }
171
172 if (m_uniqueTrigger != nullptr && m_uniqueTrigger->getDataHist() != nullptr && !m_uniqueTrigger->getDisabled()) {
173 m_uniqueTrigger->getDataHist()->Fill(RatesBinIdentifier_t::kUNIQUE_BIN, wOR);
174 }
175
176}
@ kPASS_WEIGHTED_AND_BIN
Bin used to store the total rate (AND)
@ kPASS_WEIGHTED_OR_BIN
Bin used to store the total rate (OR)
@ kUNIQUE_BIN
Bin used to store data needed to get the unique rate.
double getWeight() const
Return the union product (OR of many chains) coherently weighted by the coherent factor.
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
double getExtrapolationFactor(const WeightingValuesSummary_t &weights, const ExtrapStrat_t strat) const
TH1 * m_rateVsMuCachedPtr
Cached, non-owning pointer.
static bool isZero(double v)
TH1 * m_dataCachedPtr
Cached, non-owning pointer.
double m_enhancedBiasWeight
A property of the event derived from online enhanced bias prescales.
uint32_t m_distanceInTrain
How far into the bunch train the event was, in bunch crossings.
double m_eventMu
The actual number of interactions in the event.

◆ getCachedWeight()

double RatesGroup::getCachedWeight ( const size_t l1Hash) const

Get cached weight from triggers seeding from a given L1 item.

Definition at line 194 of file RatesGroup.cxx.

194{ return m_cachedWeights.at(l1Hash); }

◆ getChildren()

const std::unordered_map< size_t, std::set< const RatesTrigger * > > & RatesGroup::getChildren ( ) const

Definition at line 200 of file RatesGroup.cxx.

200 {
201 return m_children;
202}

◆ 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.

82 {
83 return m_dataCachedPtr; // Caller must be able to deal with nullptr (e.g unique rates groups calling on their trigger)
84}

◆ getExtrapolationFactor()

double RatesHistoBase::getExtrapolationFactor ( const WeightingValuesSummary_t & weights,
const ExtrapStrat_t strat ) const
inherited

Definition at line 96 of file RatesHistoBase.cxx.

96 {
97 switch (strat) {
98 case kLINEAR: return weights.m_linearLumiFactor;
99 case kEXPO_MU: return weights.m_expoMuFactor;
100 case kBUNCH_SCALING: return weights.m_bunchFactor;
101 case kMU_SCALING: return weights.m_muFactor;
102 case kNONE: return weights.m_noScaling;
103 default: ATH_MSG_ERROR("Error in getExtrapolationFactor. Unknown ExtrapStrat_t ENUM supplied " << strat);
104 }
105 return 0.;
106}
#define ATH_MSG_ERROR(x)
@ kMU_SCALING
Scale trigger linearly but only in the change in <mu>
@ kBUNCH_SCALING
Scale trigger linearly but only in the number of bunches.
@ kEXPO_MU
Scale trigger linearly in bunches and exponentially in mu.
const double m_noScaling
Weight for no scaling.
double m_muFactor
What weight needs to be applied to extrapolate rates linear in mu.
double m_expoMuFactor
What weight needs to be applied to extrapolate rates linear in bunches and exponential in mu.
double m_linearLumiFactor
What weight needs to be applied to extrapolate rates linear in mu and bunches.
double m_bunchFactor
What weight needs to be applied to extrapolate rates linear in number of bunches.

◆ getExtrapolationFactorString()

const std::string & RatesHistoBase::getExtrapolationFactorString ( ExtrapStrat_t strat) const
inherited

Definition at line 87 of file RatesHistoBase.cxx.

87 {
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));
90}

◆ getUniqueTrigger()

RatesTrigger * RatesGroup::getUniqueTrigger ( )

Get the trigger I am doing unique rates for.

Definition at line 198 of file RatesGroup.cxx.

198{ return m_uniqueTrigger; }

◆ getUniqueWeight()

double RatesGroup::getUniqueWeight ( const double ratesDenominator) const

Get the unique rate of a unique-rate group For a group being used to get a unique rate, we need to subtract the rate of this group of N-1 chains from the master group of N chains.

Returns
the unique rate of the trigger being calculated by this group

Definition at line 178 of file RatesGroup.cxx.

178 {
179 const double diff = m_masterGroup->m_rateAccumulatorOR - m_rateAccumulatorOR;
180 if (isZero(diff)) return 0.;
181 return diff / ratesDenominator;
182}
void diff(const Jet &rJet1, const Jet &rJet2, std::map< std::string, double > varDiff)
Difference between jets - Non-Class function required by trigger.
Definition Jet.cxx:631

◆ giveDataHist()

StatusCode RatesHistoBase::giveDataHist ( const ServiceHandle< ITHistSvc > & svc,
const std::string & name )
inherited

Definition at line 66 of file RatesHistoBase.cxx.

66 {
67 if (!m_data.get()) {
68 ATH_MSG_ERROR("RatesHistoBase::giveDataHist Warning requested histograms when histograming is OFF here.");
69 return StatusCode::FAILURE;
70 }
71 ATH_CHECK( svc->regHist(name, std::move(m_data)) );
72 return StatusCode::SUCCESS;
73}
#define ATH_CHECK
Evaluate an expression and check for errors.
std::unique_ptr< TH1 > m_data
Histogram of raw rates quantites, for when we need to normalise offline (e.g.
AthROOTErrorHandlerSvc * svc

◆ giveMuHist()

StatusCode RatesHistoBase::giveMuHist ( const ServiceHandle< ITHistSvc > & svc,
const std::string & name )
inherited

Definition at line 46 of file RatesHistoBase.cxx.

46 {
47 if (!m_rateVsMu.get()) {
48 ATH_MSG_ERROR("RatesHistoBase::giveMuHist Warning requested histograms when histograming is OFF here.");
49 return StatusCode::FAILURE;
50 }
51 ATH_CHECK( svc->regHist(name, std::move(m_rateVsMu)) );
52 return StatusCode::SUCCESS;
53}
std::unique_ptr< TH1 > m_rateVsMu
Histogram of rate as a fn.

◆ giveTrainHist()

StatusCode RatesHistoBase::giveTrainHist ( const ServiceHandle< ITHistSvc > & svc,
const std::string & name )
inherited

Definition at line 56 of file RatesHistoBase.cxx.

56 {
57 if (!m_rateVsTrain.get()) {
58 ATH_MSG_ERROR("RatesHistoBase::giveTrainHist Warning requested histograms when histograming is OFF here.");
59 return StatusCode::FAILURE;
60 }
61 ATH_CHECK( svc->regHist(name, std::move(m_rateVsTrain)) );
62 return StatusCode::SUCCESS;
63}

◆ 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.

40{
42 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)

◆ isNotPositive()

bool RatesHistoBase::isNotPositive ( double v)
inlinestaticinherited

Definition at line 104 of file RatesHistoBase.h.

104{ return v < std::numeric_limits<double>::min(); } //<! Helper fn to check if the value is non positive = trigger is disabled

◆ isZero()

bool RatesHistoBase::isZero ( double v)
inlinestaticinherited

Definition at line 103 of file RatesHistoBase.h.

103{ return abs(v) < std::numeric_limits<double>::min(); } //<! Helper fn

◆ 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 163 of file AthMessaging.h.

164{
165 MsgStream* ms = m_msg_tls.get();
166 if (!ms) {
167 if (!m_initialized.test_and_set()) initMessaging();
168 ms = new MsgStream(m_imsg,m_nm);
169 m_msg_tls.reset( ms );
170 }
171
172 ms->setLevel (m_lvl);
173 return *ms;
174}
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
void initMessaging() const
Initialize our message level and MessageSvc.

◆ 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 178 of file AthMessaging.h.

179{ return msg() << lvl; }
MsgStream & msg() const
The standard message stream.

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152{
153 if (m_lvl <= lvl) {
154 msg() << lvl;
155 return true;
156 } else {
157 return false;
158 }
159}

◆ operator=()

RatesGroup & RatesGroup::operator= ( const RatesGroup & )
delete

◆ printConfig()

const std::string RatesGroup::printConfig ( ) const

Prints the RatesGroup's configuration.

Definition at line 36 of file RatesGroup.cxx.

36 {
37 std::stringstream ss;
38 ss << m_name << std::endl;
39 for (const auto& child : m_children) {
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;
43 }
44 }
45 return ss.str();
46}
static Double_t ss

◆ printRate()

const std::string RatesGroup::printRate ( const double ratesDenominator) const

Prints the RatesGroup's rate.

Parameters
ratesDenominatorThe walltime for the run, needed to normalise from integrated weighted counts to a rate.

Definition at line 48 of file RatesGroup.cxx.

48 {
49 std::stringstream ss;
50 ss <<"RateOR: " << std::setw(11) << std::right << m_rateAccumulatorOR/ratesDenominator
51 << " +- " << std::setw(11) << std::left << sqrt(m_rateAccumulatorOR2)/ratesDenominator << " Hz, "
52 << " RateAND: " << std::setw(11) << std::right << m_rateAccumulatorAND/ratesDenominator
53 << " +- " << std::setw(11) << std::left << sqrt(m_rateAccumulatorAND2)/ratesDenominator << " Hz"
54 << " : " << m_name
56 return ss.str();
57}
const std::string & getExtrapolationFactorString(ExtrapStrat_t strat) const

◆ removeFromGroup()

void RatesGroup::removeFromGroup ( const RatesTrigger * toRemove)

Remove a trigger from this group.

It will be removed from the set mapped to its L1 seed. 'All L1' items are mapped under an empty string.

Parameters
toAddPointer to a trigger to be removed.

Definition at line 67 of file RatesGroup.cxx.

67 {
68 if (m_children.count(toRemove->getSeedHash()) == 0) return;
69 m_children.at(toRemove->getSeedHash()).erase(toRemove);
70}

◆ removeOtherL1()

void RatesGroup::removeOtherL1 ( const RatesTrigger * toKeep)

Remove from the groups mapping all triggers which have a dissimilar seed to the supplied trigger.

The group will be left with exactly one set of triggers with a common L1 seed. This is used in unique rates groups which can use a lot of the calculations done by the master rates group

Parameters
toKeepPointer to a trigger. All other triggers which do not share toKeep's L1 seed will be removed.

Definition at line 72 of file RatesGroup.cxx.

72 {
73 for (auto iterator = m_children.begin(); iterator != m_children.end(); /*noop*/) {
74 if (iterator->first == toKeep->getSeedHash()) {
75 ++iterator; // Keep
76 } else {
77 iterator = m_children.erase(iterator);
78 }
79 }
80}
size_t getSeedHash() const
JetConstituentVector::iterator iterator

◆ setDataName()

void RatesHistoBase::setDataName ( const std::string & newName)
inherited

Definition at line 92 of file RatesHistoBase.cxx.

◆ setDoCachedWeights()

void RatesGroup::setDoCachedWeights ( const bool i)

Flag group to cache weights.

Called only on the Master group

Definition at line 186 of file RatesGroup.cxx.

◆ setExpressGroup()

void RatesGroup::setExpressGroup ( const bool i)

Flag this group as the express group (modifies group trigger's prescales)

Definition at line 184 of file RatesGroup.cxx.

184{ m_isExpressGroup = i; }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level lvl)
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.

29{
30 m_lvl = lvl;
31}

◆ setRateVsMuName()

void RatesHistoBase::setRateVsMuName ( const std::string & newName)
inherited

Definition at line 93 of file RatesHistoBase.cxx.

93{if (m_rateVsMu) m_rateVsMu->SetName(newName.c_str());}

◆ setRateVsTrainName()

void RatesHistoBase::setRateVsTrainName ( const std::string & newName)
inherited

Definition at line 94 of file RatesHistoBase.cxx.

94{if (m_rateVsTrain) m_rateVsTrain->SetName(newName.c_str());}

◆ setUniqueTrigger()

void RatesGroup::setUniqueTrigger ( RatesTrigger * trigger)

Set trigger I am doing unique rates for.

Definition at line 196 of file RatesGroup.cxx.

196{ m_uniqueTrigger = trigger; }

◆ setUseCachedWeights()

void RatesGroup::setUseCachedWeights ( const bool i)

Set to use cached weights from the Master group (need ptr to m_masterGroup)

Definition at line 188 of file RatesGroup.cxx.

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_cachedWeights

std::unordered_map<size_t, double> RatesGroup::m_cachedWeights

Cached weight of the OR of all triggers except for the L1 seed-hash of the key here.

Definition at line 119 of file RatesGroup.h.

◆ m_children

std::unordered_map<size_t, std::set<const RatesTrigger*> > RatesGroup::m_children

Definition at line 127 of file RatesGroup.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 115 of file RatesHistoBase.h.

◆ m_dataCachedPtr

TH1* RatesHistoBase::m_dataCachedPtr {}
protectedinherited

Cached, non-owning pointer.

Definition at line 118 of file RatesHistoBase.h.

118{};

◆ m_doCachedWeights

bool RatesGroup::m_doCachedWeights

Used in the global rates group.

Cache extra information for the benefit of the unique rate groups

Definition at line 118 of file RatesGroup.h.

◆ m_doHistograms

bool RatesHistoBase::m_doHistograms
protectedinherited

If histogramming is switched on.

Definition at line 112 of file RatesHistoBase.h.

◆ m_extrapolationStrategy

const ExtrapStrat_t RatesGroup::m_extrapolationStrategy

How this group is to scale with luminosity.

Currently supported are linear and none.

Definition at line 121 of file RatesGroup.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_isExpressGroup

bool RatesGroup::m_isExpressGroup

If this group is calculating for the express stream - also include express prescales.

Definition at line 125 of file RatesGroup.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ m_masterGroup

const RatesGroup* RatesGroup::m_masterGroup

If not nullptr, then use the cached weights info in this master group object.

Definition at line 122 of file RatesGroup.h.

◆ 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 RatesGroup::m_name
private

Name of the group.

Definition at line 110 of file RatesGroup.h.

◆ m_nameHash

const size_t RatesGroup::m_nameHash
private

Hash of the group's name.

Definition at line 111 of file RatesGroup.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_rateAccumulatorAND

double RatesGroup::m_rateAccumulatorAND

Numerator for the rate of the AND of all triggers.

Definition at line 114 of file RatesGroup.h.

◆ m_rateAccumulatorAND2

double RatesGroup::m_rateAccumulatorAND2

For stat error.

Definition at line 116 of file RatesGroup.h.

◆ m_rateAccumulatorOR

double RatesGroup::m_rateAccumulatorOR

Numerator for the rate of the OR of all triggers.

Definition at line 113 of file RatesGroup.h.

◆ m_rateAccumulatorOR2

double RatesGroup::m_rateAccumulatorOR2

For stat error.

Definition at line 115 of file RatesGroup.h.

◆ 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 113 of file RatesHistoBase.h.

◆ m_rateVsMuCachedPtr

TH1* RatesHistoBase::m_rateVsMuCachedPtr {}
protectedinherited

Cached, non-owning pointer.

Definition at line 116 of file RatesHistoBase.h.

116{};

◆ m_rateVsTrain

std::unique_ptr<TH1> RatesHistoBase::m_rateVsTrain
protectedinherited

Histogram of rate as a fn.

of position in bunch train

Definition at line 114 of file RatesHistoBase.h.

◆ m_rateVsTrainCachedPtr

TH1* RatesHistoBase::m_rateVsTrainCachedPtr {}
protectedinherited

Cached, non-owning pointer.

Definition at line 117 of file RatesHistoBase.h.

117{};

◆ m_uniqueTrigger

RatesTrigger* RatesGroup::m_uniqueTrigger

If not nullptr, then a trigger this group is calculating the unique rate for.

Needs non-const as fills a histo

Definition at line 123 of file RatesGroup.h.

◆ m_useCachedWeights

bool RatesGroup::m_useCachedWeights

Efficiency.

Required m_masterGroup to have been set.

Definition at line 120 of file RatesGroup.h.


The documentation for this class was generated from the following files: