ATLAS Offline Software
MuonEfficiencyScaleFactors.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3  */
4 
8 
14 
15 #include <TTree.h>
16 #include <TFile.h>
17 namespace CP {
18 
20  {
25 
29 
30  using ColumnarTool::ColumnarTool;
31  };
32 
34  asg::AsgTool(name),
35  m_wp("Medium"),
36  m_sf_sets(),
37  m_current_sf(),
38  m_custom_dir(),
39  m_custom_file_Combined(),
40  m_custom_file_Calo(),
41  m_custom_file_HighEta(),
42  m_custom_file_LowPt(),
43  m_custom_file_LowPtCalo(),
44  m_custom_file_LRTCombined(),
45  m_custom_file_LRTLowPt(),
46  m_efficiency_decoration_name_data(),
47  m_efficiency_decoration_name_mc(),
48  m_sf_decoration_name(),
49  m_calibration_version("230213_Preliminary_r22run2"),
50  m_lowpt_threshold(-1.),
51  m_iso_jet_dR("dRJet"),
52  m_use2DIsoCorr(false),
53  m_affectingSys(),
54  m_filtered_sys_sets(),
55  m_init(false),
56  m_seperateSystBins(false),
57  m_breakDownSyst(false),
58  m_applyKineDepSys(true),
59  m_useLRT(false),
60  m_Type(CP::MuonEfficiencyType::Undefined) {
61 
62  m_accessors = std::make_unique<Accessors>(this);
63 
64  declareProperty("WorkingPoint", m_wp);
65 
66  // these are for debugging / testing, *not* for general use!
67  declareProperty("CustomInputFolder", m_custom_dir);
68  declareProperty("CustomFileCaloTag", m_custom_file_Calo);
69  declareProperty("CustomFileCombined", m_custom_file_Combined);
70  declareProperty("CustomFileHighEta", m_custom_file_HighEta);
71  declareProperty("CustomFileLowPt", m_custom_file_LowPt);
72  declareProperty("CustomFileLowPtCalo", m_custom_file_LowPtCalo);
73  declareProperty("CustomFileLRTCombined", m_custom_file_LRTCombined);
74  declareProperty("CustomFileLRTLowPt", m_custom_file_LRTLowPt);
75 
76  // Apply additional systematics to account for negelected pt dependency
77  // in the maps themselves or for non-closure
78  declareProperty("ApplyKinematicSystematic", m_applyKineDepSys);
79 
80  // Set specific names for the decorations of the scale-factors to the muon
81  declareProperty("DataEfficiencyDecorationName", m_efficiency_decoration_name_data);
82  declareProperty("MCEfficiencyDecorationName", m_efficiency_decoration_name_mc);
83  declareProperty("ScaleFactorDecorationName", m_sf_decoration_name);
84 
85  declareProperty("CalibrationRelease", m_calibration_version);
86  // Set this property to -1 if you do not want to use the JPsi
87  // reconstruction scale-factors
88  declareProperty("LowPtThreshold", m_lowpt_threshold);
89  declareProperty("UncorrelateSystematics", m_seperateSystBins);
90  declareProperty("BreakDownSystematics", m_breakDownSyst);
93  declareProperty("CloseJetDRDecorator", m_iso_jet_dR);
94  declareProperty("Use2DIsoCorrections", m_use2DIsoCorr);
96  declareProperty("UseLRT", m_useLRT);
97  }
100  return m_iso_jet_dR;
101  }
103  return m_use2DIsoCorr;
104  }
106  return m_lowpt_threshold;
107  }
110  return m_Type;
111  }
113  return m_sf_decoration_name.empty() ? std::string("SF") + m_wp : m_sf_decoration_name;
114  }
116  return m_efficiency_decoration_name_data.empty() ? std::string("DataEffi") + m_wp : m_efficiency_decoration_name_data;
117  }
119  return m_efficiency_decoration_name_mc.empty() ? std::string("MCEffi") + m_wp : m_efficiency_decoration_name_mc;
120  }
122  return std::string("Replica") + sf_decoration();
123  }
125  return std::string("Replica") + data_effi_decoration();
126  }
128  return std::string("Replica") + mc_effi_decoration();
129  }
131  size_t i = 0;
132  for (const auto& sf: m_sf_sets) {
133  if (sf.get() == coll) return i;
134  ++i;
135  }
136  return i;
137  }
139  return m_sf_sets.size();
140  }
142  return m_useLRT;
143  }
145  if (m_init) {
146  ATH_MSG_INFO("The tool using working point " << m_wp << " is already initialized.");
147  return StatusCode::SUCCESS;
148  }
149  if (m_wp.find("Iso") != std::string::npos) {
151 
152  } else if (m_wp.find("BadMuon") != std::string::npos) {
155  m_applyKineDepSys = true;
156  } else if (m_wp.find("TTVA") != std::string::npos) {
158  } else {
160  if (m_useLRT && m_wp!="Medium") {
161  ATH_MSG_FATAL(Form("Only Medium identification WP is supported for LRT muons. You chose %s.", m_wp.c_str()));
162  return StatusCode::FAILURE;
163  }
164  }
165  ATH_MSG_INFO("Efficiency type is = " << EfficiencyTypeName(m_Type));
166 
167  // temporary workaround to avoid bad Jpsi scale factors
168  if (m_lowpt_threshold < 0) { // not set by the user, use default values
169  if (m_calibration_version.find("run3") != std::string::npos) {
171  } else {
172  m_lowpt_threshold = 15e3;
173  }
174  }
175 
179  ATH_MSG_DEBUG("We are running Isolation or TTVA or High Pt reco SF, so we use Zmumu based SF for the whole pt range!");
180  m_lowpt_threshold = -1;
181  } else if (m_lowpt_threshold <= 0) {
182  ATH_MSG_INFO("Low pt SF turned off as crossover threshold is negative! Using Zmumu based SF for all pt values.");
183  } else {
184  ATH_MSG_INFO("JPsi based low pt SF will start to rock below " << m_lowpt_threshold / 1000. << " GeV!");
185  }
186 
187  std::set<std::string> decorations{
188  sf_decoration() ,
194  };
195  if (decorations.size() != 6){
196  ATH_MSG_FATAL("At least one of the decoration names for scale-factor/ data-efficiency / mc-efficiency is not uniquely defined... Please check your properties");
197  return StatusCode::FAILURE;
198  }
199 
201 
202  if (!m_custom_dir.empty()) ATH_MSG_WARNING("Note: setting up with user specified input file location " << m_custom_dir << " - this is not encouraged!");
203  if (!m_custom_file_Calo.empty()) ATH_MSG_WARNING("Note: setting up with user specified CaloTag input file " << m_custom_file_Calo << " - this is not encouraged!");
204  if (!m_custom_file_Combined.empty()) ATH_MSG_WARNING("Note: setting up with user specified Central muon input file " << m_custom_file_Combined << " - this is not encouraged! ");
205  if (!m_custom_file_HighEta.empty()) ATH_MSG_WARNING("Note: setting up with user specified High Eta input file " << m_custom_file_HighEta << " - this is not encouraged! ");
206  if (!m_custom_file_LowPt.empty()) ATH_MSG_WARNING("Note: setting up with user specified Low Pt input file " << m_custom_file_LowPt << " - this is not encouraged! ");
207  if (!m_custom_file_LowPtCalo.empty()) ATH_MSG_WARNING("Note: setting up with user specified Low Pt CaloTag input file " << m_custom_file_LowPtCalo << " - this is not encouraged! ");
208  if (!m_custom_file_LRTCombined.empty()) ATH_MSG_WARNING("Note: setting up with user specified Central LRT muon input file " << m_custom_file_LRTCombined << " - this is not encouraged! ");
209  if (!m_custom_file_LRTLowPt.empty()) ATH_MSG_WARNING("Note: setting up with user specified Low Pt LRT muon input file " << m_custom_file_LowPt << " - this is not encouraged! ");
210  if (m_custom_dir.empty()) ATH_MSG_INFO("Trying to initialize, with working point " << m_wp << ", using calibration release " << m_calibration_version);
211 
213 
214  // m_init has to be true for affectingSystematics()
215  m_init = true;
217  // set up for default running without systematics
219  ATH_MSG_ERROR("loading the central value systematic set failed");
220  return StatusCode::FAILURE;
221  }
222 
223  // Add the affecting systematics to the global registry
225  if (!registry.registerSystematics(*this)) {
226  ATH_MSG_ERROR("unable to register the systematics");
227  return StatusCode::FAILURE;
228  }
229  ATH_MSG_INFO("Successfully initialized! ");
230 
231  for (auto& sf_set : m_sf_sets)
232  addSubtool (*sf_set);
233  ATH_CHECK (initializeColumns());
234  return StatusCode::SUCCESS;
235  }
237  if (!info) {
239  info = evtInfo.operator->();
240  if (!info) {
241  ATH_MSG_ERROR("Could not retrieve the xAOD::EventInfo. Return 999999");
242  return 999999;
243  }
244  }
246  }
248  const auto& acc = *m_accessors;
249  if (!acc.eventTypeAcc(info,xAOD::EventInfo::IS_SIMULATION)) {
250  ATH_MSG_DEBUG("The current event is a data event. Return runNumber instead.");
251  return acc.runNumberAcc (info);
252  }
253  if (!acc.acc_rnd.isAvailable(info)) {
254  ATH_MSG_WARNING("Failed to find the RandomRunNumber decoration. Please call the apply() method from the PileupReweightingTool before hand in order to get period dependent SFs. You'll receive SFs from the most recent period.");
255  return 999999;
256  } else if (acc.acc_rnd(info) == 0) {
257  ATH_MSG_DEBUG("Pile up tool has given runNumber 0. Return SF from latest period.");
258  return 999999;
259  }
260  return acc.acc_rnd(info);
261  }
263  if (!m_init) {
264  ATH_MSG_ERROR("The tool has not been initialized yet.");
265  return CorrectionCode::Error;
266  }
267  if (!info) {
269  info = evtInfo.operator->();
270  if (!info) {
271  ATH_MSG_ERROR("Could not retrieve the xAOD::EventInfo. Return 999999");
272  return CorrectionCode::Error;
273  }
274  }
276  }
278  if (!m_init) {
279  ATH_MSG_ERROR("The tool has not been initialized yet.");
280  return CorrectionCode::Error;
281  }
282  unsigned int RunNumber = getRandomRunNumber(info);
284  }
286  if (!m_init) {
287  ATH_MSG_ERROR("The tool has not been initialized yet");
288  return CorrectionCode::Error;
289  }
290  unsigned int RunNumber = getRandomRunNumber(info);
292  }
293 
295  if (!m_init) {
296  ATH_MSG_ERROR("The tool has not been initialized yet");
297  return CorrectionCode::Error;
298  }
299  unsigned int RunNumber = getRandomRunNumber(info);
301  }
303  if (!m_init) {
304  ATH_MSG_ERROR("The tool has not been initialized yet");
305  return CorrectionCode::Error;
306  }
307  unsigned int RunNumber = getRandomRunNumber(info);
309  }
311  if (!m_init) {
312  ATH_MSG_ERROR("The tool has not been initialized yet");
313  return CorrectionCode::Error;
314  }
315  unsigned int RunNumber = getRandomRunNumber(info);
317  }
319  if (!m_init) {
320  ATH_MSG_ERROR("The tool has not been initialized yet");
321  return CorrectionCode::Error;
322  }
323  unsigned int RunNumber = getRandomRunNumber(info);
325  }
327  if (!m_init) {
328  ATH_MSG_ERROR("The tool has not been initialized yet");
329  return CorrectionCode::Error;
330  }
331  unsigned int RunNumber = getRandomRunNumber(info);
333  }
335  if (!m_init) {
336  ATH_MSG_ERROR("The tool has not been initialized yet");
337  return CorrectionCode::Error;
338  }
339  unsigned int RunNumber = getRandomRunNumber(info);
341  }
343  if (!m_init) {
344  ATH_MSG_ERROR("The tool has not been initialized yet");
345  return CorrectionCode::Error;
346  }
347  unsigned int RunNumber = getRandomRunNumber(info);
349  }
351  if (!m_init) {
352  ATH_MSG_ERROR("The tool has not been initialized yet");
353  return CorrectionCode::Error;
354  }
355  unsigned int RunNumber = getRandomRunNumber(info);
357  }
359  if (!m_init) {
360  ATH_MSG_ERROR("The tool has not been initialized yet");
361  return CorrectionCode::Error;
362  }
363  unsigned int RunNumber = getRandomRunNumber(info);
365  }
367  if (!m_init) {
368  ATH_MSG_ERROR("The tool has not been initialized yet");
369  return CorrectionCode::Error;
370  }
371  unsigned int RunNumber = getRandomRunNumber(info);
373  }
374 
375  std::string MuonEfficiencyScaleFactors::resolve_file_location(const std::string &filename) const{
376  if (!m_custom_dir.empty()) {
377  return m_custom_dir + "/" + filename;
378  }
379  std::string fullPathToFile = PathResolverFindCalibFile(Form("MuonEfficiencyCorrections/%s/%s", m_calibration_version.c_str(), filename.c_str()));
380  if (fullPathToFile.empty()) {
381  ATH_MSG_ERROR("Unable to resolve the input file " << m_calibration_version << "/" << filename << " via the PathResolver!");
382  }
383  return fullPathToFile;
384  }
387  else if (m_Type == CP::MuonEfficiencyType::Iso) {
388  return resolve_file_location(Form("Iso_%s_Z.root", m_wp.c_str()));
389  } else if (m_Type == CP::MuonEfficiencyType::TTVA) {
390  return resolve_file_location("TTVA_Z.root");
392  return resolve_file_location("BadMuonVeto_HighPt_Z.root");
393  } else if (m_Type == CP::MuonEfficiencyType::Reco) {
394  return resolve_file_location(Form("Reco_%s_Z.root", m_wp.c_str()));
395  }
396  ATH_MSG_ERROR("What?");
397  return "";
398  }
401  else if (m_Type == CP::MuonEfficiencyType::Iso) {
402  ATH_MSG_WARNING("Using standard isolation SF for LRT muons");
403  return resolve_file_location(Form("Iso_%s_Z.root", m_wp.c_str()));
404  } else if (m_Type == CP::MuonEfficiencyType::TTVA) {
405  ATH_MSG_WARNING("Using standard TTVA SF for LRT muons");
406  return resolve_file_location("TTVA_Z.root");
408  ATH_MSG_WARNING("Using standard BadMuonVeto SF for LRT muons");
409  return resolve_file_location("BadMuonVeto_HighPt_Z.root");
410  } else if (m_Type == CP::MuonEfficiencyType::Reco) {
411  return resolve_file_location(Form("Reco_%sLRT_Z.root", m_wp.c_str()));
412  }
413  ATH_MSG_ERROR("What?");
414  return "";
415  }
417 
419  else if (m_Type != CP::MuonEfficiencyType::Reco) {
420  return filename_Central();
421  } else return resolve_file_location("Reco_CaloTag_Z.root"); //note that in rel22 we switched from CaloTag to CaloScore. Now, we're not updating the filename yet to ensure backward compatibility, but it must be clear that in rel22 calibration areas this file will actually contain the CaloScore SFs.
422  }
424 
426  else if (m_Type != CP::MuonEfficiencyType::Reco) {
427  return filename_Central();
428  } else return resolve_file_location("Reco_HighEta_Z.root");
429  }
431 
433  // for the no reco WPs, we currently use the existing Z SF also for the low pt regime
435  return filename_Central();
436  } else return resolve_file_location(Form("Reco_%s_JPsi.root", m_wp.c_str()));
437  }
439 
441  // we use the Z SF for the low pt regime for Run-3
442  else if (m_Type != CP::MuonEfficiencyType::Reco || m_lowpt_threshold < 0 || m_calibration_version.find("run3") != std::string::npos) {
443  return filename_LRTCentral();
444  } else return resolve_file_location(Form("Reco_%sLRT_JPsi.root", m_wp.c_str()));
445  }
447 
449  // for the no reco WPs, we currently use the existing Z SF also for the low pt regime
451  return filename_Central();
452  } else return resolve_file_location("Reco_CaloTag_JPsi.root"); //note that in rel22 we switched from CaloTag to CaloScore. Now, we're not updating the filename yet to ensure backward compatibility, but it must be clear that in rel22 calibration areas this file will actually contain the CaloScore SFs.
453  }
454  // load the SF histos
455 
457  if (!m_sf_sets.empty()){
458  ATH_MSG_DEBUG("Input already loaded will not do it again");
459  return StatusCode::SUCCESS;
460  }
461  std::map<std::string, unsigned int> systematics = lookUpSystematics();
464  if (systematics.empty()){
465  ATH_MSG_FATAL("No valid systematic could be loaded. Not even the statistical uncertainties");
466  return StatusCode::FAILURE;
467  }
468 
470  m_sf_sets.push_back( std::make_unique<EffiCollection>(*this));
471  EffiCollection* nominal = m_sf_sets.back().get();
472 
473  std::function<unsigned int(unsigned int, unsigned int)> not_inB = [](unsigned int a , unsigned int b){
474  unsigned int b_flipped = ~b;
475  return a & b_flipped;
476  };
478  for (const auto& syst: systematics){
480  if ((syst.second & EffiCollection::ZAnalysis) && (syst.second & EffiCollection::JPsiAnalysis)) {
482  m_sf_sets.push_back(std::make_unique < EffiCollection > (nominal, *this, syst.first, not_inB(syst.second, EffiCollection::ZAnalysis), false));
483  m_sf_sets.push_back(std::make_unique < EffiCollection > (nominal, *this, syst.first, not_inB(syst.second, EffiCollection::ZAnalysis), true));
485  m_sf_sets.push_back(std::make_unique < EffiCollection > (nominal, *this, syst.first, not_inB(syst.second, EffiCollection::JPsiAnalysis), true));
486  m_sf_sets.push_back(std::make_unique < EffiCollection > (nominal, *this, syst.first, not_inB(syst.second, EffiCollection::JPsiAnalysis), false));
487  } else {
488  m_sf_sets.push_back(std::make_unique < EffiCollection > (nominal, *this, syst.first, syst.second, false));
489  m_sf_sets.push_back(std::make_unique < EffiCollection > (nominal, *this, syst.first, syst.second, true));
490  }
491  }
492  for(auto& sf: m_sf_sets){
493  if (!sf->CheckConsistency()) {
494  ATH_MSG_FATAL("Inconsistent scalefactor maps have been found for "<<(sf->getSystSet() ?sf->getSystSet()->name() : "UNKOWN"));
495  return StatusCode::FAILURE;
496  }
497  }
498  for (auto& sf_set : m_sf_sets)
499  addSubtool (*sf_set);
500  return StatusCode::SUCCESS;
501  }
502  std::map<std::string, unsigned int> MuonEfficiencyScaleFactors::lookUpSystematics(){
503  std::map<std::string, unsigned int> syst_map;
506  std::set<std::string> files_to_look_up{
508  filename_Calo(),
510  filename_LowPt(),
512  };
513  if (m_useLRT) {
514  files_to_look_up.insert(filename_LRTCentral());
515  files_to_look_up.insert(filename_LRTLowPt());
516  }
517  std::function<int(const std::string&)> get_bit = [this](const std::string& file_name){
522  if (this->use_lrt()) {
525  }
526  // last file which remains is forward
528  };
529 
530  std::function<void(const std::string&,int)> insert_bit =[&syst_map](const std::string& key, unsigned int bit){
531  if (syst_map.find(key) == syst_map.end()) syst_map.insert(std::pair<std::string, unsigned int>(key,bit));
532  else syst_map[key] = syst_map[key] | bit;
533  };
534  for (const auto& look_up : files_to_look_up){
535  std::unique_ptr<TFile> root_file(TFile::Open(look_up.c_str(), "READ"));
536  if (!root_file || !root_file->IsOpen()){
537  ATH_MSG_FATAL("Could not open file "<<look_up);
538  syst_map.clear();
539  break;
540  }
544  insert_bit("STAT", get_bit(look_up));
545  }
547  if (m_seperateSystBins) insert_bit("STAT", EffiCollection::UnCorrelated);
548 
549  TTree* syst_tree = nullptr;
550  root_file->GetObject("Systematics", syst_tree);
551 
554  if (!m_breakDownSyst || syst_tree == nullptr){
555  ATH_MSG_DEBUG("The file "<<look_up<<" does not contain any systematic tree. No break down for that one will be considered");
556  insert_bit("SYS",get_bit(look_up));
559  insert_bit("SYS", EffiCollection::PtDependent);
560  }
561  continue;
562  }
564  std::string* syst_name = nullptr;
565  bool is_symmetric(0), has_pt_sys(0), uncorrelated(0);
566  if (syst_tree->SetBranchAddress("Name", &syst_name) != 0 ||
567  syst_tree->SetBranchAddress("IsSymmetric", &is_symmetric) != 0 ||
568  syst_tree->SetBranchAddress("HasPtDependentSys", &has_pt_sys) !=0 ||
569  syst_tree->SetBranchAddress("CanBeUncorrelated", &uncorrelated) !=0){
570 
571 
572  ATH_MSG_FATAL("Although "<<look_up<<" has a systematic tree. There is no proper connection to the branches");
573  syst_map.clear();
574  break;
575  }
576  for (int i =0; syst_tree->GetEntry(i); ++i){
577  insert_bit( *syst_name, get_bit(look_up));
578  if (is_symmetric) insert_bit(*syst_name, EffiCollection::Symmetric);
579 
580  if (m_applyKineDepSys && has_pt_sys) {
581  insert_bit(*syst_name, EffiCollection::PtDependent);
582  }if (m_seperateSystBins && uncorrelated) insert_bit(*syst_name, EffiCollection::UnCorrelated);
583  }
584  }
585  return syst_map;
586  }
588  return m_affectingSys.find(systematic) != m_affectingSys.end();
589  }
592  if (!m_affectingSys.empty()) return m_affectingSys;
594  for (auto& collection : m_sf_sets){
595  if (!collection->getSystSet()){
596  ATH_MSG_FATAL("No systematic defined for scale-factor map. ");
597  return SystematicSet();
598  }
599  result.insert(*collection->getSystSet());
600  }
601  return result;
602  }
603 
606  if (!m_init) {
607  ATH_MSG_ERROR("The tool has not been initialized yet");
608  return CP::SystematicSet();
609  }
610  return affectingSystematics();
611  }
613  if (!m_init) {
614  ATH_MSG_ERROR("Initialize first the tool!");
615  return StatusCode::FAILURE;
616  }
617 
618  //check if systematics is cached
619  std::unordered_map<CP::SystematicSet, EffiCollection*>::const_iterator itr = m_filtered_sys_sets.find (systConfig);
620 
621  SystematicSet mySysConf(systConfig);
622 
623  if (itr == m_filtered_sys_sets.end()) {
624  if (!SystematicSet::filterForAffectingSystematics(systConfig, m_affectingSys, mySysConf)) {
625  ATH_MSG_ERROR("Unsupported combination of systematics passed to the tool! ");
626  return StatusCode::FAILURE;
627  }
628  itr = m_filtered_sys_sets.find(mySysConf);
629  }
630 
631  // No cache is available
632  if (itr == m_filtered_sys_sets.end()){
633  std::vector<std::unique_ptr<EffiCollection>>::const_iterator coll_itr = std::find_if(m_sf_sets.begin(), m_sf_sets.end(),[&mySysConf](const std::unique_ptr<EffiCollection>& a){return a->isAffectedBySystematic(mySysConf);});
634  if (coll_itr == m_sf_sets.end()){
635  ATH_MSG_WARNING("Invalid systematic given.");
636  return StatusCode::FAILURE;
637  }
638  m_filtered_sys_sets.insert(std::pair<SystematicSet, EffiCollection*>(systConfig, coll_itr->get()));
639  itr = m_filtered_sys_sets.find(systConfig);
640  }
641  m_current_sf = itr->second;
642 
643  if (m_seperateSystBins && !itr->first.name().empty()){
644  for (std::set<SystematicVariation>::const_iterator t = mySysConf.begin(); t != mySysConf.end(); ++t) {
645  if ((*t).isToyVariation()) {
646  // First entry corresponds to the bin number and
647  // the second entry to the position in which the map is ordered
648  // into the m_sf_sets container
649  std::pair<unsigned, float> pair = (*t).getToyVariation();
650  if (pair.first != 0 && !m_current_sf->SetSystematicBin(pair.first)){
651  ATH_MSG_WARNING("Could not apply systematic " << (*t).name() << " for bin " << pair.first);
652  return StatusCode::FAILURE;
653  }
654  return StatusCode::SUCCESS;
655  }
656  }
657  }
658  return StatusCode::SUCCESS;
659  }
660  std::string MuonEfficiencyScaleFactors::getUncorrelatedSysBinName(unsigned int Bin) const {
661  if (!m_current_sf){
662  throw std::runtime_error("No systematic has been loaded. Cannot return any syst-bin") ;
663  ATH_MSG_FATAL("No systematic has been loaded. Cannot return any syst-bin");
664 
665  }
666  return m_current_sf->GetBinName(Bin);
667  }
669  if (!m_current_sf){
670  ATH_MSG_WARNING("No systematic has been loaded. Cannot return any syst-bin");
671  return -1;
672  }
674  }
676  for (std::set<SystematicVariation>::const_iterator t = systConfig.begin(); t != systConfig.end(); ++t) {
677  if ((*t).isToyVariation()) {
678  std::pair<unsigned, float> pair = (*t).getToyVariation();
679  return getUncorrelatedSysBinName(pair.first);
680  }
681  }
682  ATH_MSG_ERROR("The given systematic " << systConfig.name() << " is not an unfolded one. Return unknown bin ");
683  return "unknown bin";
684  }
685 
687  {
688  const auto& acc = *m_accessors;
689  for (columnar::MuonId muon : muons)
690  {
691  float sf = 0;
693  {
695  acc.sfDec(muon) = sf;
696  acc.validDec(muon) = true;
697  break;
699  acc.sfDec(muon) = sf;
700  acc.validDec(muon) = false;
701  break;
702  default:
703  throw std::runtime_error("Error in getEfficiencyScaleFactor");
704  }
705  }
706  }
707 
709  const auto& acc = *m_accessors;
711  {
712  auto eventInfo = acc.eventInfoCol(event);
713  callSingleEvent (acc.muons(event), eventInfo);
714  }
715  }
716 
717 } /* namespace CP */
CP::MuonEfficiencyScaleFactors::filename_Calo
std::string filename_Calo() const
Reconstruction scale-factors have a dedicated map for calo-tag muons around |\eta|<0....
Definition: MuonEfficiencyScaleFactors.cxx:416
CP::MuonEfficiencyScaleFactors::m_custom_file_LowPtCalo
std::string m_custom_file_LowPtCalo
Definition: MuonEfficiencyScaleFactors.h:181
python.Dso.registry
registry
Definition: Control/AthenaServices/python/Dso.py:158
CP::MuonEfficiencyScaleFactors::filename_Central
std::string filename_Central() const
The following methods are meant to propagate information from the central tool to the subtool managin...
Definition: MuonEfficiencyScaleFactors.cxx:385
CP::MuonEfficiencyScaleFactors::isAffectedBySystematic
virtual bool isAffectedBySystematic(const SystematicVariation &systematic) const override
returns: whether this tool is affected by the given systematis
Definition: MuonEfficiencyScaleFactors.cxx:587
CP::MuonEfficiencyScaleFactors::~MuonEfficiencyScaleFactors
virtual ~MuonEfficiencyScaleFactors()
CP::MuonEfficiencyScaleFactors::filename_LRTLowPt
std::string filename_LRTLowPt() const
Definition: MuonEfficiencyScaleFactors.cxx:438
CP::EfficiencyScaleFactor::DataEfficiency
CorrectionCode DataEfficiency(const xAOD::Muon &mu, float &Eff) const
... and absolute efficiencies
Definition: EfficiencyScaleFactor.cxx:316
CP::MuonEfficiencyScaleFactors::recommendedSystematics
virtual SystematicSet recommendedSystematics() const override
returns: the list of all systematics this tool recommends to use
Definition: MuonEfficiencyScaleFactors.cxx:605
CP::EfficiencyScaleFactor::ScaleFactorReplicas
CorrectionCode ScaleFactorReplicas(const xAOD::Muon &mu, std::vector< float > &SF)
Definition: EfficiencyScaleFactor.cxx:414
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:196
CP::MuonEfficiencyScaleFactors::applyMCEfficiency
virtual CorrectionCode applyMCEfficiency(const xAOD::Muon &mu, const xAOD::EventInfo *info=0) const override
Definition: MuonEfficiencyScaleFactors.cxx:350
CP::MuonEfficiencyScaleFactors::m_filtered_sys_sets
std::unordered_map< CP::SystematicSet, EffiCollection * > m_filtered_sys_sets
It turned out that the code spends a large time in the look up of the systematics.
Definition: MuonEfficiencyScaleFactors.h:203
CP::MuonEfficiencyScaleFactors::m_custom_file_LRTLowPt
std::string m_custom_file_LRTLowPt
Definition: MuonEfficiencyScaleFactors.h:183
CP::EffiCollection
The EffiCollection class handles the 5 different scale-factor maps binned in time.
Definition: EffiCollection.h:34
CP::MuonEfficiencyScaleFactors::data_effi_replica_decoration
std::string data_effi_replica_decoration() const
Definition: MuonEfficiencyScaleFactors.cxx:124
CP::EffiCollection::CentralLowPt
@ CentralLowPt
Definition: EffiCollection.h:48
CP::MuonEfficiencyScaleFactors::m_custom_dir
std::string m_custom_dir
Definition: MuonEfficiencyScaleFactors.h:176
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
CP::MuonEfficiencyScaleFactors::LoadInputs
StatusCode LoadInputs()
load the SF histos
Definition: MuonEfficiencyScaleFactors.cxx:456
CP::EfficiencyScaleFactor::MCEfficiencyReplicas
CorrectionCode MCEfficiencyReplicas(const xAOD::Muon &mu, std::vector< float > &eff)
Definition: EfficiencyScaleFactor.cxx:420
get_generator_info.result
result
Definition: get_generator_info.py:21
CP::MuonEfficiencyScaleFactors::lowPtTransition
float lowPtTransition() const
If the pt of the muon is below that threshold the J/Psi or Upsilon map is used given that it's availa...
Definition: MuonEfficiencyScaleFactors.cxx:105
CP::MuonEfficiencyScaleFactors::m_useLRT
bool m_useLRT
Turn on if using LRT objects.
Definition: MuonEfficiencyScaleFactors.h:210
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CP::MuonEfficiencyScaleFactors::getEfficiencyScaleFactorReplicas
virtual CorrectionCode getEfficiencyScaleFactorReplicas(const xAOD::Muon &mu, std::vector< float > &sf_err, const xAOD::EventInfo *info=0) const override
replica generation
Definition: MuonEfficiencyScaleFactors.cxx:294
CP::MuonEfficiencyScaleFactors::applyDataEfficiency
virtual CorrectionCode applyDataEfficiency(const xAOD::Muon &mu, const xAOD::EventInfo *info=0) const override
decorate a muon with the efficiency information
Definition: MuonEfficiencyScaleFactors.cxx:318
CP::MuonEfficiencyScaleFactors::sf_replica_decoration
std::string sf_replica_decoration() const
Definition: MuonEfficiencyScaleFactors.cxx:121
CP::MuonEfficiencyScaleFactors::m_iso_jet_dR
std::string m_iso_jet_dR
Name of the decoration to catch up the close by jets.
Definition: MuonEfficiencyScaleFactors.h:198
CP::MuonEfficiencyScaleFactors::getDataEfficiencyReplicas
virtual CorrectionCode getDataEfficiencyReplicas(const xAOD::Muon &mu, std::vector< float > &sf_err, const xAOD::EventInfo *info=0) const
Definition: MuonEfficiencyScaleFactors.cxx:326
CP::MuonEfficiencyScaleFactors::applyMCEfficiencyReplicas
virtual CorrectionCode applyMCEfficiencyReplicas(const xAOD::Muon &mu, int nreplicas=50, const xAOD::EventInfo *info=0) const
Definition: MuonEfficiencyScaleFactors.cxx:366
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
CP::BadMuonVeto
@ BadMuonVeto
Definition: MuonEfficiencyType.h:17
MuonEfficiencyScaleFactors.h
CP::MuonEfficiencyScaleFactors::Accessors::eventTypeAcc
columnar::EventInfoHelpers::EventTypeAccessor eventTypeAcc
Definition: MuonEfficiencyScaleFactors.cxx:22
CP::MuonEfficiencyScaleFactors::sf_decoration
std::string sf_decoration() const
The apply<Blah> methods decorate their result directly to the muon.
Definition: MuonEfficiencyScaleFactors.cxx:112
CP::MuonEfficiencyScaleFactors::m_eventInfo
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo
Definition: MuonEfficiencyScaleFactors.h:85
CP::EffiCollection::UnCorrelated
@ UnCorrelated
Definition: EffiCollection.h:61
CP::SystematicSet::empty
bool empty() const
returns: whether the set is empty
Definition: SystematicSet.h:67
CP::EffiCollection::Central
@ Central
The five different scale-factor maps.
Definition: EffiCollection.h:45
CheckAppliedSFs.systematics
systematics
Definition: CheckAppliedSFs.py:231
asg
Definition: DataHandleTestTool.h:28
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
CP::MuonEfficiencyScaleFactors::getMCEfficiency
virtual CorrectionCode getMCEfficiency(const xAOD::Muon &mu, float &eff, const xAOD::EventInfo *info=0) const override
Obtain the muon efficiency measured using the MC.
Definition: MuonEfficiencyScaleFactors.cxx:342
CP::MuonEfficiencyScaleFactors::m_custom_file_LRTCombined
std::string m_custom_file_LRTCombined
Definition: MuonEfficiencyScaleFactors.h:182
CP::MuonEfficiencyScaleFactors::getMCEfficiencyReplicas
virtual CorrectionCode getMCEfficiencyReplicas(const xAOD::Muon &mu, std::vector< float > &sf_err, const xAOD::EventInfo *info=0) const
Definition: MuonEfficiencyScaleFactors.cxx:358
CP::SystematicSet::name
std::string name() const
returns: the systematics joined into a single string.
Definition: SystematicSet.cxx:277
CP::EffiCollection::Calo
@ Calo
Definition: EffiCollection.h:46
CP::MuonEfficiencyScaleFactors::Accessors
Definition: MuonEfficiencyScaleFactors.cxx:20
MuonEfficiencyType.h
CP::MuonEfficiencyScaleFactors::applyEfficiencyScaleFactor
virtual CorrectionCode applyEfficiencyScaleFactor(const xAOD::Muon &mu, const xAOD::EventInfo *info=0) const override
decorate the muon with scale factor information
Definition: MuonEfficiencyScaleFactors.cxx:285
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
CP::MuonEfficiencyScaleFactors::m_sf_sets
std::vector< std::unique_ptr< EffiCollection > > m_sf_sets
This vector stores all scale-factor maps.
Definition: MuonEfficiencyScaleFactors.h:171
CP::SystematicVariation
Definition: SystematicVariation.h:47
CP::MuonEfficiencyScaleFactors::m_custom_file_Combined
std::string m_custom_file_Combined
Definition: MuonEfficiencyScaleFactors.h:177
columnar::ObjectRange
a class representing a continuous sequence of objects (a.k.a. a container)
Definition: ContainerId.h:177
xAOD::EventInfo_v1::IS_SIMULATION
@ IS_SIMULATION
true: simulation, false: data
Definition: EventInfo_v1.h:151
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:49
python.DataFormatRates.events
events
Definition: DataFormatRates.py:105
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
CP::MuonEfficiencyScaleFactors::m_use2DIsoCorr
bool m_use2DIsoCorr
Definition: MuonEfficiencyScaleFactors.h:199
CP::EfficiencyScaleFactor::ApplyScaleFactor
CorrectionCode ApplyScaleFactor(const xAOD::Muon &mu) const
or you can just decorate the scale-factor to the muon
Definition: EfficiencyScaleFactor.cxx:377
CP::EffiCollection::Forward
@ Forward
Definition: EffiCollection.h:47
CP::MuonEfficiencyScaleFactors::filename_LRTCentral
std::string filename_LRTCentral() const
LRT muons have their own efficiency maps.
Definition: MuonEfficiencyScaleFactors.cxx:399
CP::EfficiencyScaleFactor::DataEfficiencyReplicas
CorrectionCode DataEfficiencyReplicas(const xAOD::Muon &mu, std::vector< float > &eff)
Definition: EfficiencyScaleFactor.cxx:417
CP::MuonEfficiencyScaleFactors::m_sf_decoration_name
std::string m_sf_decoration_name
Definition: MuonEfficiencyScaleFactors.h:189
physics_parameters.file_name
string file_name
Definition: physics_parameters.py:32
CP::MuonEfficiencyScaleFactors::getUncorrelatedSysBinName
virtual std::string getUncorrelatedSysBinName(unsigned int Bin) const override
Definition: MuonEfficiencyScaleFactors.cxx:660
CP::MuonEfficiencyScaleFactors::getPosition
size_t getPosition(const EffiCollection *coll) const
Returns the position of the collection in the syst set vector.
Definition: MuonEfficiencyScaleFactors.cxx:130
CP::MuonEfficiencyScaleFactors::filename_LowPt
std::string filename_LowPt() const
Returns the scale-factor maps from a complementary scale-factor measurement using the J/Psi or Upsilo...
Definition: MuonEfficiencyScaleFactors.cxx:430
CP::MuonEfficiencyScaleFactors::MuonEfficiencyScaleFactors
MuonEfficiencyScaleFactors(const std::string &name)
Definition: MuonEfficiencyScaleFactors.cxx:33
CP::CorrectionCode::OutOfValidityRange
@ OutOfValidityRange
Input object is out of validity range.
Definition: CorrectionCode.h:37
CP::CorrectionCode::Error
@ Error
Some error happened during the object correction.
Definition: CorrectionCode.h:36
histSizes.code
code
Definition: histSizes.py:129
CP::MuonEfficiencyScaleFactors::m_init
bool m_init
Definition: MuonEfficiencyScaleFactors.h:205
CP::MuonEfficiencyScaleFactors::m_efficiency_decoration_name_mc
std::string m_efficiency_decoration_name_mc
Definition: MuonEfficiencyScaleFactors.h:188
CP::Iso
@ Iso
Definition: MuonEfficiencyType.h:16
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
CP::MuonEfficiencyScaleFactors::callSingleEvent
void callSingleEvent(columnar::MuonRange muons, columnar::EventInfoId event) const
Definition: MuonEfficiencyScaleFactors.cxx:686
lumiFormat.i
int i
Definition: lumiFormat.py:85
CP::MuonEfficiencyScaleFactors::Accessors::runNumberAcc
columnar::EventInfoAccessor< uint32_t > runNumberAcc
Definition: MuonEfficiencyScaleFactors.cxx:23
SystematicRegistry.h
PixelAthClusterMonAlgCfg.e4
e4
Definition: PixelAthClusterMonAlgCfg.py:332
CP::MuonEfficiencyScaleFactors::applyDataEfficiencyReplicas
virtual CorrectionCode applyDataEfficiencyReplicas(const xAOD::Muon &mu, int nreplicas=50, const xAOD::EventInfo *info=0) const
Definition: MuonEfficiencyScaleFactors.cxx:334
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
CP::MuonEfficiencyScaleFactors::m_efficiency_decoration_name_data
std::string m_efficiency_decoration_name_data
Definition: MuonEfficiencyScaleFactors.h:187
CP::MuonEfficiencyScaleFactors::resolve_file_location
std::string resolve_file_location(const std::string &filename) const
utility method to 'dress' a filename using the path resolver
Definition: MuonEfficiencyScaleFactors.cxx:375
CP::Reco
@ Reco
Definition: MuonEfficiencyType.h:14
CP::EffiCollection::PtDependent
@ PtDependent
Definition: EffiCollection.h:60
CP::EfficiencyScaleFactor::MCEfficiency
CorrectionCode MCEfficiency(const xAOD::Muon &mu, float &Eff) const
... mc efficiency
Definition: EfficiencyScaleFactor.cxx:331
CP::SystematicSet::end
const_iterator end() const
description: const iterator to the end of the set
Definition: SystematicSet.h:59
CP::EffiCollection::GetBinName
std::string GetBinName(unsigned int bin) const
Returns the global bin name conststucted from the axis titles and the bin borders.
Definition: EffiCollection.cxx:315
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
CP::MuonEfficiencyScaleFactors::applyEfficiencyScaleFactorReplicas
virtual CorrectionCode applyEfficiencyScaleFactorReplicas(const xAOD::Muon &mu, int nreplicas=50, const xAOD::EventInfo *info=0) const override
decorate the muon with a set of SF replica weights.
Definition: MuonEfficiencyScaleFactors.cxx:302
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CP::EfficiencyScaleFactor::ApplyDataEfficiency
CorrectionCode ApplyDataEfficiency(const xAOD::Muon &mu) const
You can decorate the data efficiecny as well.
Definition: EfficiencyScaleFactor.cxx:390
CP::MuonEfficiencyScaleFactors::m_current_sf
EffiCollection * m_current_sf
Pointer to the current active map in terms of systematics.
Definition: MuonEfficiencyScaleFactors.h:174
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
columnar::EventInfoHelpers::EventTypeAccessor
Definition: EventInfoHelpers.h:28
CP::MuonEfficiencyScaleFactors::affectingSystematics
virtual SystematicSet affectingSystematics() const override
returns: the list of all systematics this tool can be affected by
Definition: MuonEfficiencyScaleFactors.cxx:591
CP::MuonEfficiencyScaleFactors::m_affectingSys
CP::SystematicSet m_affectingSys
Definition: MuonEfficiencyScaleFactors.h:200
CP::EfficiencyScaleFactor::ApplyDataEfficiencyReplicas
CorrectionCode ApplyDataEfficiencyReplicas(const xAOD::Muon &mu, int n_replicas)
Definition: EfficiencyScaleFactor.cxx:396
CP::MuonEfficiencyScaleFactors::filename_HighEta
std::string filename_HighEta() const
High-eta reconstruction scale-factors are not obtained by the means of are not obtained by the means ...
Definition: MuonEfficiencyScaleFactors.cxx:423
CP::MuonEfficiencyScaleFactors::Accessors::validDec
columnar::MuonDecorator< char > validDec
Definition: MuonEfficiencyScaleFactors.cxx:28
StatusCode.h
CP::EffiCollection::retrieveSF
EfficiencyScaleFactor * retrieveSF(const xAOD::Muon &mu, unsigned int RunNumber) const
return the correct SF type to provide, depending on eta and the author
Definition: EffiCollection.cxx:257
CP::MuonEfficiencyScaleFactors::callEvents
virtual void callEvents(columnar::EventContextRange events) const override
Definition: MuonEfficiencyScaleFactors.cxx:708
EventInfoWrite.RunNumber
RunNumber
Definition: EventInfoWrite.py:51
columnar::ObjectId
a class representing a single object (electron, muons, etc.)
Definition: ContainerId.h:178
PathResolver.h
CP::MuonEfficiencyScaleFactors::m_breakDownSyst
bool m_breakDownSyst
Definition: MuonEfficiencyScaleFactors.h:207
CP::Undefined
@ Undefined
Definition: MuonEfficiencyType.h:13
CP::MuonEfficiencyScaleFactors::m_applyKineDepSys
bool m_applyKineDepSys
Definition: MuonEfficiencyScaleFactors.h:208
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
CP::MuonEfficiencyScaleFactors::m_wp
std::string m_wp
the working point to operate on
Definition: MuonEfficiencyScaleFactors.h:168
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:76
CP::MuonEfficiencyScaleFactors::Accessors::muons
columnar::MuonAccessor< columnar::ObjectColumn > muons
Definition: MuonEfficiencyScaleFactors.cxx:26
ReadHandle.h
Handle class for reading from StoreGate.
CP::MuonEfficiencyScaleFactors::m_custom_file_Calo
std::string m_custom_file_Calo
Definition: MuonEfficiencyScaleFactors.h:178
CP::TTVA
@ TTVA
Definition: MuonEfficiencyType.h:15
CP::MuonEfficiencyScaleFactors::getNCollections
size_t getNCollections() const
Returns the number of EffiCollections stored in this class.
Definition: MuonEfficiencyScaleFactors.cxx:138
CP::MuonEfficiencyScaleFactors::m_custom_file_HighEta
std::string m_custom_file_HighEta
Definition: MuonEfficiencyScaleFactors.h:179
CP::EffiCollection::ZAnalysis
@ ZAnalysis
Definition: EffiCollection.h:51
CP::EffiCollection::Symmetric
@ Symmetric
Definition: EffiCollection.h:59
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:283
CP::EffiCollection::CaloLowPt
@ CaloLowPt
Definition: EffiCollection.h:49
CP::SystematicSet::find
iterator find(const SystematicVariation &sys) const
description: find an element in the set
Definition: SystematicSet.h:63
CP::CorrectionCode::Ok
@ Ok
The correction was done successfully.
Definition: CorrectionCode.h:38
a
TList * a
Definition: liststreamerinfos.cxx:10
CP::MuonEfficiencyScaleFactors::m_accessors
std::unique_ptr< Accessors > m_accessors
Definition: MuonEfficiencyScaleFactors.h:216
CP::EfficiencyScaleFactor::ApplyMCEfficiency
CorrectionCode ApplyMCEfficiency(const xAOD::Muon &mu) const
... or decorate them directly
Definition: EfficiencyScaleFactor.cxx:402
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
CP::EffiCollection::JPsiAnalysis
@ JPsiAnalysis
Distinguish these two because the systematics are named with an extra LOWPT.
Definition: EffiCollection.h:54
CP::MuonEfficiencyScaleFactors::getRandomRunNumber
unsigned int getRandomRunNumber(const xAOD::EventInfo *info) const
Definition: MuonEfficiencyScaleFactors.cxx:236
CP::MuonEfficiencyType
MuonEfficiencyType
Definition: MuonEfficiencyType.h:12
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
CP::MuonEfficiencyScaleFactors::mc_effi_decoration
std::string mc_effi_decoration() const
Definition: MuonEfficiencyScaleFactors.cxx:118
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CP::EfficiencyScaleFactor::ApplyScaleFactorReplicas
CorrectionCode ApplyScaleFactorReplicas(const xAOD::Muon &mu, int n_replicas)
Definition: EfficiencyScaleFactor.cxx:383
CP::SystematicRegistry
This module implements the central registry for handling systematic uncertainties with CP tools.
Definition: SystematicRegistry.h:25
CP::MuonEfficiencyScaleFactors::use_lrt
bool use_lrt() const
option to set if we want to use LRT muons
Definition: MuonEfficiencyScaleFactors.cxx:141
CP::MuonEfficiencyScaleFactors::m_custom_file_LowPt
std::string m_custom_file_LowPt
Definition: MuonEfficiencyScaleFactors.h:180
CP::SystematicSet::begin
const_iterator begin() const
description: const iterator to the beginning of the set
Definition: SystematicSet.h:55
CP::MuonEfficiencyScaleFactors::lookUpSystematics
std::map< std::string, unsigned int > lookUpSystematics()
Scale-factor files since Moriond2019 contain the breakdown of systematics into their individual compo...
Definition: MuonEfficiencyScaleFactors.cxx:502
columnar::ColumnarTool
the base class for all columnar components
Definition: ColumnAccessorDataArray.h:17
CP::MuonEfficiencyScaleFactors::mc_effi_replica_deocration
std::string mc_effi_replica_deocration() const
Definition: MuonEfficiencyScaleFactors.cxx:127
CP::MuonEfficiencyScaleFactors::uncorrelate_sys
bool uncorrelate_sys() const
Returns a boolean whether the uncorrelation of systematics has been switched on.
Definition: MuonEfficiencyScaleFactors.cxx:108
CP::CorrectionCode
Return value from object correction CP tools.
Definition: CorrectionCode.h:31
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:23
CP::EfficiencyScaleFactor::ScaleFactor
CorrectionCode ScaleFactor(const xAOD::Muon &mu, float &SF) const
the important bits - extract SF info
Definition: EfficiencyScaleFactor.cxx:297
CP::MuonEfficiencyScaleFactors::Accessors::acc_rnd
columnar::EventInfoAccessor< unsigned int > acc_rnd
Definition: MuonEfficiencyScaleFactors.cxx:24
CP::MuonEfficiencyScaleFactors::getUnCorrelatedSystBin
virtual int getUnCorrelatedSystBin(const xAOD::Muon &mu) const override
Definition: MuonEfficiencyScaleFactors.cxx:668
CP::MuonEfficiencyScaleFactors::close_by_jet_decoration
const std::string & close_by_jet_decoration() const
Returns the string telling the tool in which float AuxElement the information of the separation to th...
Definition: MuonEfficiencyScaleFactors.cxx:99
CP::MuonEfficiencyScaleFactors::initialize
virtual StatusCode initialize() override
initialize the tool once all settings are in place!
Definition: MuonEfficiencyScaleFactors.cxx:144
CP::MuonEfficiencyScaleFactors::getEfficiencyScaleFactor
virtual CorrectionCode getEfficiencyScaleFactor(const xAOD::Muon &mu, float &sf, const xAOD::EventInfo *info=0) const override
Retrieve the Scale factor and decorate the muon.
Definition: MuonEfficiencyScaleFactors.cxx:262
dqt_zlumi_alleff_HIST.eff
int eff
Definition: dqt_zlumi_alleff_HIST.py:113
CP::EfficiencyScaleFactor::ApplyMCEfficiencyReplicas
CorrectionCode ApplyMCEfficiencyReplicas(const xAOD::Muon &mu, int n_replicas)
Definition: EfficiencyScaleFactor.cxx:408
columnar::AccessorTemplate
the raw column accessor template class
Definition: ColumnAccessor.h:81
CP::MuonEfficiencyScaleFactors::filename_LowPtCalo
std::string filename_LowPtCalo() const
Definition: MuonEfficiencyScaleFactors.cxx:446
CP::MuonEfficiencyScaleFactors::m_lowpt_threshold
float m_lowpt_threshold
threshold below which low-pt SF (i.e. from JPsi) should be used
Definition: MuonEfficiencyScaleFactors.h:196
CP::MuonEfficiencyScaleFactors::m_seperateSystBins
bool m_seperateSystBins
Definition: MuonEfficiencyScaleFactors.h:206
CP::EffiCollection::getUnCorrelatedSystBin
int getUnCorrelatedSystBin(const xAOD::Muon &mu) const
Returns the bin number from which the scale-factor of the muon is going to be retrieved....
Definition: EffiCollection.cxx:331
CP::MuonEfficiencyScaleFactors::use_2D_iso_corrections
bool use_2D_iso_corrections() const
option to set if we want to use 1D or 2D isolation SFs
Definition: MuonEfficiencyScaleFactors.cxx:102
CP::EffiCollection::SetSystematicBin
bool SetSystematicBin(unsigned int Bin)
If systematic decorrelation is activated then the user needs to loop manually over the syst bins.
Definition: EffiCollection.cxx:293
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:51
CP::MuonEfficiencyScaleFactors::Accessors::eventInfoCol
columnar::EventInfoAccessor< columnar::ObjectColumn > eventInfoCol
Definition: MuonEfficiencyScaleFactors.cxx:21
python.ParticleTypeUtil.info
def info
Definition: ParticleTypeUtil.py:87
CP::MuonEfficiencyScaleFactors::measurement
CP::MuonEfficiencyType measurement() const
Returns the type of the measurement to be carried out... E.g. Reco/TTVA/Iso.
Definition: MuonEfficiencyScaleFactors.cxx:109
CP::MuonEfficiencyScaleFactors::m_Type
CP::MuonEfficiencyType m_Type
Definition: MuonEfficiencyScaleFactors.h:212
CP::MuonEfficiencyScaleFactors::applySystematicVariation
virtual StatusCode applySystematicVariation(const SystematicSet &systConfig) override
effects: configure this tool for the given list of systematic variations.
Definition: MuonEfficiencyScaleFactors.cxx:612
SystematicVariation.h
CP::MuonEfficiencyScaleFactors::data_effi_decoration
std::string data_effi_decoration() const
Definition: MuonEfficiencyScaleFactors.cxx:115
CP::SystematicSet::filterForAffectingSystematics
static StatusCode filterForAffectingSystematics(const SystematicSet &systConfig, const SystematicSet &affectingSystematics, SystematicSet &filteredSystematics)
description: filter the systematics for the affected systematics returns: success guarantee: strong f...
Definition: SystematicSet.cxx:212
CP::MuonEfficiencyScaleFactors::Accessors::sfDec
columnar::MuonDecorator< float > sfDec
Definition: MuonEfficiencyScaleFactors.cxx:27
CP::MuonEfficiencyScaleFactors::getDataEfficiency
virtual CorrectionCode getDataEfficiency(const xAOD::Muon &mu, float &eff, const xAOD::EventInfo *info=0) const override
Obtain the muon efficiency measured using the data.
Definition: MuonEfficiencyScaleFactors.cxx:310
CP::SystematicRegistry::getInstance
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
Definition: SystematicRegistry.cxx:25
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
CP::MuonEfficiencyScaleFactors::m_calibration_version
std::string m_calibration_version
subfolder to load from the calibration db
Definition: MuonEfficiencyScaleFactors.h:192
EffiCollection.h