4#ifndef MUONEFFICIENCYCORRECITONS_EFFICIENCYSCALEFACTOR_H_
5#define MUONEFFICIENCYCORRECITONS_EFFICIENCYSCALEFACTOR_H_
25#include <TDirectory.h>
52 const std::string &
file,
53 const std::string &time_unit);
62 const MuonEfficiencyScaleFactors& ref_tool,
63 const std::string&
file,
64 const std::string& time_unit,
65 const std::string& syst_name,
66 int syst_type_bitmap);
132 std::string
sysname(
bool with_direction =
true)
const;
186 std::unique_ptr<HistHandler>
m_sf;
Header file for AthHistogramAlgorithm.
Return value from object correction CP tools.
EfficiencyScaleFactor(const EfficiencyScaleFactor &)=delete
Do not allow for copy constructors and other assignments of the class.
CorrectionCode ApplyScaleFactor(const xAOD::Muon &mu) const
or you can just decorate the scale-factor to the muon
std::unique_ptr< FloatVectorDecorator > m_mc_eff_rep_decor
bool m_is_lowpt
states that this SF should respond to low pt systematics rather than high pt ones
int nOverFlowBins() const
Number of overflow bins in the map.
bool IsUpVariation() const
CorrectionCode MCEfficiencyReplicas(const xAOD::Muon &mu, std::vector< float > &eff)
bool SetSystematicBin(int bin)
This function will let the world implode since it allows to decorrelate the sysstematics bin by bin.
unsigned int firstRun() const
First run to which the map belongs to.
CorrectionCode ApplyMCEfficiencyReplicas(const xAOD::Muon &mu, int n_replicas)
EfficiencyScaleFactor & operator=(const EfficiencyScaleFactor &)=delete
SFReplicaVec m_mc_eff_replicas
std::unique_ptr< FloatDecorator > m_mc_eff_decor
columnar::MuonAccessor< columnar::RetypeColumn< double, float > > phiAcc
std::unique_ptr< FloatVectorDecorator > m_eff_rep_decor
std::shared_ptr< EfficiencyScaleFactor > m_NominalFallBack
Nominal fall-back scale-factor.
std::unique_ptr< IKinematicSystHandler > m_sf_KineDepsys
CorrectionCode ApplyDataEfficiency(const xAOD::Muon &mu) const
You can decorate the data efficiecny as well.
CorrectionCode ApplyDataEfficiencyReplicas(const xAOD::Muon &mu, int n_replicas)
void setFirstLastRun(unsigned int first, unsigned int last)
Set the run-number coverage.
float m_default_eff
default efficiency value (in case of OutOfValidityRange)
bool ReadFromFile(const std::string &file, const std::string &time_unit)
Read SF histrograms from a given input file.
CorrectionCode ScaleFactor(const xAOD::Muon &mu, float &SF) const
the important bits - extract SF info
float m_default_eff_ttva
default TTVA efficiency value (in case of MuonStandAlone for |eta|>2.5)
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
SFReplicaVec m_eff_replicas
void DebugPrint() const
debug method
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...
std::unique_ptr< FloatDecorator > m_eff_decor
std::unique_ptr< HistHandler > package_histo(columnar::ColumnarTool<> *parent, TH1 *h)
CorrectionCode ApplyScaleFactorReplicas(const xAOD::Muon &mu, int n_replicas)
unsigned int lastRun() const
Last run to which the map belongs to. The last run number is given exclusvely...
void GenerateReplicas(int nrep, int seed)
std::string GetBinName(int bin) const
Returns the name of the bin using the axis title from the scale-factor map.
CorrectionCode DataEfficiencyReplicas(const xAOD::Muon &mu, std::vector< float > &eff)
bool CheckConsistency()
check the consistency of the scale-factor map.
std::unique_ptr< FloatDecorator > m_sf_decor
bool m_is_up
Boolean whether the scale-factor is varying upwards or downwards Only relevant if the systname is not...
columnar::MuonAccessor< columnar::RetypeColumn< double, float > > etaAcc
columnar::MuonAccessor< columnar::RetypeColumn< double, float > > ptAcc
SFReplicaVec m_sf_replicas
replicas, in case we use them
std::vector< std::unique_ptr< HistHandler > > SFReplicaVec
std::unique_ptr< FloatVectorDecorator > m_sf_rep_decor
CorrectionCode MCEfficiency(const xAOD::Muon &mu, float &Eff) const
... mc efficiency
columnar::MuonAccessor< columnar::RetypeColumn< xAOD::Muon::MuonType, std::uint16_t > > muonTypeAcc
std::unique_ptr< HistHandler > m_sf
the histograms needed to run
bool separateBinSyst() const
int nBins() const
How many bins does the scale-factor map have.
std::unique_ptr< HistHandler > m_eff
SG::AuxElement::Decorator< std::vector< float > > FloatVectorDecorator
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...
bool isOverFlowBin(int b) const
Check whether the bin is overflow or not.
bool m_respond_to_kineDepSyst
steers the pt dependent systematics
CorrectionCode ApplyMCEfficiency(const xAOD::Muon &mu) const
... or decorate them directly
bool coversRunNumber(unsigned int run) const
Check if a run of data-taking is covered by this map.
columnar::MuonAccessor< columnar::ObjectColumn > m_muons
CorrectionCode ScaleFactorReplicas(const xAOD::Muon &mu, std::vector< float > &SF)
std::unique_ptr< HistHandler > m_mc_eff
CP::MuonEfficiencyType m_measurement
Section of variables of the tool.
std::unique_ptr< HistHandler > ReadHistFromFile(columnar::ColumnarTool<> *parent, const std::string &name, TFile *f, const std::string &time_unit)
static const unsigned int m_warningLimit
void GenerateReplicasFromHist(HistHandler *h, int nrep, int seed, EfficiencyScaleFactor::SFReplicaVec &repVector)
std::atomic< unsigned int > m_warnsPrinted
std::string sysname(bool with_direction=true) const
A string having the full name of the systematic including the measurement.
SG::AuxElement::Decorator< float > FloatDecorator
Typedef to make the definition of the follow decorators a bit shorted.
bool m_separateBinSyst
Can the systematic be decorrelated.
CorrectionCode DataEfficiency(const xAOD::Muon &mu, float &Eff) const
... and absolute efficiencies
Class to wrap a set of SystematicVariations.
SG::Decorator< T, ALLOC > Decorator
Select isolated Photons, Electrons and Muons.
ObjectId< ContainerId::muon > MuonId
AccessorTemplate< ContainerId::muon, CT, ColumnAccessMode::input, CM > MuonAccessor
Muon_v1 Muon
Reference the current persistent version: