ATLAS Offline Software
|
#include <EfficiencyScaleFactor.h>
Public Member Functions | |
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 map & the time unit to consider. More... | |
EfficiencyScaleFactor (std::shared_ptr< EfficiencyScaleFactor > nominal, const MuonEfficiencyScaleFactors &ref_tool, const std::string &file, const std::string &time_unit, const std::string &syst_name, int syst_type_bitmap) | |
Constructor to use for systematic evaluations the nominal scale-factor is given as a fallback map in case the user want to activate uncorrelated systematic – a shared ptr is used to ensure that the map is always defined allthough the nominal container has been deleted somehow – the name of the systematic encodes the systematic to retrieve from the file. More... | |
EfficiencyScaleFactor (const EfficiencyScaleFactor &)=delete | |
Do not allow for copy constructors and other assignments of the class. More... | |
EfficiencyScaleFactor & | operator= (const EfficiencyScaleFactor &)=delete |
bool | CheckConsistency () |
check the consistency of the scale-factor map. More... | |
int | nBins () const |
How many bins does the scale-factor map have. More... | |
std::string | GetBinName (int bin) const |
Returns the name of the bin using the axis title from the scale-factor map. More... | |
int | nOverFlowBins () const |
Number of overflow bins in the map. More... | |
bool | isOverFlowBin (int b) const |
Check whether the bin is overflow or not. More... | |
int | FindBinSF (const xAOD::Muon &mu) const |
Finds the bin to which the muon corresponds to. More... | |
bool | SetSystematicBin (int bin) |
This function will let the world implode since it allows to decorrelate the sysstematics bin by bin. More... | |
bool | separateBinSyst () const |
bool | IsUpVariation () const |
CorrectionCode | ScaleFactor (const xAOD::Muon &mu, float &SF) const |
the important bits - extract SF info More... | |
CorrectionCode | ScaleFactorReplicas (const xAOD::Muon &mu, std::vector< float > &SF) |
CorrectionCode | ApplyScaleFactor (const xAOD::Muon &mu) const |
or you can just decorate the scale-factor to the muon More... | |
CorrectionCode | ApplyScaleFactorReplicas (const xAOD::Muon &mu, int n_replicas) |
CorrectionCode | DataEfficiency (const xAOD::Muon &mu, float &Eff) const |
... and absolute efficiencies More... | |
CorrectionCode | DataEfficiencyReplicas (const xAOD::Muon &mu, std::vector< float > &eff) |
CorrectionCode | ApplyDataEfficiency (const xAOD::Muon &mu) const |
You can decorate the data efficiecny as well. More... | |
CorrectionCode | ApplyDataEfficiencyReplicas (const xAOD::Muon &mu, int n_replicas) |
CorrectionCode | MCEfficiency (const xAOD::Muon &mu, float &Eff) const |
... mc efficiency More... | |
CorrectionCode | MCEfficiencyReplicas (const xAOD::Muon &mu, std::vector< float > &eff) |
CorrectionCode | ApplyMCEfficiency (const xAOD::Muon &mu) const |
... or decorate them directly More... | |
CorrectionCode | ApplyMCEfficiencyReplicas (const xAOD::Muon &mu, int n_replicas) |
void | DebugPrint () const |
debug method More... | |
std::string | sysname (bool with_direction=true) const |
A string having the full name of the systematic including the measurement. More... | |
unsigned int | firstRun () const |
First run to which the map belongs to. More... | |
unsigned int | lastRun () const |
Last run to which the map belongs to. The last run number is given exclusvely... More... | |
bool | coversRunNumber (unsigned int run) const |
Check if a run of data-taking is covered by this map. More... | |
void | setFirstLastRun (unsigned int first, unsigned int last) |
Set the run-number coverage. More... | |
Private Types | |
typedef std::vector< std::unique_ptr< HistHandler > > | SFReplicaVec |
typedef SG::AuxElement::Decorator< float > | FloatDecorator |
Typedef to make the definition of the follow decorators a bit shorted. More... | |
typedef SG::AuxElement::Decorator< std::vector< float > > | FloatVectorDecorator |
Private Member Functions | |
bool | ReadFromFile (const std::string &file, const std::string &time_unit) |
Read SF histrograms from a given input file. More... | |
std::unique_ptr< HistHandler > | ReadHistFromFile (const std::string &name, TFile *f, const std::string &time_unit) |
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-dependet systematic More... | |
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 More... | |
std::unique_ptr< HistHandler > | package_histo (TH1 *h) |
void | GenerateReplicas (int nrep, int seed) |
void | GenerateReplicasFromHist (HistHandler *h, int nrep, int seed, EfficiencyScaleFactor::SFReplicaVec &repVector) |
Private Attributes | |
CP::MuonEfficiencyType | m_measurement |
Section of variables of the tool. More... | |
std::string | m_syst_name |
bool | m_is_up |
Boolean whether the scale-factor is varying upwards or downwards Only relevant if the systname is not empty. More... | |
bool | m_is_lowpt |
states that this SF should respond to low pt systematics rather than high pt ones More... | |
bool | m_respond_to_kineDepSyst |
steers the pt dependent systematics More... | |
bool | m_separateBinSyst |
Can the systematic be decorrelated. More... | |
std::unique_ptr< HistHandler > | m_sf |
the histograms needed to run More... | |
std::unique_ptr< HistHandler > | m_eff |
std::unique_ptr< HistHandler > | m_mc_eff |
std::unique_ptr< FloatDecorator > | m_sf_decor |
std::unique_ptr< FloatDecorator > | m_eff_decor |
std::unique_ptr< FloatDecorator > | m_mc_eff_decor |
std::unique_ptr< FloatVectorDecorator > | m_sf_rep_decor |
std::unique_ptr< FloatVectorDecorator > | m_eff_rep_decor |
std::unique_ptr< FloatVectorDecorator > | m_mc_eff_rep_decor |
std::unique_ptr< IKinematicSystHandler > | m_sf_KineDepsys |
SFReplicaVec | m_sf_replicas |
replicas, in case we use them More... | |
SFReplicaVec | m_eff_replicas |
SFReplicaVec | m_mc_eff_replicas |
std::shared_ptr< EfficiencyScaleFactor > | m_NominalFallBack |
Nominal fall-back scale-factor. More... | |
int | m_SystematicBin |
float | m_default_eff |
default efficiency value (in case of OutOfValidityRange) More... | |
float | m_default_eff_ttva |
default TTVA efficiency value (in case of MuonStandAlone for |eta|>2.5) More... | |
std::atomic< unsigned int > | m_warnsPrinted |
unsigned int | m_firstRun |
unsigned int | m_lastRun |
Static Private Attributes | |
static const unsigned int | m_warningLimit = 10 |
Definition at line 35 of file EfficiencyScaleFactor.h.
|
private |
Typedef to make the definition of the follow decorators a bit shorted.
Definition at line 184 of file EfficiencyScaleFactor.h.
|
private |
Definition at line 185 of file EfficiencyScaleFactor.h.
|
private |
Definition at line 141 of file EfficiencyScaleFactor.h.
EfficiencyScaleFactor::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 map & the time unit to consider.
Definition at line 173 of file EfficiencyScaleFactor.cxx.
EfficiencyScaleFactor::EfficiencyScaleFactor | ( | std::shared_ptr< EfficiencyScaleFactor > | nominal, |
const MuonEfficiencyScaleFactors & | ref_tool, | ||
const std::string & | file, | ||
const std::string & | time_unit, | ||
const std::string & | syst_name, | ||
int | syst_type_bitmap | ||
) |
Constructor to use for systematic evaluations the nominal scale-factor is given as a fallback map in case the user want to activate uncorrelated systematic – a shared ptr is used to ensure that the map is always defined allthough the nominal container has been deleted somehow – the name of the systematic encodes the systematic to retrieve from the file.
To ensure backwards compability with older files the names "STAT" and "SYS" refer to the total systematic
Nominal set loaded nothing needs to be done further
Asking for the total systematic... May be the current file does not support the asymmetric break-down yet. Let's try the good old approach and load the total sys histogram
Not even the old approach lead to something fruitful... Lets forget it and reset everything
Stat error can be retrieved from the nominal histogram itself
This systematic name is reserved for the kinematic histhandler
Some other systematic is asked for... Failure
Apply the systematic variations
Thus far there're no kinematic dependent systematics for low-pt
As well as for the high-eta range.
Load the pt_dependent systematics if needed
Old format of the pt-dependent systematic loaded
Now it comes to the new format
That one needs to be named properly in the future
Use the approach from the old sacle-factor file
Definition at line 12 of file EfficiencyScaleFactor.cxx.
|
delete |
Do not allow for copy constructors and other assignments of the class.
CorrectionCode EfficiencyScaleFactor::ApplyDataEfficiency | ( | const xAOD::Muon & | mu | ) | const |
You can decorate the data efficiecny as well.
Definition at line 379 of file EfficiencyScaleFactor.cxx.
CorrectionCode EfficiencyScaleFactor::ApplyDataEfficiencyReplicas | ( | const xAOD::Muon & | mu, |
int | n_replicas | ||
) |
Definition at line 385 of file EfficiencyScaleFactor.cxx.
CorrectionCode EfficiencyScaleFactor::ApplyMCEfficiency | ( | const xAOD::Muon & | mu | ) | const |
... or decorate them directly
Definition at line 391 of file EfficiencyScaleFactor.cxx.
CorrectionCode EfficiencyScaleFactor::ApplyMCEfficiencyReplicas | ( | const xAOD::Muon & | mu, |
int | n_replicas | ||
) |
Definition at line 397 of file EfficiencyScaleFactor.cxx.
CorrectionCode EfficiencyScaleFactor::ApplyScaleFactor | ( | const xAOD::Muon & | mu | ) | const |
or you can just decorate the scale-factor to the muon
Definition at line 366 of file EfficiencyScaleFactor.cxx.
CorrectionCode EfficiencyScaleFactor::ApplyScaleFactorReplicas | ( | const xAOD::Muon & | mu, |
int | n_replicas | ||
) |
Definition at line 372 of file EfficiencyScaleFactor.cxx.
bool EfficiencyScaleFactor::CheckConsistency | ( | ) |
check the consistency of the scale-factor map.
Needed histograms should be defined and the nominal fall back map is assigned properly as well as the map has a valid run number range
The histogram is simply not loaded which is fine since only the scale-factor is required
Definition at line 201 of file EfficiencyScaleFactor.cxx.
bool EfficiencyScaleFactor::coversRunNumber | ( | unsigned int | run | ) | const |
Check if a run of data-taking is covered by this map.
Definition at line 194 of file EfficiencyScaleFactor.cxx.
CorrectionCode EfficiencyScaleFactor::DataEfficiency | ( | const xAOD::Muon & | mu, |
float & | Eff | ||
) | const |
... and absolute efficiencies
Definition at line 308 of file EfficiencyScaleFactor.cxx.
CorrectionCode EfficiencyScaleFactor::DataEfficiencyReplicas | ( | const xAOD::Muon & | mu, |
std::vector< float > & | eff | ||
) |
Definition at line 406 of file EfficiencyScaleFactor.cxx.
void CP::EfficiencyScaleFactor::DebugPrint | ( | ) | const |
debug method
int EfficiencyScaleFactor::FindBinSF | ( | const xAOD::Muon & | mu | ) | const |
Finds the bin to which the muon corresponds to.
Definition at line 481 of file EfficiencyScaleFactor.cxx.
unsigned int EfficiencyScaleFactor::firstRun | ( | ) | const |
First run to which the map belongs to.
If the measurement is not carried out in time then it's usally 1
Definition at line 188 of file EfficiencyScaleFactor.cxx.
|
private |
Definition at line 440 of file EfficiencyScaleFactor.cxx.
|
private |
Definition at line 445 of file EfficiencyScaleFactor.cxx.
std::string EfficiencyScaleFactor::GetBinName | ( | int | bin | ) | const |
Returns the name of the bin using the axis title from the scale-factor map.
Definition at line 473 of file EfficiencyScaleFactor.cxx.
|
private |
read the content of the correct bin in one of my histos. MCefficiencies actually do not need a pt-dependet systematic
Definition at line 339 of file EfficiencyScaleFactor.cxx.
|
private |
read a vector of replica contents in the correct bin in one of my histos
Definition at line 412 of file EfficiencyScaleFactor.cxx.
bool EfficiencyScaleFactor::isOverFlowBin | ( | int | b | ) | const |
Check whether the bin is overflow or not.
Definition at line 289 of file EfficiencyScaleFactor.cxx.
bool EfficiencyScaleFactor::IsUpVariation | ( | ) | const |
Definition at line 185 of file EfficiencyScaleFactor.cxx.
unsigned int EfficiencyScaleFactor::lastRun | ( | ) | const |
Last run to which the map belongs to. The last run number is given exclusvely...
Definition at line 191 of file EfficiencyScaleFactor.cxx.
CorrectionCode EfficiencyScaleFactor::MCEfficiency | ( | const xAOD::Muon & | mu, |
float & | Eff | ||
) | const |
... mc efficiency
Definition at line 323 of file EfficiencyScaleFactor.cxx.
CorrectionCode EfficiencyScaleFactor::MCEfficiencyReplicas | ( | const xAOD::Muon & | mu, |
std::vector< float > & | eff | ||
) |
Definition at line 409 of file EfficiencyScaleFactor.cxx.
int EfficiencyScaleFactor::nBins | ( | ) | const |
How many bins does the scale-factor map have.
Only the bins of the primary map are counted. If the map has an extra kinematic systematic on top, these bins cannot be resolved at the moment
Definition at line 283 of file EfficiencyScaleFactor.cxx.
int EfficiencyScaleFactor::nOverFlowBins | ( | ) | const |
Number of overflow bins in the map.
Definition at line 286 of file EfficiencyScaleFactor.cxx.
|
delete |
|
private |
Definition at line 267 of file EfficiencyScaleFactor.cxx.
|
private |
Read SF histrograms from a given input file.
|
private |
Definition at line 252 of file EfficiencyScaleFactor.cxx.
CorrectionCode EfficiencyScaleFactor::ScaleFactor | ( | const xAOD::Muon & | mu, |
float & | SF | ||
) | const |
the important bits - extract SF info
scale factors...
Definition at line 292 of file EfficiencyScaleFactor.cxx.
CorrectionCode EfficiencyScaleFactor::ScaleFactorReplicas | ( | const xAOD::Muon & | mu, |
std::vector< float > & | SF | ||
) |
Definition at line 403 of file EfficiencyScaleFactor.cxx.
bool EfficiencyScaleFactor::separateBinSyst | ( | ) | const |
Definition at line 182 of file EfficiencyScaleFactor.cxx.
void EfficiencyScaleFactor::setFirstLastRun | ( | unsigned int | first, |
unsigned int | last | ||
) |
Set the run-number coverage.
Definition at line 197 of file EfficiencyScaleFactor.cxx.
bool EfficiencyScaleFactor::SetSystematicBin | ( | int | bin | ) |
This function will let the world implode since it allows to decorrelate the sysstematics bin by bin.
Definition at line 460 of file EfficiencyScaleFactor.cxx.
std::string EfficiencyScaleFactor::sysname | ( | bool | with_direction = true | ) | const |
A string having the full name of the systematic including the measurement.
If the systematic string is empty then an empty string is returned. The flag controls whether the suffix __1UP or __1DN is appended after the string.
Definition at line 179 of file EfficiencyScaleFactor.cxx.
|
private |
default efficiency value (in case of OutOfValidityRange)
Definition at line 211 of file EfficiencyScaleFactor.h.
|
private |
default TTVA efficiency value (in case of MuonStandAlone for |eta|>2.5)
Definition at line 213 of file EfficiencyScaleFactor.h.
|
private |
Definition at line 180 of file EfficiencyScaleFactor.h.
|
private |
Definition at line 188 of file EfficiencyScaleFactor.h.
|
private |
Definition at line 192 of file EfficiencyScaleFactor.h.
|
private |
Definition at line 202 of file EfficiencyScaleFactor.h.
|
private |
Definition at line 218 of file EfficiencyScaleFactor.h.
|
private |
states that this SF should respond to low pt systematics rather than high pt ones
Definition at line 173 of file EfficiencyScaleFactor.h.
|
private |
Boolean whether the scale-factor is varying upwards or downwards Only relevant if the systname is not empty.
Definition at line 171 of file EfficiencyScaleFactor.h.
|
private |
Definition at line 219 of file EfficiencyScaleFactor.h.
|
private |
Definition at line 181 of file EfficiencyScaleFactor.h.
|
private |
Definition at line 189 of file EfficiencyScaleFactor.h.
|
private |
Definition at line 193 of file EfficiencyScaleFactor.h.
|
private |
Definition at line 203 of file EfficiencyScaleFactor.h.
|
private |
Section of variables of the tool.
Definition at line 166 of file EfficiencyScaleFactor.h.
|
private |
Nominal fall-back scale-factor.
Definition at line 206 of file EfficiencyScaleFactor.h.
|
private |
steers the pt dependent systematics
Definition at line 175 of file EfficiencyScaleFactor.h.
|
private |
Can the systematic be decorrelated.
Definition at line 177 of file EfficiencyScaleFactor.h.
|
private |
the histograms needed to run
Definition at line 179 of file EfficiencyScaleFactor.h.
|
private |
Definition at line 187 of file EfficiencyScaleFactor.h.
|
private |
Definition at line 197 of file EfficiencyScaleFactor.h.
|
private |
Definition at line 191 of file EfficiencyScaleFactor.h.
|
private |
replicas, in case we use them
Definition at line 201 of file EfficiencyScaleFactor.h.
|
private |
Definition at line 167 of file EfficiencyScaleFactor.h.
|
private |
Definition at line 207 of file EfficiencyScaleFactor.h.
|
staticprivate |
Definition at line 216 of file EfficiencyScaleFactor.h.
|
mutableprivate |
Definition at line 215 of file EfficiencyScaleFactor.h.