ATLAS Offline Software
Loading...
Searching...
No Matches
ElectronChargeEfficiencyCorrectionTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ELECTRONCHARGECORRECTION__ELECTRONCHARGECORRECTIONTOOL__H
6#define ELECTRONCHARGECORRECTION__ELECTRONCHARGECORRECTIONTOOL__H
7
8#include "AsgTools/AsgTool.h"
11#include "TH2.h"
14
15#include <map>
16#include <string>
17#include <vector>
18
19// Forward declaration(s):
20namespace xAOD {
21class IParticle;
22}
23
24namespace CP {
25
28 , public asg::AsgTool
29{
32
33public:
36
39
40public:
42 virtual StatusCode initialize() override final;
43
44
47 const xAOD::Electron& inputObject,
48 double& sf) const override final;
49
52 const xAOD::Electron& inputObject) const override final;
53
55 virtual bool isAffectedBySystematic(
56 const SystematicVariation& systematic) const override final;
57
59 virtual SystematicSet affectingSystematics() const override final;
60
62 virtual CP::SystematicSet recommendedSystematics() const override final;
63
64 virtual StatusCode applySystematicVariation(const SystematicSet& systConfig) override final;
65
66
68 virtual const CP::SystematicSet& appliedSystematics() const override final
69 {
71 }
72
73 virtual int systUncorrVariationIndex(const xAOD::Electron&) const override final
74 {
76 "systUncorrVariationIndex is not implemented in "
77 "ElectronChargeEfficiencyCorrectionTool");
78 return -999;
79 }
80
82 const double, const double, const unsigned int,
83 double&) const override final{
85 "No toysimplemented in "
86 "ElectronChargeEfficiencyCorrectionTool");
88 }
89 //
90 virtual int getNumberOfToys() const override final
91 {
93 "No toysimplemented in "
94 "ElectronChargeEfficiencyCorrectionTool");
95 return -1;
96 };
97
98 virtual void printCorrelationModels() const override final
99 {
101 "ONLY A DEFAULT Correlation model available for now");
102 };
103
104
105private:
106 StatusCode registerSystematics();
108 float getChargeFlipRate(double eta,
109 double pt,
110 TH2* hrates,
111 double& flipRate) const;
112
115 //
116 //
119
121 std::map<std::string, std::vector<TH2*>>
122 m_SF_SS; // keys (e.g. RunNumber223333_319200_Nvtx0_10_Phi1.5_1.6) mapping
123 // to vector of SF histograms --> vector m_SF: 0=nominal, 1=stat,
124 // 2,3,4...n=syst
125 std::map<std::string, std::vector<TH2*>>
126 m_SF_OS; // keys (e.g. RunNumber223333_319200_Nvtx0_10_Phi1.5_1.6) mapping
127 // to vector of SF histograms --> vector m_SF: 0=nominal, 1=stat,
128 // 2,3,4...n=syst
129
130 // cuts // further variables to bin in
131 std::vector<unsigned int> m_RunNumbers;
134
136 std::string m_filename;
137
139 std::string m_workingPoint;
140
144
148
152
156
158 float m_gevmev;
159
160 // Systematics
161 std::vector<std::string> m_systematics;
162
163 std::map<CP::SystematicSet, CP::SystematicSet> m_filtered_sys_sets;
164 // boost::unordered_map<SystematicSet,EffiCollection*> m_sf_sets;
167
170
174};
175
176} // End namespace CP
177
178#endif
Scalar eta() const
pseudorapidity method
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
Base class for elements of a container that can have aux data.
Return value from object correction CP tools.
@ Error
Some error happened during the object correction.
std::map< std::string, std::vector< TH2 * > > m_SF_OS
CP::SystematicSet * m_appliedSystematics
Currently applied systematics.
virtual void printCorrelationModels() const override final
print available/implemented correlation models
std::string m_workingPoint
The name of the folder defining the LH/iso working point.
std::string m_filename
The name of the input file that contains the histograms.
virtual ASG_TOOL_CLASS(ElectronChargeEfficiencyCorrectionTool, IAsgElectronEfficiencyCorrectionTool) public ~ElectronChargeEfficiencyCorrectionTool()
Standard destructor.
std::map< CP::SystematicSet, CP::SystematicSet > m_filtered_sys_sets
double m_pt_lowlimit
Lower limit of pt range where corrections are available; taken from histogram.
std::map< std::string, std::vector< TH2 * > > m_SF_SS
Histogram that holds the correction rates for Monte Carlo.
virtual const CP::SystematicSet & appliedSystematics() const override final
returns: the currently applied systematics
virtual bool isAffectedBySystematic(const SystematicVariation &systematic) const override final
Returns whether this tool is affected by the given systematics.
virtual int systUncorrVariationIndex(const xAOD::Electron &) const override final
virtual CP::SystematicSet recommendedSystematics() const override final
Returns the list of all systematics this tool recommends to use.
double m_eta_uplimit
Upper limit of eta range where corrections are available; taken from histogram.
virtual CP::CorrectionCode applyEfficiencyScaleFactor(const xAOD::Electron &inputObject) const override final
Decorate the electron.
float getChargeFlipRate(double eta, double pt, TH2 *hrates, double &flipRate) const
Get the charge flip rate rate given pt, eta, histogram.
virtual StatusCode initialize() override final
Gaudi Service Interface method implementations.
std::string m_eventInfoCollectionName
The Event info collection name.
virtual CP::CorrectionCode getEfficiencyScaleFactor(const double, const double, const unsigned int, double &) const override final
virtual StatusCode applySystematicVariation(const SystematicSet &systConfig) override final
effects: configure this tool for the given list of systematic variations.
double m_eta_lowlimit
Lower limit of eta range where corrections are available; taken from histogram.
virtual CP::CorrectionCode getEfficiencyScaleFactor(const xAOD::Electron &inputObject, double &sf) const override final
Retrieve the Scale factor.
double m_pt_uplimit
Upper limit of pt range where corrections are available; taken from histogram.
virtual SystematicSet affectingSystematics() const override final
Returns the list of all systematics this tool can be affected by.
Class to wrap a set of SystematicVariations.
SG::Decorator< T, ALLOC > Decorator
Definition AuxElement.h:575
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
Class providing the definition of the 4-vector interface.
Select isolated Photons, Electrons and Muons.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
setRcore setEtHad setFside pt
Electron_v1 Electron
Definition of the current "egamma version".