49 if (fileName.empty()) {
50 ANA_MSG_INFO(
"Skipping loading trigger SF for year " << year <<
" since the provided file name is empty");
51 return StatusCode::SUCCESS;
53 ATH_MSG_INFO(
"Loading trigger SF from user specified file " << fileName <<
" for year " << year);
57 if (fileName.empty()) {
58 if (year == 2015) fileName =
"muontrigger_sf_2015_mc20a_v3.root";
59 else if (year == 2016) fileName =
"muontrigger_sf_2016_mc20a_v3.root";
60 else if (year == 2017) fileName =
"muontrigger_sf_2017_mc20d_v3.root";
61 else if (year == 2018) fileName =
"muontrigger_sf_2018_mc20e_v3.root";
62 else if (year == 2022) fileName =
"muontrigger_sf_2022_mc23a_v3.root";
63 else if (year == 2023) fileName =
"muontrigger_sf_2023_mc23d_v3.root";
64 else if (year == 2024) fileName =
"muontrigger_sf_2024_mc23e_v1.root";
67 return StatusCode::SUCCESS;
71 TDirectory* origDir = gDirectory;
77 if (filePath.empty()) {
78 ATH_MSG_ERROR(
"Unable to resolve the input file " << fileName <<
" via PathResolver.");
86 TFile*
file = TFile::Open(filePath.c_str());
88 if (
file ==
nullptr || !
file->IsOpen()) {
89 ATH_MSG_FATAL(
"MuonTriggerScaleFactors::initialize Couldn't open file " << filePath);
90 return StatusCode::FAILURE;
95 static const std::vector<std::string>
type {
"data",
"mc" };
96 static const std::vector<std::string> region {
"barrel",
"endcap" };
97 static const std::vector<std::string> systematic {
"nominal",
"stat_up",
"stat_down",
"syst_up",
"syst_down" };
101 TDirectory* qualityDirectory =
file->GetDirectory(
m_muonQuality.value().c_str());
102 if (qualityDirectory ==
nullptr) {
103 ATH_MSG_FATAL(
"MuonTriggerScaleFactors::initialize cannot find directory with selected quality");
104 return StatusCode::FAILURE;
107 TIter nextPeriod(qualityDirectory->GetListOfKeys());
108 while ((periodKey = (TKey*) nextPeriod())) {
109 if (not periodKey->IsFolder())
continue;
110 TDirectory* periodDirectory = qualityDirectory->GetDirectory(periodKey->GetName());
111 std::string periodName = std::string(periodKey->GetName());
112 std::string periodName_InMap = periodName.substr(std::string(
"Period").size(), periodName.size());
115 TIter nextTrigger(periodDirectory->GetListOfKeys());
116 while ((triggerKey = (TKey*) nextTrigger())) {
117 if (not triggerKey->IsFolder())
continue;
118 TDirectory* triggerDirectory = periodDirectory->GetDirectory(triggerKey->GetName());
119 std::string triggerName = std::string(triggerKey->GetName());
120 if(!std::set<std::string>{
"HLT_mu26_ivarmedium",
"HLT_mu50",
"HLT_mu26_ivarmedium_OR_HLT_mu50"}.count(triggerName) &&
m_binning ==
"coarse"){
121 ATH_MSG_DEBUG(
"Coarse binning not supported for di-muon trigger legs at the moment");
124 for (
const auto& iregion : region) {
125 bool isBarrel = iregion.find(
"barrel") != std::string::npos;
126 for (
const auto& itype :
type) {
127 bool isData = itype.find(
"data") != std::string::npos;
128 std::string histname = (
"_MuonTrigEff_" + periodName +
"_" + triggerName +
"_" +
m_muonQuality.value() +
"_" +
"_EtaPhi_" +
m_binning +
"_" + iregion +
"_" + itype);
129 for (
const auto& isys : systematic) {
130 if (itype.find(
"data") != std::string::npos && isys.find(
"syst") != std::string::npos)
continue;
131 std::string path =
"eff_etaphi_" +
m_binning +
"_" + iregion +
"_" + itype +
"_" + isys;
132 TH2* hist =
dynamic_cast<TH2*
>(triggerDirectory->Get(path.c_str()));
135 ATH_MSG_FATAL(
"MuonTriggerScaleFactors::initialize " << path <<
" not found under trigger " << triggerName <<
" and period " << periodName <<
" for year: " << year);
138 hist->SetDirectory(0);
142 ATH_MSG_FATAL(
"MuonTriggerScaleFactors::initialize(): histogram " << path <<
" is duplicated for year" << year <<
" in period " << periodName);
143 return StatusCode::FAILURE;
145 m_efficiencyMap.insert(std::pair<EffiHistoIdent, TH1_Ptr>(HistoId, std::shared_ptr < TH1 > (hist)));
155 TH1_Ptr tmp_h2 =
TH1_Ptr(
dynamic_cast<TH2F*
>(Nominal_H->Clone(Form(
"tmp_h2_%s", Nominal_H->GetName()))));
156 const int xbins = tmp_h2->GetNbinsX(), ybins = tmp_h2->GetNbinsY();
157 for (
int x_i = 0; x_i <= xbins; ++x_i) {
158 for (
int y_i = 0; y_i <= ybins; ++y_i) {
159 double statErr = std::abs(tmp_h2->GetBinContent(x_i, y_i) - StatUp_H->GetBinContent(x_i, y_i));
160 tmp_h2->SetBinError(x_i, y_i, statErr);
172 return StatusCode::SUCCESS;
190 return StatusCode::FAILURE;
195 return StatusCode::FAILURE;
203 constexpr auto years_to_run = std::to_array<int>({2015, 2016, 2017, 2018, 2022, 2023, 2024});
204 for (
const int &year: years_to_run) {
221 ATH_MSG_ERROR(
"Campaign " <<
m_campaign.value() <<
" is not supported. Please choose a valid campaign or leave empty to load all years.");
223 return StatusCode::SUCCESS;
228 ATH_MSG_ERROR(
"MuonTriggerScaleFactors::getTriggerScaleFactor This is an experimental function. If you really know what you are doing set UseExperimental property.");
232 if (trigger.empty()) {
233 ATH_MSG_ERROR(
"MuonTriggerScaleFactors::getTriggerScaleFactor Trigger must have value.");
239 if (trigger ==
"HLT_mu8noL1")
240 ATH_MSG_WARNING(
"What you are trying to do is not correct. For di-muon triggers you should get the efficiency with getTriggerEfficiency and compute the SF by yourself.");
241 else if (trigger.find(
"HLT_2mu10") != std::string::npos || trigger.find(
"HLT_2mu14") != std::string::npos)
242 ATH_MSG_WARNING(
"Di-muon trigger scale factors for single reco muons are not supported!");
249 if (trigger.empty()) {
250 ATH_MSG_ERROR(
"MuonTriggerScaleFactors::getTriggerScaleFactor Trigger must have value.");
256 if (trigger ==
"HLT_mu8noL1") {
257 ATH_MSG_WARNING(
"What you are trying to do is not correct. For di-muon triggers you should get the efficiency with getTriggerEfficiency and compute the SF by yourself.");
258 }
else if (trigger.find(
"HLT_2mu10") != std::string::npos || trigger.find(
"HLT_2mu14") != std::string::npos) {
276 std::size_t pos = sysBaseName.find(
"MCTOY");
277 if (pos == std::string::npos)
return -1;
278 return atoi(sysBaseName.substr(pos + 5, pos + 8).c_str());
282 if (trigger.empty()) {
283 ATH_MSG_ERROR(
"MuonTriggerScaleFactors::getTriggerEfficiency Trigger must have value.");
287 configuration.
isData = dataType;
303 std::string systype =
"";
305 systype =
"syst_down";
309 systype =
"stat_down";
323 if (configuration.
replicaIndex != -1) systype =
"replicas";
340 std::vector<TH1_Ptr> replica_v;
341 const int xbins =
h->GetNbinsX(), ybins =
h->GetNbinsY();
343 for (
int t = 0; t < nrep; ++t) {
344 TH2* replica =
dynamic_cast<TH2*
>(
h->Clone(Form(
"rep%d_%s", t,
h->GetName())));
346 for (
int x_i = 0; x_i <= xbins; ++x_i) {
347 for (
int y_i = 0; y_i <= ybins; ++y_i) {
348 replica->SetBinContent(x_i, y_i, Rndm.Gaus(
h->GetBinContent(x_i, y_i),
h->GetBinError(x_i, y_i)));
351 replica_v.push_back(
TH1_Ptr(replica));
358 return H1.get() !=
nullptr;
363 ATH_MSG_ERROR(
"MuonTriggerScaleFactors::getTriggerScaleFactor This is an experimental function. If you really know what you are doing set UseExperimental property.");
367 const double mu_eta =
muon.eta();
368 const double mu_phi =
muon.phi();
373 ATH_MSG_ERROR(
"Could not find efficiency map for muon with eta: " << mu_eta <<
" and phi: " << mu_phi <<
". Something is inconsistent. Please check your settings for year, mc and trigger." );
377 double mu_phi_corr = mu_phi;
378 if (mu_phi_corr < eff_h2->GetYaxis()->GetXmin()) mu_phi_corr += 2.0 *
M_PI;
379 if (mu_phi_corr > eff_h2->GetYaxis()->GetXmax()) mu_phi_corr -= 2.0 *
M_PI;
380 return eff_h2->FindFixBin(mu_eta, mu_phi_corr);
385 const std::string histName = period +
"_" + Trigger +
"_" + (isBarrel ?
"b" :
"e") +
"_" + (isData ?
"data" :
"mc") + Systematic;
386 return std::hash<std::string>()(histName);
409 const double mu_eta =
muon.eta();
410 const double mu_phi =
muon.phi();
421 ATH_MSG_WARNING(
"Could not find what you are looking for in the efficiency map. The trigger you are looking for, year and mc are not consistent, or the trigger is unavailable in this data period. Returning efficiency = 0.");
427 ATH_MSG_ERROR(
"Could not find what you are looking for in the efficiency map. The trigger you are looking for, year and mc are not consistent, or the trigger is unavailable in this data period. Please check how you set up the tool.");
432 if (configuration.
replicaIndex >= (
int) cit->second.size()) {
433 ATH_MSG_ERROR(
"MuonTriggerScaleFactors::getMuonEfficiency ; index for replicated histograms is out of range.");
440 if (cit.get() ==
nullptr) {
442 ATH_MSG_WARNING(
"Could not find what you are looking for in the efficiency map. The trigger you are looking for, year and mc are not consistent, or the trigger is unavailable in this data period. Returning efficiency = 0.");
446 ATH_MSG_ERROR(
"Could not find what you are looking for in the efficiency map. The trigger you are looking for, year and mc are not consistent, or the trigger is unavailable in this data period. Please check how you set up the tool.");
453 double mu_phi_corr = mu_phi;
454 if (mu_phi_corr < eff_h2->GetYaxis()->GetXmin()) mu_phi_corr += 2.0 *
M_PI;
455 if (mu_phi_corr > eff_h2->GetYaxis()->GetXmax()) mu_phi_corr -= 2.0 *
M_PI;
457 const int bin = eff_h2->FindFixBin(mu_eta, mu_phi_corr);
462 ATH_MSG_DEBUG(
"getMuonEfficiency [eta,phi,phi_corr]=[" << mu_eta <<
"," << mu_phi <<
"," << mu_phi_corr <<
"], ibin=" <<
bin <<
" eff=" << eff);
470 if (mucont.
size() != 2) {
471 ATH_MSG_FATAL(
"MuonTriggerScaleFactors::GetTriggerSF;Currently dimuon trigger chains only implemented for events with exactly 2 muons.");
475 Double_t eff_data = 0;
478 std::string data_err =
"";
479 std::string mc_err =
"";
482 data_err =
"nominal";
485 data_err =
"nominal";
486 mc_err =
"syst_down";
488 data_err =
"stat_down";
491 data_err =
"stat_up";
494 data_err =
"nominal";
505 if (configuration.
replicaIndex != -1) data_err =
"replicas";
508 configuration.
isData =
true;
512 configuration.
isData =
false;
517 double event_SF = 1.;
519 if (std::abs(1. - eff_mc) > 0.0001) {
520 event_SF = eff_data / eff_mc;
523 TriggerSF = event_SF;
532 double rate_not_fired_data = 1.;
533 double rate_not_fired_mc = 1.;
535 for (
const auto mu : mucont) {
537 double eff_data = 0., eff_mc = 0.;
546 std::string muon_trigger_name = trigger;
547 std::string data_err =
"";
548 std::string mc_err =
"";
557 data_err =
"nominal";
560 data_err =
"nominal";
561 mc_err =
"syst_down";
563 data_err =
"stat_down";
566 data_err =
"stat_up";
569 data_err =
"nominal";
580 if (configuration.
replicaIndex != -1) data_err =
"replicas";
583 configuration.
isData =
true;
586 configuration.
isData =
false;
591 rate_not_fired_data *= (1. - eff_data);
592 rate_not_fired_mc *= (1. - eff_mc);
595 double event_SF = 1.;
596 if (1 - rate_not_fired_data == 0) event_SF = 0;
597 if ((mucont.
size()) and (std::abs(1. - rate_not_fired_mc) > 0.0001)) {
599 event_SF = (1. - rate_not_fired_data) / (1. - rate_not_fired_mc);
601 TriggerSF = event_SF;
612 double eff_data = 0., eff_mc = 0.;
621 std::string muon_trigger_name = trigger;
622 std::string data_err =
"";
623 std::string mc_err =
"";
632 data_err =
"nominal";
635 data_err =
"nominal";
636 mc_err =
"syst_down";
638 data_err =
"stat_down";
641 data_err =
"stat_up";
644 data_err =
"nominal";
650 if (configuration.
replicaIndex != -1) data_err =
"replicas";
653 configuration.
isData =
true;
657 configuration.
isData =
false;
664 if (std::abs(eff_mc) > 0.0001)
665 TriggerSF = eff_data / eff_mc;
695 if (trigger.find(
"2mu10") != std::string::npos)
return "HLT_mu10";
696 if (trigger.find(
"2mu14") != std::string::npos)
return "HLT_mu14";
697 throw std::runtime_error(
"Unknown dimuon trigger");
701 std::size_t
index = trigger.find(
"HLT_mu");
702 if (
index != std::string::npos) {
703 std::string rawNumber = trigger.substr(
index + 6);
704 if (!rawNumber.empty() && isdigit(rawNumber[0])) {
705 std::stringstream(rawNumber) >>
threshold;
711 ATH_MSG_ERROR(
"MuonTriggerScaleFactors::getThreshold Could not extract threshold for trigger " << trigger);
740 if (runNumber >= 266904 && runNumber <= 272531)
return "AC";
741 else if (runNumber >= 276073 && runNumber <= 276954)
return "D";
742 else if (runNumber >= 278727 && runNumber <= 279928)
return "E";
743 else if (runNumber >= 279932 && runNumber <= 280422)
return "F";
744 else if (runNumber >= 280423 && runNumber <= 281075)
return "G";
745 else if (runNumber >= 281130 && runNumber <= 281411)
return "H";
746 else if (runNumber >= 281662 && runNumber <= 282482)
return "I";
747 else if (runNumber >= 282625 && runNumber <= 284484)
return "J";
749 else if (year == 2016) {
750 if (runNumber >= 296939 && runNumber <= 300287)
return "A";
751 else if (runNumber >= 300345 && runNumber <= 300908)
return "B";
752 else if (runNumber >= 301912 && runNumber <= 302393)
return "C";
753 else if (runNumber >= 302737 && runNumber <= 302872)
return "D1D3";
754 else if (runNumber >= 302919 && runNumber <= 303560)
return "D4D8";
755 else if (runNumber >= 303638 && runNumber <= 303892)
return "E";
756 else if (runNumber >= 303943 && runNumber <= 304494)
return "F";
757 else if (runNumber >= 305291 && runNumber <= 306714)
return "G";
758 else if (runNumber >= 307124 && runNumber <= 308084)
return "I";
759 else if (runNumber >= 309311 && runNumber <= 309759)
return "K";
760 else if (runNumber >= 310015 && runNumber <= 311481)
return "L";
762 else if (year == 2017) {
763 if (runNumber >= 324320 && runNumber <= 325558)
return "A";
764 else if (runNumber >= 325713 && runNumber <= 328393)
return "B";
765 else if (runNumber >= 329385 && runNumber <= 330470)
return "C";
766 else if (runNumber >= 330857 && runNumber <= 332304)
return "D";
767 else if (runNumber >= 332720 && runNumber <= 334779)
return "E";
768 else if (runNumber >= 334842 && runNumber <= 335290)
return "F";
769 else if (runNumber >= 336497 && runNumber <= 336782)
return "H";
770 else if (runNumber >= 336832 && runNumber <= 337833)
return "I";
771 else if (runNumber >= 338183 && runNumber <= 340453)
return "K";
773 else if (year == 2018) {
774 if (runNumber >= 348197 && runNumber <= 348836)
return "A";
775 else if (runNumber >= 348885 && runNumber <= 349533)
return "B";
776 else if (runNumber >= 349534 && runNumber <= 350220)
return "C";
777 else if (runNumber >= 350310 && runNumber <= 352107)
return "D";
778 else if (runNumber >= 352123 && runNumber <= 352137)
return "E";
779 else if (runNumber >= 352274 && runNumber <= 352514)
return "F";
780 else if (runNumber >= 354107 && runNumber <= 354494)
return "G";
781 else if (runNumber >= 354826 && runNumber <= 355224)
return "H";
782 else if (runNumber >= 355261 && runNumber <= 355273)
return "I";
783 else if (runNumber >= 355331 && runNumber <= 355468)
return "J";
784 else if (runNumber >= 355529 && runNumber <= 356259)
return "K";
785 else if (runNumber >= 357050 && runNumber <= 359171)
return "L";
786 else if (runNumber >= 359191 && runNumber <= 360414)
return "M";
787 else if (runNumber >= 361635 && runNumber <= 361696)
return "N";
788 else if (runNumber >= 361738 && runNumber <= 363400)
return "O";
789 else if (runNumber >= 363664 && runNumber <= 364292)
return "Q";
791 else if (year == 2022) {
792 if(runNumber >= 430536 && runNumber <= 432180)
return "F";
793 else if (runNumber >= 435816 && runNumber <= 439927)
return "H";
794 else if (runNumber >= 440199 && runNumber <= 440613)
return "J";
796 else if (year == 2023) {
797 if(runNumber >= 451094 && runNumber <= 455924)
return "F";
798 else if (runNumber >= 455975 && runNumber <= 456749)
return "G";
800 else if (year == 2024) {
801 if(runNumber >= 473235 && runNumber <= 473400)
return "E";
802 else if (runNumber >= 473617 && runNumber <= 474271)
return "F";
803 else if (runNumber >= 474441 && runNumber <= 474602)
return "G";
804 else if (runNumber >= 474657 && runNumber <= 475522)
return "H";
805 else if (runNumber >= 476060 && runNumber <= 477048)
return "I";
806 else if (runNumber >= 479103 && runNumber <= 480032)
return "K";
807 else if (runNumber >= 480188 && runNumber <= 482221)
return "M";
808 else if (runNumber >= 482374 && runNumber <= 484799)
return "N";
809 else if (runNumber >= 484909 && runNumber <= 486706)
return "O";
812 ATH_MSG_FATAL(
"RunNumber: " << runNumber <<
" not known! Will stop the code to prevent using wrong SFs.");
813 throw std::invalid_argument{
""};
819 if (info.operator->()==
nullptr) {
821 throw std::invalid_argument{
""};
824 ATH_MSG_DEBUG(
"The current event is a data event. Return runNumber instead.");
825 return info->runNumber();
829 ATH_MSG_FATAL(
"Failed to find the RandomRunNumber decoration. Please call the apply() method from the PileupReweightingTool beforehand in order to get period dependent SFs");
830 throw std::invalid_argument{
""};
831 }
else if (acc_rnd(*info) == 0) {
832 ATH_MSG_FATAL(
"Pile up tool has given runNumber 0. Exiting the code.");
833 throw std::invalid_argument{
""};
837 return acc_rnd(*info);
842 TDirectory* tempDir = 0;
844 while (not tempDir) {
846 dirname <<
"MuonTriggerScaleFactorsTempDir_%i" << counter;
847 if (gROOT->GetDirectory((
dirname.str()).c_str())) {
851 tempDir = gROOT->mkdir((
dirname.str()).c_str());
853 ATH_MSG_ERROR(
"getTemporaryDirectory::Temporary directory could not be created");
863 if (!systematic.
empty()) {
865 return sys.find(systematic) != sys.end();
894 ATH_MSG_ERROR(
"Failed to add systematic to list of recommended systematics.");
895 return StatusCode::FAILURE;
897 return StatusCode::SUCCESS;
916 ATH_MSG_ERROR(
"Unsupported combination of systematics passed to the tool!");
917 return StatusCode::FAILURE;
921 itr =
m_systFilter.insert(std::make_pair(systConfig, filteredSys)).first;
934 return StatusCode::FAILURE;
938 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
static const Attributes_t empty
Header file for AthHistogramAlgorithm.
Return value from object correction CP tools.
@ Error
Some error happened during the object correction.
@ OutOfValidityRange
Input object is out of validity range.
@ Ok
The correction was done successfully.
unsigned int getYear(unsigned int run) const
Gaudi::Property< int > m_ReplicaRandomSeed
static const std::map< unsigned int, int > m_runNumber_year
Gaudi::Property< std::string > m_forcePeriod
virtual CorrectionCode GetTriggerSF_dimu(Double_t &TriggerSF, TrigMuonEff::Configuration &configuration, const xAOD::MuonContainer &mucont, const std::string &trigger) const
StatusCode LoadTriggerMap(unsigned int year)
std::set< std::string > m_replicaSet
virtual StatusCode initialize(void)
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo
Gaudi::Property< std::vector< std::string > > m_replicaTriggerList
Gaudi::Property< std::string > m_campaign
std::map< EffiHistoIdent, std::vector< TH1_Ptr > > m_efficiencyMapReplicaArray
TDirectory * getTemporaryDirectory(void) const
Gaudi::Property< int > m_nReplicas
Gaudi::Property< std::string > m_calibrationVersion
virtual CorrectionCode getMuonEfficiency(Double_t &eff, const TrigMuonEff::Configuration &configuration, const xAOD::Muon &muon, const std::string &trigger, const std::string &systematic) const
Gaudi::Property< std::string > m_binning
virtual std::shared_ptr< TH1 > getEfficiencyHistogram(unsigned int year, const std::string &period, const std::string &trigger, bool isData, const std::string &Systematic, bool isBarrel=true) const
virtual int getReplica_index(const std::string &sysBaseName, const std::string &trigStr) const
std::pair< YearPeriod, unsigned int > EffiHistoIdent
virtual StatusCode applySystematicVariation(const CP::SystematicSet &systConfig)
effects: configure this tool for the given list of systematic variations.
MuonTriggerScaleFactors(const std::string &name)
std::vector< TH1_Ptr > generateReplicas(TH1_Ptr h, int nrep, int seed) const
virtual CorrectionCode getDimuonEfficiency(Double_t &eff, const TrigMuonEff::Configuration &configuration, const xAOD::MuonContainer &mucont, const std::string &chain, const std::string &systematic) const
unsigned int encodeHistoName(const std::string &period, const std::string &Trigger, bool isData, const std::string &Systematic, bool isBarrel=true) const
Gaudi::Property< bool > m_allowZeroSF
virtual CorrectionCode GetTriggerSF(Double_t &TriggerSF, TrigMuonEff::Configuration &configuration, const xAOD::MuonContainer &mucont, const std::string &trigger) const
Gaudi::Property< int > m_forceYear
virtual int getBinNumber(const xAOD::Muon &muon, const std::string &trigger) const
StatusCode registerSystematics()
Gaudi::Property< std::string > m_customInputFolder
std::string getTriggerCorrespondingToDimuonTrigger(const std::string &trigger) const
CP::SystematicSet * m_appliedSystematics
std::string getDataPeriod() const
Gaudi::Property< bool > m_experimental
Gaudi::Property< std::map< unsigned int, std::string > > m_customInputFilePerYear
CorrectionCode getThreshold(Int_t &threshold, const std::string &trigger) const
std::unordered_map< CP::SystematicSet, CP::SystematicSet > m_systFilter
Gaudi::Property< std::string > m_muonQuality
const CP::SystematicSet & appliedSystematics() const
unsigned int getRunNumber() const
virtual bool isAffectedBySystematic(const CP::SystematicVariation &systematic) const
Declare the interface that this class provides.
virtual CorrectionCode getTriggerScaleFactor(const xAOD::MuonContainer &mucont, Double_t &triggersf, const std::string &trigger) const
EfficiencyMap m_efficiencyMap
virtual ~MuonTriggerScaleFactors()
virtual CP::SystematicSet affectingSystematics() const
returns: the list of all systematics this tool can be affected by
virtual CP::SystematicSet recommendedSystematics() const
returns: the list of all systematics this tool recommends to use
virtual bool isTriggerSupported(const std::string &trigger) const
Returns whether the trigger is supported by the tool or not. The decision depends on the present (ran...
virtual CorrectionCode getTriggerEfficiency(const xAOD::Muon &mu, Double_t &efficiency, const std::string &trigger, Bool_t dataType) const
std::pair< unsigned int, std::string > YearPeriod
This module implements the central registry for handling systematic uncertainties with CP tools.
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
StatusCode registerSystematics(const IReentrantSystematicsTool &tool)
effects: register all the systematics from the tool
Class to wrap a set of SystematicVariations.
bool matchSystematic(const SystematicVariation &systematic, MATCHTYPE type=FULL) const
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
static StatusCode filterForAffectingSystematics(const SystematicSet &systConfig, const SystematicSet &affectingSystematics, SystematicSet &filteredSystematics)
description: filter the systematics for the affected systematics returns: success guarantee: strong f...
bool empty() const
returns: whether this is an empty systematic, i.e.
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
SG::ConstAccessor< T, ALLOC > ConstAccessor
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
@ IS_SIMULATION
true: simulation, false: data
void efficiency(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
Select isolated Photons, Electrons and Muons.
std::shared_ptr< TH1 > TH1_Ptr
constexpr double muon_barrel_endcap_boundary
Muon_v1 Muon
Reference the current persistent version:
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".
structure to hold variables to configure behaviour of the tool
int replicaIndex
index of replicated histograms to access
int run(int argc, char *argv[])
std::string dirname(std::string name)
std::string basename(std::string name)