ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | Private Member Functions | Private Attributes | List of all members
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. More...
 
virtual ~RatesGroup ()
 
 RatesGroup (const RatesGroup &)=delete
 
RatesGroupoperator= (const RatesGroup &)=delete
 
void addToGroup (const RatesTrigger *toAdd)
 Add a trigger to this group. More...
 
void removeFromGroup (const RatesTrigger *toRemove)
 Remove a trigger from this group. More...
 
void removeOtherL1 (const RatesTrigger *toKeep)
 Remove from the groups mapping all triggers which have a dissimilar seed to the supplied trigger. More...
 
void execute (const WeightingValuesSummary_t &weights)
 Perform group rates evaluation. More...
 
void setExpressGroup (const bool i)
 Flag this group as the express group (modifies group trigger's prescales) More...
 
void setDoCachedWeights (const bool i)
 Flag group to cache weights. More...
 
void setUseCachedWeights (const bool i)
 Set to use cached weights from the Master group (need ptr to m_masterGroup) More...
 
void duplicateChildren (const RatesGroup *toDuplicate)
 Copy in triggers from another group. More...
 
double getCachedWeight (const size_t l1Hash) const
 Get cached weight from triggers seeding from a given L1 item. More...
 
void setUniqueTrigger (RatesTrigger *trigger)
 Set trigger I am doing unique rates for. More...
 
RatesTriggergetUniqueTrigger ()
 Get the trigger I am doing unique rates for. More...
 
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. More...
 
const std::unordered_map< size_t, std::set< const RatesTrigger * > > & getChildren () const
 
const std::string printConfig () const
 Prints the RatesGroup's configuration. More...
 
const std::string printRate (const double ratesDenominator) const
 Prints the RatesGroup's rate. More...
 
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. More...
 
TH1 * getDataHist ()
 
bool doHistograms () const
 If histogramming was enabled in this rates object. More...
 
const std::string & getExtrapolationFactorString (ExtrapStrat_t strat) const
 
double getExtrapolationFactor (const WeightingValuesSummary_t &weights, const ExtrapStrat_t strat) const
 
bool msgLvl (const MSG::Level lvl) const
 Test the output level. More...
 
MsgStream & msg () const
 The standard message stream. More...
 
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream. More...
 
void setLevel (MSG::Level lvl)
 Change the current logging level. More...
 

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

Protected Attributes

bool m_doHistograms
 If histogramming is switched on. More...
 
std::unique_ptr< TH1 > m_rateVsMu
 Histogram of rate as a fn. More...
 
std::unique_ptr< TH1 > m_rateVsTrain
 Histogram of rate as a fn. More...
 
std::unique_ptr< TH1 > m_data
 Histogram of raw rates quantites, for when we need to normalise offline (e.g. More...
 
TH1 * m_rateVsMuCachedPtr
 Cached, non-owning pointer. More...
 
TH1 * m_rateVsTrainCachedPtr
 Cached, non-owning pointer. More...
 
TH1 * m_dataCachedPtr
 Cached, non-owning pointer. More...
 
bool m_givenRateVsMu
 m_rateVsMu has been given to the THistSvc and should not be deleted More...
 
bool m_givenRateVsTrain
 m_rateVsTrain has been given to the THistSvc and should not be deleted More...
 
bool m_givenData
 m_data has been given to the THistSvc and should not be deleted More...
 

Private Member Functions

void initMessaging () const
 Initialize our message level and MessageSvc. More...
 

Private Attributes

const std::string m_name
 Name of the group. More...
 
const size_t m_nameHash
 Hash of the group's name. More...
 
std::string m_nm
 Message source name. More...
 
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels) More...
 
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer. More...
 
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level. More...
 
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging) More...
 

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  :
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),
31  m_children()
32  {}

◆ ~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 77 of file RatesHistoBase.cxx.

77  {
78  m_rateVsTrain.reset();
79  m_rateVsTrainCachedPtr = nullptr;
80 }

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

◆ 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()) {
174  }
175 
176 }

◆ 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 83 of file RatesHistoBase.cxx.

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

◆ getExtrapolationFactor()

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

Definition at line 94 of file RatesHistoBase.cxx.

94  {
95  switch (strat) {
96  case kLINEAR: return weights.m_linearLumiFactor;
97  case kEXPO_MU: return weights.m_expoMuFactor;
98  case kBUNCH_SCALING: return weights.m_bunchFactor;
99  case kMU_SCALING: return weights.m_muFactor;
100  case kNONE: return weights.m_noScaling;
101  default: ATH_MSG_ERROR("Error in getExtrapolationFactor. Unknown ExtrapStrat_t ENUM supplied " << strat);
102  }
103  return 0.;
104 }

◆ getExtrapolationFactorString()

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

Definition at line 88 of file RatesHistoBase.cxx.

88  {
89  static const std::vector<std::string> values{"LINEAR_L","LINEAR_BUNCH_EXPO_MU","LINEAR_BUNCHES","LINEAR_MU","NONE"};
90  return values.at(static_cast<size_t>(strat));
91 }

◆ 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  {
180  if (isZero(diff)) return 0.;
181  return diff / ratesDenominator;
182 }

◆ giveDataHist()

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

Definition at line 67 of file RatesHistoBase.cxx.

67  {
68  if (!m_data.get()) {
69  ATH_MSG_ERROR("RatesHistoBase::giveDataHist Warning requested histograms when histograming is OFF here.");
70  return StatusCode::FAILURE;
71  }
72  ATH_CHECK( svc->regHist(name, std::move(m_data)) );
73  return StatusCode::SUCCESS;
74 }

◆ giveMuHist()

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

Definition at line 47 of file RatesHistoBase.cxx.

47  {
48  if (!m_rateVsMu.get()) {
49  ATH_MSG_ERROR("RatesHistoBase::giveMuHist Warning requested histograms when histograming is OFF here.");
50  return StatusCode::FAILURE;
51  }
52  ATH_CHECK( svc->regHist(name, std::move(m_rateVsMu)) );
53  return StatusCode::SUCCESS;
54 }

◆ giveTrainHist()

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

Definition at line 57 of file RatesHistoBase.cxx.

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

◆ 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  m_lvl = m_imsg ?
43  static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
44  MSG::INFO;
45 }

◆ isNotPositive()

static bool RatesHistoBase::isNotPositive ( double  v)
inlinestaticinherited

Definition at line 104 of file RatesHistoBase.h.

104 { return v < 1e-10; } //<! Helper fn to check if the value is non positive = trigger is disabled

◆ isZero()

static bool RatesHistoBase::isZero ( double  v)
inlinestaticinherited

Definition at line 103 of file RatesHistoBase.h.

103 { return fabs(v) < 1e-10; } //<! 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 164 of file AthMessaging.h.

165 {
166  MsgStream* ms = m_msg_tls.get();
167  if (!ms) {
168  if (!m_initialized.test_and_set()) initMessaging();
169  ms = new MsgStream(m_imsg,m_nm);
170  m_msg_tls.reset( ms );
171  }
172 
173  ms->setLevel (m_lvl);
174  return *ms;
175 }

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

180 { return msg() << lvl; }

◆ 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_initialized.test_and_set()) initMessaging();
154  if (m_lvl <= lvl) {
155  msg() << lvl;
156  return true;
157  } else {
158  return false;
159  }
160 }

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

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

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

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

186 { m_doCachedWeights = i; }

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

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

188 { m_useCachedWeights = i; }

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

◆ m_dataCachedPtr

TH1* RatesHistoBase::m_dataCachedPtr
protectedinherited

Cached, non-owning pointer.

Definition at line 115 of file RatesHistoBase.h.

◆ 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 109 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_givenData

bool RatesHistoBase::m_givenData
protectedinherited

m_data has been given to the THistSvc and should not be deleted

Definition at line 118 of file RatesHistoBase.h.

◆ m_givenRateVsMu

bool RatesHistoBase::m_givenRateVsMu
protectedinherited

m_rateVsMu has been given to the THistSvc and should not be deleted

Definition at line 116 of file RatesHistoBase.h.

◆ m_givenRateVsTrain

bool RatesHistoBase::m_givenRateVsTrain
protectedinherited

m_rateVsTrain has been given to the THistSvc and should not be deleted

Definition at line 117 of file RatesHistoBase.h.

◆ m_imsg

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

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

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

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

◆ m_rateVsMuCachedPtr

TH1* RatesHistoBase::m_rateVsMuCachedPtr
protectedinherited

Cached, non-owning pointer.

Definition at line 113 of file RatesHistoBase.h.

◆ m_rateVsTrain

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

Histogram of rate as a fn.

of position in bunch train

Definition at line 111 of file RatesHistoBase.h.

◆ m_rateVsTrainCachedPtr

TH1* RatesHistoBase::m_rateVsTrainCachedPtr
protectedinherited

Cached, non-owning pointer.

Definition at line 114 of file RatesHistoBase.h.

◆ 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:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
kUNIQUE_BIN
@ kUNIQUE_BIN
Bin used to store data needed to get the unique rate.
Definition: RatesHistoBase.h:48
RatesTrigger::getSeedHash
size_t getSeedHash() const
Definition: RatesTrigger.cxx:145
RatesGroup::m_uniqueTrigger
RatesTrigger * m_uniqueTrigger
If not nullptr, then a trigger this group is calculating the unique rate for.
Definition: RatesGroup.h:123
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
RatesHistoBase::m_dataCachedPtr
TH1 * m_dataCachedPtr
Cached, non-owning pointer.
Definition: RatesHistoBase.h:115
RatesGroup::m_isExpressGroup
bool m_isExpressGroup
If this group is calculating for the express stream - also include express prescales.
Definition: RatesGroup.h:125
RatesGroup::m_name
const std::string m_name
Name of the group.
Definition: RatesGroup.h:110
RatesGroup::m_rateAccumulatorAND2
double m_rateAccumulatorAND2
For stat error.
Definition: RatesGroup.h:116
mc.diff
diff
Definition: mc.SFGenPy8_MuMu_DD.py:14
RatesGroup::m_extrapolationStrategy
const ExtrapStrat_t m_extrapolationStrategy
How this group is to scale with luminosity.
Definition: RatesGroup.h:121
kMU_SCALING
@ kMU_SCALING
Scale trigger linearly but only in the change in <mu>
Definition: RatesHistoBase.h:34
RatesGroup::getCachedWeight
double getCachedWeight(const size_t l1Hash) const
Get cached weight from triggers seeding from a given L1 item.
Definition: RatesGroup.cxx:194
python.TrigTLAMonitorAlgorithm.triggers
triggers
Definition: TrigTLAMonitorAlgorithm.py:196
RatesGroup::m_nameHash
const size_t m_nameHash
Hash of the group's name.
Definition: RatesGroup.h:111
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
python.Bindings.values
values
Definition: Control/AthenaPython/python/Bindings.py:805
RatesGroup::m_masterGroup
const RatesGroup * m_masterGroup
If not nullptr, then use the cached weights info in this master group object.
Definition: RatesGroup.h:122
RatesGroup::m_children
std::unordered_map< size_t, std::set< const RatesTrigger * > > m_children
Definition: RatesGroup.h:127
kPASS_WEIGHTED_OR_BIN
@ kPASS_WEIGHTED_OR_BIN
Bin used to store the total rate (OR)
Definition: RatesHistoBase.h:45
RatesCPS::setCoherentFactor
void setCoherentFactor(const double coherentFactor)
Set a common prescale factor for this group.
Definition: RatesGroup.h:17
python.UpdateManyBadChannelIOVs.toRemove
tuple toRemove
Definition: UpdateManyBadChannelIOVs.py:87
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
kLINEAR
@ kLINEAR
Scale trigger linearly with luminosity.
Definition: RatesHistoBase.h:31
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
RatesHistoBase::getDataHist
TH1 * getDataHist()
Definition: RatesHistoBase.cxx:83
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
lumiFormat.i
int i
Definition: lumiFormat.py:85
RatesHistoBase::m_data
std::unique_ptr< TH1 > m_data
Histogram of raw rates quantites, for when we need to normalise offline (e.g.
Definition: RatesHistoBase.h:112
RatesHistoBase::getExtrapolationFactor
double getExtrapolationFactor(const WeightingValuesSummary_t &weights, const ExtrapStrat_t strat) const
Definition: RatesHistoBase.cxx:94
kEXPO_MU
@ kEXPO_MU
Scale trigger linearly in bunches and exponentially in mu.
Definition: RatesHistoBase.h:32
RatesHistoBase::m_rateVsMu
std::unique_ptr< TH1 > m_rateVsMu
Histogram of rate as a fn.
Definition: RatesHistoBase.h:110
RatesHistoBase::m_rateVsTrain
std::unique_ptr< TH1 > m_rateVsTrain
Histogram of rate as a fn.
Definition: RatesHistoBase.h:111
kBUNCH_SCALING
@ kBUNCH_SCALING
Scale trigger linearly but only in the number of bunches.
Definition: RatesHistoBase.h:33
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
RatesHistoBase::m_rateVsTrainCachedPtr
TH1 * m_rateVsTrainCachedPtr
Cached, non-owning pointer.
Definition: RatesHistoBase.h:114
RatesGroup::m_doCachedWeights
bool m_doCachedWeights
Used in the global rates group.
Definition: RatesGroup.h:118
DeMoUpdate.toAdd
bool toAdd
Definition: DeMoUpdate.py:1304
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
RatesHistoBase::RatesHistoBase
RatesHistoBase(const std::string &name, IMessageSvc *msgSvc, const bool doHistograms=true)
Definition: RatesHistoBase.cxx:10
RatesTrigger::getDisabled
bool getDisabled() const
If I or my seed were prescaled out.
Definition: RatesTrigger.cxx:159
RatesHistoBase::m_rateVsMuCachedPtr
TH1 * m_rateVsMuCachedPtr
Cached, non-owning pointer.
Definition: RatesHistoBase.h:113
RatesGroup::m_rateAccumulatorOR2
double m_rateAccumulatorOR2
For stat error.
Definition: RatesGroup.h:115
kPASS_WEIGHTED_AND_BIN
@ kPASS_WEIGHTED_AND_BIN
Bin used to store the total rate (AND)
Definition: RatesHistoBase.h:46
RatesHistoBase::isZero
static bool isZero(double v)
Definition: RatesHistoBase.h:103
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
RatesCPS::execute
void execute(const double prescale)
Keep track of a union product (OR of many chains) excluding the coherent part.
Definition: RatesGroup.cxx:8
weights
Definition: herwig7_interface.h:44
python.PyAthena.v
v
Definition: PyAthena.py:154
RatesHistoBase::doHistograms
bool doHistograms() const
If histogramming was enabled in this rates object.
Definition: RatesHistoBase.h:99
RatesGroup::getChildren
const std::unordered_map< size_t, std::set< const RatesTrigger * > > & getChildren() const
Definition: RatesGroup.cxx:200
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
DeMoScan.first
bool first
Definition: DeMoScan.py:536
RatesGroup::m_rateAccumulatorOR
double m_rateAccumulatorOR
Numerator for the rate of the OR of all triggers.
Definition: RatesGroup.h:113
RatesGroup::m_rateAccumulatorAND
double m_rateAccumulatorAND
Numerator for the rate of the AND of all triggers.
Definition: RatesGroup.h:114
RatesGroup::m_cachedWeights
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
AthMessaging::initMessaging
void initMessaging() const
Initialize our message level and MessageSvc.
Definition: AthMessaging.cxx:39
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
AthMessaging::m_msg_tls
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
Definition: AthMessaging.h:132
RatesCPS::getWeight
double getWeight() const
Return the union product (OR of many chains) coherently weighted by the coherent factor.
Definition: RatesGroup.cxx:12
RatesCPS
Helper class to keep track of coherent prescales between chains in a group This class knows about its...
Definition: RatesGroup.h:14
RatesGroup::m_useCachedWeights
bool m_useCachedWeights
Efficiency.
Definition: RatesGroup.h:120
RatesHistoBase::getExtrapolationFactorString
const std::string & getExtrapolationFactorString(ExtrapStrat_t strat) const
Definition: RatesHistoBase.cxx:88
kNONE
@ kNONE
Do not scale this trigger for changes in luminosity.
Definition: RatesHistoBase.h:35