ATLAS Offline Software
Loading...
Searching...
No Matches
AsgPhotonEfficiencyCorrectionTool.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

namespace ADD_CMODE (CP)

Function Documentation

◆ ADD_CMODE()

namespace ADD_CMODE ( CP )

Standard constructor

Standard destructor

Gaudi Service Interface method implementations

Add some method for now as a first step to move the tool to then new interface

The methods below should notify the user of what is actually in the list , without him having to go in the wiki

returns: whether this tool is affected by the given systematic

returns: the list of all systematics this tool can be affected by

returns: the list of all systematics this tool recommends to use

returns: the currently applied systematics

Configure this tool for the given systematics

I think these calculate methods are only used internally

Pointer to the underlying ROOT based tool

Systematics filter map

Currently applied systematics

The list of input file names

The prefix string for the result

The string for the result

Force the data type to a given value

Isolation working point

Trigger name for trigger SF

map filename

Definition at line 1 of file AsgPhotonEfficiencyCorrectionTool.h.

42{
43
44class AsgPhotonEfficiencyCorrectionTool
46 virtual public CP::ISystematicsTool,
47 public asg::AsgTool,
49{
50 ASG_TOOL_CLASS3(AsgPhotonEfficiencyCorrectionTool, IAsgPhotonEfficiencyCorrectionTool, CP::ISystematicsTool, CP::IReentrantSystematicsTool )
51
52public:
54 AsgPhotonEfficiencyCorrectionTool ( const std::string& myname );
55
57 virtual ~AsgPhotonEfficiencyCorrectionTool();
58
60 virtual StatusCode initialize() override;
61
62
63public:
65 virtual CP::CorrectionCode getEfficiencyScaleFactor(const xAOD::Egamma& inputObject, double& efficiencyScaleFactor) const override;
66 CP::CorrectionCode getEfficiencyScaleFactor(columnar::EgammaId inputObject, columnar::EventInfoId eventInfo, double& efficiencyScaleFactor) const;
67 virtual CP::CorrectionCode getEfficiencyScaleFactorError(const xAOD::Egamma& inputObject, double& efficiencyScaleFactorError) const override;
68 CP::CorrectionCode getEfficiencyScaleFactorError(columnar::EgammaId inputObject, columnar::EventInfoId eventInfo, double& efficiencyScaleFactorError) const;
69 virtual CP::CorrectionCode applyEfficiencyScaleFactor(xAOD::Egamma& inputObject) const override;
70
72
74 virtual bool isAffectedBySystematic( const CP::SystematicVariation& systematic ) const override;
75
77 virtual CP::SystematicSet affectingSystematics() const override;
78
80 virtual CP::SystematicSet recommendedSystematics() const override;
81
83 const CP::SystematicSet& appliedSystematics() const {
84 assert (m_appliedSystematics != nullptr);
85 return *m_appliedSystematics;
86 }
87
89 virtual StatusCode applySystematicVariation ( const CP::SystematicSet& systConfig ) override;
90
91 StatusCode registerSystematics();
92
93 // Private member variables
94private:
95 typedef Root::TElectronEfficiencyCorrectionTool::Result Result;
97 CP::CorrectionCode calculate( columnar::EgammaId egam, columnar::EventInfoId eventInfo, Result& result ) const;
98
100 Root::TElectronEfficiencyCorrectionTool* m_rootTool_unc;
101 Root::TElectronEfficiencyCorrectionTool* m_rootTool_con;
102
104 std::unordered_map<CP::SystematicSet, CP::SystematicSet> m_systFilter;
105
107 CP::SystematicSet* m_appliedSystematics = nullptr;
108
109 // The prefix for the systematic name
110 std::string m_sysSubstring;
111
112 // Get the correction filename from the map
113 std::string getFileName(const std::string& isoWP, const std::string& trigWP, bool isConv);
114
115 // Set prefix of the corresponding calibration filenames:
116 std::string m_file_prefix_ID="efficiencySF.offline.";
117 std::string m_file_prefix_ISO="efficiencySF.Isolation.";
118 std::string m_file_prefix_Trig="efficiencySF.";
119 std::string m_file_prefix_TrigEff="efficiency.";
120
121 // Properties
122
124 std::string m_corrFileNameConv;
125 std::string m_corrFileNameUnconv;
126
128 std::string m_resultPrefix;
129
131 std::string m_resultName;
132
134 int m_dataTypeOverwrite;
135
137 std::string m_isoWP;
138
140 std::string m_trigger;
141
143 std::string m_mapFile;
144
145 // bin boundaries of correction files
146 std::map<float, std::vector<float>> m_pteta_bins;
147
148 //use RandomRun Number
149 bool m_useRandomRunNumber;
150 int m_defaultRandomRunNumber;
151
152 // remove TRT converted photon for Run-3
153 bool m_removeTRTConversion;
154
155 Gaudi::Property<bool> m_allowMissingLinks{ this, "AllowMissingLinks", false, "Allow missing links in the input objects. This should only be used by experts running on expert formats." };
156
157 // an accessor structure that hides the columnar accessors from the
158 // root dictionaries that can't handle them. these dictionaries are
159 // used by some users to instantiate the tools (instead of using the
160 // factory mechanism).
161 struct Accessors : public columnar::ColumnarTool<>
162 {
163 Accessors(AsgPhotonEfficiencyCorrectionTool& tool) : columnar::ColumnarTool<>(&tool) {}
164
165 columnar::EventInfoAccessor<columnar::ObjectColumn> eventInfoAcc {*this, "EventInfo", {.addMTDependency=true}};
166 columnar::EgammaAccessor<columnar::ObjectColumn> photonsAcc {*this, "Photons"};
167 columnar::ClusterAccessor<columnar::ObjectColumn> clusterAcc {*this, "egammaClusters"};
168 columnar::VertexAccessor<columnar::ObjectColumn> verticesAcc {*this, "GSFConversionVertices"};
169 columnar::TrackAccessor<columnar::ObjectColumn> tracksAcc {*this, "GSFTrackParticles"};
170
171 columnar::EventInfoAccessor<uint32_t> randomRunNumberAcc {*this, "RandomRunNumber"};
172
173 columnar::EgammaAccessor<float> etaAcc{*this,"eta"};
174 columnar::EgammaHelpers::IsConvertedPhotonAccessor<> isConvertedPhotonAcc{*this};
175 columnar::EgammaDecorator<float> sfDec{*this,"sfOut"};
176 columnar::EgammaDecorator<char> validDec{*this,"validOut"};
177
178 columnar::EgammaAccessor<std::vector<columnar::OptClusterId>> caloClusterAcc {*this, "caloClusterLinks"};
179 columnar::ClusterAccessor<float> clusterEAcc {*this, "calE"};
180 columnar::ClusterHelpers::EtaBEAccessor<> clusterEtaBEAcc {*this};
181 };
182 std::unique_ptr<Accessors> m_accessors {std::make_unique<Accessors>(*this)};
183
184
185public:
186
187 void callSingleEvent (columnar::EgammaRange photons, columnar::EventInfoId event) const;
188 void callEvents (columnar::EventContextRange events) const override;
189
190}; // End: class definition
191
192} // namespace ADD_CMODE(CP)
#define ASG_TOOL_CLASS3(CLASSNAME, INT1, INT2, INT3)
ICscStripFitter::Result Result
virtual SystematicSet affectingSystematics() const =0
the list of all systematics this tool can be affected by
virtual SystematicSet recommendedSystematics() const =0
the list of all systematics this tool recommends to use
Interface for all CP tools supporting systematic variations.
virtual StatusCode applySystematicVariation(const SystematicSet &systConfig)=0
effects: configure this tool for the given list of systematic variations.
virtual bool isAffectedBySystematic(const SystematicVariation &systematic) const =0
Declare the interface that this class provides.
virtual CP::CorrectionCode getEfficiencyScaleFactorError(const xAOD::Egamma &, double &) const =0
Get the "photon scale factor error" as a return value.
virtual CP::CorrectionCode applyEfficiencyScaleFactor(xAOD::Egamma &) const =0
Decorate the photon with its scale factor.
virtual CP::CorrectionCode getEfficiencyScaleFactor(const xAOD::Egamma &, double &) const =0
Get the "photon scale factor" as a return value.
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
the base class for all columnar components
::StatusCode StatusCode
StatusCode definition for legacy code.
void calculate(xAOD::Electron &electron)
AccessorTemplate< ClusterDef, CT, ColumnAccessMode::input, CM > ClusterAccessor
Definition ClusterDef.h:25
ObjectRange< EgammaDef > EgammaRange
Definition EgammaDef.h:46
AccessorTemplate< EgammaDef, CT, ColumnAccessMode::input, CM > EgammaAccessor
Definition EgammaDef.h:49
ObjectRange< EventContextDef > EventContextRange
AccessorTemplate< VertexDef, CT, ColumnAccessMode::input, CM > VertexAccessor
Definition TrackDef.h:66
AccessorTemplate< EgammaDef, CT, ColumnAccessMode::output, CM > EgammaDecorator
Definition EgammaDef.h:50
AccessorTemplate< TrackDef, CT, ColumnAccessMode::input, CM > TrackAccessor
Definition TrackDef.h:45
ObjectId< EgammaDef > EgammaId
Definition EgammaDef.h:47
ObjectId< EventInfoDef > EventInfoId
AccessorTemplate< EventInfoDef, CT, ColumnAccessMode::input, CM > EventInfoAccessor
getFileName(name, sep='#')
Definition TrfUtils.py:45
Egamma_v1 Egamma
Definition of the current "egamma version".
Definition Egamma.h:17
void initialize()