|
ATLAS Offline Software
|
Go to the documentation of this file.
4 #ifndef MUONEFFICIENCYCORRECITONS_EFFICIENCYSCALEFACTOR_H_
5 #define MUONEFFICIENCYCORRECITONS_EFFICIENCYSCALEFACTOR_H_
20 #include <TDirectory.h>
34 class MuonEfficiencyScaleFactors;
47 const std::string &
file,
48 const std::string &time_unit);
58 const std::string&
file,
59 const std::string& time_unit,
60 const std::string& syst_name,
61 int syst_type_bitmap);
126 std::string
sysname(
bool with_direction =
true)
const;
145 std::unique_ptr<HistHandler>
ReadHistFromFile(
const std::string&
name, TFile*
f,
const std::string& time_unit);
179 std::unique_ptr<HistHandler>
m_sf;
std::unique_ptr< FloatDecorator > m_eff_decor
CorrectionCode DataEfficiency(const xAOD::Muon &mu, float &Eff) const
... and absolute efficiencies
SG::AuxElement::Decorator< std::vector< float > > FloatVectorDecorator
std::atomic< unsigned int > m_warnsPrinted
CorrectionCode ScaleFactorReplicas(const xAOD::Muon &mu, std::vector< float > &SF)
std::unique_ptr< HistHandler > package_histo(TH1 *h)
bool isOverFlowBin(int b) const
Check whether the bin is overflow or not.
CorrectionCode MCEfficiencyReplicas(const xAOD::Muon &mu, std::vector< float > &eff)
std::unique_ptr< HistHandler > ReadHistFromFile(const std::string &name, TFile *f, const std::string &time_unit)
CorrectionCode GetContentReplicasFromHist(EfficiencyScaleFactor::SFReplicaVec &replicas, const xAOD::Muon &mu, std::vector< float > &SF, bool add_kine_syst)
read a vector of replica contents in the correct bin in one of my histos
void DebugPrint() const
debug method
std::unique_ptr< HistHandler > m_mc_eff
SG::AuxElement::Decorator< float > FloatDecorator
Typedef to make the definition of the follow decorators a bit shorted.
std::unique_ptr< IKinematicSystHandler > m_sf_KineDepsys
bool IsUpVariation() const
std::unique_ptr< HistHandler > m_eff
bool m_is_lowpt
states that this SF should respond to low pt systematics rather than high pt ones
std::shared_ptr< EfficiencyScaleFactor > m_NominalFallBack
Nominal fall-back scale-factor.
const float SF[NF]
Cross sections for Fluor.
int FindBinSF(const xAOD::Muon &mu) const
Finds the bin to which the muon corresponds to.
CorrectionCode GetContentFromHist(const HistHandler *Hist, const xAOD::Muon &mu, float &SF, bool add_kine_syst) const
read the content of the correct bin in one of my histos. MCefficiencies actually do not need a pt-dep...
std::unique_ptr< FloatVectorDecorator > m_sf_rep_decor
Select isolated Photons, Electrons and Muons.
static const unsigned int m_warningLimit
CorrectionCode ApplyScaleFactor(const xAOD::Muon &mu) const
or you can just decorate the scale-factor to the muon
CorrectionCode DataEfficiencyReplicas(const xAOD::Muon &mu, std::vector< float > &eff)
CP::MuonEfficiencyType m_measurement
Section of variables of the tool.
bool coversRunNumber(unsigned int run) const
Check if a run of data-taking is covered by this map.
float m_default_eff
default efficiency value (in case of OutOfValidityRange)
bool SetSystematicBin(int bin)
This function will let the world implode since it allows to decorrelate the sysstematics bin by bin.
EfficiencyScaleFactor(const EfficiencyScaleFactor &)=delete
Do not allow for copy constructors and other assignments of the class.
bool m_separateBinSyst
Can the systematic be decorrelated.
Helper class to provide type-safe access to aux data.
void setFirstLastRun(unsigned int first, unsigned int last)
Set the run-number coverage.
std::unique_ptr< FloatDecorator > m_sf_decor
SFReplicaVec m_sf_replicas
replicas, in case we use them
CorrectionCode MCEfficiency(const xAOD::Muon &mu, float &Eff) const
... mc efficiency
bool ReadFromFile(const std::string &file, const std::string &time_unit)
Read SF histrograms from a given input file.
CorrectionCode ApplyDataEfficiency(const xAOD::Muon &mu) const
You can decorate the data efficiecny as well.
CorrectionCode ApplyDataEfficiencyReplicas(const xAOD::Muon &mu, int n_replicas)
float m_default_eff_ttva
default TTVA efficiency value (in case of MuonStandAlone for |eta|>2.5)
unsigned int lastRun() const
Last run to which the map belongs to. The last run number is given exclusvely...
SFReplicaVec m_mc_eff_replicas
int nOverFlowBins() const
Number of overflow bins in the map.
void GenerateReplicas(int nrep, int seed)
void GenerateReplicasFromHist(HistHandler *h, int nrep, int seed, EfficiencyScaleFactor::SFReplicaVec &repVector)
CorrectionCode ApplyMCEfficiency(const xAOD::Muon &mu) const
... or decorate them directly
CorrectionCode ApplyScaleFactorReplicas(const xAOD::Muon &mu, int n_replicas)
std::string sysname(bool with_direction=true) const
A string having the full name of the systematic including the measurement.
Return value from object correction CP tools.
CorrectionCode ScaleFactor(const xAOD::Muon &mu, float &SF) const
the important bits - extract SF info
std::string GetBinName(int bin) const
Returns the name of the bin using the axis title from the scale-factor map.
std::unique_ptr< FloatDecorator > m_mc_eff_decor
bool m_is_up
Boolean whether the scale-factor is varying upwards or downwards Only relevant if the systname is not...
std::vector< std::unique_ptr< HistHandler > > SFReplicaVec
int nBins() const
How many bins does the scale-factor map have.
CorrectionCode ApplyMCEfficiencyReplicas(const xAOD::Muon &mu, int n_replicas)
bool CheckConsistency()
check the consistency of the scale-factor map.
EfficiencyScaleFactor(const MuonEfficiencyScaleFactors &ref_tool, const std::string &file, const std::string &time_unit)
Nominal constructor to use having the measurement (Reco/TTVA/Iso/BadMuon) path to the scale-factor ma...
unsigned int firstRun() const
First run to which the map belongs to.
bool m_respond_to_kineDepSyst
steers the pt dependent systematics
std::unique_ptr< HistHandler > m_sf
the histograms needed to run
std::unique_ptr< FloatVectorDecorator > m_mc_eff_rep_decor
std::unique_ptr< FloatVectorDecorator > m_eff_rep_decor
EfficiencyScaleFactor & operator=(const EfficiencyScaleFactor &)=delete
SFReplicaVec m_eff_replicas
bool separateBinSyst() const