5#ifndef MUONTRIGGERSCALEFACTORS_H_
6#define MUONTRIGGERSCALEFACTORS_H_
14#include "TDirectory.h"
19#include <unordered_map>
54 virtual int getReplica_index(
const std::string& sysBaseName,
const std::string& trigStr)
const;
79 unsigned int encodeHistoName(
const std::string &period,
const std::string& Trigger,
bool isData,
const std::string& Systematic,
bool isBarrel =
true)
const;
83 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;
84 virtual std::shared_ptr<TH1>
getEfficiencyHistogram(
const std::string& trigger,
bool isData,
const std::string& Systematic,
bool isBarrel =
true)
const;
99 std::string
getDataPeriod(
unsigned int runNumber,
unsigned int year)
const;
115 Gaudi::Property<std::string>
m_muonQuality {
this,
"MuonQuality",
"Medium",
"the muon quality to get the scale factors for"};
116 Gaudi::Property<std::string>
m_campaign {
this,
"Campaign",
"",
"the MC campaign to get the scale factors for"};
119 Gaudi::Property<std::string>
m_calibrationVersion {
this,
"CalibrationVersion",
"250731_SummerUpdate",
"the calibration version to use"};
120 Gaudi::Property<std::string>
m_customInputFolder {
this,
"CustomInputFolder",
"",
"the custom input folder to use (debugging only)"};
121 Gaudi::Property<std::map<unsigned int, std::string>>
m_customInputFilePerYear {
this,
"CustomInputFilePerYear", {},
"the custom input file to use per year (debugging only)"};
122 Gaudi::Property<std::string>
m_binning {
this,
"Binning",
"fine",
"the binning to use"};
124 Gaudi::Property<bool>
m_allowZeroSF {
this,
"AllowZeroSF",
false,
"if a trigger is not available will return 0 instead of throwing an error. More difficult to spot configuration issues. Use at own risk"};
125 Gaudi::Property<bool>
m_experimental {
this,
"UseExperimental",
false,
"enable experimental features like single muon SF"};
126 Gaudi::Property<int>
m_forceYear {
this,
"ForceYear", -1,
"Only for developers. Never use this in any analysis!!!!!!"};
127 Gaudi::Property<std::string>
m_forcePeriod {
this,
"ForcePeriod",
"",
"Only for developers. Never use this in any analysis!!!!!!"};
130 Gaudi::Property<std::vector<std::string>>
m_replicaTriggerList {
this,
"ReplicaTriggerList", {},
"List of triggers on which we want to generate stat. uncertainty toy replicas."};
132 Gaudi::Property<int>
m_nReplicas {
this,
"NReplicas", 100,
"Number of generated toy replicas, if replicas are required."};
133 Gaudi::Property<int>
m_ReplicaRandomSeed {
this,
"ReplicaRandomSeed", 12345,
"Random seed for toy replica generation."};
Header file for AthHistogramAlgorithm.
Return value from object correction CP tools.
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
std::map< EffiHistoIdent, TH1_Ptr > EfficiencyMap
virtual int getReplica_index(const std::string &sysBaseName, const std::string &trigStr) const
std::pair< YearPeriod, unsigned int > EffiHistoIdent
std::string getDataPeriod(unsigned int runNumber, unsigned int year) const
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
Class to wrap a set of SystematicVariations.
Property holding a SG store/key/clid from which a ReadHandle is made.
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
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 run(int argc, char *argv[])