ATLAS Offline Software
Loading...
Searching...
No Matches
egammaMVAFunctions Namespace Reference

These functions are for calculating variables used by the MVA calibration. More...

Classes

struct  ConversionHelper
 The ConversionHelper struct is stll used by egammaMVATree in PhysicsAnalysis but not the functions in the dictionaries above. More...

Typedefs

using funcMap_t
 Define the map type since it's long.

Functions

float compute_cl_eta (const xAOD::CaloCluster &cluster)
float compute_cl_phi (const xAOD::CaloCluster &cluster)
float compute_cl_e (const xAOD::CaloCluster &cluster)
float compute_cl_etaCalo (const xAOD::CaloCluster &cluster)
float compute_cl_phiCalo (const xAOD::CaloCluster &cluster)
float compute_cl_etas1 (const xAOD::CaloCluster &cluster)
float compute_cl_etas2 (const xAOD::CaloCluster &cluster)
float compute_rawcl_Es0 (const xAOD::CaloCluster &cl)
float compute_rawcl_Es1 (const xAOD::CaloCluster &cl)
float compute_rawcl_Es2 (const xAOD::CaloCluster &cl)
float compute_rawcl_Es3 (const xAOD::CaloCluster &cl)
float compute_correctedcl_Es0 (const xAOD::CaloCluster &cl)
float compute_correctedcl_Es1 (const xAOD::CaloCluster &cl)
float compute_correctedcl_Es2 (const xAOD::CaloCluster &cl)
float compute_correctedcl_Es3 (const xAOD::CaloCluster &cl)
float compute_rawcl_Eacc (const xAOD::CaloCluster &cl)
float compute_rawcl_f0 (const xAOD::CaloCluster &cl)
float compute_correctedcl_Eacc (const xAOD::CaloCluster &cl)
float compute_correctedcl_f0 (const xAOD::CaloCluster &cl)
float compute_calibHitsShowerDepth (const std::array< float, 4 > &cl, float eta)
float compute_rawcl_calibHitsShowerDepth (const xAOD::CaloCluster &cl)
float compute_correctedcl_calibHitsShowerDepth (const xAOD::CaloCluster &cl)
float compute_et (const xAOD::CaloCluster &cl)
float cl_getMoment (const xAOD::CaloCluster &cl, xAOD::CaloCluster::MomentType m, const char *name)
float compute_cl_significance (const xAOD::CaloCluster &cl)
float compute_cl_secondLambda (const xAOD::CaloCluster &cl)
float compute_cl_lateral (const xAOD::CaloCluster &cl)
float compute_cl_longitudinal (const xAOD::CaloCluster &cl)
float compute_cl_fracMax (const xAOD::CaloCluster &cl)
float compute_cl_secondR (const xAOD::CaloCluster &cl)
float compute_cl_centerLambda (const xAOD::CaloCluster &cl)
float compute_cl_secondDensity (const xAOD::CaloCluster &cl)
float compute_cl_x (const xAOD::CaloCluster &cl)
float compute_cl_y (const xAOD::CaloCluster &cl)
float compute_cl_z (const xAOD::CaloCluster &cl)
float compute_cl_secondR_fudge (const xAOD::Egamma &eg)
float compute_eta_FCAL (const xAOD::CaloCluster &cl)
float compute_etaMod_FCAL (const xAOD::CaloCluster &cl)
float compute_cellIndex_FCAL (const xAOD::CaloCluster &cl)
float compute_etaMod_EMEC (const xAOD::CaloCluster &cl)
float compute_cellIndex_EMEC (const xAOD::CaloCluster &cl)
float compute_phiMod_EMEC (const xAOD::CaloCluster &cl)
float compute_R12_EMEC (const xAOD::CaloCluster &cl)
float compute_el_charge (const xAOD::Electron &el)
float compute_el_tracketa (const xAOD::Electron &el)
float compute_el_trackpt (const xAOD::Electron &el)
float compute_el_trackz0 (const xAOD::Electron &el)
float compute_el_refittedTrack_qoverp (const xAOD::Electron &el)
int compute_el_author (const xAOD::Electron &el)
int compute_ph_convFlag (const xAOD::Photon &ph)
float getPtAtFirstMeasurement (const xAOD::TrackParticle *tp)
float compute_ptconv_decor (const xAOD::Photon *ph)
 This ptconv function uses the vertex decorations.
float compute_ptconv (const xAOD::Photon *ph)
 This ptconv is the old one used by MVACalib.
float compute_pt1conv (const xAOD::Photon *ph)
float compute_pt2conv (const xAOD::Photon *ph)
template<int itrack, xAOD::SummaryType summary>
int compute_convtrkXhits (const xAOD::Photon *ph)
int compute_convtrk1nPixHits (const xAOD::Photon *ph)
int compute_convtrk2nPixHits (const xAOD::Photon *ph)
int compute_convtrk1nSCTHits (const xAOD::Photon *ph)
int compute_convtrk2nSCTHits (const xAOD::Photon *ph)
std::unique_ptr< funcMap_tinitializeElectronFuncs (bool useLayerCorrected)
 A function to build the map for electrons.
std::unique_ptr< funcMap_tinitializeUnconvertedPhotonFuncs (bool useLayerCorrected)
 A function to build the map for uncoverted photons.
std::unique_ptr< funcMap_tinitializeConvertedPhotonFuncs (bool useLayerCorrected)
 A function to build the map for converted photons.
std::unique_ptr< funcMap_tinitializeForwardElectronFuncs (bool useLayerCorrected)
 NEW: A function to build the map for forward electrons.
void initializeClusterFuncs (funcMap_t &funcLibrary, const std::string &prefix, bool useLayerCorrected)
void initializeEgammaFuncs (funcMap_t &funcLibrary, const std::string &prefix, bool useLayerCorrected)

Detailed Description

These functions are for calculating variables used by the MVA calibration.

These functions are for building the maps of functions.

The user can use the functions

Typedef Documentation

◆ funcMap_t

Initial value:
std::unordered_map<std::string,
std::function<float(const xAOD::Egamma*, const xAOD::CaloCluster*)> >
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Egamma_v1 Egamma
Definition of the current "egamma version".
Definition Egamma.h:17

Define the map type since it's long.

Definition at line 310 of file egammaMVAFunctions.h.

Function Documentation

◆ cl_getMoment()

float egammaMVAFunctions::cl_getMoment ( const xAOD::CaloCluster & cl,
xAOD::CaloCluster::MomentType m,
const char * name )
inline

Definition at line 144 of file egammaMVAFunctions.h.

146 {
147 double tmp = 0.;
148 if (!cl.retrieveMoment(m, tmp)) {
149 throw std::runtime_error(std::string("Forward-electron missing moment: ") + name);
150 }
151 return static_cast<float>(tmp);
152 }

◆ compute_calibHitsShowerDepth()

float egammaMVAFunctions::compute_calibHitsShowerDepth ( const std::array< float, 4 > & cl,
float eta )
inline

Definition at line 102 of file egammaMVAFunctions.h.

103 {
104 const float denominator = cl[0] + cl[1] + cl[2] + cl[3];
105 if (denominator == 0) return 0.;
106
107 const std::array<float, 4> radius(get_MVAradius(eta));
108
109 // loop unrolling
110 return (radius[0] * cl[0]
111 + radius[1] * cl[1]
112 + radius[2] * cl[2]
113 + radius[3] * cl[3]) / denominator;
114 }
Scalar eta() const
pseudorapidity method
std::array< float, 4 > get_MVAradius(float eta)
helper function to compute shower depth

◆ compute_cellIndex_EMEC()

float egammaMVAFunctions::compute_cellIndex_EMEC ( const xAOD::CaloCluster & cl)
inline

Definition at line 189 of file egammaMVAFunctions.h.

189 {
190 return std::floor(std::abs(cl.eta())/0.1);
191 }

◆ compute_cellIndex_FCAL()

float egammaMVAFunctions::compute_cellIndex_FCAL ( const xAOD::CaloCluster & cl)
inline

Definition at line 183 of file egammaMVAFunctions.h.

183 {
184 return std::floor(std::abs(compute_eta_FCAL(cl))/0.15);
185 }
float compute_eta_FCAL(const xAOD::CaloCluster &cl)

◆ compute_cl_centerLambda()

float egammaMVAFunctions::compute_cl_centerLambda ( const xAOD::CaloCluster & cl)
inline

Definition at line 161 of file egammaMVAFunctions.h.

161{ return cl_getMoment(cl, xAOD::CaloCluster::CENTER_LAMBDA , "CENTER_LAMBDA"); }
@ CENTER_LAMBDA
Shower depth at Cluster Centroid.
float cl_getMoment(const xAOD::CaloCluster &cl, xAOD::CaloCluster::MomentType m, const char *name)

◆ compute_cl_e()

float egammaMVAFunctions::compute_cl_e ( const xAOD::CaloCluster & cluster)
inline

Definition at line 51 of file egammaMVAFunctions.h.

51{ return cluster.e(); }
virtual double e() const
The total energy of the particle.

◆ compute_cl_eta()

float egammaMVAFunctions::compute_cl_eta ( const xAOD::CaloCluster & cluster)
inline

Definition at line 49 of file egammaMVAFunctions.h.

49{ return cluster.eta(); }
virtual double eta() const
The pseudorapidity ( ) of the particle.

◆ compute_cl_etaCalo()

float egammaMVAFunctions::compute_cl_etaCalo ( const xAOD::CaloCluster & cluster)
inline

Definition at line 52 of file egammaMVAFunctions.h.

52 {
53 double tmp = 0.;
55 throw std::runtime_error("etaCalo not found in CaloCluster object");
56 }
57 return tmp;
58 }
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
@ ETACALOFRAME
Eta in the calo frame (for egamma).

◆ compute_cl_etas1()

float egammaMVAFunctions::compute_cl_etas1 ( const xAOD::CaloCluster & cluster)
inline

Definition at line 66 of file egammaMVAFunctions.h.

66{ return cluster.etaBE(1); }
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.

◆ compute_cl_etas2()

float egammaMVAFunctions::compute_cl_etas2 ( const xAOD::CaloCluster & cluster)
inline

Definition at line 67 of file egammaMVAFunctions.h.

67{ return cluster.etaBE(2); }

◆ compute_cl_fracMax()

float egammaMVAFunctions::compute_cl_fracMax ( const xAOD::CaloCluster & cl)
inline

Definition at line 158 of file egammaMVAFunctions.h.

158{ return cl_getMoment(cl, xAOD::CaloCluster::ENG_FRAC_MAX , "ENG_FRAC_MAX"); }
@ ENG_FRAC_MAX
Energy fraction of hottest cell.

◆ compute_cl_lateral()

float egammaMVAFunctions::compute_cl_lateral ( const xAOD::CaloCluster & cl)
inline

Definition at line 156 of file egammaMVAFunctions.h.

156{ return cl_getMoment(cl, xAOD::CaloCluster::LATERAL , "LATERAL"); }
@ LATERAL
Normalized lateral moment.

◆ compute_cl_longitudinal()

float egammaMVAFunctions::compute_cl_longitudinal ( const xAOD::CaloCluster & cl)
inline

Definition at line 157 of file egammaMVAFunctions.h.

157{ return cl_getMoment(cl, xAOD::CaloCluster::LONGITUDINAL , "LONGITUDINAL"); }
@ LONGITUDINAL
Normalized longitudinal moment.

◆ compute_cl_phi()

float egammaMVAFunctions::compute_cl_phi ( const xAOD::CaloCluster & cluster)
inline

Definition at line 50 of file egammaMVAFunctions.h.

50{ return cluster.phi(); }
virtual double phi() const
The azimuthal angle ( ) of the particle.

◆ compute_cl_phiCalo()

float egammaMVAFunctions::compute_cl_phiCalo ( const xAOD::CaloCluster & cluster)
inline

Definition at line 59 of file egammaMVAFunctions.h.

59 {
60 double tmp = 0.;
62 throw std::runtime_error("phiCalo not found in CaloCluster object");
63 }
64 return tmp;
65 }
@ PHICALOFRAME
Phi in the calo frame (for egamma).

◆ compute_cl_secondDensity()

float egammaMVAFunctions::compute_cl_secondDensity ( const xAOD::CaloCluster & cl)
inline

Definition at line 162 of file egammaMVAFunctions.h.

162{ return cl_getMoment(cl, xAOD::CaloCluster::SECOND_ENG_DENS,"SECOND_ENG_DENS"); }
@ SECOND_ENG_DENS
Second Moment in E/V.

◆ compute_cl_secondLambda()

float egammaMVAFunctions::compute_cl_secondLambda ( const xAOD::CaloCluster & cl)
inline

Definition at line 155 of file egammaMVAFunctions.h.

155{ return cl_getMoment(cl, xAOD::CaloCluster::SECOND_LAMBDA , "SECOND_LAMBDA"); }
@ SECOND_LAMBDA
Second Moment in .

◆ compute_cl_secondR()

float egammaMVAFunctions::compute_cl_secondR ( const xAOD::CaloCluster & cl)
inline

Definition at line 160 of file egammaMVAFunctions.h.

160{ return cl_getMoment(cl, xAOD::CaloCluster::SECOND_R , "SECOND_R"); }
@ SECOND_R
Second Moment in .

◆ compute_cl_secondR_fudge()

float egammaMVAFunctions::compute_cl_secondR_fudge ( const xAOD::Egamma & eg)
inline

Definition at line 167 of file egammaMVAFunctions.h.

167 {
168 static const SG::AuxElement::Accessor<float> accR2("SECOND_R");
169 if (accR2.isAvailable(eg)) { return accR2(eg); }
170 return -1.;
171 }

◆ compute_cl_significance()

float egammaMVAFunctions::compute_cl_significance ( const xAOD::CaloCluster & cl)
inline

Definition at line 154 of file egammaMVAFunctions.h.

154{ return cl_getMoment(cl, xAOD::CaloCluster::SIGNIFICANCE , "SIGNIFICANCE"); }
@ SIGNIFICANCE
Cluster significance.

◆ compute_cl_x()

float egammaMVAFunctions::compute_cl_x ( const xAOD::CaloCluster & cl)
inline

Definition at line 163 of file egammaMVAFunctions.h.

163{ return cl_getMoment(cl, xAOD::CaloCluster::CENTER_X , "CENTER_X"); }
@ CENTER_X
Cluster Centroid ( ).

◆ compute_cl_y()

float egammaMVAFunctions::compute_cl_y ( const xAOD::CaloCluster & cl)
inline

Definition at line 164 of file egammaMVAFunctions.h.

164{ return cl_getMoment(cl, xAOD::CaloCluster::CENTER_Y , "CENTER_Y"); }
@ CENTER_Y
Cluster Centroid ( ).

◆ compute_cl_z()

float egammaMVAFunctions::compute_cl_z ( const xAOD::CaloCluster & cl)
inline

Definition at line 165 of file egammaMVAFunctions.h.

165{ return cl_getMoment(cl, xAOD::CaloCluster::CENTER_Z , "CENTER_Z"); }
@ CENTER_Z
Cluster Centroid ( ).

◆ compute_convtrk1nPixHits()

int egammaMVAFunctions::compute_convtrk1nPixHits ( const xAOD::Photon * ph)
inline

Definition at line 301 of file egammaMVAFunctions.h.

int compute_convtrkXhits(const xAOD::Photon *ph)

◆ compute_convtrk1nSCTHits()

int egammaMVAFunctions::compute_convtrk1nSCTHits ( const xAOD::Photon * ph)
inline

Definition at line 303 of file egammaMVAFunctions.h.

◆ compute_convtrk2nPixHits()

int egammaMVAFunctions::compute_convtrk2nPixHits ( const xAOD::Photon * ph)
inline

Definition at line 302 of file egammaMVAFunctions.h.

◆ compute_convtrk2nSCTHits()

int egammaMVAFunctions::compute_convtrk2nSCTHits ( const xAOD::Photon * ph)
inline

Definition at line 304 of file egammaMVAFunctions.h.

◆ compute_convtrkXhits()

template<int itrack, xAOD::SummaryType summary>
int egammaMVAFunctions::compute_convtrkXhits ( const xAOD::Photon * ph)
inline

Definition at line 288 of file egammaMVAFunctions.h.

288 {
289 const auto vx = ph->vertex();
290 if (!vx) return 0.;
291
292 if (vx->trackParticle(0)) {
293 uint8_t hits;
294 if (vx->trackParticle(itrack)->summaryValue(hits, summary)) {
295 return hits;
296 }
297 }
298 return 0.;
299 }
const xAOD::Vertex * vertex(size_t index=0) const
Pointer to the xAOD::Vertex/es that match the photon candidate.
Definition Photon_v1.cxx:61

◆ compute_correctedcl_calibHitsShowerDepth()

float egammaMVAFunctions::compute_correctedcl_calibHitsShowerDepth ( const xAOD::CaloCluster & cl)
inline

Definition at line 125 of file egammaMVAFunctions.h.

125 {
126 const std::array<float, 4> cluster_array {{ compute_correctedcl_Es0(cl),
130 return compute_calibHitsShowerDepth(cluster_array, compute_cl_eta(cl));
131 }
float compute_correctedcl_Es3(const xAOD::CaloCluster &cl)
float compute_correctedcl_Es1(const xAOD::CaloCluster &cl)
float compute_calibHitsShowerDepth(const std::array< float, 4 > &cl, float eta)
float compute_correctedcl_Es2(const xAOD::CaloCluster &cl)
float compute_cl_eta(const xAOD::CaloCluster &cluster)
float compute_correctedcl_Es0(const xAOD::CaloCluster &cl)

◆ compute_correctedcl_Eacc()

float egammaMVAFunctions::compute_correctedcl_Eacc ( const xAOD::CaloCluster & cl)
inline

Definition at line 98 of file egammaMVAFunctions.h.

◆ compute_correctedcl_Es0()

float egammaMVAFunctions::compute_correctedcl_Es0 ( const xAOD::CaloCluster & cl)
inline

Definition at line 78 of file egammaMVAFunctions.h.

78 {
79 static const SG::ConstAccessor<double> acc ("correctedcl_Es0");
80 return acc.isAvailable(cl) ? acc(cl) : cl.energyBE(0);
81 }
Helper class to provide constant type-safe access to aux data.

◆ compute_correctedcl_Es1()

float egammaMVAFunctions::compute_correctedcl_Es1 ( const xAOD::CaloCluster & cl)
inline

Definition at line 82 of file egammaMVAFunctions.h.

82 {
83 static const SG::ConstAccessor<double> acc ("correctedcl_Es1");
84 return acc.isAvailable(cl) ? acc(cl) : cl.energyBE(1);
85 }

◆ compute_correctedcl_Es2()

float egammaMVAFunctions::compute_correctedcl_Es2 ( const xAOD::CaloCluster & cl)
inline

Definition at line 86 of file egammaMVAFunctions.h.

86 {
87 static const SG::ConstAccessor<double> acc ("correctedcl_Es2");
88 return acc.isAvailable(cl) ? acc(cl) : cl.energyBE(2);
89 }

◆ compute_correctedcl_Es3()

float egammaMVAFunctions::compute_correctedcl_Es3 ( const xAOD::CaloCluster & cl)
inline

Definition at line 90 of file egammaMVAFunctions.h.

90 {
91 static const SG::ConstAccessor<double> acc ("correctedcl_Es3");
92 return acc.isAvailable(cl) ? acc(cl) : cl.energyBE(3);
93 }

◆ compute_correctedcl_f0()

float egammaMVAFunctions::compute_correctedcl_f0 ( const xAOD::CaloCluster & cl)
inline

Definition at line 99 of file egammaMVAFunctions.h.

float compute_correctedcl_Eacc(const xAOD::CaloCluster &cl)

◆ compute_el_author()

int egammaMVAFunctions::compute_el_author ( const xAOD::Electron & el)
inline

Definition at line 210 of file egammaMVAFunctions.h.

210 {
211 static const SG::ConstAccessor<unsigned short int> acc ("author");
212 return acc (el);
213 }

◆ compute_el_charge()

float egammaMVAFunctions::compute_el_charge ( const xAOD::Electron & el)
inline

Definition at line 205 of file egammaMVAFunctions.h.

205{ return el.charge(); }

◆ compute_el_refittedTrack_qoverp()

float egammaMVAFunctions::compute_el_refittedTrack_qoverp ( const xAOD::Electron & el)
inline

Definition at line 209 of file egammaMVAFunctions.h.

209{ return el.trackParticle()->qOverP(); }

◆ compute_el_tracketa()

float egammaMVAFunctions::compute_el_tracketa ( const xAOD::Electron & el)
inline

Definition at line 206 of file egammaMVAFunctions.h.

206{ return el.trackParticle()->eta(); }

◆ compute_el_trackpt()

float egammaMVAFunctions::compute_el_trackpt ( const xAOD::Electron & el)
inline

Definition at line 207 of file egammaMVAFunctions.h.

207{ return el.trackParticle()->pt(); }

◆ compute_el_trackz0()

float egammaMVAFunctions::compute_el_trackz0 ( const xAOD::Electron & el)
inline

Definition at line 208 of file egammaMVAFunctions.h.

208{ return el.trackParticle()->z0(); }

◆ compute_et()

float egammaMVAFunctions::compute_et ( const xAOD::CaloCluster & cl)
inline

Definition at line 137 of file egammaMVAFunctions.h.

137 {
138 const float e = cl.e();
139 const float eta = cl.eta();
140 const float c = std::cosh(eta);
141 return (c != 0.f) ? (e / c) : 0.f;
142 }

◆ compute_eta_FCAL()

float egammaMVAFunctions::compute_eta_FCAL ( const xAOD::CaloCluster & cl)
inline

Definition at line 173 of file egammaMVAFunctions.h.

173 {
174 float x = compute_cl_x(cl);
175 float y = compute_cl_y(cl);
176 float z = compute_cl_z(cl);
177 float theta = std::acos(z/std::sqrt(x*x+y*y+z*z));
178 return -std::log(std::tan(theta/2.));
179 }
Scalar theta() const
theta method
#define y
#define x
#define z
float compute_cl_y(const xAOD::CaloCluster &cl)
float compute_cl_z(const xAOD::CaloCluster &cl)
float compute_cl_x(const xAOD::CaloCluster &cl)

◆ compute_etaMod_EMEC()

float egammaMVAFunctions::compute_etaMod_EMEC ( const xAOD::CaloCluster & cl)
inline

Definition at line 186 of file egammaMVAFunctions.h.

186 {
187 return std::fmod(std::abs(cl.eta()),0.1);
188 }

◆ compute_etaMod_FCAL()

float egammaMVAFunctions::compute_etaMod_FCAL ( const xAOD::CaloCluster & cl)
inline

Definition at line 180 of file egammaMVAFunctions.h.

180 {
181 return std::fmod(std::abs(compute_eta_FCAL(cl)),0.15);
182 }

◆ compute_ph_convFlag()

int egammaMVAFunctions::compute_ph_convFlag ( const xAOD::Photon & ph)
inline

Definition at line 216 of file egammaMVAFunctions.h.

216 {
217 const auto original = xAOD::EgammaHelpers::conversionType(&ph);
218 if (original == 3) return 2;
219 else if (original != 0) return 1;
220 else return original;
221 }
xAOD::EgammaParameters::ConversionType conversionType(const xAOD::Photon *ph)
return the photon conversion type (see EgammaEnums)

◆ compute_phiMod_EMEC()

float egammaMVAFunctions::compute_phiMod_EMEC ( const xAOD::CaloCluster & cl)
inline

Definition at line 192 of file egammaMVAFunctions.h.

192 {
193 static const float cz = std::numbers::pi/16.;
194 float phi_mod = std::fmod(cl.phi(), cz);
195 if (phi_mod < 0) phi_mod += cz;
196 return phi_mod;
197 }

◆ compute_pt1conv()

float egammaMVAFunctions::compute_pt1conv ( const xAOD::Photon * ph)
inline

Definition at line 259 of file egammaMVAFunctions.h.

260 {
261 static const SG::AuxElement::Accessor<float> accPt1("pt1");
262
263 const xAOD::Vertex* vx = ph->vertex();
264 if (!vx) return 0.0;
265 if (accPt1.isAvailable(*vx)) {
266 return accPt1(*vx);
267 } else {
269 }
270 }
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
float getPtAtFirstMeasurement(const xAOD::TrackParticle *tp)
Vertex_v1 Vertex
Define the latest version of the vertex class.

◆ compute_pt2conv()

float egammaMVAFunctions::compute_pt2conv ( const xAOD::Photon * ph)
inline

Definition at line 272 of file egammaMVAFunctions.h.

273 {
274 static const SG::AuxElement::Accessor<float> accPt2("pt2");
275
276 const xAOD::Vertex* vx = ph->vertex();
277 if (!vx) return 0.0;
278 if (accPt2.isAvailable(*vx)) {
279 return accPt2(*vx);
280 } else {
282 }
283 }

◆ compute_ptconv()

float egammaMVAFunctions::compute_ptconv ( const xAOD::Photon * ph)
inline

This ptconv is the old one used by MVACalib.

Definition at line 248 of file egammaMVAFunctions.h.

249 {
250 auto vx = ph->vertex();
251 if (!vx) return 0.0;
252
253 TLorentzVector sum;
254 if (vx->trackParticle(0)) sum += vx->trackParticle(0)->p4();
255 if (vx->trackParticle(1)) sum += vx->trackParticle(1)->p4();
256 return sum.Perp();
257 }

◆ compute_ptconv_decor()

float egammaMVAFunctions::compute_ptconv_decor ( const xAOD::Photon * ph)
inline

This ptconv function uses the vertex decorations.

Definition at line 238 of file egammaMVAFunctions.h.

239 {
240 static const SG::AuxElement::Accessor<float> accPx("px");
241 static const SG::AuxElement::Accessor<float> accPy("py");
242
243 auto vx = ph->vertex();
244 return vx ? std::hypot(accPx(*vx), accPy(*vx)) : 0.0;
245 }

◆ compute_R12_EMEC()

float egammaMVAFunctions::compute_R12_EMEC ( const xAOD::CaloCluster & cl)
inline

Definition at line 198 of file egammaMVAFunctions.h.

198 {
199 double es1 = cl.energy_max(CaloSampling::EME2);
200 double es2 = cl.energy_max(CaloSampling::EME3);
201 return es2 != 0 ? float(es1/es2) : -1;
202 }

◆ compute_rawcl_calibHitsShowerDepth()

float egammaMVAFunctions::compute_rawcl_calibHitsShowerDepth ( const xAOD::CaloCluster & cl)
inline

Definition at line 116 of file egammaMVAFunctions.h.

117 {
118 const std::array<float, 4> cluster_array {{ compute_rawcl_Es0(cl),
121 compute_rawcl_Es3(cl) }};
122 return compute_calibHitsShowerDepth(cluster_array, compute_cl_eta(cl));
123 }
float compute_rawcl_Es1(const xAOD::CaloCluster &cl)
float compute_rawcl_Es2(const xAOD::CaloCluster &cl)
float compute_rawcl_Es0(const xAOD::CaloCluster &cl)
float compute_rawcl_Es3(const xAOD::CaloCluster &cl)

◆ compute_rawcl_Eacc()

float egammaMVAFunctions::compute_rawcl_Eacc ( const xAOD::CaloCluster & cl)
inline

Definition at line 95 of file egammaMVAFunctions.h.

95{ return cl.energyBE(1) + cl.energyBE(2) + cl.energyBE(3); }

◆ compute_rawcl_Es0()

float egammaMVAFunctions::compute_rawcl_Es0 ( const xAOD::CaloCluster & cl)
inline

Definition at line 68 of file egammaMVAFunctions.h.

68{ return cl.energyBE(0); }

◆ compute_rawcl_Es1()

float egammaMVAFunctions::compute_rawcl_Es1 ( const xAOD::CaloCluster & cl)
inline

Definition at line 74 of file egammaMVAFunctions.h.

74{ return cl.energyBE(1); }

◆ compute_rawcl_Es2()

float egammaMVAFunctions::compute_rawcl_Es2 ( const xAOD::CaloCluster & cl)
inline

Definition at line 75 of file egammaMVAFunctions.h.

75{ return cl.energyBE(2); }

◆ compute_rawcl_Es3()

float egammaMVAFunctions::compute_rawcl_Es3 ( const xAOD::CaloCluster & cl)
inline

Definition at line 76 of file egammaMVAFunctions.h.

76{ return cl.energyBE(3); }

◆ compute_rawcl_f0()

float egammaMVAFunctions::compute_rawcl_f0 ( const xAOD::CaloCluster & cl)
inline

Definition at line 96 of file egammaMVAFunctions.h.

96{ return cl.energyBE(0) / (cl.energyBE(1) + cl.energyBE(2) + cl.energyBE(3)); }

◆ getPtAtFirstMeasurement()

float egammaMVAFunctions::getPtAtFirstMeasurement ( const xAOD::TrackParticle * tp)
inline

Definition at line 224 of file egammaMVAFunctions.h.

225 {
226 if (!tp) return 0;
227 for (unsigned int i = 0; i < tp->numberOfParameters(); ++i) {
229 return hypot(tp->parameterPX(i), tp->parameterPY(i));
230 }
231 }
232 return tp->pt();
233 }
float parameterPX(unsigned int index) const
Returns the parameter x momentum component, for 'index'.
float parameterPY(unsigned int index) const
Returns the parameter y momentum component, for 'index'.
xAOD::ParameterPosition parameterPosition(unsigned int index) const
Return the ParameterPosition of the parameters at 'index'.
size_t numberOfParameters() const
Returns the number of additional parameters stored in the TrackParticle.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
@ FirstMeasurement
Parameter defined at the position of the 1st measurement.

◆ initializeClusterFuncs()

void egammaMVAFunctions::initializeClusterFuncs ( funcMap_t & funcLibrary,
const std::string & prefix,
bool useLayerCorrected )

Definition at line 192 of file egammaMVAFunctions.cxx.

195 {
196
197 funcLibrary[prefix + "_cl_eta"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
198 { return compute_cl_eta(*cl); };
199 funcLibrary[prefix + "_cl_phi"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
200 { return compute_cl_phi(*cl); };
201 funcLibrary[prefix + "_cl_E"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
202 { return compute_cl_e(*cl); };
203 funcLibrary[prefix + "_cl_etaCalo"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
204 { return compute_cl_etaCalo(*cl); };
205 funcLibrary[prefix + "_cl_phiCalo"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
206 { return compute_cl_phiCalo(*cl); };
207 funcLibrary[prefix + "_cl_E_TileGap3"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
208 { return cl->eSample(CaloSampling::TileGap3); };
209
210 funcLibrary[prefix + "_cellIndexCalo"] = funcLibrary["cellIndexCalo"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
211 { return std::floor(std::abs(compute_cl_etaCalo(*cl))/0.025); };
212 funcLibrary[prefix + "_phiModCalo"] = funcLibrary["phiModCalo"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
213 { return ((abs(compute_cl_eta(*cl)) < 1.425) ?
214 std::fmod(compute_cl_phiCalo(*cl), TMath::Pi() / 512) :
215 std::fmod(compute_cl_phiCalo(*cl), TMath::Pi() / 384));
216 };
217
218 // improved version of phiModCalo, proposed by G. Unal, studied by L. Nasella
219 // see https://its.cern.ch/jira/browse/ATLASEG-325
220 // see https://indico.cern.ch/event/1364593/contributions/5843081/
221 funcLibrary[prefix + "_phiModCalo1"] = funcLibrary["phiModCalo1"] =
222 [](const xAOD::Egamma*, const xAOD::CaloCluster* cl) {
223 using std::numbers::pi;
224 const double eta = compute_cl_eta(*cl);
225 const double phi = compute_cl_phiCalo(*cl);
226 const double pi_divisor = std::abs(eta) < 1.425 ? 512. : 384.;
227
228 if (eta > 0.) {
229 if (phi > 0.) return std::fmod(phi, pi / pi_divisor);
230 else return std::fmod((2 * pi + phi), pi / pi_divisor);
231 }
232 else return std::fmod((pi - phi), pi / pi_divisor);
233 };
234
235 funcLibrary[prefix + "_phiModCell"] = funcLibrary["phiModCell"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
236 { return std::fmod(std::abs(compute_cl_phiCalo(*cl)), TMath::Pi() / 128); };
237 funcLibrary[prefix + "_etaModCalo"] = funcLibrary["etaModCalo"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
238 { return std::fmod(std::abs(compute_cl_etaCalo(*cl)), 0.025); };
239 funcLibrary["abs(" + prefix + "_cl_eta)"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
240 { return std::abs(compute_cl_eta(*cl)); };
241 funcLibrary[prefix + "_dPhiTG3"] = funcLibrary["dPhiTG3"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
242 { return std::fmod(2.*TMath::Pi()+compute_cl_phi(*cl),TMath::Pi()/32.)-TMath::Pi()/64.0; };
243
244 if (useLayerCorrected) {
245 funcLibrary[prefix + "_rawcl_Es0"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
246 { return compute_correctedcl_Es0(*cl); };
247 funcLibrary[prefix + "_rawcl_Es1"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
248 { return compute_correctedcl_Es1(*cl); };
249 funcLibrary[prefix + "_rawcl_Es2"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
250 { return compute_correctedcl_Es2(*cl); };
251 funcLibrary[prefix + "_rawcl_Es3"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
252 { return compute_correctedcl_Es3(*cl); };
253 funcLibrary[prefix + "_rawcl_Eacc"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
254 { return compute_correctedcl_Eacc(*cl); };
255 funcLibrary[prefix + "_rawcl_f0"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
256 { return compute_correctedcl_f0(*cl); };
257 funcLibrary[prefix + "_rawcl_calibHitsShowerDepth"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
259 funcLibrary[prefix + "_R12"] = funcLibrary["R12"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
261 funcLibrary[prefix + "_fTG3"] = funcLibrary["fTG3"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
262 { return cl->eSample(CaloSampling::TileGap3)/compute_correctedcl_Eacc(*cl); };
263 } else {
264 funcLibrary[prefix + "_rawcl_Es0"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
265 { return compute_rawcl_Es0(*cl); };
266 funcLibrary[prefix + "_rawcl_Es1"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
267 { return compute_rawcl_Es1(*cl); };
268 funcLibrary[prefix + "_rawcl_Es2"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
269 { return compute_rawcl_Es2(*cl); };
270 funcLibrary[prefix + "_rawcl_Es3"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
271 { return compute_rawcl_Es3(*cl); };
272 funcLibrary[prefix + "_rawcl_Eacc"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
273 { return compute_rawcl_Eacc(*cl); };
274 funcLibrary[prefix + "_rawcl_f0"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
275 { return compute_rawcl_f0(*cl); };
276 funcLibrary[prefix + "_rawcl_calibHitsShowerDepth"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
277 { return compute_rawcl_calibHitsShowerDepth(*cl); };
278 funcLibrary[prefix + "_R12"] = funcLibrary["R12"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
279 { return compute_rawcl_Es1(*cl)/compute_rawcl_Es2(*cl); };
280 funcLibrary[prefix + "_fTG3"] = funcLibrary["fTG3"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
281 { return cl->eSample(CaloSampling::TileGap3)/compute_rawcl_Eacc(*cl); };
282 }
283 }
Scalar phi() const
phi method
#define pi
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
float compute_rawcl_calibHitsShowerDepth(const xAOD::CaloCluster &cl)
float compute_correctedcl_f0(const xAOD::CaloCluster &cl)
float compute_cl_phiCalo(const xAOD::CaloCluster &cluster)
float compute_cl_phi(const xAOD::CaloCluster &cluster)
float compute_rawcl_Eacc(const xAOD::CaloCluster &cl)
float compute_cl_etaCalo(const xAOD::CaloCluster &cluster)
float compute_cl_e(const xAOD::CaloCluster &cluster)
float compute_correctedcl_calibHitsShowerDepth(const xAOD::CaloCluster &cl)
float compute_rawcl_f0(const xAOD::CaloCluster &cl)

◆ initializeConvertedPhotonFuncs()

std::unique_ptr< funcMap_t > egammaMVAFunctions::initializeConvertedPhotonFuncs ( bool useLayerCorrected)

A function to build the map for converted photons.

Definition at line 73 of file egammaMVAFunctions.cxx.

74 {
75 auto funcLibraryPtr = std::make_unique<funcMap_t>();
76 funcMap_t& funcLibrary = *funcLibraryPtr;
77
78 initializeClusterFuncs(funcLibrary, "ph", useLayerCorrected);
79 initializeEgammaFuncs(funcLibrary, "ph", useLayerCorrected);
80
81
82 funcLibrary["ph_Rconv"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)->float
83 { return xAOD::EgammaHelpers::conversionRadius(static_cast<const xAOD::Photon*>(eg)); };
84
85 funcLibrary["ph_convR"] = funcLibrary["convR"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)->float
86 {
87 const auto *ph = static_cast<const xAOD::Photon*>(eg);
88 if (compute_ptconv(ph) > 3*GeV) {
90 }
91 return 799.0;
92
93 };
94 funcLibrary["ph_zconv"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
95 {
96 const auto *vertex = static_cast<const xAOD::Photon*>(eg)->vertex();
97 return vertex ? vertex->position().z() : 9999;
98 };
99 funcLibrary["ph_pt1conv"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)->float
100 { return compute_pt1conv(static_cast<const xAOD::Photon*>(eg)); };
101 funcLibrary["ph_pt2conv"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)->float
102 { return compute_pt2conv(static_cast<const xAOD::Photon*>(eg)); };
103 funcLibrary["ph_ptconv"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
104 { return compute_ptconv(static_cast<const xAOD::Photon*>(eg)); };
105
106 funcLibrary["ph_convPtRatio"] = funcLibrary["convPtRatio"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)->float
107 {
108 const auto *ph = static_cast<const xAOD::Photon*>(eg);
110 auto pt1 = compute_pt1conv(ph);
111 auto pt2 = compute_pt2conv(ph);
112 auto denom = pt1+pt2;
113 if (denom == 0.)[[unlikely]] return std::numeric_limits<float>::max();
114 return std::max(pt1, pt2)/denom;
115 }
116 return 1.0f;
117 };
118
119 if (useLayerCorrected) {
120 funcLibrary["ph_convEtOverPt"] = funcLibrary["convEtOverPt"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*cl)->float
121 {
122 const auto *ph = static_cast<const xAOD::Photon*>(eg);
123
124 float rv = 0.0;
126 auto denom = std::cosh(compute_cl_eta(*cl))*compute_ptconv(ph);
127 if (denom == 0.f)[[unlikely]] rv = std::numeric_limits<float>::max();
128 else rv = std::max(0.0f, compute_correctedcl_Eacc(*cl)/denom);
129 }
130 return std::min(rv, 2.0f);
131 };
132 } else {
133 funcLibrary["ph_convEtOverPt"] = funcLibrary["convEtOverPt"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*cl)->float
134 {
135 const auto *ph = static_cast<const xAOD::Photon*>(eg);
136
137 float rv = 0.0;
139 auto denom = (std::cosh(compute_cl_eta(*cl))*compute_ptconv(ph));
140 if (denom == 0.f)[[unlikely]] rv = std::numeric_limits<float>::max();
141 else rv = std::max(0.0f, compute_rawcl_Eacc(*cl)/denom);
142 }
143 return std::min(rv, 2.0f);
144 };
145 }
146
147 return funcLibraryPtr;
148 }
float compute_ptconv(const xAOD::Photon *ph)
This ptconv is the old one used by MVACalib.
float compute_pt2conv(const xAOD::Photon *ph)
std::unordered_map< std::string, std::function< float(const xAOD::Egamma *, const xAOD::CaloCluster *)> > funcMap_t
Define the map type since it's long.
void initializeEgammaFuncs(funcMap_t &funcLibrary, const std::string &prefix, bool useLayerCorrected)
float compute_pt1conv(const xAOD::Photon *ph)
void initializeClusterFuncs(funcMap_t &funcLibrary, const std::string &prefix, bool useLayerCorrected)
std::size_t numberOfSiTracks(const xAOD::Photon *eg)
return the number of Si tracks in the conversion
float conversionRadius(const xAOD::Vertex *vx)
return the conversion radius or 9999.
Photon_v1 Photon
Definition of the current "egamma version".
#define unlikely(x)

◆ initializeEgammaFuncs()

void egammaMVAFunctions::initializeEgammaFuncs ( funcMap_t & funcLibrary,
const std::string & prefix,
bool useLayerCorrected )

Definition at line 287 of file egammaMVAFunctions.cxx.

290 {
291 funcLibrary[prefix + "_e011"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
293 funcLibrary[prefix + "_e033"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
295 funcLibrary[prefix + "_e132"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
297 funcLibrary[prefix + "_e1152"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
299 funcLibrary[prefix + "_ethad1"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
301 funcLibrary[prefix + "_ethad"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
303 funcLibrary[prefix + "_f1"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
305 funcLibrary[prefix + "_f3"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
307 funcLibrary[prefix + "_f1core"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
309 funcLibrary[prefix + "_f3core"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
311 funcLibrary[prefix + "_e233"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
313 funcLibrary[prefix + "_e235"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
315 funcLibrary[prefix + "_e255"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
317 funcLibrary[prefix + "_e237"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
319 funcLibrary[prefix + "_e277"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
321 funcLibrary[prefix + "_e333"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
323 funcLibrary[prefix + "_e335"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
325 funcLibrary[prefix + "_e337"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
327 funcLibrary[prefix + "_e377"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
329 funcLibrary[prefix + "_weta1"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
331 funcLibrary[prefix + "_weta2"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
333 funcLibrary[prefix + "_e2ts1"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
335 funcLibrary[prefix + "_e2tsts1"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
337 funcLibrary[prefix + "_fracs1"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
339 funcLibrary[prefix + "_widths1"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
341 funcLibrary[prefix + "_widths2"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
343 funcLibrary[prefix + "_poscs1"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
345 funcLibrary[prefix + "_poscs2"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
347 funcLibrary[prefix + "_asy1"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
349 funcLibrary[prefix + "_pos"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
351 funcLibrary[prefix + "_pos7"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
353 funcLibrary[prefix + "_barys1"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
355 funcLibrary[prefix + "_wtots1"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
357 funcLibrary[prefix + "_emins1"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
359 funcLibrary[prefix + "_emaxs1"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
361 funcLibrary[prefix + "_r33over37allcalo"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
363 funcLibrary[prefix + "_ecore"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
365 funcLibrary[prefix + "_Reta"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
367 funcLibrary[prefix + "_Rphi"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
369 funcLibrary[prefix + "_Eratio"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
371 funcLibrary[prefix + "_Rhad"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
373 funcLibrary[prefix + "_Rhad1"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
375 funcLibrary[prefix + "_DeltaE"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
377
378 }
bool showerShapeValue(float &value, const EgammaParameters::ShowerShapeType information) const
Accessor for ShowerShape values.
@ e235
uncalibrated energy (sum of cells) of the middle sampling in a rectangle of size 3x5
Definition EgammaEnums.h:72
@ e337
uncalibrated energy (sum of cells) of the third sampling in a rectangle of size 3x7
Definition EgammaEnums.h:90
@ wtots1
shower width is determined in a window detaxdphi = 0,0625 ×~0,2, corresponding typically to 20 strips...
@ pos7
Difference between the track and the shower positions: sum_{i=i_m-7}^{i=i_m+7}E_i x (i-i_m) / sum_{i=...
@ f3core
E3(3x3)/E fraction of the energy reconstructed in the third compartment of the electromagnetic calori...
Definition EgammaEnums.h:66
@ ethad1
transverse energy in the first sampling of the hadronic calorimeters behind the cluster calculated fr...
Definition EgammaEnums.h:43
@ e277
uncalibrated energy (sum of cells) of the middle sampling in a rectangle of size 7x7
Definition EgammaEnums.h:81
@ e237
uncalibrated energy (sum of cells) of the middle sampling in a rectangle of size 3x7
Definition EgammaEnums.h:78
@ ethad
ET leakage into hadronic calorimeter with exclusion of energy in CaloSampling::TileGap3.
Definition EgammaEnums.h:46
@ e1152
uncalibrated energy (sum of cells) in strips in a 15x2 window in cells in eta X phi
Definition EgammaEnums.h:40
@ f3
fraction of energy reconstructed in 3rd sampling
Definition EgammaEnums.h:55
@ poscs2
relative position in eta within cell in 2nd sampling
@ ecore
core energy in em calo E(core) = E0(3x3) + E1(15x2) + E2(5x5) + E3(3x5)
@ f1
E1/E = fraction of energy reconstructed in the first sampling, where E1 is energy in all strips belon...
Definition EgammaEnums.h:53
@ pos
difference between shower cell and predicted track in +/- 1 cells
@ widths2
same as egammaParameters::weta2 but without corrections on particle impact point inside the cell
@ e2ts1
2nd max in strips calc by summing 3 strips
@ poscs1
relative position in eta within cell in 1st sampling
@ Eratio
(emaxs1-e2tsts1)/(emaxs1+e2tsts1)
@ e335
uncalibrated energy (sum of cells) of the third sampling in a rectangle of size 3x5
Definition EgammaEnums.h:87
@ e377
uncalibrated energy (sum of cells) of the middle sampling in a rectangle of size 7x7
Definition EgammaEnums.h:93
@ e333
uncalibrated energy (sum of cells) of the third sampling in a rectangle of size 3x3
Definition EgammaEnums.h:84
@ emaxs1
energy of strip with maximal energy deposit
@ e255
uncalibrated energy (sum of cells) of the middle sampling in a rectangle of size 5x5
Definition EgammaEnums.h:75
@ DeltaE
e2tsts1-emins1
@ barys1
barycentre in sampling 1 calculated in 3 strips
@ e233
uncalibrated energy (sum of cells) of the middle sampling in a rectangle of size 3x3 (in cell units e...
Definition EgammaEnums.h:69
@ asy1
uncorr asymmetry in 3 strips in the 1st sampling
@ e033
uncalibrated energy (sum of cells) in presampler in a 3x3 window in cells in eta X phi
Definition EgammaEnums.h:34
@ e132
uncalibrated energy (sum of cells) in strips in a 3x2 window in cells in eta X phi
Definition EgammaEnums.h:37
@ fracs1
shower shape in the shower core : [E(+/-3)-E(+/-1)]/E(+/-1), where E(+/-n) is the energy in ± n strip...
@ r33over37allcalo
1-ratio of energy in 3x3 over 3x7 cells; E(3x3) = E0(1x1) + E1(3x1) + E2(3x3) + E3(3x3); E(3x7) = E0(...
@ weta2
the lateral width is calculated with a window of 3x5 cells using the energy weighted sum over all cel...
@ e011
uncalibrated energy (sum of cells) in presampler in a 1x1 window in cells in eta X phi
Definition EgammaEnums.h:31
@ weta1
shower width using +/-3 strips around the one with the maximal energy deposit: w3 strips = sqrt{sum(E...
Definition EgammaEnums.h:98
@ e2tsts1
energy of the cell corresponding to second energy maximum in the first sampling
@ emins1
energy reconstructed in the strip with the minimal value between the first and second maximum
@ widths1
same as egammaParameters::weta1 but without corrections on particle impact point inside the cell
@ f1core
E1(3x1)/E = fraction of the energy reconstructed in the first longitudinal compartment of the electro...
Definition EgammaEnums.h:61

◆ initializeElectronFuncs()

std::unique_ptr< funcMap_t > egammaMVAFunctions::initializeElectronFuncs ( bool useLayerCorrected)

A function to build the map for electrons.

Definition at line 35 of file egammaMVAFunctions.cxx.

36 {
37 // rel21 uses a naming version of some variables without prefix, keep both for compatibility
38 auto funcLibraryPtr = std::make_unique<funcMap_t>();
39 funcMap_t& funcLibrary = *funcLibraryPtr;
40
41 initializeClusterFuncs(funcLibrary, "el", useLayerCorrected);
42 initializeEgammaFuncs(funcLibrary, "el", useLayerCorrected);
43
44 // specific functions only for electrons
45 funcLibrary["el_charge"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
46 { return compute_el_charge(*(static_cast<const xAOD::Electron*>(eg))); };
47 funcLibrary["el_tracketa"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
48 { return compute_el_tracketa(*(static_cast<const xAOD::Electron*>(eg))); };
49 funcLibrary["el_trackpt"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
50 { return compute_el_trackpt(*(static_cast<const xAOD::Electron*>(eg))); };
51 funcLibrary["el_trackz0"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
52 { return compute_el_trackz0(*(static_cast<const xAOD::Electron*>(eg))); };
53 funcLibrary["el_refittedTrack_qoverp"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
54 { return compute_el_refittedTrack_qoverp(*(static_cast<const xAOD::Electron*>(eg))); };
55
56 return funcLibraryPtr;
57 }
float compute_el_charge(const xAOD::Electron &el)
float compute_el_trackpt(const xAOD::Electron &el)
float compute_el_tracketa(const xAOD::Electron &el)
float compute_el_refittedTrack_qoverp(const xAOD::Electron &el)
float compute_el_trackz0(const xAOD::Electron &el)
Electron_v1 Electron
Definition of the current "egamma version".

◆ initializeForwardElectronFuncs()

std::unique_ptr< funcMap_t > egammaMVAFunctions::initializeForwardElectronFuncs ( bool useLayerCorrected)

NEW: A function to build the map for forward electrons.

Definition at line 150 of file egammaMVAFunctions.cxx.

150 {
151 auto funcLibraryPtr = std::make_unique<funcMap_t>();
152 funcMap_t& funcLibrary = *funcLibraryPtr;
153
154 funcLibrary["el_cl_e"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
155 { return compute_cl_e(*cl); };
156 funcLibrary["abs_el_cl_eta"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
157 { return std::abs(compute_cl_eta(*cl)); };
158 funcLibrary["etaModCalo"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
159 { return (std::abs(cl->eta()) < 3.15 ? compute_etaMod_EMEC(*cl) : compute_etaMod_FCAL(*cl)); };
160 funcLibrary["cellIndex"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
161 { return (std::abs(cl->eta()) < 3.15 ? compute_cellIndex_EMEC(*cl) : compute_cellIndex_FCAL(*cl)); };
162 funcLibrary["el_cl_phi"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
163 { return compute_cl_phi(*cl); };
164 funcLibrary["phiMod2pi32"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
165 { return compute_phiMod_EMEC(*cl); };
166 if (useLayerCorrected) {
167 funcLibrary["el_cl_secondR"] = [](const xAOD::Egamma* eg, const xAOD::CaloCluster*)
168 { return compute_cl_secondR_fudge(*eg); };
169 } else {
170 funcLibrary["el_cl_secondR"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
171 { return compute_cl_secondR(*cl); };
172 }
173 funcLibrary["Es1Es2Ratio"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
174 { return compute_R12_EMEC(*cl); };
175 funcLibrary["el_cl_centerX"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
176 { return compute_cl_x(*cl); };
177 funcLibrary["el_cl_centerY"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
178 { return compute_cl_y(*cl); };
179 funcLibrary["abs_el_cl_centerZ"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
180 { return std::abs(compute_cl_z(*cl)); };
181 funcLibrary["el_cl_centerLambda"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
182 { return compute_cl_centerLambda(*cl); };
183 funcLibrary["el_cl_secondMoment"] = [](const xAOD::Egamma*, const xAOD::CaloCluster* cl)
184 { return compute_cl_secondDensity(*cl); };
185
186 return funcLibraryPtr;
187 }
float compute_etaMod_FCAL(const xAOD::CaloCluster &cl)
float compute_cellIndex_EMEC(const xAOD::CaloCluster &cl)
float compute_cl_secondR(const xAOD::CaloCluster &cl)
float compute_cl_centerLambda(const xAOD::CaloCluster &cl)
float compute_cl_secondR_fudge(const xAOD::Egamma &eg)
float compute_cellIndex_FCAL(const xAOD::CaloCluster &cl)
float compute_R12_EMEC(const xAOD::CaloCluster &cl)
float compute_etaMod_EMEC(const xAOD::CaloCluster &cl)
float compute_cl_secondDensity(const xAOD::CaloCluster &cl)
float compute_phiMod_EMEC(const xAOD::CaloCluster &cl)

◆ initializeUnconvertedPhotonFuncs()

std::unique_ptr< funcMap_t > egammaMVAFunctions::initializeUnconvertedPhotonFuncs ( bool useLayerCorrected)

A function to build the map for uncoverted photons.

Definition at line 60 of file egammaMVAFunctions.cxx.

61 {
62 auto funcLibraryPtr = std::make_unique<funcMap_t>();
63 funcMap_t& funcLibrary = *funcLibraryPtr;
64
65 initializeClusterFuncs(funcLibrary, "ph", useLayerCorrected);
66 initializeEgammaFuncs(funcLibrary, "ph", useLayerCorrected);
67
68 return funcLibraryPtr;
69 }