5#ifndef MUONEFFICIENCYSCALEFACTORS_H_
6#define MUONEFFICIENCYSCALEFACTORS_H_
27#include <unordered_map>
Return value from object correction CP tools.
The EffiCollection class handles the 5 different scale-factor maps binned in time.
std::string filename_LRTCentral() const
LRT muons have their own efficiency maps.
std::string m_custom_file_Calo
bool uncorrelate_sys() const
Returns a boolean whether the uncorrelation of systematics has been switched on.
std::string m_custom_file_LRTLowPt
std::string filename_HighEta() const
High-eta reconstruction scale-factors are not obtained by the means of are not obtained by the means ...
std::string m_custom_file_LowPtCalo
std::string m_efficiency_decoration_name_data
std::string resolve_file_location(const std::string &filename) const
utility method to 'dress' a filename using the path resolver
virtual SystematicSet recommendedSystematics() const override
returns: the list of all systematics this tool recommends to use
virtual int getUnCorrelatedSystBin(const xAOD::Muon &mu) const override
virtual CorrectionCode getDataEfficiencyReplicas(const xAOD::Muon &mu, std::vector< float > &sf_err, const xAOD::EventInfo *info=0) const
virtual CorrectionCode getMCEfficiency(const xAOD::Muon &mu, float &eff, const xAOD::EventInfo *info=0) const override
Obtain the muon efficiency measured using the MC.
virtual StatusCode applySystematicVariation(const SystematicSet &systConfig) override
effects: configure this tool for the given list of systematic variations.
virtual CorrectionCode getMCEfficiencyReplicas(const xAOD::Muon &mu, std::vector< float > &sf_err, const xAOD::EventInfo *info=0) const
virtual CorrectionCode applyEfficiencyScaleFactorReplicas(const xAOD::Muon &mu, int nreplicas=50, const xAOD::EventInfo *info=0) const override
decorate the muon with a set of SF replica weights.
std::string mc_effi_replica_deocration() const
CP::MuonEfficiencyType m_Type
std::string m_sf_decoration_name
virtual std::string getUncorrelatedSysBinName(unsigned int Bin) const override
float m_lowpt_threshold
threshold below which low-pt SF (i.e. from JPsi) should be used
virtual CorrectionCode applyMCEfficiency(const xAOD::Muon &mu, const xAOD::EventInfo *info=0) const override
std::string filename_Calo() const
Reconstruction scale-factors have a dedicated map for calo-tag muons around |\eta|<0....
std::string m_custom_file_HighEta
std::map< std::string, unsigned int > lookUpSystematics()
Scale-factor files since Moriond2019 contain the breakdown of systematics into their individual compo...
std::string m_wp
the working point to operate on
std::string sf_decoration() const
The apply<Blah> methods decorate their result directly to the muon.
std::string m_custom_file_LowPt
virtual SystematicSet affectingSystematics() const override
returns: the list of all systematics this tool can be affected by
std::unique_ptr< Accessors > m_accessors
std::unordered_map< CP::SystematicSet, EffiCollection * > m_filtered_sys_sets
It turned out that the code spends a large time in the look up of the systematics.
bool use_2D_iso_corrections() const
option to set if we want to use 1D or 2D isolation SFs
void callSingleEvent(columnar::MuonRange muons, columnar::EventInfoId event) const
virtual CorrectionCode applyDataEfficiency(const xAOD::Muon &mu, const xAOD::EventInfo *info=0) const override
decorate a muon with the efficiency information
virtual CorrectionCode applyEfficiencyScaleFactor(const xAOD::Muon &mu, const xAOD::EventInfo *info=0) const override
decorate the muon with scale factor information
std::string sf_replica_decoration() const
std::vector< std::unique_ptr< EffiCollection > > m_sf_sets
This vector stores all scale-factor maps.
unsigned int getRandomRunNumber(const xAOD::EventInfo *info) const
std::string filename_Central() const
The following methods are meant to propagate information from the central tool to the subtool managin...
virtual ~MuonEfficiencyScaleFactors()
std::string m_custom_file_Combined
std::string data_effi_replica_decoration() const
virtual CorrectionCode getEfficiencyScaleFactorReplicas(const xAOD::Muon &mu, std::vector< float > &sf_err, const xAOD::EventInfo *info=0) const override
replica generation
virtual StatusCode initialize() override
initialize the tool once all settings are in place!
size_t getNCollections() const
Returns the number of EffiCollections stored in this class.
std::string filename_LowPtCalo() const
std::string m_iso_jet_dR
Name of the decoration to catch up the close by jets.
float lowPtTransition() const
If the pt of the muon is below that threshold the J/Psi or Upsilon map is used given that it's availa...
std::string m_custom_file_LRTCombined
EffiCollection * m_current_sf
Pointer to the current active map in terms of systematics.
virtual bool isAffectedBySystematic(const SystematicVariation &systematic) const override
returns: whether this tool is affected by the given systematis
virtual CorrectionCode applyDataEfficiencyReplicas(const xAOD::Muon &mu, int nreplicas=50, const xAOD::EventInfo *info=0) const
std::string mc_effi_decoration() const
std::string filename_LRTLowPt() const
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo
size_t getPosition(const EffiCollection *coll) const
Returns the position of the collection in the syst set vector.
std::string data_effi_decoration() const
virtual CorrectionCode getDataEfficiency(const xAOD::Muon &mu, float &eff, const xAOD::EventInfo *info=0) const override
Obtain the muon efficiency measured using the data.
CP::MuonEfficiencyType measurement() const
Returns the type of the measurement to be carried out... E.g. Reco/TTVA/Iso.
virtual void callEvents(columnar::EventContextRange events) const override
virtual CorrectionCode applyMCEfficiencyReplicas(const xAOD::Muon &mu, int nreplicas=50, const xAOD::EventInfo *info=0) const
std::string m_efficiency_decoration_name_mc
bool use_lrt() const
option to set if we want to use LRT muons
std::string filename_LowPt() const
Returns the scale-factor maps from a complementary scale-factor measurement using the J/Psi or Upsilo...
virtual CorrectionCode getEfficiencyScaleFactor(const xAOD::Muon &mu, float &sf, const xAOD::EventInfo *info=0) const override
Retrieve the Scale factor and decorate the muon.
std::string m_calibration_version
subfolder to load from the calibration db
const std::string & close_by_jet_decoration() const
Returns the string telling the tool in which float AuxElement the information of the separation to th...
bool m_useLRT
Turn on if using LRT objects.
MuonEfficiencyScaleFactors(const std::string &name)
StatusCode LoadInputs()
load the SF histos
CP::SystematicSet m_affectingSys
Class to wrap a set of SystematicVariations.
Property holding a SG store/key/clid from which a ReadHandle is made.
Select isolated Photons, Electrons and Muons.
ObjectId< ContainerId::muon > MuonId
ObjectRange< ContainerId::eventContext > EventContextRange
ObjectRange< ContainerId::muon > MuonRange
ObjectId< ContainerId::eventInfo > EventInfoId
EventInfo_v1 EventInfo
Definition of the latest event info version.
Muon_v1 Muon
Reference the current persistent version: