ATLAS Offline Software
RatesAnalysisAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // RatesAnalysis includes
7 
9 
11 #include "TrigConfData/HLTMenu.h"
12 #include "TrigConfData/L1Menu.h"
15 //uncomment the line below to use the HistSvc for outputting trees and histograms
16 #include "GaudiKernel/ITHistSvc.h"
17 #include "TH1.h"
19 #include <sstream>
20 
21 
22 RatesAnalysisAlg::RatesAnalysisAlg( const std::string& name, ISvcLocator* pSvcLocator ) :
23  AthAnalysisAlgorithm( name, pSvcLocator ),
24  m_linearLumiFactor(0),
25  m_weightingValues(),
26  m_ratesDenominator(0),
27  m_targetMu(0.),
28  m_targetBunches(0.),
29  m_targetLumi(0.),
30  m_runNumber(0.),
31  m_eventCounter(0),
32  m_weightedEventCounter(0),
33  m_scalingHist(nullptr),
34  m_bcidHist(nullptr),
35  m_metadataTree(nullptr)
36 {}
37 
39 
41  const double thresholdMin,
42  const double thresholdMax,
43  const uint32_t thresholdBins,
45  const double prescale,
46  const std::string& seedName,
47  const double seedPrecale,
48  const Method_t method,
49  const ExtrapStrat_t extrapolation) {
50 
51  if (method != kMANUAL) {
52  ATH_MSG_ERROR("Sorry - ScanTriggers have to be implemented with the kMANUAL method for now.");
53  return StatusCode::FAILURE;
54  }
55 
57  m_scanTriggers.emplace(name, std::make_unique<RatesScanTrigger>(name, msgSvc(), thresholdMin, thresholdMax, thresholdBins, behaviour, prescale, seedName, seedPrecale, e));
59  if (isRandomSeed(name, seedName)) newScanTrigger->setSeedsFromRandom(true);
60  ATH_MSG_DEBUG("newScanTrigger " << name << " added");
61  return StatusCode::SUCCESS;
62 }
63 
64 
66  const std::vector<double>& thresholdBinEdges,
68  const double prescale,
69  const std::string& seedName,
70  const double seedPrecale,
71  const Method_t method,
72  const ExtrapStrat_t extrapolation) {
73 
74  if (method != kMANUAL) {
75  ATH_MSG_ERROR("Sorry - ScanTriggers have to be implemented with the kMANUAL method for now.");
76  return StatusCode::FAILURE;
77  }
78 
80 
81  m_scanTriggers.emplace(name, std::make_unique<RatesScanTrigger>(name, msgSvc(), thresholdBinEdges, behaviour, prescale, seedName, seedPrecale, e));
83  if (isRandomSeed(name, seedName)) newScanTrigger->setSeedsFromRandom(true);
84  ATH_MSG_DEBUG("newScanTrigger " << name << " added");
85  return StatusCode::SUCCESS;
86 }
87 
88 
90  const double prescale,
91  const double expressPrescale,
92  const std::string& seedName,
93  const double seedPrecale,
94  const std::string& groups,
95  const Method_t method,
96  const ExtrapStrat_t extrapolation) {
97 
98  std::set<std::string> groupSet;
99  std::istringstream ss(groups);
100  while (ss) {
101  std::string group;
102  if (!std::getline(ss, group, ',')) break;
103  groupSet.insert(group);
104  }
105 
106  return newTrigger(name, prescale, expressPrescale, seedName, seedPrecale, groupSet, method, extrapolation);
107 }
108 
110  const double prescale,
111  const double expressPrescale,
112  const std::string& seedName,
113  const double seedPrecale,
114  const std::set<std::string>& groups,
115  const Method_t method,
116  const ExtrapStrat_t extrapolation) {
117 
118  if (m_eventCounter > 1) { // All triggers must be defined before we start looping over the sample
119  ATH_MSG_FATAL("Too late to call newTrigger. All emulated triggers must be registered during ratesInitialize().");
120  return StatusCode::FAILURE;
121  }
122  if (method == kEXISTING) ATH_CHECK( checkExistingTrigger(name, seedName) ); // Check this agrees with what is in the AOD
123 
124  // Check if it already exists
125  if (m_triggers.count(name) == 1) {
126  ATH_MSG_WARNING("Trigger " << name << " is already registered.");
127  return StatusCode::SUCCESS;
128  }
129 
130  const ExtrapStrat_t e = (m_enableLumiExtrapolation ? extrapolation : ExtrapStrat_t::kNONE);
131  m_triggers.emplace(name, std::make_unique<RatesTrigger>(name, msgSvc(), prescale, expressPrescale, seedName, seedPrecale, m_doHistograms, e));
132  RatesTrigger* newTriggerPtr = m_triggers.at(name).get();
133 
134  if (isRandomSeed(name, seedName)) newTriggerPtr->setSeedsFromRandom(true);
135 
136  // Only worthwhile doing the remainder if the trigger is not disabled. Otherwise will slow everything down
137  if (newTriggerPtr->getDisabled()) {
138  ATH_MSG_DEBUG("newTrigger " << name << " added (disabled)");
139  return StatusCode::SUCCESS;
140  }
141 
142  if (method == kAUTO) {
143  m_autoTriggers.push_back(name);
144  } else if (method == kEXISTING) {
145  m_existingTriggers[name] = m_tdt->getChainGroup(name);
147  }
148 
149  // Add this trigger to its groups
150  if (m_doTriggerGroups) {
151  for (const std::string& group : groups) {
152  // Ignore BW and PS groups
153  if (group.starts_with("BW") || group.starts_with("PS") || group.starts_with("STREAM:express")) continue;
154 
155  const auto [it, inserted] = m_groups.try_emplace(group, std::make_unique<RatesGroup>(group, msgSvc(), m_doHistograms, m_enableLumiExtrapolation));
156  if (inserted) {
157  // As the group is formed from at least one active trigger - it must be active itself (counter example - CPS group of a PS=-1 trigger)
158  m_activeGroups.insert( it->second.get() );
159  }
160  it->second->addToGroup( newTriggerPtr );
161  // For CPS, we let the trigger know that it is special
162  if (isCPS(group)) {
163  if (newTriggerPtr->getCPSID() != 0) ATH_MSG_WARNING("Trigger " << name << " can only be in one coherent prescale group.");
164  newTriggerPtr->setCPS(group); // This changes the CPSID
165  const size_t CPSID = newTriggerPtr->getCPSID();
166  // Find the lowest prescale of any member in this CPS group
167  m_lowestPrescale.try_emplace(CPSID, FLT_MAX);
168  if (prescale < m_lowestPrescale[CPSID]) m_lowestPrescale[CPSID] = prescale;
169  }
170  }
171  }
172 
173  // Add to total rates
174  const uint32_t level = getLevel(name);
175  if (m_doGlobalGroups) {
176  if (level == 2) m_globalGroups.at(m_l2GroupName)->addToGroup( newTriggerPtr );
177  else if (level == 1) m_globalGroups.at(m_l1GroupName)->addToGroup( newTriggerPtr );
178  }
179  // Add to express group - if express prescale is enabled
180  if (level == 2 && expressPrescale >= 1) {
181  if (m_doGlobalGroups) m_globalGroups.at(m_expressGroupName)->addToGroup( newTriggerPtr );
182  if (m_doExpressRates) m_expressTriggers.insert( newTriggerPtr );
183  }
184 
185  ATH_MSG_DEBUG("newTrigger " << name << " added");
186  return StatusCode::SUCCESS;
187 }
188 
191  return addExisting(".*");
192 }
193 
194 const std::unordered_map<std::string, std::unique_ptr<RatesTrigger>>& RatesAnalysisAlg::getTriggerMap() const {
195  return m_triggers;
196 }
197 
199  // Check we have the TDT
201 
202  const auto& triggers = m_tdt->getListOfTriggers(pattern);
203  ATH_MSG_INFO("Read " << triggers.size() << " triggers from AOD.");
204 
205  // Check if chain was disabled in athena job
206  const bool runWithPrescaleJSON = !m_prescalesJSON.value().empty();
207  const TrigConf::HLTPrescalesSet& hltPrescalesSet = m_configSvc->hltPrescalesSet(Gaudi::Hive::currentContext());
208  for( auto & p : hltPrescalesSet.data().get_child("prescales") ) {
209  if ((!m_prescalesJSON.value().count(p.first) && !runWithPrescaleJSON) || hltPrescalesSet.prescale(p.first).prescale < 0){
210  m_prescalesJSON[p.first]["prescale"] = (hltPrescalesSet.prescale(p.first).enabled ? hltPrescalesSet.prescale(p.first).prescale : -1);
211  m_prescalesJSON[p.first]["prescale_express"] = (hltPrescalesSet.prescale_express(p.first).enabled ? hltPrescalesSet.prescale_express(p.first).prescale : -1);
212  if (hltPrescalesSet.prescale(p.first).prescale < 0){
213  ATH_MSG_WARNING("Trigger " << p.first << " disabled in supplied AOD file. DISABLING");
214  }
215  }
216  }
217 
218  const TrigConf::L1PrescalesSet& l1PrescalesSet = m_configSvc->l1PrescalesSet(Gaudi::Hive::currentContext());
219  for( auto & p : l1PrescalesSet.prescales() ) {
220  if ((!m_prescalesJSON.value().count(p.first) && !runWithPrescaleJSON) || p.second.prescale < 0){
221  m_prescalesJSON[p.first]["prescale"] = p.second.prescale;
222 
223  if (p.second.prescale < 0){
224  ATH_MSG_WARNING("Trigger " << p.first << " disabled in supplied AOD file. DISABLING");
225  }
226  }
227  }
228 
229  // Iterate over the triggers and add them
230  for (const auto& trigger : triggers) {
231  ATH_MSG_DEBUG("Considering " << trigger );
232  const bool isHLT = (getLevel(trigger) == 2);
233  const auto trigConf = (isHLT ? m_tdt->ExperimentalAndExpertMethods().getChainConfigurationDetails(trigger) : nullptr);
234  if (isHLT && !trigConf) {
235  ATH_MSG_ERROR("Problem with TDT trig conf - cannot get details for " << trigger << ", will be ignored.");
236  continue;
237  }
238  const std::string lowerName = (isHLT ? trigConf->lower_chain_name() : "");
239  std::set<std::string> groups = std::set<std::string>(); // To be filled later from the HLTMenu
240 
241  if (isHLT) {
242  // If this is a HLT item, we require it to be seeded by at most one item. This allows us to use a factorising rates algorithm
243  if (lowerName.find(",") != std::string::npos) {
244  ATH_MSG_WARNING("Can not add " << trigger << " due to multiple L1 seeds." );
245  continue;
246  }
247 
248  if (lowerName.empty()) {
249  ATH_MSG_WARNING("Can not add " << trigger << " due to multiple L1 seeds: L1All" );
250  continue;
251  }
252 
253  // Check it also wasn't disabled in the reprocessing (e.g. auto prescaled out in a perf or tightperf menu)
254  if (trigConf->prescale() < 1.) { // Note this prescale is from ATHENA
255  ATH_MSG_DEBUG("Will not add " << trigger << ", it was disabled in the reprocessing.");
256  continue;
257  }
258 
259  ATH_CHECK(m_configSvc.isValid());
260  const TrigConf::HLTMenu& hltMenu = m_configSvc->hltMenu(Gaudi::Hive::currentContext());
261 
262  TrigConf::HLTMenu::const_iterator chain = std::find_if(hltMenu.begin(), hltMenu.end(), [&] (const TrigConf::Chain& c) {return c.name() == trigger;});
263  if (chain == hltMenu.end()){
264  ATH_MSG_WARNING("Chain " << trigger << " not found in the menu!");
265  continue;
266  }
267 
268  std::vector<std::string> chainGroups = (*chain).groups();
269  std::vector<std::string> chainStreams = (*chain).streams();
270 
271  ATH_MSG_DEBUG(" chain " << trigger << " has " << chainGroups.size() << " groups and " << chainStreams.size() << " streams");
272 
273  groups.insert(chainGroups.begin(), chainGroups.end());
274  for (const std::string& stream : chainStreams){
275  groups.insert("STREAM:" + stream );
276  }
277  }
278 
279  // Get the prescale, express prescale and lower prescale. Note these prescales are from SUPPLIED JSON.
280  double prescale = 1., expressPrescale = -1., lowerPrescale = 1.;
281  if (m_prescalesJSON.size() != 0) {
282  if (m_prescalesJSON.value().count(trigger) == 0) {
283  ATH_MSG_WARNING("Unable to find " << trigger << " in supplied JSON. DISABLING." );
284  prescale = 0.;
285  } else {
286  prescale = m_prescalesJSON[trigger]["prescale"];
287  expressPrescale = m_prescalesJSON[trigger]["prescale_express"];
288  }
289  if (isHLT) {
290  if (m_prescalesJSON.value().count(lowerName) == 0) {
291  ATH_MSG_WARNING("Unable to find " << trigger << "'s seed, " << lowerName << ", in supplied JSON. DISABLING." );
292  lowerPrescale = 0.;
293  } else {
294  lowerPrescale = m_prescalesJSON[lowerName]["prescale"];
295  }
296  }
297  }
298 
299 
300  // We now have all the info needed to add this trigger
301  ATH_MSG_DEBUG("Registering existing trigger " << trigger << " for automatic TDT based rates prediction." );
302  ATH_CHECK( newTrigger(trigger, prescale, expressPrescale, lowerName, lowerPrescale, groups, kEXISTING) );
303  }
304 
305  for (const auto& trigger : m_prescalesJSON) {
306  if (trigger.second.at("prescale") > 0 && std::find(triggers.begin(), triggers.end(), trigger.first) == triggers.end()) {
307  ATH_MSG_WARNING( "Trigger " << trigger.first << " in supplied JSON is NOT AVAILABLE in the supplied AOD file.");
308  }
309  }
310 
311  return StatusCode::SUCCESS;
312 }
313 
315  if (m_tdt.empty()){
316  ATH_MSG_ERROR("TriggerDecisionTool is not available!");
317  return StatusCode::FAILURE;
318  }
319  [[maybe_unused]] static std::atomic<bool> printed = [&]() {
320  ATH_MSG_INFO("TDT contains: " << m_tdt->getListOfTriggers().size() << " triggers, "
321  << m_tdt->getListOfStreams().size() << " streams and "
322  << m_tdt->getListOfGroups().size() << " groups.");
323  return true;
324  }();
325  return StatusCode::SUCCESS;
326 }
327 
328 
329 StatusCode RatesAnalysisAlg::checkExistingTrigger(const std::string& name, const std::string& seedName) {
331  const auto& triggers = m_tdt->getListOfTriggers(name);
332  if (triggers.size() != 1) {
333  ATH_MSG_FATAL("Unable to find existing trigger " << name << " in this AOD.");
334  return StatusCode::FAILURE;
335  }
336  if (getLevel(name) == 1) return StatusCode::SUCCESS;
337  // L1 items will crash if we call this on them.
338  const auto trigConf = m_tdt->ExperimentalAndExpertMethods().getChainConfigurationDetails(triggers.at(0));
339  if (trigConf->lower_chain_name() != seedName) {
340  ATH_MSG_FATAL("Tried to register an existing trigger '" << name << "' seeding from '" << seedName << "' but in this AOD it seeds from '" << trigConf->lower_chain_name() << "'");
341  return StatusCode::FAILURE;
342  }
343  return StatusCode::SUCCESS;
344 }
345 
346 StatusCode RatesAnalysisAlg::setTriggerDesicison(const std::string& name, const bool triggerIsPassed, const bool triggerIsActive) {
347  // Currently - we call execute on setPassed, so the user would be unable to overwrite a decision set e.g. by the TDT.
348  // so for now we only accept positive decisions here.
349  if (triggerIsPassed || triggerIsActive) {
350  const auto iterator = m_triggers.find(name);
351  if (iterator == m_triggers.end()) {
352  ATH_MSG_ERROR("Cannot find trigger " << name << " did you call newTrigger for this in initialize?");
353  return StatusCode::FAILURE;
354  }
355  iterator->second->setPassedAndExecute(triggerIsPassed, triggerIsActive, m_weightingValues); // There is logic in the RatesTrigger to prevent multiple calls per event by accident.
356  m_activatedTriggers.insert( iterator->second.get() );
357  }
358  return StatusCode::SUCCESS;
359 }
360 
361 
363  const auto iterator = m_scanTriggers.find(name);
364  if (iterator == m_scanTriggers.end()) {
365  ATH_MSG_ERROR("Cannot find scan-trigger " << name << " did you call newScanTrigger for this in initialize?");
366  return StatusCode::FAILURE;
367  }
368  iterator->second->setPassedAndExecute(threshold, m_weightingValues); // There is logic in the RatesScanTrigger to prevent multiple calls per event by accident.
369  m_activatedTriggers.insert( static_cast<RatesTrigger*>(iterator->second.get()));
370  return StatusCode::SUCCESS;
371 }
372 
374  return StatusCode::SUCCESS;
375 }
376 
378  ATH_MSG_INFO ("Initializing " << name() << "...");
379 
380  if (!m_tdt.empty()){
381  ATH_CHECK( m_tdt.retrieve() );
382  }
383 
384  if(!m_configSvc.empty()) {
385  ATH_CHECK( m_configSvc.retrieve() );
386  }
387 
388  ATH_CHECK( m_enhancedBiasRatesTool.retrieve() );
389 
393 
395  ATH_MSG_ERROR("DoUniqueRates=True requires DoGlobalGroups=True");
396  return StatusCode::FAILURE;
397  }
398 
400  return StatusCode::SUCCESS;
401 }
402 
404  // Let user add their triggers
405  ATH_MSG_INFO("Initializing User's Triggers (note: we are actually now in the event loop)");
406 
407  if (m_doGlobalGroups) {
408  m_globalGroups.emplace(m_l1GroupName, std::make_unique<RatesGroup>(m_l1GroupName, msgSvc(), m_doHistograms, m_enableLumiExtrapolation));
409  m_globalGroups.emplace(m_l2GroupName, std::make_unique<RatesGroup>(m_l2GroupName, msgSvc(), m_doHistograms, m_enableLumiExtrapolation));
410  m_globalGroups.at(m_l2GroupName)->setDoCachedWeights( m_doUniqueRates ); // This extra sub-weight caching is only utilised by unique-rate groups
411  if (m_doExpressRates) {
413  m_globalGroups.at(m_expressGroupName)->setExpressGroup( true );
414  }
415  }
416 
417  // This runs the derived class's code to add whatever triggers are desired.
418  // Should be calling newTrigger(...), newScanTrigger(...) or addExisting(...), addAllExisting().
420 
421  ATH_MSG_INFO("Computing coherent factors for coherent prescale groups.");
422  // Now we are not going to get any more chains - we can fill in the coherent prescale factors
423  for (const auto& trigger : m_triggers) {
424  const size_t CPSID = trigger.second->getCPSID();
425  if (CPSID != 0) trigger.second->setCoherentFactor( m_lowestPrescale.at(CPSID) );
426  }
427 
429  ATH_MSG_INFO("Creating extra groups to calculate unique rates.");
430  const RatesGroup* l2GroupPtr = m_globalGroups.at(m_l2GroupName).get(); // The finalised list of all HLT chains
431  const RatesGroup* l1GroupPtr = m_globalGroups.at(m_l1GroupName).get(); // The finalised list of all L1 chains
432  for (const auto& trigger : m_triggers) {
433  const uint32_t level = getLevel(trigger.first);
434  m_uniqueGroups.emplace(trigger.first, std::make_unique<RatesGroup>(trigger.first, msgSvc(), false, m_enableLumiExtrapolation)); // Each trigger gets its own unique group. No hist needed
435  RatesTrigger* triggerPtr = m_triggers.at(trigger.first).get();
436  RatesGroup* uniqueGroupPtr = m_uniqueGroups.at(trigger.first).get();
437  triggerPtr->setUniqueGroup( uniqueGroupPtr ); // Create two-way links
438  uniqueGroupPtr->setUniqueTrigger( triggerPtr ); // Create two-way links
439  // Copy in the global rates topology and make note of the unique rates master group
440  if (level == 2) uniqueGroupPtr->duplicateChildren( l2GroupPtr );
441  else if (level == 1) uniqueGroupPtr->duplicateChildren( l1GroupPtr );
442  else continue;
443  // Remove this one chain from the group (a unique rate is the rate of the entire menu minus one chain)
444  uniqueGroupPtr->removeFromGroup( triggerPtr );
445  if (getLevel(trigger.first) == 2) {
446  // For HLT, we can be more computationally efficient by utilising cached info from the hlt group
447  // We remove from the group all other L1 seeds except for the one seeding our chain.
448  // This sub-weight is the only one which can change. The combined weight of all other L1 seeds
449  // can be cached by the master group and fetched from there.
450  uniqueGroupPtr->removeOtherL1( triggerPtr );
451  uniqueGroupPtr->setUseCachedWeights(true);
452  }
453  // Efficiency - if the trigger is disabled, no need to actually calculate anything for it.
454  if (trigger.second->getDisabled() == false) {
455  m_activeGroups.insert( uniqueGroupPtr ); // Add this to the event loop
456  }
457  }
458  }
459 
460  ATH_MSG_INFO("Retrieving HLT chain's ID and Group from HLT menu.");
461 
462  if(!m_configSvc.empty() && m_configSvc.isValid()) {
463  const TrigConf::HLTMenu& hltmenu = m_configSvc->hltMenu( Gaudi::Hive::currentContext() );
464 
465  TrigConf::HLTMenu::const_iterator chain_itr = hltmenu.begin();
466  TrigConf::HLTMenu::const_iterator chain_end = hltmenu.end();
467 
468  m_hltChainIDGroup.resize(hltmenu.size());
469  for (size_t i = 0; i < hltmenu.size(); i++) m_hltChainIDGroup.at(i).resize(3);
470 
471  size_t c = 0;
472  for( ; chain_itr != chain_end; ++chain_itr ) {
473  std::string chainName = ( *chain_itr ).name() ;
474  unsigned int chainID = ( *chain_itr ).counter();
475  std::vector<std::string> chainGroups = ( *chain_itr ).groups();
476  for (std::string& stream : (*chain_itr).streams()){
477  chainGroups.push_back("STREAM:" + stream);
478  }
479  std::string singlechainGroups = "";
480  for (unsigned int j=0; j < chainGroups.size(); ++j){
481  if (j==0) singlechainGroups += chainGroups[j];
482  else singlechainGroups += ", "+chainGroups[j];
483  }
484 
485  m_hltChainIDGroup.at(c).at(0) = chainName;
486  m_hltChainIDGroup.at(c).at(1) = std::to_string(chainID);
487  m_hltChainIDGroup.at(c).at(2) = singlechainGroups;
488  ++c;
489  }
490  }
491 
492  ATH_MSG_INFO("Retrieving L1 item's ID from L1 menu.");
493 
494  if(!m_configSvc.empty() && m_configSvc.isValid()) {
495  const TrigConf::L1Menu& l1menu = m_configSvc->l1Menu( Gaudi::Hive::currentContext() );
496 
497  m_l1ItemID.resize(l1menu.size());
498  for (size_t i = 0; i < l1menu.size(); i++) {
499  // No groups for items
500  m_l1ItemID.at(i).resize(2);
501  }
502 
503  TrigConf::L1Menu::const_iterator item_itr = l1menu.begin();
504  TrigConf::L1Menu::const_iterator item_end = l1menu.end();
505 
506  size_t c = 0;
507  for( ; item_itr != item_end; ++item_itr ) {
508  m_l1ItemID.at(c).at(0) = (*item_itr).name();
509  m_l1ItemID.at(c).at(1) = std::to_string((*item_itr).ctpId());
510  ++c;
511  }
512  }
513 
514  // Print all triggers
515  if (msgLevel(MSG::DEBUG)) {
516  if (m_triggers.size()) {
517  ATH_MSG_DEBUG("################## Configured to estimate rates for the following triggers:");
518  for (const auto& trigger : m_triggers) ATH_MSG_DEBUG(trigger.second->printConfig());
519  }
520  if (m_scanTriggers.size()) {
521  ATH_MSG_DEBUG("################## Configured to estimate rates for the following scan triggers:");
522  for (const auto& trigger : m_scanTriggers) ATH_MSG_DEBUG(trigger.second->printConfig());
523  }
524  if (m_groups.size()) {
525  ATH_MSG_DEBUG("################## Configured to estimate rates for the following groups of triggers:");
526  for (const auto& group : m_groups) ATH_MSG_DEBUG(group.second->printConfig());
527  }
528  if (m_globalGroups.size()) {
529  ATH_MSG_DEBUG("################## Configured to estimate rates for the following global groups of triggers:");
530  for (const auto& group : m_globalGroups) ATH_MSG_DEBUG(group.second->printConfig());
531  }
532  }
533  if (m_doHistograms) {
534  ATH_MSG_DEBUG("################## Registering normalisation histogram:");
535  m_scalingHist = new TH1D(std::format("normalisation{}",m_histogramSuffix.value()).c_str(),";;",3,0.,3.);
536  ATH_CHECK( histSvc()->regHist("/RATESTREAM/normalisation" + m_histogramSuffix, m_scalingHist) );
537  m_bcidHist = new TH1D("bcid",";BCID;Events",3565,-.5,3564.5);
538  ATH_CHECK( histSvc()->regHist("/RATESTREAM/bcid", m_bcidHist) );
539  ATH_MSG_DEBUG("################## Registering metadata tree histogram:");
540  ATH_CHECK( histSvc()->regTree("/RATESTREAM/metadata", std::make_unique<TTree>("metadata", "metadata")) );
541  ATH_CHECK( histSvc()->getTree("/RATESTREAM/metadata", m_metadataTree) );
542  if (m_triggers.size()) {
543  ATH_MSG_DEBUG("################## Registering trigger histograms:");
544  for (const auto& trigger : m_triggers) {
545  if (!trigger.second->doHistograms()) continue; // Not all may be doing histograming
546  std::string lvlSubdir = "";
547  if (trigger.second->getName().find("L1") == 0){
548  lvlSubdir = "Rate_ChainL1_HLT/";
549  } else if (trigger.second->getName().find("HLT") == 0) {
550  lvlSubdir = "Rate_ChainHLT_HLT/";
551  }
552  trigger.second->setDataName("data"+m_histogramSuffix);
553  ATH_CHECK( trigger.second->giveDataHist(histSvc(), std::string("/RATESTREAM/All/" + lvlSubdir + trigger.first + "/data")) );
554  trigger.second->setRateVsMuName("rateVsMu"+m_histogramSuffix);
555  ATH_CHECK( trigger.second->giveMuHist(histSvc(), std::string("/RATESTREAM/All/" + lvlSubdir + trigger.first + "/rateVsMu")) );
557  trigger.second->setRateVsTrainName("rateVsTrain"+m_histogramSuffix);
558  ATH_CHECK( trigger.second->giveTrainHist(histSvc(), std::string("/RATESTREAM/All/" + lvlSubdir + trigger.first + "/rateVsTrain")) );
559  } else trigger.second->clearTrainHist();
560  }
561  }
562  if (m_scanTriggers.size()) {
563  ATH_MSG_DEBUG("################## Registering scan trigger histograms:");
564  for (const auto& trigger : m_scanTriggers) {
565  trigger.second->setHistoName("rateVsThreshold"+m_histogramSuffix);
566  ATH_CHECK( trigger.second->giveThresholdHist(histSvc(), std::string("/RATESTREAM/ScanTriggers/" + trigger.first + "/rateVsThreshold" + m_histogramSuffix)) );
567  }
568  }
569  if (m_groups.size()) {
570  ATH_MSG_DEBUG("################## Registering group histograms:");
571  for (const auto& group : m_groups) {
572  if (!group.second->doHistograms()) continue;
573  std::string groupName = group.first;
574  std::replace( groupName.begin(), groupName.end(), ':', '_');
575  group.second->setDataName("data"+m_histogramSuffix);
576  ATH_CHECK( group.second->giveDataHist(histSvc(), std::string("/RATESTREAM/All/Rate_Group_HLT/" + groupName + "/data")) );
577  group.second->setRateVsMuName("rateVsMu"+m_histogramSuffix);
578  ATH_CHECK( group.second->giveMuHist(histSvc(), std::string("/RATESTREAM/All/Rate_Group_HLT/" + groupName + "/rateVsMu")) );
580  group.second->setRateVsTrainName("rateVsTrain"+m_histogramSuffix);
581  ATH_CHECK( group.second->giveTrainHist(histSvc(), std::string("/RATESTREAM/All/Rate_Group_HLT/" + groupName + "/rateVsTrain")) );
582  } else group.second->clearTrainHist();
583  }
584  }
585  if (m_globalGroups.size()) {
586  ATH_MSG_DEBUG("################## Registering global group histograms:");
587  for (const auto& group : m_globalGroups) {
588  if (!group.second->doHistograms()) continue;
589  group.second->setDataName("data"+m_histogramSuffix);
590  ATH_CHECK( group.second->giveDataHist(histSvc(), std::string("/RATESTREAM/All/Rate_Group_HLT/RATE_GLOBAL_" + group.first + "/data")) );
591  group.second->setRateVsMuName("rateVsMu"+m_histogramSuffix);
592  ATH_CHECK( group.second->giveMuHist(histSvc(), std::string("/RATESTREAM/All/Rate_Group_HLT/RATE_GLOBAL_" + group.first + "/rateVsMu")) );
594  group.second->setRateVsTrainName("rateVsTrain"+m_histogramSuffix);
595  ATH_CHECK( group.second->giveTrainHist(histSvc(), std::string("/RATESTREAM/All/Rate_Group_HLT/RATE_GLOBAL_" + group.first + "/rateVsTrain")) );
596  } else group.second->clearTrainHist();
597  }
598  }
599  }
600 
601  // Has the user set a lumi extrapolation? If not - set a default
603 
604  // We now know the final lumi scaling so we can set the bunch scaling
605  const uint32_t ebPairedBunches = m_enhancedBiasRatesTool->getPairedBunches();
606  ATH_MSG_INFO("Number of paired bunches in input file:" << m_enhancedBiasRatesTool->getPairedBunches());
608 
609  return StatusCode::SUCCESS;
610 }
611 
612 // HSTP filter from Jet/EtMiss
614 
615  if (!m_doMultiSliceDiJet) {
616  return StatusCode::SUCCESS;
617  };
618 
620  ATH_CHECK( truthHS_jets.isValid() );
622  ATH_CHECK( truthPU_jets.isValid() );
623 
624  // Extract the pT of the leading jet that defines the hardness. The jet containers should always be pT sorted
625  const double pT_j1_truthPU = truthPU_jets->size() ? truthPU_jets->front()->pt() : 0; // Hardest PU truth jet
626  const double pT_j1_truthHS = truthHS_jets->size() ? truthHS_jets->front()->pt() : 5000; // In the rare case of no HS truth jets in the event, assume it is close to the 5 GeV threshold
627 
628  // Now see if we pass the filter.
629  pass = pT_j1_truthHS > pT_j1_truthPU;
630  ATH_MSG_DEBUG("Hard Scatter (" << pT_j1_truthHS/1000. << " GeV) Harder Than Pileup (" << pT_j1_truthPU/1000. << " GeV) filter " << (pass ? "PASSES" : "FAILS"));
631  return StatusCode::SUCCESS;
632 }
633 
635  ATH_MSG_VERBOSE("Executing " << name() << " on event " << m_eventCounter << "...");
636  if (m_eventCounter++ == 0) { // First time in execute loop - cannot access TDT before this.
638  }
639 
640  // Get event characteristics
642  ATH_CHECK( eventInfo.isValid() );
643  uint32_t distance = 0;
644  ATH_CHECK( m_enhancedBiasRatesTool->getDistanceIntoTrain(eventInfo.get(), distance) );
645  const bool isMC = m_enhancedBiasRatesTool->isMC();
646 
647  // Get the weighting & scaling characteristics
649  m_weightingValues.m_eventMu = std::ceil(eventInfo->actualInteractionsPerCrossing()); // This always seems to be a half integer
650  m_weightingValues.m_eventLumi = m_enhancedBiasRatesTool->getLBLumi(eventInfo.get());
651  m_weightingValues.m_isUnbiased = m_enhancedBiasRatesTool->isUnbiasedEvent(eventInfo.get());
653  m_weightingValues.m_eventLiveTime = m_enhancedBiasRatesTool->getEBLiveTime(eventInfo.get());
655 
656  // Bunch factor doesn't change as a fn. of the run. Reminder: m_bunchFactor = m_targetBunches / (double)ebPairedBunches;
660 
661  // Ignore zero weighted events. Typically these come from bad LB
663  return StatusCode::SUCCESS;
664  }
665 
666  const double weightedEvents = (isMC ? eventInfo->mcEventWeight() : m_weightingValues.m_enhancedBiasWeight);
667  m_weightedEventCounter += weightedEvents;
668 
669  double ratesDenominator = 0.0;
670  if (m_doMultiSliceDiJet) {
671  ratesDenominator = eventInfo->mcEventWeight(); // In multi-slice mode we only normalize to the weighted number of events
672  } else {
673  ratesDenominator = m_weightingValues.m_eventLiveTime * (isMC ? eventInfo->mcEventWeight() : 1.0); // Otherwise, we need to keep track of elapsed walltime as well
674  }
675  m_ratesDenominator += ratesDenominator;
676 
677  if (m_doHistograms) {
679  m_scalingHist->Fill(0.5, ratesDenominator); // Walltime
680  m_scalingHist->Fill(1.5, 1.); // Total events
681  m_scalingHist->Fill(2.5, weightedEvents ); // Total weighted events
682  }
683 
684  // HSTP filter check
685  if (isMC) {
686  bool filterPass = true;
687  ATH_CHECK( pass_HstpFilter(filterPass) );
688  if (!filterPass) {return StatusCode::SUCCESS;}
689  }
690 
691  // Do automated triggers
693 
694  // Do TDT-controlled triggers
696 
697  // Run user's code. Do manual triggers
698  ATH_CHECK( ratesExecute() );
699 
700  // Execute groups
701  for (const auto& group : m_globalGroups) group.second->execute(m_weightingValues); // Physics, L1, express: Must execute before m_uniqueGroups (which are in active groups). Map.
702  for (const auto& group : m_activeGroups) group->execute(m_weightingValues); // Individual groups, CPS groups and active unique groups. Set.
703 
704  // Reset triggers
705  for (const auto& trigger : m_activatedTriggers) trigger->reset();
706  m_activatedTriggers.clear();
707 
708  // Some debug info
709  if (m_eventCounter % 1000 == 0) {
710  ATH_MSG_INFO( "Event " << m_eventCounter << " " << m_weightingValues.print() << " currentWallTime:" << m_ratesDenominator );
711  }
712 
713  setFilterPassed(true); //if got here, assume that means algorithm passed
714  return StatusCode::SUCCESS;
715 }
716 
718  for (const auto& trigger : m_existingTriggers) {
719  const bool passed = trigger.second->isPassed();
720  // L1 chains are always active, HLT chains are active if their L1 passed.
721  const std::string& lower = m_lowerTrigger[trigger.first];
722  // Expect this find operation to fail for L1 chains (lower = "")
723  const std::unordered_map<std::string, const Trig::ChainGroup*>::const_iterator it = m_existingTriggers.find(lower);
724  const bool active = (it == m_existingTriggers.end() ? true : it->second->isPassed());
725  ATH_CHECK( setTriggerDesicison(trigger.first, passed, active) );
726  }
727  return StatusCode::SUCCESS;
728 }
729 
731  // TODO emulation code here
732  for (const auto& trigger : m_autoTriggers) {
733  ATH_MSG_WARNING("Cannot do rates for " << trigger << ". Automatic trigger emulation is not yet included, sorry :(");
734  }
735  return StatusCode::SUCCESS;
736 }
737 
739  ATH_MSG_INFO ("Finalizing " << name() << "...");
740 
742  if (!m_doMultiSliceDiJet) { // Cannot estimate multi-slice rates before the merging stage
743  if (m_scanTriggers.size()) {
744  ATH_MSG_INFO("################## Computed Rate Scans for Threshold-Scan Items:");
745  for (const auto& trigger : m_scanTriggers) ATH_MSG_INFO(trigger.second->printRate(m_ratesDenominator));
746  }
747  if (m_triggers.size()) {
748  ATH_MSG_INFO("################## Computed Rate Estimations for Single Items:");
749  std::set<std::string> keys; // Used an unordered map for speed, but now we'd like the items in order
750  for (const auto& trigger : m_triggers) keys.insert(trigger.first);
751  for (const std::string& key : keys) ATH_MSG_INFO(m_triggers.at(key)->printRate(m_ratesDenominator));
752  }
753  if (m_expressTriggers.size()) {
754  ATH_MSG_INFO("################## Computed Express Rate Estimations for Single Items:");
755  for (const auto& trigger : m_expressTriggers) ATH_MSG_INFO(trigger->printExpressRate(m_ratesDenominator));
756  }
757  if (m_groups.size()) {
758  ATH_MSG_INFO("################## Computed Rate Estimations for Groups:");
759  for (const auto& group : m_groups) ATH_MSG_INFO(group.second->printRate(m_ratesDenominator));
760  }
761  if (m_globalGroups.size()) {
762  ATH_MSG_INFO("################## Computed Rate Estimations for Global Groups:");
763  for (const auto& group : m_globalGroups) ATH_MSG_INFO(group.second->printRate(m_ratesDenominator));
764  }
765  }
766  ATH_MSG_INFO("################## LHC Conditions and weighting information:");
768  printTarget();
769  printStatistics();
770  ATH_MSG_INFO("##################");
771  writeMetadata();
772 
773  return StatusCode::SUCCESS;
774 }
775 
776 void RatesAnalysisAlg::setTargetLumiMu(const double lumi, const double mu) {
777  if (m_eventCounter > 1) { // All settings must be defined before we start looping over the sample
778  ATH_MSG_WARNING("Too late to call setTargetLumiMu. Do this during ratesInitialize().");
779  return;
780  }
781  m_targetLumi = lumi;
782  if (isZero(mu)) {
783  ATH_MSG_WARNING("Cannot have <mu> = 0. Setting to 1.");
784  m_targetMu = 1;
785  } else {
786  m_targetMu = mu;
787  }
790  ATH_MSG_WARNING("Un-physical number of bunches " << m_targetBunches << ", should be within 1 < N < " << EnhancedBiasWeighter::FULL_RING+1);
791  if (m_targetBunches == 0) ++m_targetBunches;
792  }
793  printTarget();
794 }
795 
796 void RatesAnalysisAlg::setTargetLumiBunches(const double lumi, const int32_t bunches) {
797  if (m_eventCounter > 1) { // All settings must be defined before we start looping over the sample
798  ATH_MSG_WARNING("Too late to call setTargetLumiBunches. Do this during ratesInitialize().");
799  return;
800  }
801  m_targetLumi = lumi;
802  if (bunches == 0) {
803  ATH_MSG_WARNING("Cannot have bunches = 0. Setting to 1.");
804  m_targetBunches = 1;
805  } else {
806  m_targetBunches = bunches;
807  }
809  printTarget();
810 }
811 
812 
813 void RatesAnalysisAlg::setTargetMuBunches(const double mu, const int32_t bunches) {
814  if (m_eventCounter > 1) { // All settings must be defined before we start looping over the sample
815  ATH_MSG_WARNING("Too late to call setTargetMuBunches. Do this during ratesInitialize().");
816  return;
817  }
818  if (bunches == 0) {
819  ATH_MSG_WARNING("Cannot have paired bunches = 0. Setting to 1.");
820  m_targetBunches = 1;
821  } else {
822  m_targetBunches = bunches;
823  }
824  if (isZero(mu)) {
825  ATH_MSG_WARNING("Cannot have mu = 0. Setting to 1.");
826  m_targetMu = 1;
827  } else {
828  m_targetMu = mu;
829  }
831  printTarget();
832 }
833 
836  ATH_MSG_INFO("Calculating rates for a target L_inst. = " << m_targetLumi << " cm-2s-1, mu = " << m_targetMu << ", paired bunches = " << m_targetBunches);
837  } else {
838  ATH_MSG_INFO("Luminosity extrapolation is switched off. Input files will determin the paired bunches, L_inst. and mu profile.");
839  }
840 }
841 
843  ATH_MSG_INFO("Processed " << m_eventCounter << " raw events, " << m_weightedEventCounter << " weighted. Total LHC wall-time of " << m_ratesDenominator << " s.");
844 }
845 
847  ATH_MSG_INFO("Input " << (m_enhancedBiasRatesTool->isMC() ? "MC" : "EB Data")
848  << " with <L_inst.> = "
849  << m_enhancedBiasRatesTool->getAverageLumi()
850  << " cm-2s-1, <mu> = "
851  << m_enhancedBiasRatesTool->getAverageMu()
852  << ", paired bunches = "
853  << m_enhancedBiasRatesTool->getPairedBunches());
854 }
855 
856 bool RatesAnalysisAlg::isCPS(const std::string& group) const {
857  return (group.find("CPS") != std::string::npos);
858 }
859 
860 bool RatesAnalysisAlg::isRandomSeed(const std::string& me, const std::string& seed) const {
861  if (me.find("L1_RD") != std::string::npos) return true;
862  if (me.find("L1RD") != std::string::npos) return true;
863  if (seed.find("L1_RD") != std::string::npos) return true;
864  return false;
865 }
866 
867 uint32_t RatesAnalysisAlg::getLevel(const std::string& name) const {
868  if (name.find("HLT_") != std::string::npos) return 2;
869  if (name.find("L1_") != std::string::npos) return 1;
870  return 2;
871 }
872 
874  if (!m_metadataTree) {
875  return;
876  }
877  m_runNumber = m_enhancedBiasRatesTool->getRunNumber();
878  m_metadataTree->Branch("runNumber", &m_runNumber);
879  m_metadataTree->Branch("targetMu", &m_targetMu);
880  m_metadataTree->Branch("targetBunches", &m_targetBunches);
881  m_metadataTree->Branch("targetLumi", &m_targetLumi);
882 
883  std::vector<std::string> triggers;
884  std::vector<std::string> lowers;
885  std::vector<double> prescales;
886  std::vector<double> express;
887  triggers.reserve(m_triggers.size());
888  lowers.reserve(m_triggers.size());
889  prescales.reserve(m_triggers.size());
890  express.reserve(m_triggers.size());
891  for (const auto& trigger : m_triggers) {
892  triggers.push_back(trigger.first);
893  lowers.push_back(trigger.second->getSeedName());
894  prescales.push_back(trigger.second->getPrescale() );
895  express.push_back(trigger.second->getPrescale(true /*includeExpress*/) );
896  }
897  for (const auto& group : m_groups) {
898  triggers.push_back(group.first);
899  lowers.push_back("-");
900  prescales.push_back(-1);
901  express.push_back(-1);
902  }
903  for (const auto& group : m_globalGroups) {
904  triggers.push_back("RATE_GLOBAL_" + group.first);
905  lowers.push_back("-");
906  prescales.push_back(-1);
907  express.push_back(-1);
908  }
909  m_metadataTree->Branch("triggers", &triggers);
910  m_metadataTree->Branch("lowers", &lowers);
911  m_metadataTree->Branch("prescales", &prescales);
912  m_metadataTree->Branch("express", &express);
913  std::vector<int32_t> bunchGroups;
914  bunchGroups.reserve(16);
915 
916  uint32_t masterKey = 0;
917  uint32_t hltPrescaleKey = 0;
918  uint32_t lvl1PrescaleKey = 0;
919 
920  if(!m_enhancedBiasRatesTool->isMC()){
921  bunchGroups = m_enhancedBiasRatesTool->getBunchGroups();
922  }
923  if(!m_configSvc.empty() && m_configSvc.isValid() && ( bunchGroups.size() == 0 || std::all_of(bunchGroups.begin(), bunchGroups.end(), [](int i) { return i==0; }) ) && (!m_enhancedBiasRatesTool->isMC())) {
924  const TrigConf::L1BunchGroupSet& bgs = m_configSvc->l1BunchGroupSet(Gaudi::Hive::currentContext());
925  for (size_t i = 0; i < bgs.maxNBunchGroups(); ++i ) {
926  bunchGroups.push_back(bgs.getBunchGroup(i)->size());
927  }
928  masterKey = m_configSvc->masterKey();
929  hltPrescaleKey = m_configSvc->hltPrescaleKey();
930  lvl1PrescaleKey = m_configSvc->lvl1PrescaleKey();
931  }
932  m_metadataTree->Branch("bunchGroups", &bunchGroups);
933 
934  m_metadataTree->Branch("hltChainIDGroup", &m_hltChainIDGroup);
935  m_metadataTree->Branch("l1ItemID", &m_l1ItemID);
936 
937  m_metadataTree->Branch("masterKey", &masterKey);
938  m_metadataTree->Branch("lvl1PrescaleKey", &lvl1PrescaleKey);
939  m_metadataTree->Branch("hltPrescaleKey", &hltPrescaleKey);
940  std::string atlasProject = std::getenv("AtlasProject");
941  std::string atlasVersion = std::getenv("AtlasVersion");
942  m_metadataTree->Branch("AtlasProject", &atlasProject);
943  m_metadataTree->Branch("AtlasVersion", &atlasVersion);
944  m_metadataTree->Fill();
945 }
RunTileTBRec.method
method
Definition: RunTileTBRec.py:73
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
TrigConf::DataStructure::data
const ptree & data() const
Access to the underlying data, if needed.
Definition: DataStructure.h:83
TrigConf::HLTPrescalesSet::HLTPrescale::prescale
double prescale
Definition: HLTPrescalesSet.h:24
RatesAnalysisAlg::printStatistics
void printStatistics() const
Print some extra statistics on events processed.
Definition: RatesAnalysisAlg.cxx:842
AthHistogramAlgorithm::histSvc
const ServiceHandle< ITHistSvc > & histSvc() const
The standard THistSvc (for writing histograms and TTrees and more to a root file) Returns (kind of) a...
Definition: AthHistogramAlgorithm.h:113
mergePhysValFiles.pattern
pattern
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:25
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
RatesAnalysisAlg::m_expressGroupName
const std::string m_expressGroupName
Definition: RatesAnalysisAlg.h:269
replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition: hcg.cxx:307
ChainDefInMenu.groups
groups
Definition: ChainDefInMenu.py:43
HLTPrescalesSet.h
RatesAnalysisAlg::populateTriggers
StatusCode populateTriggers()
Register all triggers to emulate.
Definition: RatesAnalysisAlg.cxx:403
RatesAnalysisAlg::m_runNumber
uint32_t m_runNumber
What is the RunNumber.
Definition: RatesAnalysisAlg.h:295
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
WeightingValuesSummary_t::m_eventLiveTime
double m_eventLiveTime
How much wall-time at P1 did this event represent.
Definition: RatesHistoBase.h:62
AthAnalysisAlgorithm
Definition: AthAnalysisAlgorithm.h:34
RatesScanTrigger
Used to calculate a rate scan as a function of some threshold value.
Definition: RatesScanTrigger.h:14
RatesAnalysisAlg::m_tdt
ToolHandle< Trig::TrigDecisionTool > m_tdt
Definition: RatesAnalysisAlg.h:272
RatesAnalysisAlg::newTrigger
StatusCode newTrigger(const std::string &name, const double prescale=1., const double expressPrescale=-1., const std::string &seedName="", const double seedPrecale=1., const std::string &groups="", const Method_t method=kMANUAL, const ExtrapStrat_t extrapolation=kLINEAR)
Version of newTrigger which accepts a set of group names rather than a comma separated string.
Definition: RatesAnalysisAlg.cxx:89
RatesGroup::removeFromGroup
void removeFromGroup(const RatesTrigger *toRemove)
Remove a trigger from this group.
Definition: RatesGroup.cxx:67
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
RatesAnalysisAlg::m_enableLumiExtrapolation
Gaudi::Property< bool > m_enableLumiExtrapolation
Definition: RatesAnalysisAlg.h:287
RatesAnalysisAlg::m_lowerTrigger
std::unordered_map< std::string, std::string > m_lowerTrigger
Map of triggers lower chain, to tell if a HLT trigger ran or not.
Definition: RatesAnalysisAlg.h:262
RatesAnalysisAlg::ratesExecute
virtual StatusCode ratesExecute()=0
To be implemented by the user.
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
vtune_athena.format
format
Definition: vtune_athena.py:14
TrigCompositeUtils::passed
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
Definition: TrigCompositeUtilsRoot.cxx:117
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
RatesAnalysisAlg::m_truthHS_jets_RHKey
SG::ReadHandleKey< xAOD::JetContainer > m_truthHS_jets_RHKey
Definition: RatesAnalysisAlg.h:276
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
TrigConf::HLTMenu
HLT menu configuration.
Definition: HLTMenu.h:21
python.RatesAnalysisFullMenu.prescales
prescales
Definition: RatesAnalysisFullMenu.py:121
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
RatesAnalysisAlg::m_scanTriggers
std::unordered_map< std::string, std::unique_ptr< RatesScanTrigger > > m_scanTriggers
All individual rates-scan triggers (L1 or HLT)
Definition: RatesAnalysisAlg.h:250
RatesAnalysisAlg::~RatesAnalysisAlg
virtual ~RatesAnalysisAlg()
Definition: RatesAnalysisAlg.cxx:38
RatesAnalysisAlg::checkGotTDT
StatusCode checkGotTDT()
Internal check that the TDT is fetched.
Definition: RatesAnalysisAlg.cxx:314
RatesAnalysisAlg::newScanTrigger
StatusCode newScanTrigger(const std::string &name, const double thresholdMin, const double thresholdMax, const uint32_t thresholdBins=100, const RatesScanTrigger::TriggerBehaviour_t behaviour=RatesScanTrigger::TriggerBehaviour_t::kTriggerBelowThreshold, const double prescale=1., const std::string &seedName="", const double seedPrecale=1., const Method_t method=kMANUAL, const ExtrapStrat_t extrapolation=kLINEAR)
Register a new threshold scan trigger which plots rate as a function of some dependent variable.
Definition: RatesAnalysisAlg.cxx:40
WeightingValuesSummary_t::m_isUnbiased
bool m_isUnbiased
If the event was taken online with a RD trigger.
Definition: RatesHistoBase.h:60
RatesAnalysisAlg::m_l2GroupName
const std::string m_l2GroupName
Definition: RatesAnalysisAlg.h:268
RatesGroup::setUseCachedWeights
void setUseCachedWeights(const bool i)
Set to use cached weights from the Master group (need ptr to m_masterGroup)
Definition: RatesGroup.cxx:188
RatesAnalysisAlg::initialize_extra_content
virtual StatusCode initialize_extra_content()
Initialization of additional payload for inherited classes.
Definition: RatesAnalysisAlg.cxx:373
RatesAnalysisAlg.h
RunTileMonitoring.groupName
groupName
Definition: RunTileMonitoring.py:158
MuonGM::round
float round(const float toRound, const unsigned int decimals)
Definition: Mdt.cxx:27
RatesAnalysisAlg::m_bcidHist
TH1D * m_bcidHist
Histogram of the BCIDs distribution of the processing.
Definition: RatesAnalysisAlg.h:300
WeightingValuesSummary_t::m_eventLumi
double m_eventLumi
The instantaneous lumi in cm-2s-1.
Definition: RatesHistoBase.h:59
skel.it
it
Definition: skel.GENtoEVGEN.py:407
RatesAnalysisAlg::m_enhancedBiasRatesTool
ToolHandle< IEnhancedBiasWeighter > m_enhancedBiasRatesTool
Definition: RatesAnalysisAlg.h:271
RatesAnalysisAlg::ratesInitialize
virtual StatusCode ratesInitialize()=0
To be implemented by the user.
WeightingValuesSummary_t::print
const std::string print()
Definition: RatesHistoBase.h:69
RatesAnalysisAlg::m_expoScalingFactor
Gaudi::Property< double > m_expoScalingFactor
Definition: RatesAnalysisAlg.h:279
TrigConf::HLTPrescalesSet::prescale_express
const HLTPrescale & prescale_express(const std::string &chainName) const
HLT prescales by chain names.
Definition: HLTPrescalesSet.cxx:96
RatesAnalysisAlg::m_groups
std::unordered_map< std::string, std::unique_ptr< RatesGroup > > m_groups
All regular and CPS groups.
Definition: RatesAnalysisAlg.h:251
RatesAnalysisAlg::m_ratesDenominator
double m_ratesDenominator
How much walltime is seen by the algorithm.
Definition: RatesAnalysisAlg.h:190
WeightingValuesSummary_t::m_linearLumiFactor
double m_linearLumiFactor
What weight needs to be applied to extrapolate rates linear in mu and bunches.
Definition: RatesHistoBase.h:66
WeightingValuesSummary_t::m_distanceInTrain
uint32_t m_distanceInTrain
How far into the bunch train the event was, in bunch crossings.
Definition: RatesHistoBase.h:61
RatesAnalysisAlg::m_doUniqueRates
Gaudi::Property< bool > m_doUniqueRates
Definition: RatesAnalysisAlg.h:281
RatesAnalysisAlg::m_globalGroups
std::unordered_map< std::string, std::unique_ptr< RatesGroup > > m_globalGroups
Big (master) groups which do the OR of the whole menu.
Definition: RatesAnalysisAlg.h:252
RatesAnalysisAlg::m_targetMu
double m_targetMu
What pileup level the prediction is targeting.
Definition: RatesAnalysisAlg.h:292
TrigConf::L1Menu
L1 menu configuration.
Definition: L1Menu.h:28
L1PrescalesSet.h
python.TrigTLAMonitorAlgorithm.triggers
triggers
Definition: TrigTLAMonitorAlgorithm.py:196
RatesAnalysisAlg::m_autoTriggers
std::vector< std::string > m_autoTriggers
List of triggers which it is up to us to the algorithm to work out the pass/fail for.
Definition: RatesAnalysisAlg.h:259
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
TrigConf::L1BunchGroupSet::getBunchGroup
const std::shared_ptr< L1BunchGroup > & getBunchGroup(const std::string &name) const
Accessor to the bunchgroup by name.
Definition: L1BunchGroupSet.cxx:118
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
RatesScanTrigger::TriggerBehaviour_t
TriggerBehaviour_t
enum to describe if a trigger should activate for values >= or <= than the thresold
Definition: RatesScanTrigger.h:20
RatesAnalysisAlg::kEXISTING
@ kEXISTING
The pass/fail decision is taken from the Trigger Decision Tool for an existing trigger.
Definition: RatesAnalysisAlg.h:46
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
H5Utils::getTree
std::string getTree(const std::string &file_name)
Definition: getTree.cxx:36
RatesTrigger::setUniqueGroup
void setUniqueGroup(const RatesGroup *unique)
If I have a group which is calculating my unique rate.
Definition: RatesTrigger.cxx:167
ExtrapStrat_t
ExtrapStrat_t
Extrapolation strategy to apply to each emulated trigger.
Definition: RatesHistoBase.h:30
RatesAnalysisAlg::setTargetMuBunches
void setTargetMuBunches(const double mu, const int32_t bunches)
Set the target mu and number of bunches.
Definition: RatesAnalysisAlg.cxx:813
RatesAnalysisAlg::m_prescalesJSON
Gaudi::Property< std::map< std::string, std::map< std::string, double > > > m_prescalesJSON
Definition: RatesAnalysisAlg.h:289
RatesAnalysisAlg::setTargetLumiMu
void setTargetLumiMu(const double lumi, const double mu)
Set the target instantaneous luminosity and mu.
Definition: RatesAnalysisAlg.cxx:776
RatesAnalysisAlg::kAUTO
@ kAUTO
The pass/fail decision is automatically emulated per event based on decoding the trigger name.
Definition: RatesAnalysisAlg.h:45
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
RatesAnalysisAlg::m_weightedEventCounter
double m_weightedEventCounter
Count how many weighted events were processed.
Definition: RatesAnalysisAlg.h:297
RatesAnalysisAlg::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: RatesAnalysisAlg.h:275
RatesTrigger
Used to calculate the rate for a single trigger at L1 or the HLT.
Definition: RatesTrigger.h:15
RatesAnalysisAlg::initialize
virtual StatusCode initialize()
Get the trigger decision tool and set up global groups.
Definition: RatesAnalysisAlg.cxx:377
RatesGroup
Used to calculate the rate for a group of RatesTrigger objects at L1 or the HLT.
Definition: RatesGroup.h:29
RatesAnalysisAlg::Method_t
Method_t
Method by which the trigger pass/fail decision is calculated.
Definition: RatesAnalysisAlg.h:43
WeightingValuesSummary_t::m_enhancedBiasWeight
double m_enhancedBiasWeight
A property of the event derived from online enhanced bias prescales.
Definition: RatesHistoBase.h:57
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
RatesAnalysisAlg::executeTriggerEmulation
StatusCode executeTriggerEmulation()
Internal call to get the pass/fail for all automatically emulated triggers.
Definition: RatesAnalysisAlg.cxx:730
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
RatesTrigger::setSeedsFromRandom
void setSeedsFromRandom(const bool i)
Set if this trigger is to behave as if it seeds from a random L1 item.
Definition: RatesTrigger.cxx:149
Trk::active
@ active
Definition: Layer.h:47
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
lumiFormat.i
int i
Definition: lumiFormat.py:85
TrigConf::HLTPrescalesSet::prescale
const HLTPrescale & prescale(const std::string &chainName) const
HLT prescales by chain names.
Definition: HLTPrescalesSet.cxx:85
RatesTrigger::setCPS
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)
Definition: RatesTrigger.cxx:171
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::ReadHandle::get
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
RatesAnalysisAlg::m_metadataTree
TTree * m_metadataTree
Used to write out some metadata needed by post-processing (e.g.
Definition: RatesAnalysisAlg.h:302
RatesAnalysisAlg::m_targetBunches
double m_targetBunches
How many bunches the prediction is targeting.
Definition: RatesAnalysisAlg.h:293
RatesAnalysisAlg::m_doMultiSliceDiJet
Gaudi::Property< bool > m_doMultiSliceDiJet
Definition: RatesAnalysisAlg.h:192
RatesAnalysisAlg::setTargetLumiBunches
void setTargetLumiBunches(const double lumi, const int32_t bunches)
Set the target instantaneous luminosity and number of bunches.
Definition: RatesAnalysisAlg.cxx:796
RatesAnalysisAlg::RatesAnalysisAlg
RatesAnalysisAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: RatesAnalysisAlg.cxx:22
python.RatesAnalysisFullMenu.e34
e34
Definition: RatesAnalysisFullMenu.py:29
RatesAnalysisAlg::isCPS
bool isCPS(const std::string &group) const
String match coherent prescale groups.
Definition: RatesAnalysisAlg.cxx:856
DataVector::front
const T * front() const
Access the first element in the collection as an rvalue.
RatesAnalysisAlg::m_uniqueGroups
std::unordered_map< std::string, std::unique_ptr< RatesGroup > > m_uniqueGroups
Groups used to obtain unique rates for chains.
Definition: RatesAnalysisAlg.h:253
RatesAnalysisAlg::m_weightingValues
WeightingValuesSummary_t m_weightingValues
Possible weighting & lumi extrapolation values for the current event.
Definition: RatesAnalysisAlg.h:189
RatesAnalysisAlg::addExisting
StatusCode addExisting(const std::string &pattern)
Register some existing triggers based on wild-card match, e.g.
Definition: RatesAnalysisAlg.cxx:198
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
WeightingValuesSummary_t::m_expoMuFactor
double m_expoMuFactor
What weight needs to be applied to extrapolate rates linear in bunches and exponential in mu.
Definition: RatesHistoBase.h:67
TrigConf::L1BunchGroupSet::maxNBunchGroups
constexpr std::size_t maxNBunchGroups() const
Maximum number of bunchgroups.
Definition: L1BunchGroupSet.h:107
RatesTrigger::getCPSID
size_t getCPSID() const
Get the hash of my CPS group name.
Definition: RatesTrigger.cxx:173
RatesAnalysisAlg::kMANUAL
@ kMANUAL
The pass/fail decision is evaluated by the user and supplied per event using setTriggerDesicison.
Definition: RatesAnalysisAlg.h:44
RatesAnalysisAlg::m_doHistograms
Gaudi::Property< bool > m_doHistograms
Definition: RatesAnalysisAlg.h:191
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
RatesAnalysisAlg::execute
virtual StatusCode execute()
In first call - register all triggers.
Definition: RatesAnalysisAlg.cxx:634
TrigConf::L1BunchGroupSet
L1 board configuration.
Definition: L1BunchGroupSet.h:71
RatesGroup::removeOtherL1
void removeOtherL1(const RatesTrigger *toKeep)
Remove from the groups mapping all triggers which have a dissimilar seed to the supplied trigger.
Definition: RatesGroup.cxx:72
RatesAnalysisAlg::m_activeGroups
std::unordered_set< RatesGroup * > m_activeGroups
All groups which are enabled (PS >= 1)
Definition: RatesAnalysisAlg.h:257
RatesAnalysisAlg::printTarget
void printTarget() const
Print the target instantaneous luminosity, mu and number of bunches.
Definition: RatesAnalysisAlg.cxx:834
TrigConf::HLTMenu::begin
const_iterator begin() const
Begin of the HLT chains list.
Definition: HLTMenu.cxx:51
RatesAnalysisAlg::isRandomSeed
bool isRandomSeed(const std::string &me, const std::string &seed) const
String match random L1 items.
Definition: RatesAnalysisAlg.cxx:860
EnhancedBiasWeighter::FULL_RING
constexpr static uint32_t FULL_RING
Number of bunches in a full ring.
Definition: EnhancedBiasWeighter.h:56
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
RatesTrigger::getDisabled
bool getDisabled() const
If I or my seed were prescaled out.
Definition: RatesTrigger.cxx:165
TrigConf::L1PrescalesSet
L1 menu configuration.
Definition: L1PrescalesSet.h:19
RatesAnalysisAlg::getTriggerMap
const std::unordered_map< std::string, std::unique_ptr< RatesTrigger > > & getTriggerMap() const
Definition: RatesAnalysisAlg.cxx:194
WeightingValuesSummary_t::m_bunchFactor
double m_bunchFactor
What weight needs to be applied to extrapolate rates linear in number of bunches.
Definition: RatesHistoBase.h:64
TrigConf::HLTMenu::size
std::size_t size() const
Accessor to the number of HLT chains.
Definition: HLTMenu.cxx:35
TrigConf::ConstIter
Forward iterator over an iterable of type V returning an object of type T.
Definition: ConstIter.h:32
RatesAnalysisAlg::pass_HstpFilter
StatusCode pass_HstpFilter(bool &pass)
Boolean indicating if the event passes the HS-softer-than-PU (HSTP) filter.
Definition: RatesAnalysisAlg.cxx:613
BunchGroupSet.h
RatesAnalysisAlg::m_activatedTriggers
std::unordered_set< RatesTrigger * > m_activatedTriggers
Triggers which were changed & hence need to be reset at the event end.
Definition: RatesAnalysisAlg.h:255
L1BunchGroupSet.h
RatesAnalysisAlg::m_doExpressRates
Gaudi::Property< bool > m_doExpressRates
Definition: RatesAnalysisAlg.h:284
RatesHistoBase::isZero
static bool isZero(double v)
Definition: RatesHistoBase.h:103
EnhancedBiasWeighter::LHC_FREQUENCY
constexpr static double LHC_FREQUENCY
Definition: EnhancedBiasWeighter.h:55
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
RatesAnalysisAlg::m_histogramSuffix
Gaudi::Property< std::string > m_histogramSuffix
Definition: RatesAnalysisAlg.h:290
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
threshold
Definition: chainparser.cxx:74
RatesAnalysisAlg::m_scalingHist
TH1D * m_scalingHist
One-bin histogram to store the normalisation of the sample, for use in later combinations.
Definition: RatesAnalysisAlg.h:299
RatesAnalysisAlg::setTargetLumi
void setTargetLumi(const double lumi)
Set the target instantaneous luminosity.
Definition: RatesAnalysisAlg.h:172
RatesAnalysisAlg::executeTrigDecisionToolTriggers
StatusCode executeTrigDecisionToolTriggers()
Internal call to get the pass/fail for all TDT triggers.
Definition: RatesAnalysisAlg.cxx:717
RatesGroup::setUniqueTrigger
void setUniqueTrigger(RatesTrigger *trigger)
Set trigger I am doing unique rates for.
Definition: RatesGroup.cxx:196
EventInfo.h
RatesAnalysisAlg::checkExistingTrigger
StatusCode checkExistingTrigger(const std::string &name, const std::string &seedName)
Internal function to check if a supplied HLT trigger and L1 seed match what is stored in the AOD conf...
Definition: RatesAnalysisAlg.cxx:329
RatesAnalysisAlg::writeMetadata
void writeMetadata()
Write to outpute tree (if any) the metadata needed downstream.
Definition: RatesAnalysisAlg.cxx:873
RatesAnalysisAlg::m_triggers
std::unordered_map< std::string, std::unique_ptr< RatesTrigger > > m_triggers
All individual triggers (L1 or HLT)
Definition: RatesAnalysisAlg.h:195
RatesAnalysisAlg::getLevel
uint32_t getLevel(const std::string &name) const
String match to a trigger level.
Definition: RatesAnalysisAlg.cxx:867
RatesAnalysisAlg::m_configSvc
ServiceHandle< TrigConf::ITrigConfigSvc > m_configSvc
Definition: RatesAnalysisAlg.h:273
lumiFormat.lumi
lumi
Definition: lumiFormat.py:106
RatesAnalysisAlg::printInputSummary
void printInputSummary() const
Print the input data instantaneous luminosity, mu and number of bunches.
Definition: RatesAnalysisAlg.cxx:846
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28
SCT_ConditionsAlgorithms::CoveritySafe::getenv
std::string getenv(const std::string &variableName)
get an environment variable
Definition: SCT_ConditionsUtilities.cxx:17
RatesAnalysisAlg::m_l1GroupName
const std::string m_l1GroupName
Definition: RatesAnalysisAlg.h:267
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
RatesAnalysisAlg::m_lowestPrescale
std::unordered_map< size_t, double > m_lowestPrescale
Lowest prescale within a CPS group, key is the hash of the CPS group name.
Definition: RatesAnalysisAlg.h:258
DEBUG
#define DEBUG
Definition: page_access.h:11
RatesAnalysisAlg::m_l1ItemID
std::vector< std::vector< std::string > > m_l1ItemID
Definition: RatesAnalysisAlg.h:265
python.TriggerAPI.TriggerAPISession.chainName
chainName
Definition: TriggerAPISession.py:426
TrigConf::L1PrescalesSet::prescales
const std::map< std::string, L1Prescale > & prescales() const
Definition: L1PrescalesSet.cxx:58
python.XMLReader.l1menu
l1menu
Definition: XMLReader.py:73
RatesAnalysisAlg::ratesFinalize
virtual StatusCode ratesFinalize()=0
To be implemented by the user.
EventInfoRead.isMC
isMC
Definition: EventInfoRead.py:11
TrigConf::HLTPrescalesSet::HLTPrescale::enabled
bool enabled
Definition: HLTPrescalesSet.h:23
RatesAnalysisAlg::m_existingTriggers
std::unordered_map< std::string, const Trig::ChainGroup * > m_existingTriggers
Map of triggers which we ask the TDT ChainGroup for the pass/fail.
Definition: RatesAnalysisAlg.h:261
HLTMenu.h
ValidateEBMenu.seedName
seedName
Definition: ValidateEBMenu.py:100
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
xAOD::EventInfo_v1::mcEventWeight
float mcEventWeight(size_t i=0) const
The weight of one specific MC event used in the simulation.
Definition: EventInfo_v1.cxx:203
RatesAnalysisAlg::m_vetoStartOfTrain
Gaudi::Property< uint32_t > m_vetoStartOfTrain
Definition: RatesAnalysisAlg.h:288
WeightingValuesSummary_t::m_muFactor
double m_muFactor
What weight needs to be applied to extrapolate rates linear in mu.
Definition: RatesHistoBase.h:65
RatesAnalysisAlg::addAllExisting
StatusCode addAllExisting()
Register all existing triggers in the AOD into the rates algorithm.
Definition: RatesAnalysisAlg.cxx:189
RatesAnalysisAlg::finalize
virtual StatusCode finalize()
Print rates.
Definition: RatesAnalysisAlg.cxx:738
L1Menu.h
RatesAnalysisAlg::m_doTriggerGroups
Gaudi::Property< bool > m_doTriggerGroups
Definition: RatesAnalysisAlg.h:283
TrigConf::Chain
HLT chain configuration.
Definition: TrigConfData/TrigConfData/HLTChain.h:18
RatesAnalysisAlg::m_useBunchCrossingData
Gaudi::Property< bool > m_useBunchCrossingData
Definition: RatesAnalysisAlg.h:285
xAOD::EventInfo_v1::bcid
uint32_t bcid() const
The bunch crossing ID of the event.
RatesAnalysisAlg::m_targetLumi
double m_targetLumi
What instantaneous luminosity the prediction is targeting.
Definition: RatesAnalysisAlg.h:294
TrigConf::HLTPrescalesSet
HLT menu configuration.
Definition: HLTPrescalesSet.h:19
RatesAnalysisAlg::m_eventCounter
uint32_t m_eventCounter
Count how many events processed.
Definition: RatesAnalysisAlg.h:296
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:51
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
python.compressB64.c
def c
Definition: compressB64.py:93
RatesAnalysisAlg::setTriggerDesicison
StatusCode setTriggerDesicison(const std::string &name, const bool triggerIsPassed=true, const bool triggerIsActive=true)
Set the pass/fail decision for an item.
Definition: RatesAnalysisAlg.cxx:346
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
TrigConf::HLTMenu::end
const_iterator end() const
End of the HLT chains list.
Definition: HLTMenu.cxx:57
RatesAnalysisAlg::m_inelasticCrossSection
Gaudi::Property< double > m_inelasticCrossSection
Definition: RatesAnalysisAlg.h:280
RatesAnalysisAlg::m_doGlobalGroups
Gaudi::Property< bool > m_doGlobalGroups
Definition: RatesAnalysisAlg.h:282
RatesAnalysisAlg::m_hltChainIDGroup
std::vector< std::vector< std::string > > m_hltChainIDGroup
Definition: RatesAnalysisAlg.h:264
RatesAnalysisAlg::isZero
bool isZero(double v) const
Helper function for floating point subtraction.
Definition: RatesAnalysisAlg.h:248
xAOD::EventInfo_v1::actualInteractionsPerCrossing
float actualInteractionsPerCrossing() const
Average interactions per crossing for the current BCID - for in-time pile-up.
Definition: EventInfo_v1.cxx:380
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
RatesGroup::duplicateChildren
void duplicateChildren(const RatesGroup *toDuplicate)
Copy in triggers from another group.
Definition: RatesGroup.cxx:190
kNONE
@ kNONE
Do not scale this trigger for changes in luminosity.
Definition: RatesHistoBase.h:35
RatesAnalysisAlg::m_truthPU_jets_RHKey
SG::ReadHandleKey< xAOD::JetContainer > m_truthPU_jets_RHKey
Definition: RatesAnalysisAlg.h:277
RatesAnalysisAlg::m_expressTriggers
std::unordered_set< RatesTrigger * > m_expressTriggers
Triggers with non-zero express PS, used to print them at the end.
Definition: RatesAnalysisAlg.h:256
WeightingValuesSummary_t::m_eventMu
double m_eventMu
The actual number of interactions in the event.
Definition: RatesHistoBase.h:58