ATLAS Offline Software
egammaMVAFunctions.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef EGAMMAMVACALIB_EGAMMAMVAFUNCTIONS
6 #define EGAMMAMVACALIB_EGAMMAMVAFUNCTIONS
7 
8 #include "xAODEgamma/Egamma.h"
9 #include "xAODEgamma/Electron.h"
10 #include "xAODEgamma/Photon.h"
14 #include "egammaMVALayerDepth.h"
16 
17 #include "TLorentzVector.h"
18 
19 #include <functional>
20 #include <string>
21 #include <unordered_map>
22 #include <cmath>
23 #include <memory>
24 #include <stdexcept>
25 
26 // for the ConversionHelper (deprecated?)
28 
40 // Changing the definition of the functions means breaking backward
41 // compatibility with previous version of the MVA calibrations.
42 
44 {
45  // inline functions to avoid duplicates problem during linking (and performance)
46  // cluster functions
47  // REMEMBER to add the functions using corrected layer energies
48  inline float compute_cl_eta(const xAOD::CaloCluster& cluster) { return cluster.eta(); }
49  inline float compute_cl_phi(const xAOD::CaloCluster& cluster) { return cluster.phi(); }
50  inline float compute_cl_e(const xAOD::CaloCluster& cluster) { return cluster.e(); }
51  inline float compute_cl_etaCalo(const xAOD::CaloCluster& cluster) {
52  double tmp = 0.;
54  throw std::runtime_error("etaCalo not found in CaloCluster object");
55  }
56  return tmp;
57  }
58  inline float compute_cl_phiCalo(const xAOD::CaloCluster& cluster) {
59  double tmp = 0.;
61  throw std::runtime_error("phiCalo not found in CaloCluster object");
62  }
63  return tmp;
64  }
65  inline float compute_cl_etas1(const xAOD::CaloCluster& cluster) { return cluster.etaBE(1); }
66  inline float compute_cl_etas2(const xAOD::CaloCluster& cluster) { return cluster.etaBE(2); }
67  inline float compute_rawcl_Es0(const xAOD::CaloCluster& cl) { return cl.energyBE(0); }
68  /*inline std::function<float(const xAOD::CaloCluster&)> compute_rawcl_Es0_auto(bool use_corrected)
69  {
70  if (use_corrected) return [](const xAOD::CaloCluster& cl) { return cl.energyBE(0); };
71  else return [](const xAOD::CaloCluster& cl) { return cl.energyBE(0); };
72  }*/
73  inline float compute_rawcl_Es1(const xAOD::CaloCluster& cl) { return cl.energyBE(1); }
74  inline float compute_rawcl_Es2(const xAOD::CaloCluster& cl) { return cl.energyBE(2); }
75  inline float compute_rawcl_Es3(const xAOD::CaloCluster& cl) { return cl.energyBE(3); }
76 
78  static const SG::ConstAccessor<double> acc ("correctedcl_Es0");
79  return acc.isAvailable(cl) ? acc(cl) : cl.energyBE(0);
80  }
82  static const SG::ConstAccessor<double> acc ("correctedcl_Es1");
83  return acc.isAvailable(cl) ? acc(cl) : cl.energyBE(1);
84  }
86  static const SG::ConstAccessor<double> acc ("correctedcl_Es2");
87  return acc.isAvailable(cl) ? acc(cl) : cl.energyBE(2);
88  }
90  static const SG::ConstAccessor<double> acc ("correctedcl_Es3");
91  return acc.isAvailable(cl) ? acc(cl) : cl.energyBE(3);
92  }
93 
94  inline float compute_rawcl_Eacc(const xAOD::CaloCluster& cl) { return cl.energyBE(1) + cl.energyBE(2) + cl.energyBE(3); }
95  inline float compute_rawcl_f0(const xAOD::CaloCluster& cl) { return cl.energyBE(0) / (cl.energyBE(1) + cl.energyBE(2) + cl.energyBE(3)); }
96 
99 
100 
101  inline float compute_calibHitsShowerDepth(const std::array<float, 4>& cl, float eta)
102  {
103  const float denominator = cl[0] + cl[1] + cl[2] + cl[3];
104  if (denominator == 0) return 0.;
105 
106  const std::array<float, 4> radius(get_MVAradius(eta));
107 
108  // loop unrolling
109  return (radius[0] * cl[0]
110  + radius[1] * cl[1]
111  + radius[2] * cl[2]
112  + radius[3] * cl[3]) / denominator;
113  }
114 
116  {
117  const std::array<float, 4> cluster_array {{ compute_rawcl_Es0(cl),
120  compute_rawcl_Es3(cl) }};
121  return compute_calibHitsShowerDepth(cluster_array, compute_cl_eta(cl));
122  }
123 
125  const std::array<float, 4> cluster_array {{ compute_correctedcl_Es0(cl),
129  return compute_calibHitsShowerDepth(cluster_array, compute_cl_eta(cl));
130  }
131 
132  // ------------------------------------------------------------------
133  // Forward-electron getters
134  // ------------------------------------------------------------------
135 
136  inline float compute_et(const xAOD::CaloCluster& cl) {
137  const float e = cl.e();
138  const float eta = cl.eta();
139  const float c = std::cosh(eta);
140  return (c != 0.f) ? (e / c) : 0.f;
141  }
142  // be 100% sure what variables the FE BDT should use. For the run 2
143  inline float cl_getMoment(const xAOD::CaloCluster& cl,
145  const char* name) {
146  double tmp = 0.;
147  if (!cl.retrieveMoment(m, tmp)) {
148  throw std::runtime_error(std::string("Forward-electron missing moment: ") + name);
149  }
150  return static_cast<float>(tmp);
151  }
152 
155  inline float compute_cl_lateral (const xAOD::CaloCluster& cl){ return cl_getMoment(cl, xAOD::CaloCluster::LATERAL , "LATERAL"); }
157  inline float compute_cl_fracMax (const xAOD::CaloCluster& cl){ return cl_getMoment(cl, xAOD::CaloCluster::ENG_FRAC_MAX , "ENG_FRAC_MAX"); }
158 
159  inline float compute_cl_secondR (const xAOD::CaloCluster& cl){ return cl_getMoment(cl, xAOD::CaloCluster::SECOND_R , "SECOND_R"); }
162  inline float compute_cl_x (const xAOD::CaloCluster& cl){ return cl_getMoment(cl, xAOD::CaloCluster::CENTER_X , "CENTER_X"); }
163  inline float compute_cl_y (const xAOD::CaloCluster& cl){ return cl_getMoment(cl, xAOD::CaloCluster::CENTER_Y , "CENTER_Y"); }
164  inline float compute_cl_z (const xAOD::CaloCluster& cl){ return cl_getMoment(cl, xAOD::CaloCluster::CENTER_Z , "CENTER_Z"); }
165 
166  inline float compute_cl_secondR_fudge(const xAOD::Egamma& eg) {
167  static const SG::AuxElement::Accessor<float> accR2("SECOND_R");
168  if (accR2.isAvailable(eg)) { return accR2(eg); }
169  return -1.;
170  }
171 
172  inline float compute_eta_FCAL(const xAOD::CaloCluster& cl){
173  float x = compute_cl_x(cl);
174  float y = compute_cl_y(cl);
175  float z = compute_cl_z(cl);
176  float theta = std::acos(z/std::sqrt(x*x+y*y+z*z));
177  return -std::log(std::tan(theta/2.));
178  }
180  return std::fmod(std::abs(compute_eta_FCAL(cl)),0.15);
181  }
183  return std::floor(std::abs(compute_eta_FCAL(cl))/0.15);
184  }
186  return std::fmod(std::abs(cl.eta()),0.1);
187  }
189  return std::floor(std::abs(cl.eta())/0.1);
190  }
192  static const float cz = std::numbers::pi/16.;
193  float phi_mod = std::fmod(cl.phi(), cz);
194  if (phi_mod < 0) phi_mod += cz;
195  return phi_mod;
196  }
197  inline float compute_R12_EMEC(const xAOD::CaloCluster& cl){
198  return float(cl.energy_max(CaloSampling::EME1)/cl.energy_max(CaloSampling::EME2));
199  }
200 
201  // electron functions
202  inline float compute_el_charge(const xAOD::Electron& el) { return el.charge(); }
203  inline float compute_el_tracketa(const xAOD::Electron& el) { return el.trackParticle()->eta(); }
204  inline float compute_el_trackpt(const xAOD::Electron& el) { return el.trackParticle()->pt(); }
205  inline float compute_el_trackz0(const xAOD::Electron& el) { return el.trackParticle()->z0(); }
206  inline float compute_el_refittedTrack_qoverp(const xAOD::Electron& el) { return el.trackParticle()->qOverP(); }
207  inline int compute_el_author(const xAOD::Electron& el) {
208  static const SG::ConstAccessor<unsigned short int> acc ("author");
209  return acc (el);
210  }
211 
212  // photon functions
213  inline int compute_ph_convFlag(const xAOD::Photon& ph) {
214  const auto original = xAOD::EgammaHelpers::conversionType(&ph);
215  if (original == 3) return 2;
216  else if (original != 0) return 1;
217  else return original;
218  }
219 
220  // a utility function
222  {
223  if (!tp) return 0;
224  for (unsigned int i = 0; i < tp->numberOfParameters(); ++i) {
225  if (tp->parameterPosition(i) == xAOD::FirstMeasurement) {
226  return hypot(tp->parameterPX(i), tp->parameterPY(i));
227  }
228  }
229  return tp->pt();
230  }
231 
232  // define a few without using conversion helper
233 
235  inline float compute_ptconv_decor(const xAOD::Photon* ph)
236  {
237  static const SG::AuxElement::Accessor<float> accPx("px");
238  static const SG::AuxElement::Accessor<float> accPy("py");
239 
240  auto vx = ph->vertex();
241  return vx ? std::hypot(accPx(*vx), accPy(*vx)) : 0.0;
242  }
243 
245  inline float compute_ptconv(const xAOD::Photon* ph)
246  {
247  auto vx = ph->vertex();
248  if (!vx) return 0.0;
249 
250  TLorentzVector sum;
251  if (vx->trackParticle(0)) sum += vx->trackParticle(0)->p4();
252  if (vx->trackParticle(1)) sum += vx->trackParticle(1)->p4();
253  return sum.Perp();
254  }
255 
256  inline float compute_pt1conv(const xAOD::Photon* ph)
257  {
258  static const SG::AuxElement::Accessor<float> accPt1("pt1");
259 
260  const xAOD::Vertex* vx = ph->vertex();
261  if (!vx) return 0.0;
262  if (accPt1.isAvailable(*vx)) {
263  return accPt1(*vx);
264  } else {
265  return getPtAtFirstMeasurement(vx->trackParticle(0));
266  }
267  }
268 
269  inline float compute_pt2conv(const xAOD::Photon* ph)
270  {
271  static const SG::AuxElement::Accessor<float> accPt2("pt2");
272 
273  const xAOD::Vertex* vx = ph->vertex();
274  if (!vx) return 0.0;
275  if (accPt2.isAvailable(*vx)) {
276  return accPt2(*vx);
277  } else {
278  return getPtAtFirstMeasurement(vx->trackParticle(1));
279  }
280  }
281 
282  // using template to avoid rewriting code for 1st, 2nd track and
283  // for all the summary types
284  template<int itrack, xAOD::SummaryType summary>
285  inline int compute_convtrkXhits(const xAOD::Photon* ph) {
286  const auto vx = ph->vertex();
287  if (!vx) return 0.;
288 
289  if (vx->trackParticle(0)) {
290  uint8_t hits;
291  if (vx->trackParticle(itrack)->summaryValue(hits, summary)) {
292  return hits;
293  }
294  }
295  return 0.;
296  }
297 
298  inline int compute_convtrk1nPixHits(const xAOD::Photon* ph) { return compute_convtrkXhits<0, xAOD::numberOfPixelHits>(ph); }
299  inline int compute_convtrk2nPixHits(const xAOD::Photon* ph) { return compute_convtrkXhits<1, xAOD::numberOfPixelHits>(ph); }
300  inline int compute_convtrk1nSCTHits(const xAOD::Photon* ph) { return compute_convtrkXhits<0, xAOD::numberOfSCTHits>(ph); }
301  inline int compute_convtrk2nSCTHits(const xAOD::Photon* ph) { return compute_convtrkXhits<1, xAOD::numberOfSCTHits>(ph); }
302 
303  // The functions to return the dictionaries of functions,
304  // i.e., the variable name to function
305 
307  using funcMap_t = std::unordered_map<std::string,
308  std::function<float(const xAOD::Egamma*, const xAOD::CaloCluster*)> >;
309 
311  std::unique_ptr<funcMap_t> initializeElectronFuncs(bool useLayerCorrected);
312 
314  std::unique_ptr<funcMap_t> initializeUnconvertedPhotonFuncs(bool useLayerCorrected);
315 
317  std::unique_ptr<funcMap_t> initializeConvertedPhotonFuncs(bool useLayerCorrected);
318 
320  std::unique_ptr<funcMap_t> initializeForwardElectronFuncs(bool useLayerCorrected);
321 
325  {
327  : asg::AsgMessaging("ConversionHelper"),
328  m_vertex(ph ? ph->vertex() : nullptr),
329  m_tp0(m_vertex ? m_vertex->trackParticle(0) : nullptr),
330  m_tp1(m_vertex ? m_vertex->trackParticle(1) : nullptr),
331  m_pt1conv(0.), m_pt2conv(0.)
332  {
333 
334  ATH_MSG_DEBUG("init conversion helper");
335  if (!m_vertex) return;
336 
337  static const SG::AuxElement::Accessor<float> accPt1("pt1");
338  static const SG::AuxElement::Accessor<float> accPt2("pt2");
339  if (accPt1.isAvailable(*m_vertex) && accPt2.isAvailable(*m_vertex))
340  {
341  m_pt1conv = accPt1(*m_vertex);
342  m_pt2conv = accPt2(*m_vertex);
343  }
344  else
345  {
346  ATH_MSG_WARNING("pt1/pt2 not available, will approximate from first measurements");
349  }
350  }
351 
353  : ConversionHelper(&ph) { } // delegating constr
354 
355  inline float ph_Rconv() const { return m_vertex ? hypot(m_vertex->position().x(), m_vertex->position().y()) : 0; }
356  inline float ph_zconv() const { return m_vertex ? m_vertex->position().z() : 0.; }
357  inline int ph_convtrk1nPixHits() const {
358  if (!m_tp0) { return 0; }
359  uint8_t hits = 0;
361  else {
362  ATH_MSG_WARNING("cannot read xAOD::numberOfPixelHits");
363  return 0;
364  }
365  }
366  inline int ph_convtrk2nPixHits() const {
367  if (!m_tp1) return 0;
368  uint8_t hits;
370  else {
371  ATH_MSG_WARNING("cannot read xAOD::numberOfPixelHits");
372  return 0;
373  }
374  }
375  inline int ph_convtrk1nSCTHits() const {
376  if (!m_tp0) { return 0; }
377  uint8_t hits;
378  if (m_tp0->summaryValue(hits, xAOD::numberOfSCTHits)) { return hits; }
379  else {
380  ATH_MSG_WARNING("cannot read xAOD::numberOfSCTHits");
381  return 0;
382  }
383  }
384  inline int ph_convtrk2nSCTHits() const {
385  if (!m_tp1) { return 0; }
386  uint8_t hits;
387  if (m_tp1->summaryValue(hits, xAOD::numberOfSCTHits)) { return hits; }
388  else {
389  ATH_MSG_WARNING("cannot read xAOD::numberOfSCTHits");
390  return 0;
391  }
392  }
393  inline float ph_pt1conv() const { return m_pt1conv; }
394  inline float ph_pt2conv() const { return m_pt2conv; }
395  inline float ph_ptconv() const {
396  // TODO: evaluate if move to this new definition, by now keep the previous one
397  // to be consistent with the training
398  // return m_vertex ? xAOD::EgammaHelpers::momentumAtVertex(*m_vertex).perp() : 0.;
399  TLorentzVector sum;
400  if (m_tp0) sum += m_tp0->p4();
401  if (m_tp1) sum += m_tp1->p4();
402  return sum.Perp();
403  }
404  private:
409  };
410 
411 
412 } // end namespace
413 
414 #endif
xAOD::CaloCluster_v1::SECOND_R
@ SECOND_R
Second Moment in .
Definition: CaloCluster_v1.h:126
egammaMVAFunctions::compute_el_trackz0
float compute_el_trackz0(const xAOD::Electron &el)
Definition: egammaMVAFunctions.h:205
egammaMVAFunctions::compute_cl_secondR_fudge
float compute_cl_secondR_fudge(const xAOD::Egamma &eg)
Definition: egammaMVAFunctions.h:166
egammaMVAFunctions::compute_rawcl_Eacc
float compute_rawcl_Eacc(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:94
egammaMVAFunctions::compute_cl_phiCalo
float compute_cl_phiCalo(const xAOD::CaloCluster &cluster)
Definition: egammaMVAFunctions.h:58
xAOD::CaloCluster_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition: CaloCluster_v1.cxx:256
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
egammaMVAFunctions::compute_cl_centerLambda
float compute_cl_centerLambda(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:160
egammaMVAFunctions::funcMap_t
std::unordered_map< std::string, std::function< float(const xAOD::Egamma *, const xAOD::CaloCluster *)> > funcMap_t
Define the map type since it's long.
Definition: egammaMVAFunctions.h:308
egammaMVAFunctions::compute_cl_secondLambda
float compute_cl_secondLambda(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:154
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
egammaMVAFunctions::compute_ph_convFlag
int compute_ph_convFlag(const xAOD::Photon &ph)
Definition: egammaMVAFunctions.h:213
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:553
ParticleTest.eg
eg
Definition: ParticleTest.py:29
egammaMVAFunctions::ConversionHelper::ph_convtrk2nSCTHits
int ph_convtrk2nSCTHits() const
Definition: egammaMVAFunctions.h:384
egammaMVAFunctions::compute_cl_z
float compute_cl_z(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:164
egammaMVAFunctions::compute_phiMod_EMEC
float compute_phiMod_EMEC(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:191
egammaMVAFunctions
These functions are for calculating variables used by the MVA calibration.
Definition: egammaMVAFunctions.h:44
xAOD::CaloCluster_v1::CENTER_X
@ CENTER_X
Cluster Centroid ( )
Definition: CaloCluster_v1.h:134
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
egammaMVAFunctions::ConversionHelper::ph_pt2conv
float ph_pt2conv() const
Definition: egammaMVAFunctions.h:394
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
egammaMVAFunctions::compute_cl_fracMax
float compute_cl_fracMax(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:157
egammaMVAFunctions::ConversionHelper::ph_pt1conv
float ph_pt1conv() const
Definition: egammaMVAFunctions.h:393
egammaMVAFunctions::compute_cl_e
float compute_cl_e(const xAOD::CaloCluster &cluster)
Definition: egammaMVAFunctions.h:50
egammaMVAFunctions::compute_correctedcl_calibHitsShowerDepth
float compute_correctedcl_calibHitsShowerDepth(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:124
egammaMVAFunctions::compute_ptconv
float compute_ptconv(const xAOD::Photon *ph)
This ptconv is the old one used by MVACalib.
Definition: egammaMVAFunctions.h:245
xAOD::TrackParticle_v1::summaryValue
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
Definition: TrackParticle_v1.cxx:666
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:75
egammaMVAFunctions::compute_cl_secondR
float compute_cl_secondR(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:159
egammaMVAFunctions::ConversionHelper::ph_Rconv
float ph_Rconv() const
Definition: egammaMVAFunctions.h:355
asg
Definition: DataHandleTestTool.h:28
egammaMVAFunctions::compute_convtrk1nSCTHits
int compute_convtrk1nSCTHits(const xAOD::Photon *ph)
Definition: egammaMVAFunctions.h:300
egammaMVAFunctions::compute_cl_longitudinal
float compute_cl_longitudinal(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:156
egammaMVAFunctions::compute_convtrk1nPixHits
int compute_convtrk1nPixHits(const xAOD::Photon *ph)
Definition: egammaMVAFunctions.h:298
ParticleTest.tp
tp
Definition: ParticleTest.py:25
xAOD::CaloCluster_v1::CENTER_LAMBDA
@ CENTER_LAMBDA
Shower depth at Cluster Centroid.
Definition: CaloCluster_v1.h:139
asg::AsgMessaging::AsgMessaging
AsgMessaging(const std::string &name)
Constructor with a name.
Definition: AsgMessaging.cxx:17
egammaMVAFunctions::compute_el_trackpt
float compute_el_trackpt(const xAOD::Electron &el)
Definition: egammaMVAFunctions.h:204
egammaMVAFunctions::compute_eta_FCAL
float compute_eta_FCAL(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:172
xAOD::numberOfPixelHits
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
Definition: TrackingPrimitives.h:260
xAOD::Vertex_v1::position
const Amg::Vector3D & position() const
Returns the 3-pos.
xAOD::Egamma_v1
Definition: Egamma_v1.h:56
SG::ConstAccessor< double >
egammaMVAFunctions::compute_cl_eta
float compute_cl_eta(const xAOD::CaloCluster &cluster)
Definition: egammaMVAFunctions.h:48
egammaMVAFunctions::cl_getMoment
float cl_getMoment(const xAOD::CaloCluster &cl, xAOD::CaloCluster::MomentType m, const char *name)
Definition: egammaMVAFunctions.h:143
xAOD::CaloCluster_v1::ENG_FRAC_MAX
@ ENG_FRAC_MAX
Energy fraction of hottest cell.
Definition: CaloCluster_v1.h:143
egammaMVAFunctions::compute_cellIndex_FCAL
float compute_cellIndex_FCAL(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:182
egammaMVAFunctions::getPtAtFirstMeasurement
float getPtAtFirstMeasurement(const xAOD::TrackParticle *tp)
Definition: egammaMVAFunctions.h:221
egammaMVAFunctions::compute_cl_x
float compute_cl_x(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:162
x
#define x
egammaMVAFunctions::compute_cl_secondDensity
float compute_cl_secondDensity(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:161
egammaMVAFunctions::ConversionHelper::m_pt2conv
float m_pt2conv
Definition: egammaMVAFunctions.h:408
egammaMVAFunctions::compute_correctedcl_Es0
float compute_correctedcl_Es0(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:77
pi
#define pi
Definition: TileMuonFitter.cxx:65
xAOD::CaloCluster_v1::SECOND_LAMBDA
@ SECOND_LAMBDA
Second Moment in .
Definition: CaloCluster_v1.h:127
xAOD::CaloCluster_v1::MomentType
MomentType
Enums to identify different moments.
Definition: CaloCluster_v1.h:123
egammaMVAFunctions::compute_et
float compute_et(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:136
xAOD::CaloCluster_v1::CENTER_Z
@ CENTER_Z
Cluster Centroid ( )
Definition: CaloCluster_v1.h:136
AsgMessaging.h
egammaMVAFunctions::ConversionHelper::ph_ptconv
float ph_ptconv() const
Definition: egammaMVAFunctions.h:395
xAOD::CaloCluster_v1::etaBE
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
Definition: CaloCluster_v1.cxx:628
xAOD::TrackParticle_v1::p4
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
Definition: TrackParticle_v1.cxx:122
Egamma.h
xAOD::CaloCluster_v1::SECOND_ENG_DENS
@ SECOND_ENG_DENS
Second Moment in E/V.
Definition: CaloCluster_v1.h:147
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:62
egammaMVAFunctions::initializeConvertedPhotonFuncs
std::unique_ptr< funcMap_t > initializeConvertedPhotonFuncs(bool useLayerCorrected)
A function to build the map for converted photons.
Definition: egammaMVAFunctions.cxx:72
EgammaxAODHelpers.h
egammaMVAFunctions::compute_pt2conv
float compute_pt2conv(const xAOD::Photon *ph)
Definition: egammaMVAFunctions.h:269
egammaMVAFunctions::compute_convtrk2nSCTHits
int compute_convtrk2nSCTHits(const xAOD::Photon *ph)
Definition: egammaMVAFunctions.h:301
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
egammaMVAFunctions::compute_calibHitsShowerDepth
float compute_calibHitsShowerDepth(const std::array< float, 4 > &cl, float eta)
Definition: egammaMVAFunctions.h:101
egammaMVAFunctions::compute_el_tracketa
float compute_el_tracketa(const xAOD::Electron &el)
Definition: egammaMVAFunctions.h:203
egammaMVAFunctions::compute_correctedcl_Es2
float compute_correctedcl_Es2(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:85
xAOD::CaloCluster_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition: CaloCluster_v1.cxx:251
lumiFormat.i
int i
Definition: lumiFormat.py:85
egammaMVAFunctions::ConversionHelper::ph_zconv
float ph_zconv() const
Definition: egammaMVAFunctions.h:356
CaloCluster.h
z
#define z
egammaMVAFunctions::initializeForwardElectronFuncs
std::unique_ptr< funcMap_t > initializeForwardElectronFuncs(bool useLayerCorrected)
NEW: A function to build the map for forward electrons.
Definition: egammaMVAFunctions.cxx:143
egammaMVAFunctions::compute_correctedcl_f0
float compute_correctedcl_f0(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:98
xAOD::FirstMeasurement
@ FirstMeasurement
Parameter defined at the position of the 1st measurement.
Definition: TrackingPrimitives.h:214
Photon.h
egammaMVAFunctions::compute_cl_y
float compute_cl_y(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:163
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
egammaMVAFunctions::ConversionHelper::ConversionHelper
ConversionHelper(const xAOD::Photon *ph)
Definition: egammaMVAFunctions.h:326
egammaMVAFunctions::initializeUnconvertedPhotonFuncs
std::unique_ptr< funcMap_t > initializeUnconvertedPhotonFuncs(bool useLayerCorrected)
A function to build the map for uncoverted photons.
Definition: egammaMVAFunctions.cxx:59
PhotonxAODHelpers.h
constants.EME1
int EME1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:55
egammaMVAFunctions::compute_el_refittedTrack_qoverp
float compute_el_refittedTrack_qoverp(const xAOD::Electron &el)
Definition: egammaMVAFunctions.h:206
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
python.getProblemFolderFromLogs.el
dictionary el
Definition: getProblemFolderFromLogs.py:48
hist_file_dump.f
f
Definition: hist_file_dump.py:140
xAOD::CaloCluster_v1::retrieveMoment
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
Definition: CaloCluster_v1.cxx:662
egammaMVAFunctions::compute_rawcl_Es1
float compute_rawcl_Es1(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:73
egammaMVAFunctions::compute_rawcl_f0
float compute_rawcl_f0(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:95
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
xAOD::Vertex_v1::trackParticle
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
Definition: Vertex_v1.cxx:249
egammaMVAFunctions::compute_cl_etaCalo
float compute_cl_etaCalo(const xAOD::CaloCluster &cluster)
Definition: egammaMVAFunctions.h:51
egammaMVAFunctions::compute_el_author
int compute_el_author(const xAOD::Electron &el)
Definition: egammaMVAFunctions.h:207
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
ReadTripsProbsFromCool.denominator
denominator
Definition: ReadTripsProbsFromCool.py:96
get_MVAradius
std::array< float, 4 > get_MVAradius(float eta)
helper function to compute shower depth
Definition: egammaMVALayerDepth.cxx:10
egammaMVAFunctions::compute_cl_significance
float compute_cl_significance(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:153
egammaMVAFunctions::compute_correctedcl_Eacc
float compute_correctedcl_Eacc(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:97
egammaMVAFunctions::compute_convtrk2nPixHits
int compute_convtrk2nPixHits(const xAOD::Photon *ph)
Definition: egammaMVAFunctions.h:299
egammaMVAFunctions::compute_etaMod_FCAL
float compute_etaMod_FCAL(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:179
egammaMVAFunctions::compute_rawcl_calibHitsShowerDepth
float compute_rawcl_calibHitsShowerDepth(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:115
egammaMVAFunctions::ConversionHelper::m_vertex
const xAOD::Vertex * m_vertex
Definition: egammaMVAFunctions.h:405
egammaMVAFunctions::ConversionHelper::ph_convtrk1nPixHits
int ph_convtrk1nPixHits() const
Definition: egammaMVAFunctions.h:357
egammaMVAFunctions::ConversionHelper::ph_convtrk1nSCTHits
int ph_convtrk1nSCTHits() const
Definition: egammaMVAFunctions.h:375
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
asg::AsgMessaging
Class mimicking the AthMessaging class from the offline software.
Definition: AsgMessaging.h:40
egammaMVAFunctions::ConversionHelper::m_tp0
const xAOD::TrackParticle * m_tp0
Definition: egammaMVAFunctions.h:406
egammaMVAFunctions::ConversionHelper
The ConversionHelper struct is stll used by egammaMVATree in PhysicsAnalysis but not the functions in...
Definition: egammaMVAFunctions.h:325
egammaMVAFunctions::initializeElectronFuncs
std::unique_ptr< funcMap_t > initializeElectronFuncs(bool useLayerCorrected)
A function to build the map for electrons.
Definition: egammaMVAFunctions.cxx:34
xAOD::Electron_v1
Definition: Electron_v1.h:34
xAOD::CaloCluster_v1::PHICALOFRAME
@ PHICALOFRAME
Phi in the calo frame (for egamma)
Definition: CaloCluster_v1.h:191
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
egammaMVAFunctions::compute_R12_EMEC
float compute_R12_EMEC(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:197
egammaMVAFunctions::compute_cellIndex_EMEC
float compute_cellIndex_EMEC(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:188
egammaMVAFunctions::compute_cl_etas2
float compute_cl_etas2(const xAOD::CaloCluster &cluster)
Definition: egammaMVAFunctions.h:66
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
egammaMVAFunctions::compute_cl_phi
float compute_cl_phi(const xAOD::CaloCluster &cluster)
Definition: egammaMVAFunctions.h:49
y
#define y
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
egammaMVAFunctions::ConversionHelper::m_pt1conv
float m_pt1conv
Definition: egammaMVAFunctions.h:408
egammaMVALayerDepth.h
xAOD::Photon_v1
Definition: Photon_v1.h:37
xAOD::CaloCluster_v1::SIGNIFICANCE
@ SIGNIFICANCE
Cluster significance.
Definition: CaloCluster_v1.h:160
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
egammaMVAFunctions::compute_cl_etas1
float compute_cl_etas1(const xAOD::CaloCluster &cluster)
Definition: egammaMVAFunctions.h:65
egammaMVAFunctions::compute_pt1conv
float compute_pt1conv(const xAOD::Photon *ph)
Definition: egammaMVAFunctions.h:256
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
egammaMVAFunctions::compute_etaMod_EMEC
float compute_etaMod_EMEC(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:185
xAOD::EgammaHelpers::conversionType
xAOD::EgammaParameters::ConversionType conversionType(const xAOD::Photon *ph)
return the photon conversion type (see EgammaEnums)
Definition: PhotonxAODHelpers.cxx:21
egammaMVAFunctions::compute_ptconv_decor
float compute_ptconv_decor(const xAOD::Photon *ph)
This ptconv function uses the vertex decorations.
Definition: egammaMVAFunctions.h:235
egammaMVAFunctions::compute_correctedcl_Es3
float compute_correctedcl_Es3(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:89
xAOD::numberOfSCTHits
@ numberOfSCTHits
number of hits in SCT [unit8_t].
Definition: TrackingPrimitives.h:269
xAOD::CaloCluster_v1::LATERAL
@ LATERAL
Normalized lateral moment.
Definition: CaloCluster_v1.h:140
egammaMVAFunctions::compute_convtrkXhits
int compute_convtrkXhits(const xAOD::Photon *ph)
Definition: egammaMVAFunctions.h:285
SG::ConstAccessor< T, AuxAllocator_t< T > >::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Electron.h
egammaMVAFunctions::compute_correctedcl_Es1
float compute_correctedcl_Es1(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:81
egammaMVAFunctions::compute_cl_lateral
float compute_cl_lateral(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:155
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:44
egammaMVAFunctions::compute_rawcl_Es2
float compute_rawcl_Es2(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:74
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
egammaMVAFunctions::ConversionHelper::ConversionHelper
ConversionHelper(const xAOD::Photon &ph)
Definition: egammaMVAFunctions.h:352
egammaMVAFunctions::compute_rawcl_Es3
float compute_rawcl_Es3(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:75
xAOD::CaloCluster_v1::ETACALOFRAME
@ ETACALOFRAME
Eta in the calo frame (for egamma)
Definition: CaloCluster_v1.h:190
xAOD::CaloCluster_v1::LONGITUDINAL
@ LONGITUDINAL
Normalized longitudinal moment.
Definition: CaloCluster_v1.h:141
egammaMVAFunctions::ConversionHelper::m_tp1
const xAOD::TrackParticle * m_tp1
Definition: egammaMVAFunctions.h:407
egammaMVAFunctions::compute_rawcl_Es0
float compute_rawcl_Es0(const xAOD::CaloCluster &cl)
Definition: egammaMVAFunctions.h:67
python.compressB64.c
def c
Definition: compressB64.py:93
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:25
xAOD::Photon_v1::vertex
const xAOD::Vertex * vertex(size_t index=0) const
Pointer to the xAOD::Vertex/es that match the photon candidate.
Definition: Photon_v1.cxx:46
xAOD::CaloCluster_v1::e
virtual double e() const
The total energy of the particle.
Definition: CaloCluster_v1.cxx:265
xAOD::CaloCluster_v1::CENTER_Y
@ CENTER_Y
Cluster Centroid ( )
Definition: CaloCluster_v1.h:135
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56
python.SystemOfUnits.m
float m
Definition: SystemOfUnits.py:106
egammaMVAFunctions::compute_el_charge
float compute_el_charge(const xAOD::Electron &el)
Definition: egammaMVAFunctions.h:202
python.LArMinBiasAlgConfig.float
float
Definition: LArMinBiasAlgConfig.py:65
egammaMVAFunctions::ConversionHelper::ph_convtrk2nPixHits
int ph_convtrk2nPixHits() const
Definition: egammaMVAFunctions.h:366
SCT_Monitoring::summary
@ summary
Definition: SCT_MonitoringNumbers.h:65