Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
egammaEnergyCorrectionTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
9 
10 
11 
18 #include "TF1.h"
19 #include "TFile.h"
20 #include "TGraphErrors.h"
21 #include "TH1.h"
22 #include "TH2.h"
23 #include "TList.h"
24 #include "TSystem.h"
25 #include "TRandom3.h"
27 
28 #include <format>
29 #include <cassert>
30 #include <exception>
31 #include <iomanip>
32 #include <ios>
33 #include <iostream>
34 #include <utility>
35 #include <type_traits> //std::is_pointer
36 #include <cmath> //hypot
37 
38 
39 namespace {
40 double qsum(double x, double y) {
41  return std::hypot(x, y);
42 }
43 
44 template <typename TargetPtr, typename SourcePtr>
45 TargetPtr checked_own_cast(SourcePtr ptr) {
46  // Do we have ptr types
48  "attempt to cast to no ptr object");
50  "attempt to cast from no ptr object");
51 
52  // nullptr input
53  if (!ptr) {
54  throw std::runtime_error(
55  "Attempt to cast from nullptr in egammaEnergyCorrectionTool");
56  }
57 
58  // dynamic_cast and check
59  TargetPtr obj = dynamic_cast<TargetPtr>(ptr);
60  if (not obj) {
61  throw std::runtime_error("failed dynamic cast for " +
62  std::string(ptr->GetName()) +
63  " in egammaEnergyCorrectionTool");
64  }
65 
66  // For most ROOT types we want onwership
67  // TAxis nothing
68  if constexpr (std::is_same_v<TAxis, std::remove_pointer_t<TargetPtr>>) {
69  }
70  // TList SetOwner
71  else if constexpr (std::is_same_v<TList, std::remove_pointer_t<TargetPtr>>) {
72  obj->SetOwner();
73  // mainly TH1,TH2
74  } else {
75  obj->SetDirectory(nullptr);
76  }
77 
78  return obj;
79 }
80 
81 double getValueHistoAt(const TH1& histo, double xvalue,
82  bool use_lastbin_overflow = false,
83  bool use_firstbin_underflow = false,
84  bool use_interpolation = false) {
85  if (use_interpolation) {
86  return histo.Interpolate(xvalue);
87  }
88  else {
89  int bin = histo.FindFixBin(xvalue);
90  if (use_lastbin_overflow and histo.IsBinOverflow(bin)) {
91  bin = histo.GetNbinsX();
92  }
93  if (use_firstbin_underflow and histo.IsBinUnderflow(bin)) {
94  bin = 1;
95  }
96  return histo.GetBinContent(bin);
97  }
98 }
99 
100 double getValueHistAt(const TH2& histo, double xvalue, double yvalue,
101  bool use_lastbin_x_overflow = false,
102  bool use_lastbin_y_overflow = false,
103  bool use_fistbin_x_underflow = false,
104  bool use_firstbin_y_underflow = false,
105  bool use_x_interpolation = false,
106  bool use_y_interpolation = false) {
107  int xbin = histo.GetXaxis()->FindFixBin(xvalue);
108  int nxbins = histo.GetXaxis()->GetNbins();
109  if (use_lastbin_x_overflow and xbin == nxbins + 1) {
110  xbin = nxbins;
111  }
112  if (use_fistbin_x_underflow and xbin == 0) {
113  xbin = 1;
114  }
115  int ybin = histo.GetYaxis()->FindFixBin(yvalue);
116  int nybins = histo.GetYaxis()->GetNbins();
117  if (use_lastbin_y_overflow and ybin == nybins + 1) {
118  ybin = nybins;
119  }
120  if (use_firstbin_y_underflow and ybin == 0) {
121  ybin = 1;
122  }
123 
124  int interpolation = 0b00;
125  if (use_x_interpolation and
126  xvalue > histo.GetXaxis()->GetBinCenter(1) and
127  xvalue < histo.GetXaxis()->GetBinCenter(nxbins)) {
128  interpolation |= 0b01;
129  }
130  if (use_y_interpolation and
131  yvalue > histo.GetYaxis()->GetBinCenter(1) and
132  yvalue < histo.GetYaxis()->GetBinCenter(nybins)) {
133  interpolation |= 0b10;
134  }
135 
136  if (interpolation == 0b00) {
137  return histo.GetBinContent(xbin, ybin);
138  }
139  else if (interpolation == 0b01) {
140  int xbin0, xbin1;
141  if(xvalue<=histo.GetXaxis()->GetBinCenter(xbin)) {
142  xbin0 = xbin - 1;
143  xbin1 = xbin;
144  }
145  else {
146  xbin0 = xbin;
147  xbin1 = xbin + 1;
148  }
149  double x0 = histo.GetXaxis()->GetBinCenter(xbin0);
150  double x1 = histo.GetXaxis()->GetBinCenter(xbin1);
151  double z0 = histo.GetBinContent(xbin0, ybin);
152  double z1 = histo.GetBinContent(xbin1, ybin);
153  return z0 + (xvalue-x0)*((z1-z0)/(x1-x0));
154  }
155  else if (interpolation == 0b10) {
156  int ybin0, ybin1;
157  if(yvalue<=histo.GetYaxis()->GetBinCenter(ybin)) {
158  ybin0 = ybin - 1;
159  ybin1 = ybin;
160  }
161  else {
162  ybin0 = ybin;
163  ybin1 = ybin + 1;
164  }
165  double y0 = histo.GetYaxis()->GetBinCenter(ybin0);
166  double y1 = histo.GetYaxis()->GetBinCenter(ybin1);
167  double z0 = histo.GetBinContent(xbin, ybin0);
168  double z1 = histo.GetBinContent(xbin, ybin1);
169  return z0 + (yvalue-y0)*((z1-z0)/(y1-y0));
170  }
171  else { //0b11
172  return histo.Interpolate(xvalue, yvalue);
173  }
174 }
175 } // end anonymous namespace
176 
177 namespace AtlasRoot {
178 
179 using std::string;
180 
182  : asg::AsgMessaging("egammaEnergyCorrectionTool"),
183  m_rootFileName(
184  PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v37/"
185  "egammaEnergyCorrectionData.root")),
186  m_esmodel(egEnergyCorr::UNDEFINED) {
187 
188  if (m_rootFileName.empty()) {
189  ATH_MSG_FATAL("cannot find configuration file");
190  throw std::runtime_error("cannot find file");
191  }
192 
193  m_begRunNumber = 0;
194  m_endRunNumber = 0;
195 
196  /*
197  * All histogram vectors start empty
198  */
199 
201 
202  // tools
203 
204  m_resolution_tool = nullptr;
205  // m_getMaterialDelta = nullptr;
206  m_e1hg_tool = nullptr;
207 
208  // switches
209 
210  m_use_etaCalo_scales = false;
211 
212  m_applyPSCorrection = true;
213  m_applyS12Correction = true;
214 
215  // special for es2015PRE
218 
219  // special for es2016PRE
221 
222  // espcial for R22 precision
223  m_useL2GainCorrection = false;
224  m_useL2GainInterpolation = false;
225  m_useLeakageCorrection = false;
227 
228  m_use_stat_error_scaling = false;
229  m_initialized = false;
230  m_RunNumber = 0;
231 }
232 
234 
235  // Clean up
236 }
237 
239 
240  ATH_MSG_DEBUG("initialize internal tool");
241 
242  // Load the ROOT filea
243  const std::unique_ptr<char[]> fname(
244  gSystem->ExpandPathName(m_rootFileName.c_str()));
245  std::unique_ptr<TFile> rootFile(TFile::Open(fname.get(), "READ"));
246 
247  if (!rootFile) {
248  ATH_MSG_ERROR("no root file found");
249  return 0;
250  }
251 
252  ATH_MSG_DEBUG("Opening ES model file " << fname.get());
253 
254  // instantiate the resolution parametrization
255  m_getMaterialDelta = std::make_unique<get_MaterialResolutionEffect>();
258  m_getMaterialDelta->setInterpolate(true);
259  }
260 
261  // Energy corrections and systematic uncertainties
263 
264  // Legacy numbers for 2010
267  m_aPSNom.reset(
268  checked_own_cast<TH1*>(rootFile->Get("Scales/es2010/alphaPS_errTot")));
269  m_aS12Nom.reset(
270  checked_own_cast<TH1*>(rootFile->Get("Scales/es2010/alphaS12_errTot")));
271  m_zeeNom.reset(checked_own_cast<TH1*>(
272  rootFile->Get("Scales/es2010/alphaZee_errStat")));
273  m_zeeSyst.reset(checked_own_cast<TH1*>(
274  rootFile->Get("Scales/es2010/alphaZee_errSyst")));
275  m_resNom.reset(checked_own_cast<TH1*>(
276  rootFile->Get("Resolution/es2010/ctZee_errStat")));
277  m_resSyst.reset(checked_own_cast<TH1*>(
278  rootFile->Get("Resolution/es2010/ctZee_errSyst")));
279  m_peakResData.reset(
280  checked_own_cast<TH1*>(rootFile->Get("Resolution/es2010/resZee_Data")));
281  m_peakResMC.reset(
282  checked_own_cast<TH1*>(rootFile->Get("Resolution/es2010/resZee_MC")));
283  m_begRunNumber = 152166;
284  m_endRunNumber = 170482;
285  // mc11c : faulty electron multiple scattering in G4; old geometry
286  // Precise Z scales, systematics otherwise as in 2010
287 
288  } else if (m_esmodel == egEnergyCorr::es2011c) {
290  m_aPSNom.reset(
291  checked_own_cast<TH1*>(rootFile->Get("Scales/es2011c/alphaPS_errTot")));
292  m_aS12Nom.reset(checked_own_cast<TH1*>(
293  rootFile->Get("Scales/es2011c/alphaS12_errTot")));
294  m_zeeNom.reset(checked_own_cast<TH1*>(
295  rootFile->Get("Scales/es2011c/alphaZee_errStat")));
296  m_zeeSyst.reset(checked_own_cast<TH1*>(
297  rootFile->Get("Scales/es2011c/alphaZee_errSyst")));
298  m_resNom.reset(checked_own_cast<TH1*>(
299  rootFile->Get("Resolution/es2011c/ctZee_errStat")));
300  m_resSyst.reset(checked_own_cast<TH1*>(
301  rootFile->Get("Resolution/es2011c/ctZee_errSyst")));
302  m_peakResData.reset(checked_own_cast<TH1*>(
303  rootFile->Get("Resolution/es2011c/resZee_Data")));
304  m_peakResMC.reset(
305  checked_own_cast<TH1*>(rootFile->Get("Resolution/es2011c/resZee_MC")));
306 
307  m_begRunNumber = 177531;
308  m_endRunNumber = 194382;
309 
310  // mc11d : correct MSc in G4; new geometry
311  // Final Run1 calibration scheme
312  } else if (m_esmodel == egEnergyCorr::es2011d ||
316  m_resolution_tool = std::make_unique<eg_resolution>("run1");
317  m_aPSNom.reset(
318  checked_own_cast<TH1*>(rootFile->Get("Scales/es2011d/alphaPS_uncor")));
319  m_daPSCor.reset(
320  checked_own_cast<TH1*>(rootFile->Get("Scales/es2011d/dalphaPS_cor")));
321  m_aS12Nom.reset(
322  checked_own_cast<TH1*>(rootFile->Get("Scales/es2011d/alphaS12_uncor")));
323  m_daS12Cor.reset(
324  checked_own_cast<TH1*>(rootFile->Get("Scales/es2011d/dalphaS12_cor")));
325  m_trkSyst.reset(checked_own_cast<TH1*>(
326  rootFile->Get("Scales/es2011d/momentum_errSyst")));
327 
329 
330  m_zeeNom.reset(checked_own_cast<TH1*>(
331  rootFile->Get("Scales/es2011d/alphaZee_errStat")));
332  m_zeeSyst.reset(checked_own_cast<TH1*>(
333  rootFile->Get("Scales/es2011d/alphaZee_errSyst")));
334  m_resNom.reset(checked_own_cast<TH1*>(
335  rootFile->Get("Resolution/es2011d/ctZee_errStat")));
336  m_resSyst.reset(checked_own_cast<TH1*>(
337  rootFile->Get("Resolution/es2011d/ctZee_errSyst")));
338 
339  } else if (m_esmodel == egEnergyCorr::es2011dMedium) {
340 
341  m_zeeNom.reset(checked_own_cast<TH1*>(
342  rootFile->Get("Scales/es2011dMedium/alphaZee_errStat")));
343  m_zeeSyst.reset(checked_own_cast<TH1*>(
344  rootFile->Get("Scales/es2011dMedium/alphaZee_errSyst")));
345  m_zeePhys.reset(checked_own_cast<TH1*>(
346  rootFile->Get("Scales/es2011dMedium/alphaZee_errPhys")));
347  m_resNom.reset(checked_own_cast<TH1*>(
348  rootFile->Get("Resolution/es2011dMedium/ctZee_errStat")));
349  m_resSyst.reset(checked_own_cast<TH1*>(
350  rootFile->Get("Resolution/es2011dMedium/ctZee_errSyst")));
351 
352  } else if (m_esmodel == egEnergyCorr::es2011dTight) {
353 
354  m_zeeNom.reset(checked_own_cast<TH1*>(
355  rootFile->Get("Scales/es2011dTight/alphaZee_errStat")));
356  m_zeeSyst.reset(checked_own_cast<TH1*>(
357  rootFile->Get("Scales/es2011dTight/alphaZee_errSyst")));
358  m_zeePhys.reset(checked_own_cast<TH1*>(
359  rootFile->Get("Scales/es2011dTight/alphaZee_errPhys")));
360  m_resNom.reset(checked_own_cast<TH1*>(
361  rootFile->Get("Resolution/es2011dTight/ctZee_errStat")));
362  m_resSyst.reset(checked_own_cast<TH1*>(
363  rootFile->Get("Resolution/es2011dTight/ctZee_errSyst")));
364  }
365 
366  m_pedestalL0.reset(checked_own_cast<TH1*>(
367  rootFile->Get("Pedestals/es2011d/pedestals_l0")));
368  m_pedestalL1.reset(checked_own_cast<TH1*>(
369  rootFile->Get("Pedestals/es2011d/pedestals_l1")));
370  m_pedestalL2.reset(checked_own_cast<TH1*>(
371  rootFile->Get("Pedestals/es2011d/pedestals_l2")));
372  m_pedestalL3.reset(checked_own_cast<TH1*>(
373  rootFile->Get("Pedestals/es2011d/pedestals_l3")));
374 
375  m_dX_ID_Nom.reset(
376  checked_own_cast<TH1*>(rootFile->Get("Material/DX0_ConfigA")));
377 
378  m_dX_IPPS_Nom.reset(checked_own_cast<TH1*>(
379  rootFile->Get("Material/Measured/DXerr_IPPS_NewG_errUncor")));
380  m_dX_IPPS_LAr.reset(checked_own_cast<TH1*>(
381  rootFile->Get("Material/Measured/DXerr_IPPS_NewG_errLAr")));
382 
383  m_dX_IPAcc_Nom.reset(checked_own_cast<TH1*>(
384  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errUncor")));
385  m_dX_IPAcc_LAr.reset(checked_own_cast<TH1*>(
386  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errLAr")));
387  m_dX_IPAcc_G4.reset(checked_own_cast<TH1*>(
388  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errG4")));
389  m_dX_IPAcc_GL1.reset(checked_own_cast<TH1*>(
390  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errGL1")));
391 
392  m_dX_PSAcc_Nom.reset(checked_own_cast<TH1*>(
393  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errUncor")));
394  m_dX_PSAcc_LAr.reset(checked_own_cast<TH1*>(
395  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errLAr")));
396  m_dX_PSAcc_G4.reset(checked_own_cast<TH1*>(
397  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errG4")));
398 
399  m_convRadius.reset(checked_own_cast<TH1*>(
400  rootFile->Get("Conversions/es2011d/convRadiusMigrations")));
401  m_convFakeRate.reset(checked_own_cast<TH1*>(
402  rootFile->Get("Conversions/es2011d/convFakeRate")));
403  m_convRecoEfficiency.reset(checked_own_cast<TH1*>(
404  rootFile->Get("Conversions/es2011d/convRecoEfficiency")));
405 
406  m_begRunNumber = 177531;
407  m_endRunNumber = 194382;
408 
409  const std::string gain_filename1 = PathResolverFindCalibFile(
410  "ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
411  const std::string gain_filename2 = PathResolverFindCalibFile(
412  "ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
413  m_gain_tool =
414  std::make_unique<egGain::GainTool>(gain_filename1, gain_filename2);
415 
416  m_e1hg_tool = std::make_unique<e1hg_systematics>(
417  PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/"
418  "e1hg_systematics_histos.root"));
419 
420  // mc12a : crude MSc fix in G4; old geometry
421  // All systematics as in 2010.
422  } else if (m_esmodel == egEnergyCorr::es2012a) {
424  m_aPSNom.reset(
425  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012a/alphaPS_errTot")));
426  m_aS12Nom.reset(checked_own_cast<TH1*>(
427  rootFile->Get("Scales/es2012a/alphaS12_errTot")));
428 
429  m_zeeNom.reset(checked_own_cast<TH1*>(
430  rootFile->Get("Scales/es2012a/alphaZee_errStat")));
431  m_zeeSyst.reset(checked_own_cast<TH1*>(
432  rootFile->Get("Scales/es2012a/alphaZee_errSyst")));
433 
434  m_resNom.reset(checked_own_cast<TH1*>(
435  rootFile->Get("Resolution/es2012a/ctZee_errStat")));
436  m_resSyst.reset(checked_own_cast<TH1*>(
437  rootFile->Get("Resolution/es2012a/ctZee_errSyst")));
438  m_peakResData.reset(checked_own_cast<TH1*>(
439  rootFile->Get("Resolution/es2012a/resZee_Data")));
440  m_peakResMC.reset(
441  checked_own_cast<TH1*>(rootFile->Get("Resolution/es2012a/resZee_MC")));
442 
443  m_begRunNumber = 195847;
444  m_endRunNumber = 219365;
445 
446  // mc12c : correct MSc in G4; new geometry
447  // Final Run1 calibration scheme
448  } else if (m_esmodel == egEnergyCorr::es2012c) {
450  m_resolution_tool = std::make_unique<eg_resolution>("run1");
451 
452  m_aPSNom.reset(
453  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/alphaPS_uncor")));
454  m_daPSCor.reset(
455  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/dalphaPS_cor")));
456  m_aS12Nom.reset(
457  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/alphaS12_uncor")));
458  m_daS12Cor.reset(
459  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/dalphaS12_cor")));
460 
461  m_trkSyst.reset(checked_own_cast<TH1*>(
462  rootFile->Get("Scales/es2012c/momentum_errSyst")));
463 
464  m_zeeNom.reset(checked_own_cast<TH1*>(
465  rootFile->Get("Scales/es2012c/alphaZee_errStat")));
466  m_zeeSyst.reset(checked_own_cast<TH1*>(
467  rootFile->Get("Scales/es2012c/alphaZee_errSyst")));
468 
469  m_resNom.reset(checked_own_cast<TH1*>(
470  rootFile->Get("Resolution/es2012c/ctZee_errStat")));
471  m_resSyst.reset(checked_own_cast<TH1*>(
472  rootFile->Get("Resolution/es2012c/ctZee_errSyst")));
473 
474  m_pedestalL0.reset(checked_own_cast<TH1*>(
475  rootFile->Get("Pedestals/es2012c/pedestals_l0")));
476  m_pedestalL1.reset(checked_own_cast<TH1*>(
477  rootFile->Get("Pedestals/es2012c/pedestals_l1")));
478  m_pedestalL2.reset(checked_own_cast<TH1*>(
479  rootFile->Get("Pedestals/es2012c/pedestals_l2")));
480  m_pedestalL3.reset(checked_own_cast<TH1*>(
481  rootFile->Get("Pedestals/es2012c/pedestals_l3")));
482 
483  m_dX_ID_Nom.reset(
484  checked_own_cast<TH1*>(rootFile->Get("Material/DX0_ConfigA")));
485 
486  m_dX_IPPS_Nom.reset(checked_own_cast<TH1*>(
487  rootFile->Get("Material/Measured/DXerr_IPPS_NewG_errUncor")));
488  m_dX_IPPS_LAr.reset(checked_own_cast<TH1*>(
489  rootFile->Get("Material/Measured/DXerr_IPPS_NewG_errLAr")));
490 
491  m_dX_IPAcc_Nom.reset(checked_own_cast<TH1*>(
492  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errUncor")));
493  m_dX_IPAcc_LAr.reset(checked_own_cast<TH1*>(
494  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errLAr")));
495  m_dX_IPAcc_G4.reset(checked_own_cast<TH1*>(
496  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errG4")));
497  m_dX_IPAcc_GL1.reset(checked_own_cast<TH1*>(
498  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errGL1")));
499 
500  m_dX_PSAcc_Nom.reset(checked_own_cast<TH1*>(
501  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errUncor")));
502  m_dX_PSAcc_LAr.reset(checked_own_cast<TH1*>(
503  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errLAr")));
504  m_dX_PSAcc_G4.reset(checked_own_cast<TH1*>(
505  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errG4")));
506 
507  m_convRadius.reset(checked_own_cast<TH1*>(
508  rootFile->Get("Conversions/es2012c/convRadiusMigrations")));
509  m_convFakeRate.reset(checked_own_cast<TH1*>(
510  rootFile->Get("Conversions/es2012c/convFakeRate")));
511  m_convRecoEfficiency.reset(checked_own_cast<TH1*>(
512  rootFile->Get("Conversions/es2012c/convRecoEfficiency")));
513 
514  m_begRunNumber = 195847;
515  m_endRunNumber = 219365;
516 
517  const std::string gain_filename1 = PathResolverFindCalibFile(
518  "ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
519  const std::string gain_filename2 = PathResolverFindCalibFile(
520  "ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
521  m_gain_tool =
522  std::make_unique<egGain::GainTool>(gain_filename1, gain_filename2);
523 
524  m_e1hg_tool = std::make_unique<e1hg_systematics>(
525  PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/"
526  "e1hg_systematics_histos.root"));
527  } else if (m_esmodel == egEnergyCorr::es2012XX) {
528  m_use_etaCalo_scales = true;
530  m_resolution_tool = std::make_unique<eg_resolution>("run1");
531 
532  m_aPSNom.reset(
533  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/alphaPS_uncor")));
534  m_daPSCor.reset(
535  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/dalphaPS_cor")));
536  m_aS12Nom.reset(
537  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/alphaS12_uncor")));
538  m_daS12Cor.reset(
539  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/dalphaS12_cor")));
540 
541  m_trkSyst.reset(checked_own_cast<TH1*>(
542  rootFile->Get("Scales/es2012c/momentum_errSyst")));
543 
544  m_zeeNom.reset(checked_own_cast<TH1*>(
545  rootFile->Get("Scales/es2015PRE/alphaZee_errStat")));
546  m_zeeSyst.reset(checked_own_cast<TH1*>(
547  rootFile->Get("Scales/es2012c/alphaZee_errSyst")));
548 
549  m_resNom.reset(checked_own_cast<TH1*>(
550  rootFile->Get("Resolution/es2015PRE/ctZee_errStat")));
551  m_resSyst.reset(checked_own_cast<TH1*>(
552  rootFile->Get("Resolution/es2012c/ctZee_errSyst")));
553 
554  m_pedestalL0.reset(checked_own_cast<TH1*>(
555  rootFile->Get("Pedestals/es2012c/pedestals_l0")));
556  m_pedestalL1.reset(checked_own_cast<TH1*>(
557  rootFile->Get("Pedestals/es2012c/pedestals_l1")));
558  m_pedestalL2.reset(checked_own_cast<TH1*>(
559  rootFile->Get("Pedestals/es2012c/pedestals_l2")));
560  m_pedestalL3.reset(checked_own_cast<TH1*>(
561  rootFile->Get("Pedestals/es2012c/pedestals_l3")));
562 
563  m_dX_ID_Nom.reset(
564  checked_own_cast<TH1*>(rootFile->Get("Material/DX0_ConfigA")));
565 
566  m_dX_IPPS_Nom.reset(checked_own_cast<TH1*>(
567  rootFile->Get("Material/Measured/DXerr_IPPS_NewG_errUncor")));
568  m_dX_IPPS_LAr.reset(checked_own_cast<TH1*>(
569  rootFile->Get("Material/Measured/DXerr_IPPS_NewG_errLAr")));
570 
571  m_dX_IPAcc_Nom.reset(checked_own_cast<TH1*>(
572  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errUncor")));
573  m_dX_IPAcc_LAr.reset(checked_own_cast<TH1*>(
574  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errLAr")));
575  m_dX_IPAcc_G4.reset(checked_own_cast<TH1*>(
576  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errG4")));
577  m_dX_IPAcc_GL1.reset(checked_own_cast<TH1*>(
578  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errGL1")));
579 
580  m_dX_PSAcc_Nom.reset(checked_own_cast<TH1*>(
581  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errUncor")));
582  m_dX_PSAcc_LAr.reset(checked_own_cast<TH1*>(
583  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errLAr")));
584  m_dX_PSAcc_G4.reset(checked_own_cast<TH1*>(
585  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errG4")));
586 
587  m_convRadius.reset(checked_own_cast<TH1*>(
588  rootFile->Get("Conversions/es2012c/convRadiusMigrations")));
589  m_convFakeRate.reset(checked_own_cast<TH1*>(
590  rootFile->Get("Conversions/es2012c/convFakeRate")));
591  m_convRecoEfficiency.reset(checked_own_cast<TH1*>(
592  rootFile->Get("Conversions/es2012c/convRecoEfficiency")));
593 
594  m_begRunNumber = 195847;
595  m_endRunNumber = 219365;
596 
597  const std::string gain_filename1 = PathResolverFindCalibFile(
598  "ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
599  const std::string gain_filename2 = PathResolverFindCalibFile(
600  "ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
601  m_gain_tool =
602  std::make_unique<egGain::GainTool>(gain_filename1, gain_filename2);
603 
604  m_e1hg_tool = std::make_unique<e1hg_systematics>(
605  PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/"
606  "e1hg_systematics_histos.root"));
607  } else if (m_esmodel == egEnergyCorr::es2015PRE or
609  m_use_etaCalo_scales = true;
611  m_resolution_tool = std::make_unique<eg_resolution>("run2_pre");
612 
613  m_aPSNom.reset(
614  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/alphaPS_uncor")));
615  m_daPSCor.reset(
616  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/dalphaPS_cor")));
617  m_aS12Nom.reset(
618  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/alphaS12_uncor")));
619  m_daS12Cor.reset(
620  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/dalphaS12_cor")));
621 
622  m_trkSyst.reset(checked_own_cast<TH1*>(
623  rootFile->Get("Scales/es2012c/momentum_errSyst")));
624 
625  m_zeeNom.reset(checked_own_cast<TH1*>(
626  rootFile->Get("Scales/es2015PRE/alphaZee_errStat")));
627  m_zeeSyst.reset(checked_own_cast<TH1*>(
628  rootFile->Get("Scales/es2015PRE/alphaZee_errSyst")));
629  m_uA2MeV_2015_first2weeks_correction.reset(checked_own_cast<TH1*>(
630  rootFile->Get("Scales/es2015PRE/histo_uA2MeV_week12")));
631 
632  m_resNom.reset(checked_own_cast<TH1*>(
633  rootFile->Get("Resolution/es2015PRE/ctZee_errStat")));
634  m_resSyst.reset(checked_own_cast<TH1*>(
635  rootFile->Get("Resolution/es2015PRE/ctZee_errSyst")));
636 
637  m_pedestalL0.reset(checked_own_cast<TH1*>(
638  rootFile->Get("Pedestals/es2012c/pedestals_l0")));
639  m_pedestalL1.reset(checked_own_cast<TH1*>(
640  rootFile->Get("Pedestals/es2012c/pedestals_l1")));
641  m_pedestalL2.reset(checked_own_cast<TH1*>(
642  rootFile->Get("Pedestals/es2012c/pedestals_l2")));
643  m_pedestalL3.reset(checked_own_cast<TH1*>(
644  rootFile->Get("Pedestals/es2012c/pedestals_l3")));
645 
646  m_dX_ID_Nom.reset(
647  checked_own_cast<TH1*>(rootFile->Get("Material/DX0_ConfigA")));
648 
649  m_dX_IPPS_Nom.reset(checked_own_cast<TH1*>(
650  rootFile->Get("Material/Measured/DXerr_IPPS_NewG_errUncor")));
651  m_dX_IPPS_LAr.reset(checked_own_cast<TH1*>(
652  rootFile->Get("Material/Measured/DXerr_IPPS_NewG_errLAr")));
653 
654  m_dX_IPAcc_Nom.reset(checked_own_cast<TH1*>(
655  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errUncor")));
656  m_dX_IPAcc_LAr.reset(checked_own_cast<TH1*>(
657  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errLAr")));
658  m_dX_IPAcc_G4.reset(checked_own_cast<TH1*>(
659  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errG4")));
660  m_dX_IPAcc_GL1.reset(checked_own_cast<TH1*>(
661  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errGL1")));
662 
663  m_dX_PSAcc_Nom.reset(checked_own_cast<TH1*>(
664  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errUncor")));
665  m_dX_PSAcc_LAr.reset(checked_own_cast<TH1*>(
666  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errLAr")));
667  m_dX_PSAcc_G4.reset(checked_own_cast<TH1*>(
668  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errG4")));
669 
670  m_convRadius.reset(checked_own_cast<TH1*>(
671  rootFile->Get("Conversions/es2012c/convRadiusMigrations")));
672  m_convFakeRate.reset(checked_own_cast<TH1*>(
673  rootFile->Get("Conversions/es2012c/convFakeRate")));
674  m_convRecoEfficiency.reset(checked_own_cast<TH1*>(
675  rootFile->Get("Conversions/es2012c/convRecoEfficiency")));
676 
677  m_begRunNumber = 195847;
678  m_endRunNumber = 219365;
679 
680  m_G4OverAFII_resolution_electron.reset(checked_own_cast<TH2*>(
681  rootFile->Get("FastSim/es2015/el_full_fast_resolution")));
682  m_G4OverAFII_resolution_unconverted.reset(checked_own_cast<TH2*>(
683  rootFile->Get("FastSim/es2015/ph_unconv_full_fast_resolution")));
684  m_G4OverAFII_resolution_converted.reset(checked_own_cast<TH2*>(
685  rootFile->Get("FastSim/es2015/ph_conv_full_fast_resolution")));
686 
690 
691  const std::string gain_filename1 = PathResolverFindCalibFile(
692  "ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
693  const std::string gain_filename2 = PathResolverFindCalibFile(
694  "ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
695  m_gain_tool =
696  std::make_unique<egGain::GainTool>(gain_filename1, gain_filename2);
697 
698  m_e1hg_tool = std::make_unique<e1hg_systematics>(
699  PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/"
700  "e1hg_systematics_histos.root"));
703  m_use_etaCalo_scales = true;
705  m_resolution_tool = std::make_unique<eg_resolution>("run2_pre");
706 
707  m_aPSNom.reset(
708  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/alphaPS_uncor")));
709  m_daPSCor.reset(
710  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/dalphaPS_cor")));
711  m_aS12Nom.reset(
712  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/alphaS12_uncor")));
713  m_daS12Cor.reset(
714  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/dalphaS12_cor")));
715 
716  m_trkSyst.reset(checked_own_cast<TH1*>(
717  rootFile->Get("Scales/es2012c/momentum_errSyst")));
718 
719  m_zeeNom.reset(checked_own_cast<TH1*>(
720  rootFile->Get("Scales/es2015PRE/alphaZee_errStat")));
721  m_zeeSyst.reset(checked_own_cast<TH1*>(
722  rootFile->Get("Scales/es2015PRE/alphaZee_errSyst")));
723  m_uA2MeV_2015_first2weeks_correction.reset(checked_own_cast<TH1*>(
724  rootFile->Get("Scales/es2015PRE/histo_uA2MeV_week12")));
725 
726  m_resNom.reset(checked_own_cast<TH1*>(
727  rootFile->Get("Resolution/es2015PRE/ctZee_errStat")));
728  m_resSyst.reset(checked_own_cast<TH1*>(
729  rootFile->Get("Resolution/es2015PRE_res_improved/ctZee_errSyst")));
730 
731  m_pedestalL0.reset(checked_own_cast<TH1*>(
732  rootFile->Get("Pedestals/es2012c/pedestals_l0")));
733  m_pedestalL1.reset(checked_own_cast<TH1*>(
734  rootFile->Get("Pedestals/es2012c/pedestals_l1")));
735  m_pedestalL2.reset(checked_own_cast<TH1*>(
736  rootFile->Get("Pedestals/es2012c/pedestals_l2")));
737  m_pedestalL3.reset(checked_own_cast<TH1*>(
738  rootFile->Get("Pedestals/es2012c/pedestals_l3")));
739 
740  m_dX_ID_Nom.reset(
741  checked_own_cast<TH1*>(rootFile->Get("Material/DX0_ConfigA")));
742 
743  m_dX_IPPS_Nom.reset(checked_own_cast<TH1*>(
744  rootFile->Get("Material/Measured/DXerr_IPPS_NewG_errUncor")));
745  m_dX_IPPS_LAr.reset(checked_own_cast<TH1*>(
746  rootFile->Get("Material/Measured/DXerr_IPPS_NewG_errLAr")));
747 
748  m_dX_IPAcc_Nom.reset(checked_own_cast<TH1*>(
749  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errUncor")));
750  m_dX_IPAcc_LAr.reset(checked_own_cast<TH1*>(
751  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errLAr")));
752  m_dX_IPAcc_G4.reset(checked_own_cast<TH1*>(
753  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errG4")));
754  m_dX_IPAcc_GL1.reset(checked_own_cast<TH1*>(
755  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errGL1")));
756 
757  m_dX_PSAcc_Nom.reset(checked_own_cast<TH1*>(
758  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errUncor")));
759  m_dX_PSAcc_LAr.reset(checked_own_cast<TH1*>(
760  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errLAr")));
761  m_dX_PSAcc_G4.reset(checked_own_cast<TH1*>(
762  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errG4")));
763 
764  m_convRadius.reset(checked_own_cast<TH1*>(
765  rootFile->Get("Conversions/es2012c/convRadiusMigrations")));
766  m_convFakeRate.reset(checked_own_cast<TH1*>(
767  rootFile->Get("Conversions/es2012c/convFakeRate")));
768  m_convRecoEfficiency.reset(checked_own_cast<TH1*>(
769  rootFile->Get("Conversions/es2012c/convRecoEfficiency")));
770 
771  m_begRunNumber = 195847;
772  m_endRunNumber = 219365;
773 
774  m_G4OverAFII_resolution_electron.reset(checked_own_cast<TH2*>(
775  rootFile->Get("FastSim/es2015/el_full_fast_resolution")));
776  m_G4OverAFII_resolution_unconverted.reset(checked_own_cast<TH2*>(
777  rootFile->Get("FastSim/es2015/ph_unconv_full_fast_resolution")));
778  m_G4OverAFII_resolution_converted.reset(checked_own_cast<TH2*>(
779  rootFile->Get("FastSim/es2015/ph_conv_full_fast_resolution")));
780 
784  const std::string gain_filename1 = PathResolverFindCalibFile(
785  "ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
786  const std::string gain_filename2 = PathResolverFindCalibFile(
787  "ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
788  m_gain_tool =
789  std::make_unique<egGain::GainTool>(gain_filename1, gain_filename2);
790 
791  m_e1hg_tool = std::make_unique<e1hg_systematics>(
792  PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/"
793  "e1hg_systematics_histos.root"));
794  } else if (m_esmodel == egEnergyCorr::es2015c_summer) {
795  m_use_etaCalo_scales = true;
797  m_resolution_tool = std::make_unique<eg_resolution>("run2_pre");
798 
799  m_aPSNom.reset(
800  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/alphaPS_uncor")));
801  m_daPSCor.reset(
802  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/dalphaPS_cor")));
803  m_aS12Nom.reset(
804  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/alphaS12_uncor")));
805  m_daS12Cor.reset(
806  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/dalphaS12_cor")));
807 
808  m_trkSyst.reset(checked_own_cast<TH1*>(
809  rootFile->Get("Scales/es2012c/momentum_errSyst")));
810 
811  m_zeeNom.reset(checked_own_cast<TH1*>(
812  rootFile->Get("Scales/es2015Summer/alphaZee_errStat")));
813  m_zeeSyst.reset(checked_own_cast<TH1*>(
814  rootFile->Get("Scales/es2015Summer/alphaZee_errSyst")));
816 
817  m_resNom.reset(checked_own_cast<TH1*>(
818  rootFile->Get("Resolution/es2015Summer/ctZee_errStat")));
819  m_resSyst.reset(checked_own_cast<TH1*>(
820  rootFile->Get("Resolution/es2015Summer/ctZee_errSyst")));
821 
822  m_pedestalL0.reset(checked_own_cast<TH1*>(
823  rootFile->Get("Pedestals/es2012c/pedestals_l0")));
824  m_pedestalL1.reset(checked_own_cast<TH1*>(
825  rootFile->Get("Pedestals/es2012c/pedestals_l1")));
826  m_pedestalL2.reset(checked_own_cast<TH1*>(
827  rootFile->Get("Pedestals/es2012c/pedestals_l2")));
828  m_pedestalL3.reset(checked_own_cast<TH1*>(
829  rootFile->Get("Pedestals/es2012c/pedestals_l3")));
830 
831  m_dX_ID_Nom.reset(
832  checked_own_cast<TH1*>(rootFile->Get("Material/DX0_ConfigA")));
833 
834  m_dX_IPPS_Nom.reset(checked_own_cast<TH1*>(
835  rootFile->Get("Material/Measured/DXerr_IPPS_NewG_errUncor")));
836  m_dX_IPPS_LAr.reset(checked_own_cast<TH1*>(
837  rootFile->Get("Material/Measured/DXerr_IPPS_NewG_errLAr")));
838 
839  m_dX_IPAcc_Nom.reset(checked_own_cast<TH1*>(
840  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errUncor")));
841  m_dX_IPAcc_LAr.reset(checked_own_cast<TH1*>(
842  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errLAr")));
843  m_dX_IPAcc_G4.reset(checked_own_cast<TH1*>(
844  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errG4")));
845  m_dX_IPAcc_GL1.reset(checked_own_cast<TH1*>(
846  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errGL1")));
847 
848  m_dX_PSAcc_Nom.reset(checked_own_cast<TH1*>(
849  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errUncor")));
850  m_dX_PSAcc_LAr.reset(checked_own_cast<TH1*>(
851  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errLAr")));
852  m_dX_PSAcc_G4.reset(checked_own_cast<TH1*>(
853  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errG4")));
854 
855  m_convRadius.reset(checked_own_cast<TH1*>(
856  rootFile->Get("Conversions/es2012c/convRadiusMigrations")));
857  m_convFakeRate.reset(checked_own_cast<TH1*>(
858  rootFile->Get("Conversions/es2012c/convFakeRate")));
859  m_convRecoEfficiency.reset(checked_own_cast<TH1*>(
860  rootFile->Get("Conversions/es2012c/convRecoEfficiency")));
861 
862  m_begRunNumber = 195847;
863  m_endRunNumber = 219365;
864 
865  m_G4OverAFII_resolution_electron.reset(checked_own_cast<TH2*>(
866  rootFile->Get("FastSim/es2015/el_full_fast_resolution")));
867  m_G4OverAFII_resolution_unconverted.reset(checked_own_cast<TH2*>(
868  rootFile->Get("FastSim/es2015/ph_unconv_full_fast_resolution")));
869  m_G4OverAFII_resolution_converted.reset(checked_own_cast<TH2*>(
870  rootFile->Get("FastSim/es2015/ph_conv_full_fast_resolution")));
871 
875 
876  const std::string gain_filename1 = PathResolverFindCalibFile(
877  "ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
878  const std::string gain_filename2 = PathResolverFindCalibFile(
879  "ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
880  m_gain_tool =
881  std::make_unique<egGain::GainTool>(gain_filename1, gain_filename2);
882 
883  m_e1hg_tool = std::make_unique<e1hg_systematics>(
884  PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/"
885  "e1hg_systematics_histos.root"));
886  m_use_temp_correction201215 = true; // for eta > 2.5
888  } else if (m_esmodel == egEnergyCorr::es2016PRE) {
889  m_use_etaCalo_scales = true;
891  m_resolution_tool = std::make_unique<eg_resolution>("run2_pre");
892 
893  m_aPSNom.reset(
894  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/alphaPS_uncor")));
895  m_daPSCor.reset(
896  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/dalphaPS_cor")));
897  m_aS12Nom.reset(
898  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/alphaS12_uncor")));
899  m_daS12Cor.reset(
900  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/dalphaS12_cor")));
901 
902  m_trkSyst.reset(checked_own_cast<TH1*>(
903  rootFile->Get("Scales/es2012c/momentum_errSyst")));
904 
905  m_zeeNom.reset(checked_own_cast<TH1*>(
906  rootFile->Get("Scales/es2015Summer/alphaZee_errStat")));
907  m_zeeSyst.reset(checked_own_cast<TH1*>(
908  rootFile->Get("Scales/es2015Summer/alphaZee_errSyst")));
909 
910  m_resNom.reset(checked_own_cast<TH1*>(
911  rootFile->Get("Resolution/es2015Summer/ctZee_errStat")));
912  m_resSyst.reset(checked_own_cast<TH1*>(
913  rootFile->Get("Resolution/es2015Summer/ctZee_errSyst")));
914 
915  m_pedestalL0.reset(checked_own_cast<TH1*>(
916  rootFile->Get("Pedestals/es2012c/pedestals_l0")));
917  m_pedestalL1.reset(checked_own_cast<TH1*>(
918  rootFile->Get("Pedestals/es2012c/pedestals_l1")));
919  m_pedestalL2.reset(checked_own_cast<TH1*>(
920  rootFile->Get("Pedestals/es2012c/pedestals_l2")));
921  m_pedestalL3.reset(checked_own_cast<TH1*>(
922  rootFile->Get("Pedestals/es2012c/pedestals_l3")));
923 
924  m_dX_ID_Nom.reset(
925  checked_own_cast<TH1*>(rootFile->Get("Material/DX0_ConfigA")));
926 
927  m_dX_IPPS_Nom.reset(checked_own_cast<TH1*>(
928  rootFile->Get("Material/Measured/DXerr_IPPS_NewG_errUncor")));
929  m_dX_IPPS_LAr.reset(checked_own_cast<TH1*>(
930  rootFile->Get("Material/Measured/DXerr_IPPS_NewG_errLAr")));
931 
932  m_dX_IPAcc_Nom.reset(checked_own_cast<TH1*>(
933  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errUncor")));
934  m_dX_IPAcc_LAr.reset(checked_own_cast<TH1*>(
935  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errLAr")));
936  m_dX_IPAcc_G4.reset(checked_own_cast<TH1*>(
937  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errG4")));
938  m_dX_IPAcc_GL1.reset(checked_own_cast<TH1*>(
939  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errGL1")));
940 
941  m_dX_PSAcc_Nom.reset(checked_own_cast<TH1*>(
942  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errUncor")));
943  m_dX_PSAcc_LAr.reset(checked_own_cast<TH1*>(
944  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errLAr")));
945  m_dX_PSAcc_G4.reset(checked_own_cast<TH1*>(
946  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errG4")));
947 
948  m_convRadius.reset(checked_own_cast<TH1*>(
949  rootFile->Get("Conversions/es2012c/convRadiusMigrations")));
950  m_convFakeRate.reset(checked_own_cast<TH1*>(
951  rootFile->Get("Conversions/es2012c/convFakeRate")));
952  m_convRecoEfficiency.reset(checked_own_cast<TH1*>(
953  rootFile->Get("Conversions/es2012c/convRecoEfficiency")));
954 
955  m_begRunNumber = 195847;
956  m_endRunNumber = 219365;
957 
958  m_G4OverAFII_resolution_electron.reset(checked_own_cast<TH2*>(
959  rootFile->Get("FastSim/es2015/el_full_fast_resolution")));
960  m_G4OverAFII_resolution_unconverted.reset(checked_own_cast<TH2*>(
961  rootFile->Get("FastSim/es2015/ph_unconv_full_fast_resolution")));
962  m_G4OverAFII_resolution_converted.reset(checked_own_cast<TH2*>(
963  rootFile->Get("FastSim/es2015/ph_conv_full_fast_resolution")));
964 
968 
969  const std::string gain_filename1 = PathResolverFindCalibFile(
970  "ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
971  const std::string gain_filename2 = PathResolverFindCalibFile(
972  "ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
973  m_gain_tool =
974  std::make_unique<egGain::GainTool>(gain_filename1, gain_filename2);
975 
976  m_e1hg_tool = std::make_unique<e1hg_systematics>(
977  PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/"
978  "e1hg_systematics_histos.root"));
979 
980  m_use_temp_correction201215 = true; // for eta > 2.5
982  } else if (m_esmodel == egEnergyCorr::es2017 or
996  m_esmodel == egEnergyCorr::es2023_R22_Run2_v1) { // add release 21
997  // here for now
998  m_use_etaCalo_scales = true;
1008  m_resolution_tool = std::make_unique<eg_resolution>("run2_R21_v1");
1009  } else {
1010  m_resolution_tool = std::make_unique<eg_resolution>("run2_pre");
1011  }
1012 
1020  m_aPSNom.reset(checked_own_cast<TH1*>(
1021  rootFile->Get("Scales/es2017_summer_final/alphaPS_uncor")));
1022  m_daPSb12.reset(checked_own_cast<TH1*>(
1023  rootFile->Get("Scales/es2017_summer_final/dalphaPS_b12")));
1024  m_daPSCor.reset(
1025  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/dalphaPS_cor")));
1026  m_aS12Nom.reset(checked_own_cast<TH1*>(
1027  rootFile->Get("Scales/es2017_summer_final/alphaS12_uncor")));
1028  m_daS12Cor.reset(checked_own_cast<TH1*>(
1029  rootFile->Get("Scales/es2012c/dalphaS12_cor")));
1030  } else if (m_esmodel == egEnergyCorr::es2018_R21_v1) {
1031  m_aPSNom.reset(checked_own_cast<TH1*>(
1032  rootFile->Get("Scales/es2017_summer_final/alphaPS_uncor")));
1033  m_daPSb12.reset(checked_own_cast<TH1*>(
1034  rootFile->Get("Scales/es2017_summer_final/dalphaPS_b12")));
1035  m_daPSCor.reset(
1036  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/dalphaPS_cor")));
1037  m_aS12Nom.reset(checked_own_cast<TH1*>(
1038  rootFile->Get("Scales/es2018_R21_v1/alphaS12_uncor")));
1039  m_daS12Cor.reset(checked_own_cast<TH1*>(
1040  rootFile->Get("Scales/es2012c/dalphaS12_cor")));
1042  m_aPSNom.reset(checked_own_cast<TH1*>(
1043  rootFile->Get("Scales/es2023_R22_Run2_v0/alphaPS_uncor")));
1044  m_aS12Nom.reset(checked_own_cast<TH1*>(
1045  rootFile->Get("Scales/es2023_R22_Run2_v0/alphaS12_uncor")));
1047  m_aPSNom.reset(checked_own_cast<TH1*>(
1048  rootFile->Get("Scales/es2023_R22_Run2_v0/alphaPS_uncor")));
1049  m_aS12Nom.reset(checked_own_cast<TH1*>(
1050  rootFile->Get("Scales/es2023_R22_Run2_v1/hE1E2_emu_run2_rel21_v0_fix")));
1051  } else {
1052  m_aPSNom.reset(checked_own_cast<TH1*>(
1053  rootFile->Get("Scales/es2012c/alphaPS_uncor")));
1054  m_daPSCor.reset(
1055  checked_own_cast<TH1*>(rootFile->Get("Scales/es2012c/dalphaPS_cor")));
1056  m_aS12Nom.reset(checked_own_cast<TH1*>(
1057  rootFile->Get("Scales/es2012c/alphaS12_uncor")));
1058  m_daS12Cor.reset(checked_own_cast<TH1*>(
1059  rootFile->Get("Scales/es2012c/dalphaS12_cor")));
1060  }
1061  m_trkSyst.reset(checked_own_cast<TH1*>(
1062  rootFile->Get("Scales/es2012c/momentum_errSyst")));
1063 
1065  m_zeeNom.reset(checked_own_cast<TH1*>(
1066  rootFile->Get("Scales/es2017/alphaZee_errStat_period_2016")));
1067  m_zeeNom_data2015.reset(checked_own_cast<TH1*>(
1068  rootFile->Get("Scales/es2017/alphaZee_errStat_period_2015")));
1069  } else if (m_esmodel == egEnergyCorr::es2017_summer or
1071  m_zeeNom.reset(checked_own_cast<TH1*>(
1072  rootFile->Get("Scales/es2017_summer/alphaZee_errStat_period_2016")));
1073  m_zeeNom_data2015.reset(checked_own_cast<TH1*>(
1074  rootFile->Get("Scales/es2017_summer/alphaZee_errStat_period_2015")));
1076  m_zeeNom.reset(checked_own_cast<TH1*>(rootFile->Get(
1077  "Scales/es2017_summer_final/alphaZee_errStat_period_2016")));
1078  m_zeeNom_data2015.reset(checked_own_cast<TH1*>(rootFile->Get(
1079  "Scales/es2017_summer_final/alphaZee_errStat_period_2015")));
1080  } else if (m_esmodel == egEnergyCorr::es2015_5TeV) {
1081  m_zeeNom.reset(checked_own_cast<TH1*>(
1082  rootFile->Get("Scales/es2015_5TeV/alphaZee_errStat_period_2015")));
1083  // Same histogram added twice for simplicity
1084  m_zeeNom_data2015.reset(checked_own_cast<TH1*>(
1085  rootFile->Get("Scales/es2015_5TeV/alphaZee_errStat_period_2015")));
1086  } else if (m_esmodel == egEnergyCorr::es2017_R21_v0) {
1087  m_zeeNom.reset(checked_own_cast<TH1*>(
1088  rootFile->Get("Scales/es2017_R21_v0/alphaZee_errStat_period_2017")));
1089  m_zeeNom_data2016.reset(checked_own_cast<TH1*>(
1090  rootFile->Get("Scales/es2017_R21_v0/alphaZee_errStat_period_2016")));
1091  m_zeeNom_data2015.reset(checked_own_cast<TH1*>(
1092  rootFile->Get("Scales/es2017_R21_v0/alphaZee_errStat_period_2015")));
1093  } else if (m_esmodel == egEnergyCorr::es2017_R21_v1) {
1094  m_zeeNom.reset(checked_own_cast<TH1*>(
1095  rootFile->Get("Scales/es2017_R21_v1/alphaZee_errStat_period_2017")));
1096  m_zeeNom_data2016.reset(checked_own_cast<TH1*>(
1097  rootFile->Get("Scales/es2017_R21_v1/alphaZee_errStat_period_2016")));
1098  m_zeeNom_data2015.reset(checked_own_cast<TH1*>(
1099  rootFile->Get("Scales/es2017_R21_v1/alphaZee_errStat_period_2015")));
1100  m_zeeFwdk.reset(checked_own_cast<TH1*>(
1101  rootFile->Get("Scales/es2017_R21_v1/alphaFwd_Finalk")));
1102  m_zeeFwdb.reset(checked_own_cast<TH1*>(
1103  rootFile->Get("Scales/es2017_R21_v1/alphaFwd_Finalb")));
1105  m_zeeNom.reset(checked_own_cast<TH1*>(rootFile->Get(
1106  "Scales/es2017_R21_ofc0_v1/alphaZee_errStat_period_2017")));
1107  m_zeeNom_data2016.reset(checked_own_cast<TH1*>(rootFile->Get(
1108  "Scales/es2017_R21_ofc0_v1/alphaZee_errStat_period_2016")));
1109  m_zeeNom_data2015.reset(checked_own_cast<TH1*>(rootFile->Get(
1110  "Scales/es2017_R21_ofc0_v1/alphaZee_errStat_period_2015")));
1111  m_zeeNom_data2018.reset(checked_own_cast<TH1*>(rootFile->Get(
1112  "Scales/es2017_R21_ofc0_v1/alphaZee_errStat_period_2018")));
1113  m_zeeFwdk.reset(checked_own_cast<TH1*>(
1114  rootFile->Get("Scales/es2017_R21_v1/alphaFwd_Finalk")));
1115  m_zeeFwdb.reset(checked_own_cast<TH1*>(
1116  rootFile->Get("Scales/es2017_R21_v1/alphaFwd_Finalb")));
1118  m_zeeNom.reset(checked_own_cast<TH1*>(rootFile->Get(
1119  "Scales/es2024_Run3_ofc0_v0/alphaZee_errStat")));
1120  m_zeeFwdk.reset(checked_own_cast<TH1*>(
1121  rootFile->Get("Scales/es2017_R21_v1/alphaFwd_Finalk")));
1122  m_zeeFwdb.reset(checked_own_cast<TH1*>(
1123  rootFile->Get("Scales/es2017_R21_v1/alphaFwd_Finalb")));
1124  } else if (m_esmodel == egEnergyCorr::es2018_R21_v0) {
1125 
1126  m_zeeNom.reset(checked_own_cast<TH1*>(
1127  rootFile->Get("Scales/es2018_R21_v0/alphaZee_errStat_period_2018")));
1128  m_zeeNom_data2017.reset(checked_own_cast<TH1*>(
1129  rootFile->Get("Scales/es2018_R21_v0/alphaZee_errStat_period_2017")));
1130  m_zeeNom_data2016.reset(checked_own_cast<TH1*>(
1131  rootFile->Get("Scales/es2018_R21_v0/alphaZee_errStat_period_2016")));
1132  m_zeeNom_data2015.reset(checked_own_cast<TH1*>(
1133  rootFile->Get("Scales/es2018_R21_v0/alphaZee_errStat_period_2015")));
1134  m_zeeFwdk.reset(checked_own_cast<TH1*>(
1135  rootFile->Get("Scales/es2018_R21_v0/alphaFwd_Finalk")));
1136  m_zeeFwdb.reset(checked_own_cast<TH1*>(
1137  rootFile->Get("Scales/es2018_R21_v0/alphaFwd_Finalb")));
1138  } else if (m_esmodel == egEnergyCorr::es2018_R21_v1) {
1139  m_zeeNom.reset(checked_own_cast<TH1*>(
1140  rootFile->Get("Scales/es2018_R21_v1/alphaZee_errStat_period_2018")));
1141  m_zeeNom_data2017.reset(checked_own_cast<TH1*>(
1142  rootFile->Get("Scales/es2018_R21_v1/alphaZee_errStat_period_2017")));
1143  m_zeeNom_data2016.reset(checked_own_cast<TH1*>(
1144  rootFile->Get("Scales/es2018_R21_v1/alphaZee_errStat_period_2016")));
1145  m_zeeNom_data2015.reset(checked_own_cast<TH1*>(
1146  rootFile->Get("Scales/es2018_R21_v1/alphaZee_errStat_period_2015")));
1147  // same as in v0 model
1148  m_zeeFwdk.reset(checked_own_cast<TH1*>(
1149  rootFile->Get("Scales/es2018_R21_v0/alphaFwd_Finalk")));
1150  m_zeeFwdb.reset(checked_own_cast<TH1*>(
1151  rootFile->Get("Scales/es2018_R21_v0/alphaFwd_Finalb")));
1152  } else if (m_esmodel == egEnergyCorr::es2022_R22_PRE) {
1153  m_zeeNom.reset(checked_own_cast<TH1*>(
1154  rootFile->Get("Scales/es2022_R22_PRE/alphaZee_errStat_period_2018")));
1155  // same as in v0 model
1156  m_zeeFwdk.reset(checked_own_cast<TH1*>(
1157  rootFile->Get("Scales/es2018_R21_v0/alphaFwd_Finalk")));
1158  m_zeeFwdb.reset(checked_own_cast<TH1*>(
1159  rootFile->Get("Scales/es2018_R21_v0/alphaFwd_Finalb")));
1161  m_zeeNom.reset(checked_own_cast<TH1*>(rootFile->Get(
1162  "Scales/es2023_R22_Run2_v0/alphaZee_errStat_period_2018")));
1163  m_zeeNom_data2017.reset(checked_own_cast<TH1*>(rootFile->Get(
1164  "Scales/es2023_R22_Run2_v0/alphaZee_errStat_period_2017")));
1165  m_zeeNom_data2016.reset(checked_own_cast<TH1*>(rootFile->Get(
1166  "Scales/es2023_R22_Run2_v0/alphaZee_errStat_period_2016")));
1167  m_zeeNom_data2015.reset(checked_own_cast<TH1*>(rootFile->Get(
1168  "Scales/es2023_R22_Run2_v0/alphaZee_errStat_period_2015")));
1169  // same as in v0 model
1170  m_zeeFwdk.reset(checked_own_cast<TH1*>(
1171  rootFile->Get("Scales/es2018_R21_v0/alphaFwd_Finalk")));
1172  m_zeeFwdb.reset(checked_own_cast<TH1*>(
1173  rootFile->Get("Scales/es2018_R21_v0/alphaFwd_Finalb")));
1175  // based on fixed E1E2
1176  m_zeeNom.reset(checked_own_cast<TH1*>(rootFile->Get(
1177  "Scales/es2023_R22_Run2_v1/alphaZee_errStat_period_2018")));
1178  m_zeeNom_data2017.reset(checked_own_cast<TH1*>(rootFile->Get(
1179  "Scales/es2023_R22_Run2_v1/alphaZee_errStat_period_2017")));
1180  m_zeeNom_data2016.reset(checked_own_cast<TH1*>(rootFile->Get(
1181  "Scales/es2023_R22_Run2_v1/alphaZee_errStat_period_2016")));
1182  m_zeeNom_data2015.reset(checked_own_cast<TH1*>(rootFile->Get(
1183  "Scales/es2023_R22_Run2_v1/alphaZee_errStat_period_2015")));
1184  // same as in v0 model
1185  m_zeeFwdk.reset(checked_own_cast<TH1*>(
1186  rootFile->Get("Scales/es2018_R21_v0/alphaFwd_Finalk")));
1187  m_zeeFwdb.reset(checked_own_cast<TH1*>(
1188  rootFile->Get("Scales/es2018_R21_v0/alphaFwd_Finalb")));
1189  } else {
1190  m_zeeNom.reset(checked_own_cast<TH1*>(
1191  rootFile->Get("Scales/es2017_R21_PRE/alphaZee_errStat_period_2016")));
1192  // SAME HISTO FOR 2015 FOR NOW
1193  m_zeeNom_data2015.reset(checked_own_cast<TH1*>(
1194  rootFile->Get("Scales/es2017_R21_PRE/alphaZee_errStat_period_2016")));
1195  }
1197  m_zeeSyst.reset(checked_own_cast<TH1*>(
1198  rootFile->Get("Scales/es2017/alphaZee_errSyst")));
1200  m_zeeSyst.reset(checked_own_cast<TH1*>(
1201  rootFile->Get("Scales/es2017_summer_final/alphaZee_errSyst")));
1202  } else if (m_esmodel == egEnergyCorr::es2015_5TeV) {
1203  m_zeeSyst.reset(checked_own_cast<TH1*>(
1204  rootFile->Get("Scales/es2015_5TeV/alphaZee_errSyst")));
1205  } else if (m_esmodel == egEnergyCorr::es2017_R21_v0) {
1206  m_zeeSyst.reset(checked_own_cast<TH1*>(
1207  rootFile->Get("Scales/es2017_summer_final/alphaZee_errSyst")));
1208  } else if (m_esmodel == egEnergyCorr::es2017_R21_v1) {
1209  m_zeeSyst.reset(checked_own_cast<TH1*>(
1210  rootFile->Get("Scales/es2017_R21_v1/alphaZee_errSyst")));
1212  m_zeeSyst.reset(checked_own_cast<TH1*>(
1213  rootFile->Get("Scales/es2017_R21_ofc0_v1/alphaZee_errSyst")));
1215  m_zeeSyst.reset(checked_own_cast<TH1*>(
1216  rootFile->Get("Scales/es2024_Run3_ofc0_v0/alphaZee_errSyst")));
1217  } else if (m_esmodel == egEnergyCorr::es2018_R21_v0) {
1218  m_zeeSyst.reset(checked_own_cast<TH1*>(
1219  rootFile->Get("Scales/es2018_R21_v0/alphaZee_errSyst")));
1220  } else if (m_esmodel == egEnergyCorr::es2018_R21_v1 ||
1223  m_zeeSyst.reset(checked_own_cast<TH1*>(
1224  rootFile->Get("Scales/es2018_R21_v1/alphaZee_errSyst")));
1225  } else if (m_esmodel == egEnergyCorr::es2022_R22_PRE) {
1226  m_zeeSyst.reset(checked_own_cast<TH1*>(
1227  rootFile->Get("Scales/es2022_R22_PRE/alphaZee_errSyst")));
1228  m_zeeSystOFC.reset(checked_own_cast<TH1*>(
1229  rootFile->Get("Scales/es2022_R22_PRE/alphaZee_errOFCSyst")));
1230  } else {
1231  m_zeeSyst.reset(checked_own_cast<TH1*>(
1232  rootFile->Get("Scales/es2017_summer/alphaZee_errSyst")));
1233  }
1234 
1237  m_resNom.reset(checked_own_cast<TH1*>(
1238  rootFile->Get("Resolution/es2017/ctZee_errStat")));
1239  } else if (m_esmodel == egEnergyCorr::es2017_summer or
1242  m_resNom.reset(checked_own_cast<TH1*>(
1243  rootFile->Get("Resolution/es2017_summer/ctZee_errStat")));
1245  m_resNom.reset(checked_own_cast<TH1*>(
1246  rootFile->Get("Resolution/es2017_summer_final/ctZee_errStat")));
1247  } else if (m_esmodel == egEnergyCorr::es2017_R21_v0) {
1248  m_resNom.reset(checked_own_cast<TH1*>(
1249  rootFile->Get("Resolution/es2017_R21_v0/ctZee_errStat")));
1250  } else if (m_esmodel == egEnergyCorr::es2017_R21_v1) {
1251  m_resNom.reset(checked_own_cast<TH1*>(
1252  rootFile->Get("Resolution/es2017_R21_v1/ctZee_errStat")));
1254  m_resNom.reset(checked_own_cast<TH1*>(
1255  rootFile->Get("Resolution/es2017_R21_ofc0_v1/ctZee_errStat")));
1257  // use same resolution smearing as run 2 ofc0 recommendation
1258  m_resNom.reset(checked_own_cast<TH1*>(
1259  rootFile->Get("Resolution/es2017_R21_ofc0_v1/ctZee_errStat")));
1260  } else if (m_esmodel == egEnergyCorr::es2018_R21_v0) {
1261  m_resNom.reset(checked_own_cast<TH1*>(
1262  rootFile->Get("Resolution/es2018_R21_v0/ctZee_errStat")));
1263  } else if (m_esmodel == egEnergyCorr::es2018_R21_v1) {
1264  m_resNom.reset(checked_own_cast<TH1*>(
1265  rootFile->Get("Resolution/es2018_R21_v1/ctZee_errStat")));
1266  } else if (m_esmodel == egEnergyCorr::es2022_R22_PRE) {
1267  m_resNom.reset(checked_own_cast<TH1*>(
1268  rootFile->Get("Resolution/es2022_R22_PRE/ctZee_errStat")));
1270  m_resNom.reset(checked_own_cast<TH1*>(
1271  rootFile->Get("Resolution/es2023_R22_Run2_v0/ctZee_errStat")));
1273  m_resNom.reset(checked_own_cast<TH1*>(
1274  rootFile->Get("Resolution/es2023_R22_Run2_v1/ctZee_errStat")));
1275  } else {
1276  m_resNom.reset(checked_own_cast<TH1*>(
1277  rootFile->Get("Resolution/es2017_R21_PRE/ctZee_errStat")));
1278  }
1279 
1281  m_resSyst.reset(checked_own_cast<TH1*>(
1282  rootFile->Get("Resolution/es2017/ctZee_errSyst")));
1284  m_resSyst.reset(checked_own_cast<TH1*>(
1285  rootFile->Get("Resolution/es2017_summer_final/ctZee_errSyst")));
1286  } else if (m_esmodel == egEnergyCorr::es2015_5TeV) {
1287  m_resSyst.reset(checked_own_cast<TH1*>(
1288  rootFile->Get("Resolution/es2015_5TeV/ctZee_errSyst")));
1289  } else if (m_esmodel == egEnergyCorr::es2017_R21_v0) {
1290  m_resSyst.reset(checked_own_cast<TH1*>(
1291  rootFile->Get("Resolution/es2017_summer_final/ctZee_errSyst")));
1292  } else if (m_esmodel == egEnergyCorr::es2017_R21_v1) {
1293  m_resSyst.reset(checked_own_cast<TH1*>(
1294  rootFile->Get("Resolution/es2017_R21_v1/ctZee_errSyst")));
1296  m_resSyst.reset(checked_own_cast<TH1*>(
1297  rootFile->Get("Resolution/es2017_R21_ofc0_v1/ctZee_errSyst")));
1299  // use same resolution smearing syst as run 2 ofc0 recommendataion
1300  m_resSyst.reset(checked_own_cast<TH1*>(
1301  rootFile->Get("Resolution/es2017_R21_ofc0_v1/ctZee_errSyst")));
1302  } else if (m_esmodel == egEnergyCorr::es2018_R21_v0) {
1303  m_resSyst.reset(checked_own_cast<TH1*>(
1304  rootFile->Get("Resolution/es2018_R21_v0/ctZee_errSyst")));
1305  } else if (m_esmodel == egEnergyCorr::es2018_R21_v1 ||
1308  m_resSyst.reset(checked_own_cast<TH1*>(
1309  rootFile->Get("Resolution/es2018_R21_v1/ctZee_errSyst")));
1310  } else if (m_esmodel == egEnergyCorr::es2022_R22_PRE) {
1311  m_resSyst.reset(checked_own_cast<TH1*>(
1312  rootFile->Get("Resolution/es2022_R22_PRE/ctZee_errSyst")));
1313  m_resSystOFC.reset(checked_own_cast<TH1*>(
1314  rootFile->Get("Resolution/es2022_R22_PRE/ctZee_errOFCSyst")));
1315  } else {
1316  m_resSyst.reset(checked_own_cast<TH1*>(
1317  rootFile->Get("Resolution/es2017_summer/ctZee_errSyst")));
1318  }
1319  // else{
1320  // m_resSyst.reset( checked_own_cast< TH1* >(
1321  // rootFile->Get("Resolution/es2017_summer_improved/ctZee_errSyst")));
1322  // }
1323 
1324  m_pedestals_es2017.reset(
1325  checked_own_cast<TH1*>(rootFile->Get("Pedestals/es2017/pedestals")));
1326 
1327  m_dX_ID_Nom.reset(
1328  checked_own_cast<TH1*>(rootFile->Get("Material/DX0_ConfigA")));
1329 
1330  m_dX_IPPS_Nom.reset(checked_own_cast<TH1*>(
1331  rootFile->Get("Material/Measured/DXerr_IPPS_NewG_errUncor")));
1332  m_dX_IPPS_LAr.reset(checked_own_cast<TH1*>(
1333  rootFile->Get("Material/Measured/DXerr_IPPS_NewG_errLAr")));
1334 
1335  m_dX_IPAcc_Nom.reset(checked_own_cast<TH1*>(
1336  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errUncor")));
1337  m_dX_IPAcc_LAr.reset(checked_own_cast<TH1*>(
1338  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errLAr")));
1339  m_dX_IPAcc_G4.reset(checked_own_cast<TH1*>(
1340  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errG4")));
1341  m_dX_IPAcc_GL1.reset(checked_own_cast<TH1*>(
1342  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errGL1")));
1343 
1344  m_dX_PSAcc_Nom.reset(checked_own_cast<TH1*>(
1345  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errUncor")));
1346  m_dX_PSAcc_LAr.reset(checked_own_cast<TH1*>(
1347  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errLAr")));
1348  m_dX_PSAcc_G4.reset(checked_own_cast<TH1*>(
1349  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errG4")));
1350 
1351  m_convRadius.reset(checked_own_cast<TH1*>(
1352  rootFile->Get("Conversions/es2012c/convRadiusMigrations")));
1354  m_convFakeRate.reset(checked_own_cast<TH1*>(
1355  rootFile->Get("Conversions/es2012c/convFakeRate")));
1356  m_convRecoEfficiency.reset(checked_own_cast<TH1*>(
1357  rootFile->Get("Conversions/es2012c/convRecoEfficiency")));
1360  m_convFakeRate_2D.reset(checked_own_cast<TH2*>(
1361  rootFile->Get("Conversions/es2023_R22_Run2_v0/convFakeRate")));
1362  m_convRecoEfficiency_2D.reset(checked_own_cast<TH2*>(
1363  rootFile->Get("Conversions/es2023_R22_Run2_v0/convRecoEfficiency")));
1364  } else {
1365  m_convFakeRate.reset(checked_own_cast<TH1*>(
1366  rootFile->Get("Conversions/es2017_summer/convFakeRate")));
1367  m_convRecoEfficiency.reset(checked_own_cast<TH1*>(
1368  rootFile->Get("Conversions/es2017_summer/convRecoEfficiency")));
1369  }
1370 
1371  // TODO: change path when moving to calibarea
1372  // TODO: better package this somewhere
1373 
1374  const std::string filename_pp0 = PathResolverFindCalibFile(
1375  "ElectronPhotonFourMomentumCorrection/v8/PP0sys.root");
1376 
1377  TFile file_pp0(filename_pp0.c_str());
1378  m_pp0_elec.reset(checked_own_cast<TH2*>(file_pp0.Get("elec")));
1379  m_pp0_conv.reset(checked_own_cast<TH2*>(file_pp0.Get("conv")));
1380  m_pp0_unconv.reset(checked_own_cast<TH2*>(file_pp0.Get("unco")));
1381 
1382  // similar case for wtots1
1383  const std::string filename_wstot = PathResolverFindCalibFile(
1384  "ElectronPhotonFourMomentumCorrection/v8/wstot_related_syst.root");
1385 
1386  TFile file_wstot(filename_wstot.c_str());
1387  m_wstot_slope_A_data.reset(
1388  checked_own_cast<TH1*>(file_wstot.Get("A_data")));
1389  m_wstot_slope_B_MC.reset(checked_own_cast<TH1*>(file_wstot.Get("B_mc")));
1391  checked_own_cast<TH1*>(file_wstot.Get("wstot_pT_el_data_p0")));
1393  checked_own_cast<TH1*>(file_wstot.Get("wstot_pT_el_data_p1")));
1395  checked_own_cast<TH1*>(file_wstot.Get("wstot_pT_uc_data_p0")));
1397  checked_own_cast<TH1*>(file_wstot.Get("wstot_pT_uc_data_p1")));
1399  checked_own_cast<TH1*>(file_wstot.Get("wstot_pT_c_data_p0")));
1401  checked_own_cast<TH1*>(file_wstot.Get("wstot_pT_c_data_p1")));
1403  checked_own_cast<TH1*>(file_wstot.Get("wstot_pT_el_mc_p0")));
1405  checked_own_cast<TH1*>(file_wstot.Get("wstot_pT_el_mc_p1")));
1407  checked_own_cast<TH1*>(file_wstot.Get("wstot_pT_ph_uc_mc_p0")));
1409  checked_own_cast<TH1*>(file_wstot.Get("wstot_pT_ph_uc_mc_p1")));
1411  checked_own_cast<TH1*>(file_wstot.Get("wstot_pT_ph_c_mc_p0")));
1413  checked_own_cast<TH1*>(file_wstot.Get("wstot_pT_ph_c_mc_p1")));
1414 
1415  m_begRunNumber = 252604;
1416  m_endRunNumber = 314199;
1417 
1422  m_G4OverAFII_resolution_electron.reset(checked_own_cast<TH2*>(
1423  rootFile->Get("FastSim/es2017_v1/resol_Af2ToG4_elec_rel21")));
1424  m_G4OverAFII_resolution_unconverted.reset(checked_own_cast<TH2*>(
1425  rootFile->Get("FastSim/es2017_v1/resol_Af2ToG4_unco_rel21")));
1426  m_G4OverAFII_resolution_converted.reset(checked_own_cast<TH2*>(
1427  rootFile->Get("FastSim/es2017_v1/resol_Af2ToG4_conv_rel21")));
1428  }
1433  m_G4OverAFII_resolution_electron.reset(checked_own_cast<TH2*>(
1434  rootFile->Get("FastSim/es2023_R22_Run2_v1/resol_AF3ToG4_elec_rel22")));
1435  m_G4OverAFII_resolution_unconverted.reset(checked_own_cast<TH2*>(
1436  rootFile->Get("FastSim/es2023_R22_Run2_v1/resol_AF3ToG4_unco_rel22")));
1437  m_G4OverAFII_resolution_converted.reset(checked_own_cast<TH2*>(
1438  rootFile->Get("FastSim/es2023_R22_Run2_v1/resol_AF3ToG4_conv_rel22")));
1439  }
1440  else {
1441  m_G4OverAFII_resolution_electron.reset(checked_own_cast<TH2*>(
1442  rootFile->Get("FastSim/es2017/el_full_fast_resolution")));
1443  m_G4OverAFII_resolution_unconverted.reset(checked_own_cast<TH2*>(
1444  rootFile->Get("FastSim/es2017/ph_unconv_full_fast_resolution")));
1445  m_G4OverAFII_resolution_converted.reset(checked_own_cast<TH2*>(
1446  rootFile->Get("FastSim/es2017/ph_conv_full_fast_resolution")));
1447  }
1451 
1452  const std::string gain_filename1 = PathResolverFindCalibFile(
1453  "ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
1454  const std::string gain_filename2 = PathResolverFindCalibFile(
1455  "ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
1456  m_gain_tool = nullptr;
1457 
1458  std::string gain_tool_run_2_filename;
1463  gain_tool_run_2_filename = PathResolverFindCalibFile(
1464  "ElectronPhotonFourMomentumCorrection/v11/"
1465  "gain_uncertainty_specialRun.root");
1468  gain_tool_run_2_filename = PathResolverFindCalibFile(
1469  "ElectronPhotonFourMomentumCorrection/v29/"
1470  "gain_uncertainty_specialRun.root");
1471  } else {
1472  gain_tool_run_2_filename = PathResolverFindCalibFile(
1473  "ElectronPhotonFourMomentumCorrection/v14/"
1474  "gain_uncertainty_specialRun.root");
1475  }
1478  m_gain_tool_run2 = std::make_unique<egGain::GainUncertainty>(
1479  gain_tool_run_2_filename, true, "GainUncertainty",
1481  } else {
1483  std::make_unique<egGain::GainUncertainty>(gain_tool_run_2_filename);
1484  }
1485 
1486  m_gain_tool_run2->msg().setLevel(this->msg().level());
1487 
1490  m_e1hg_tool = std::make_unique<e1hg_systematics>(
1491  PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v29/"
1492  "e1hg_systematics_histos.root"));
1493  } else {
1494  m_e1hg_tool = std::make_unique<e1hg_systematics>(
1495  PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/"
1496  "e1hg_systematics_histos.root"));
1497  }
1498 
1503  m_resolution_tool = std::make_unique<eg_resolution>("run2_pre");
1504 
1505  m_aPSNom.reset(checked_own_cast<TH1*>(
1506  rootFile->Get("Scales/es2015_day0/alphaPS_uncor"))); // old one
1507  m_daPSCor.reset(checked_own_cast<TH1*>(
1508  rootFile->Get("Scales/es2015_day0/dalphaPS_cor"))); // old one
1509  m_aS12Nom.reset(checked_own_cast<TH1*>(
1510  rootFile->Get("Scales/es2015_day0/alphaS12_uncor"))); // old one
1511  m_daS12Cor.reset(checked_own_cast<TH1*>(
1512  rootFile->Get("Scales/es2015_day0/dalphaS12_cor"))); // old one
1513 
1514  m_trkSyst.reset(checked_own_cast<TH1*>(
1515  rootFile->Get("Scales/es2015_day0/momentum_errSyst"))); // old one
1516 
1517  m_zeeNom.reset(checked_own_cast<TH1*>(
1518  rootFile->Get("Scales/es2015_day0/alphaZee_errStat"))); // old one
1519  m_zeeSyst.reset(checked_own_cast<TH1*>(
1520  rootFile->Get("Scales/es2015_day0/alphaZee_errSyst"))); // old one
1521 
1522  m_resNom.reset(checked_own_cast<TH1*>(
1523  rootFile->Get("Resolution/es2012c/ctZee_errStat"))); // old one
1524  m_resSyst.reset(checked_own_cast<TH1*>(
1525  rootFile->Get("Resolution/es2012c/ctZee_errSyst"))); // old one
1526 
1527  m_pedestalL0.reset(checked_own_cast<TH1*>(
1528  rootFile->Get("Pedestals/es2012c/pedestals_l0"))); // old one
1529  m_pedestalL1.reset(checked_own_cast<TH1*>(
1530  rootFile->Get("Pedestals/es2012c/pedestals_l1"))); // old one
1531  m_pedestalL2.reset(checked_own_cast<TH1*>(
1532  rootFile->Get("Pedestals/es2012c/pedestals_l2"))); // old one
1533  m_pedestalL3.reset(checked_own_cast<TH1*>(
1534  rootFile->Get("Pedestals/es2012c/pedestals_l3"))); // old one
1535 
1536  m_dX_ID_Nom.reset(checked_own_cast<TH1*>(
1537  rootFile->Get("Material/DX0_ConfigA"))); // old one
1538 
1539  m_dX_IPPS_Nom.reset(checked_own_cast<TH1*>(rootFile->Get(
1540  "Material/Measured/DXerr_IPPS_NewG_errUncor"))); // old one
1541  m_dX_IPPS_LAr.reset(checked_own_cast<TH1*>(
1542  rootFile->Get("Material/Measured/DXerr_IPPS_NewG_errLAr"))); // old one
1543 
1544  m_dX_IPAcc_Nom.reset(checked_own_cast<TH1*>(rootFile->Get(
1545  "Material/Measured/DXerr_IPAcc_NewG_errUncor"))); // old one
1546  m_dX_IPAcc_LAr.reset(checked_own_cast<TH1*>(rootFile->Get(
1547  "Material/Measured/DXerr_IPAcc_NewG_errLAr"))); // old one
1548  m_dX_IPAcc_G4.reset(checked_own_cast<TH1*>(
1549  rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errG4"))); // old one
1550  m_dX_IPAcc_GL1.reset(checked_own_cast<TH1*>(rootFile->Get(
1551  "Material/Measured/DXerr_IPAcc_NewG_errGL1"))); // old one
1552 
1553  m_dX_PSAcc_Nom.reset(checked_own_cast<TH1*>(rootFile->Get(
1554  "Material/Measured/DXerr_PSAcc_NewG_errUncor"))); // old one
1555  m_dX_PSAcc_LAr.reset(checked_own_cast<TH1*>(rootFile->Get(
1556  "Material/Measured/DXerr_PSAcc_NewG_errLAr"))); // old one
1557  m_dX_PSAcc_G4.reset(checked_own_cast<TH1*>(
1558  rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errG4"))); // old one
1559 
1560  m_convRadius.reset(checked_own_cast<TH1*>(
1561  rootFile->Get("Conversions/es2012c/convRadiusMigrations"))); // old one
1562  m_convFakeRate.reset(checked_own_cast<TH1*>(
1563  rootFile->Get("Conversions/es2012c/convFakeRate"))); // old one
1564  m_convRecoEfficiency.reset(checked_own_cast<TH1*>(
1565  rootFile->Get("Conversions/es2012c/convRecoEfficiency"))); // old one
1566 
1567  m_begRunNumber = 195847;
1568  m_endRunNumber = 219365;
1569 
1570  const std::string gain_filename1 = PathResolverFindCalibFile(
1571  "ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
1572  const std::string gain_filename2 = PathResolverFindCalibFile(
1573  "ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
1574  m_gain_tool =
1575  std::make_unique<egGain::GainTool>(gain_filename1, gain_filename2);
1576 
1577  m_e1hg_tool = std::make_unique<e1hg_systematics>(
1578  PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/"
1579  "e1hg_systematics_histos.root"));
1580 
1581  // If we are here, fail s :
1582 
1583  } else if (m_esmodel == egEnergyCorr::UNDEFINED) {
1584  ATH_MSG_FATAL("ES model not initialized - Initialization fails");
1585  return 0;
1586  } else {
1587  ATH_MSG_FATAL("ES model not recognized - Initialization fails");
1588  return 0;
1589  }
1590 
1610  // E4 systematics
1611  m_E4ElectronEtaBins.reset(checked_own_cast<TAxis*>(
1612  rootFile->Get("E4Recalibration/v4/electron_eta_axis")));
1613  m_E4ElectronGraphs.reset(
1614  checked_own_cast<TList*>(rootFile->Get("E4Recalibration/v4/electron")));
1615  // for photons use the same as electrons
1616  m_E4UnconvertedEtaBins.reset(checked_own_cast<TAxis*>(
1617  rootFile->Get("E4Recalibration/v4/electron_eta_axis")));
1618  m_E4UnconvertedGraphs.reset(
1619  checked_own_cast<TList*>(rootFile->Get("E4Recalibration/v4/electron")));
1620  m_E4ConvertedEtaBins.reset(checked_own_cast<TAxis*>(
1621  rootFile->Get("E4Recalibration/v4/electron_eta_axis")));
1622  m_E4ConvertedGraphs.reset(
1623  checked_own_cast<TList*>(rootFile->Get("E4Recalibration/v4/electron")));
1624  }
1625 
1626  // ... PS and S12 recalibration curves
1646 
1647  m_psElectronEtaBins.reset(checked_own_cast<TAxis*>(
1648  rootFile->Get("PSRecalibration/es2015PRE/ElectronAxis")));
1649  m_psElectronGraphs.reset(checked_own_cast<TList*>(
1650  rootFile->Get("PSRecalibration/es2015PRE/ElectronBiasPS")));
1651  m_psUnconvertedEtaBins.reset(checked_own_cast<TAxis*>(
1652  rootFile->Get("PSRecalibration/es2015PRE/UnconvertedAxis")));
1653  m_psUnconvertedGraphs.reset(checked_own_cast<TList*>(
1654  rootFile->Get("PSRecalibration/es2015PRE/UnconvertedBiasPS")));
1655  m_psConvertedEtaBins.reset(checked_own_cast<TAxis*>(
1656  rootFile->Get("PSRecalibration/es2015PRE/ConvertedAxis")));
1657  m_psConvertedGraphs.reset(checked_own_cast<TList*>(
1658  rootFile->Get("PSRecalibration/es2015PRE/ConvertedBiasPS")));
1659 
1660  m_s12ElectronEtaBins.reset(checked_own_cast<TAxis*>(
1661  rootFile->Get("S1Recalibration/es2015PRE/ElectronAxis")));
1662  m_s12ElectronGraphs.reset(checked_own_cast<TList*>(
1663  rootFile->Get("S1Recalibration/es2015PRE/ElectronBiasS1")));
1664  m_s12UnconvertedEtaBins.reset(checked_own_cast<TAxis*>(
1665  rootFile->Get("S1Recalibration/es2015PRE/UnconvertedAxis")));
1666  m_s12UnconvertedGraphs.reset(checked_own_cast<TList*>(
1667  rootFile->Get("S1Recalibration/es2015PRE/UnconvertedBiasS1")));
1668  m_s12ConvertedEtaBins.reset(checked_own_cast<TAxis*>(
1669  rootFile->Get("S1Recalibration/es2015PRE/ConvertedAxis")));
1670  m_s12ConvertedGraphs.reset(checked_own_cast<TList*>(
1671  rootFile->Get("S1Recalibration/es2015PRE/ConvertedBiasS1")));
1674  m_psElectronEtaBins.reset(checked_own_cast<TAxis*>(
1675  rootFile->Get("PSRecalibration/es2023_R22_Run2_v0/ElectronAxis")));
1676  m_psElectronGraphs.reset(checked_own_cast<TList*>(
1677  rootFile->Get("PSRecalibration/es2023_R22_Run2_v0/ElectronBiasPS")));
1678  m_psUnconvertedEtaBins.reset(checked_own_cast<TAxis*>(
1679  rootFile->Get("PSRecalibration/es2023_R22_Run2_v0/UnconvertedAxis")));
1680  m_psUnconvertedGraphs.reset(checked_own_cast<TList*>(
1681  rootFile->Get("PSRecalibration/es2023_R22_Run2_v0/UnconvertedBiasPS")));
1682  m_psConvertedEtaBins.reset(checked_own_cast<TAxis*>(
1683  rootFile->Get("PSRecalibration/es2023_R22_Run2_v0/ConvertedAxis")));
1684  m_psConvertedGraphs.reset(checked_own_cast<TList*>(
1685  rootFile->Get("PSRecalibration/es2023_R22_Run2_v0/ConvertedBiasPS")));
1686 
1687  m_s12ElectronEtaBins.reset(checked_own_cast<TAxis*>(
1688  rootFile->Get("S2Recalibration/ElectronAxis")));
1689  m_s12ElectronGraphs.reset(checked_own_cast<TList*>(
1690  rootFile->Get("S2Recalibration/ElectronBiasS2")));
1691  m_s12UnconvertedEtaBins.reset(checked_own_cast<TAxis*>(
1692  rootFile->Get("S2Recalibration/UnconvertedAxis")));
1693  m_s12UnconvertedGraphs.reset(checked_own_cast<TList*>(
1694  rootFile->Get("S2Recalibration/UnconvertedBiasS2")));
1695  m_s12ConvertedEtaBins.reset(checked_own_cast<TAxis*>(
1696  rootFile->Get("S2Recalibration/ConvertedAxis")));
1697  m_s12ConvertedGraphs.reset(checked_own_cast<TList*>(
1698  rootFile->Get("S2Recalibration/ConvertedBiasS2")));
1699 
1700  m_EaccElectronEtaBins.reset(checked_own_cast<TAxis*>(
1701  rootFile->Get("SaccRecalibration/ElectronAxis")));
1702  m_EaccElectronGraphs.reset(checked_own_cast<TList*>(
1703  rootFile->Get("SaccRecalibration/ElectronBiasSacc")));
1704  m_EaccUnconvertedEtaBins.reset(checked_own_cast<TAxis*>(
1705  rootFile->Get("SaccRecalibration/UnconvertedAxis")));
1706  m_EaccUnconvertedGraphs.reset(checked_own_cast<TList*>(
1707  rootFile->Get("SaccRecalibration/UnconvertedBiasSacc")));
1708  m_EaccConvertedEtaBins.reset(checked_own_cast<TAxis*>(
1709  rootFile->Get("SaccRecalibration/ConvertedAxis")));
1710  m_EaccConvertedGraphs.reset(checked_own_cast<TList*>(
1711  rootFile->Get("SaccRecalibration/ConvertedBiasSacc")));
1712  } else // run1
1713  {
1714  m_psElectronEtaBins.reset(checked_own_cast<TAxis*>(
1715  rootFile->Get("PSRecalibration/ElectronAxis")));
1716  m_psElectronGraphs.reset(checked_own_cast<TList*>(
1717  rootFile->Get("PSRecalibration/ElectronBiasPS")));
1718  m_psUnconvertedEtaBins.reset(checked_own_cast<TAxis*>(
1719  rootFile->Get("PSRecalibration/UnconvertedAxis")));
1720  m_psUnconvertedGraphs.reset(checked_own_cast<TList*>(
1721  rootFile->Get("PSRecalibration/UnconvertedBiasPS")));
1722  m_psConvertedEtaBins.reset(checked_own_cast<TAxis*>(
1723  rootFile->Get("PSRecalibration/ConvertedAxis")));
1724  m_psConvertedGraphs.reset(checked_own_cast<TList*>(
1725  rootFile->Get("PSRecalibration/ConvertedBiasPS")));
1726 
1727  m_s12ElectronEtaBins.reset(checked_own_cast<TAxis*>(
1728  rootFile->Get("S1Recalibration/ElectronAxis")));
1729  m_s12ElectronGraphs.reset(checked_own_cast<TList*>(
1730  rootFile->Get("S1Recalibration/ElectronBiasS1")));
1731  m_s12UnconvertedEtaBins.reset(checked_own_cast<TAxis*>(
1732  rootFile->Get("S1Recalibration/UnconvertedAxis")));
1733  m_s12UnconvertedGraphs.reset(checked_own_cast<TList*>(
1734  rootFile->Get("S1Recalibration/UnconvertedBiasS1")));
1735  m_s12ConvertedEtaBins.reset(checked_own_cast<TAxis*>(
1736  rootFile->Get("S1Recalibration/ConvertedAxis")));
1737  m_s12ConvertedGraphs.reset(checked_own_cast<TList*>(
1738  rootFile->Get("S1Recalibration/ConvertedBiasS1")));
1739  }
1740 
1741  // further inputs do not depend on year
1742 
1743  // ... material distortions
1744  m_matUnconvertedScale.emplace_back(
1745  std::unique_ptr<TH1>(checked_own_cast<TH1*>(
1746  rootFile->Get("Material/unconvertedBiasSubtracted_ConfigA"))));
1747  m_matUnconvertedScale.emplace_back(
1748  std::unique_ptr<TH1>(checked_own_cast<TH1*>(
1749  rootFile->Get("Material/unconvertedBiasSubtracted_ConfigCpDp"))));
1750  m_matUnconvertedScale.emplace_back(
1751  std::unique_ptr<TH1>(checked_own_cast<TH1*>(
1752  rootFile->Get("Material/unconvertedBiasSubtracted_ConfigEpLp"))));
1753  m_matUnconvertedScale.emplace_back(
1754  std::unique_ptr<TH1>(checked_own_cast<TH1*>(
1755  rootFile->Get("Material/unconvertedBiasSubtracted_ConfigFpMX"))));
1756  m_matUnconvertedScale.emplace_back(
1757  std::unique_ptr<TH1>(checked_own_cast<TH1*>(
1758  rootFile->Get("Material/unconvertedBiasSubtracted_ConfigGp"))));
1759 
1760  m_matConvertedScale.emplace_back(std::unique_ptr<TH1>(checked_own_cast<TH1*>(
1761  rootFile->Get("Material/convertedBiasSubtracted_ConfigA"))));
1762  m_matConvertedScale.emplace_back(std::unique_ptr<TH1>(checked_own_cast<TH1*>(
1763  rootFile->Get("Material/convertedBiasSubtracted_ConfigCpDp"))));
1764  m_matConvertedScale.emplace_back(std::unique_ptr<TH1>(checked_own_cast<TH1*>(
1765  rootFile->Get("Material/convertedBiasSubtracted_ConfigEpLp"))));
1766  m_matConvertedScale.emplace_back(std::unique_ptr<TH1>(checked_own_cast<TH1*>(
1767  rootFile->Get("Material/convertedBiasSubtracted_ConfigFpMX"))));
1768  m_matConvertedScale.emplace_back(std::unique_ptr<TH1>(checked_own_cast<TH1*>(
1769  rootFile->Get("Material/convertedBiasSubtracted_ConfigGp"))));
1770 
1771  m_matElectronCstTerm.emplace_back(std::unique_ptr<TH1>(checked_own_cast<TH1*>(
1772  rootFile->Get("Material/electronCstTerm_ConfigA"))));
1773  m_matElectronCstTerm.emplace_back(std::unique_ptr<TH1>(checked_own_cast<TH1*>(
1774  rootFile->Get("Material/electronCstTerm_ConfigCpDp"))));
1775  m_matElectronCstTerm.emplace_back(std::unique_ptr<TH1>(checked_own_cast<TH1*>(
1776  rootFile->Get("Material/electronCstTerm_ConfigEpLp"))));
1777  m_matElectronCstTerm.emplace_back(std::unique_ptr<TH1>(checked_own_cast<TH1*>(
1778  rootFile->Get("Material/electronCstTerm_ConfigFpMX"))));
1779  m_matElectronCstTerm.emplace_back(std::unique_ptr<TH1>(checked_own_cast<TH1*>(
1780  rootFile->Get("Material/electronCstTerm_ConfigGp"))));
1781 
1790  // update dX0 plots for distorted geometry for case A, EL, FMX and N
1791  m_matX0Additions.emplace_back(std::unique_ptr<TH1>(
1792  checked_own_cast<TH1*>(rootFile->Get("Material_rel21/DX0_ConfigA"))));
1793  m_matX0Additions.emplace_back(std::unique_ptr<TH1>(
1794  checked_own_cast<TH1*>(rootFile->Get("Material/DX0_ConfigCpDp"))));
1795  m_matX0Additions.emplace_back(std::unique_ptr<TH1>(checked_own_cast<TH1*>(
1796  rootFile->Get("Material_rel21/DX0_ConfigEpLp"))));
1797  m_matX0Additions.emplace_back(std::unique_ptr<TH1>(checked_own_cast<TH1*>(
1798  rootFile->Get("Material_rel21/DX0_ConfigFpMX"))));
1799  m_matX0Additions.emplace_back(std::unique_ptr<TH1>(
1800  checked_own_cast<TH1*>(rootFile->Get("Material/DX0_ConfigGp"))));
1801  m_matX0Additions.emplace_back(std::unique_ptr<TH1>(
1802  checked_own_cast<TH1*>(rootFile->Get("Material_rel21/DX0_ConfigN"))));
1803  } else {
1804  m_matX0Additions.emplace_back(std::unique_ptr<TH1>(
1805  checked_own_cast<TH1*>(rootFile->Get("Material/DX0_ConfigA"))));
1806  m_matX0Additions.emplace_back(std::unique_ptr<TH1>(
1807  checked_own_cast<TH1*>(rootFile->Get("Material/DX0_ConfigCpDp"))));
1808  m_matX0Additions.emplace_back(std::unique_ptr<TH1>(
1809  checked_own_cast<TH1*>(rootFile->Get("Material/DX0_ConfigEpLp"))));
1810  m_matX0Additions.emplace_back(std::unique_ptr<TH1>(
1811  checked_own_cast<TH1*>(rootFile->Get("Material/DX0_ConfigFpMX"))));
1812  m_matX0Additions.emplace_back(std::unique_ptr<TH1>(
1813  checked_own_cast<TH1*>(rootFile->Get("Material/DX0_ConfigGp"))));
1814  }
1815 
1816  m_matElectronEtaBins.reset(
1817  checked_own_cast<TAxis*>(rootFile->Get("Material/LinearityEtaBins")));
1818  m_matElectronGraphs.emplace_back(
1819  std::unique_ptr<TList>(checked_own_cast<TList*>(
1820  rootFile->Get("Material/Linearity_Cluster_ConfigA"))));
1821  m_matElectronGraphs.emplace_back(
1822  std::unique_ptr<TList>(checked_own_cast<TList*>(
1823  rootFile->Get("Material/Linearity_Cluster_ConfigCpDp"))));
1824  m_matElectronGraphs.emplace_back(
1825  std::unique_ptr<TList>(checked_own_cast<TList*>(
1826  rootFile->Get("Material/Linearity_Cluster_ConfigEpLp"))));
1827  m_matElectronGraphs.emplace_back(
1828  std::unique_ptr<TList>(checked_own_cast<TList*>(
1829  rootFile->Get("Material/Linearity_Cluster_ConfigFpMX"))));
1830  m_matElectronGraphs.emplace_back(
1831  std::unique_ptr<TList>(checked_own_cast<TList*>(
1832  rootFile->Get("Material/Linearity_Cluster_ConfigGp"))));
1833  // ... new material distortions from release 21 parameterizations
1842  m_electronBias_ConfigA.reset(checked_own_cast<TH2*>(
1843  rootFile->Get("Material_rel21/electronBias_ConfigA")));
1844  m_electronBias_ConfigEpLp.reset(checked_own_cast<TH2*>(
1845  rootFile->Get("Material_rel21/electronBias_ConfigEpLp")));
1846  m_electronBias_ConfigFpMX.reset(checked_own_cast<TH2*>(
1847  rootFile->Get("Material_rel21/electronBias_ConfigFpMX")));
1848  m_electronBias_ConfigN.reset(checked_own_cast<TH2*>(
1849  rootFile->Get("Material_rel21/electronBias_ConfigN")));
1850  m_electronBias_ConfigIBL.reset(checked_own_cast<TH2*>(
1851  rootFile->Get("Material_rel21/electronBias_ConfigIBL")));
1852  m_electronBias_ConfigPP0.reset(checked_own_cast<TH2*>(
1853  rootFile->Get("Material_rel21/electronBias_ConfigPP0")));
1854  m_unconvertedBias_ConfigA.reset(checked_own_cast<TH2*>(
1855  rootFile->Get("Material_rel21/unconvertedBias_ConfigA")));
1856  m_unconvertedBias_ConfigEpLp.reset(checked_own_cast<TH2*>(
1857  rootFile->Get("Material_rel21/unconvertedBias_ConfigEpLp")));
1858  m_unconvertedBias_ConfigFpMX.reset(checked_own_cast<TH2*>(
1859  rootFile->Get("Material_rel21/unconvertedBias_ConfigFpMX")));
1860  m_unconvertedBias_ConfigN.reset(checked_own_cast<TH2*>(
1861  rootFile->Get("Material_rel21/unconvertedBias_ConfigN")));
1862  m_unconvertedBias_ConfigIBL.reset(checked_own_cast<TH2*>(
1863  rootFile->Get("Material_rel21/unconvertedBias_ConfigIBL")));
1864  m_unconvertedBias_ConfigPP0.reset(checked_own_cast<TH2*>(
1865  rootFile->Get("Material_rel21/unconvertedBias_ConfigPP0")));
1866  m_convertedBias_ConfigA.reset(checked_own_cast<TH2*>(
1867  rootFile->Get("Material_rel21/convertedBias_ConfigA")));
1868  m_convertedBias_ConfigEpLp.reset(checked_own_cast<TH2*>(
1869  rootFile->Get("Material_rel21/convertedBias_ConfigEpLp")));
1870  m_convertedBias_ConfigFpMX.reset(checked_own_cast<TH2*>(
1871  rootFile->Get("Material_rel21/convertedBias_ConfigFpMX")));
1872  m_convertedBias_ConfigN.reset(checked_own_cast<TH2*>(
1873  rootFile->Get("Material_rel21/convertedBias_ConfigN")));
1874  m_convertedBias_ConfigIBL.reset(checked_own_cast<TH2*>(
1875  rootFile->Get("Material_rel21/convertedBias_ConfigIBL")));
1876  m_convertedBias_ConfigPP0.reset(checked_own_cast<TH2*>(
1877  rootFile->Get("Material_rel21/convertedBias_ConfigPP0")));
1878  }
1879 
1880  // ... Fastsim to Fullsim corrections
1881 
1888 
1889  m_G4OverAFII_electron.reset(checked_own_cast<TH1*>(
1890  rootFile->Get("FastSim/es2015/el_scale_full_fast_peak_gaussian")));
1891  m_G4OverAFII_unconverted.reset(checked_own_cast<TH1*>(rootFile->Get(
1892  "FastSim/es2015/ph_unconv_scale_full_fast_peak_gaussian")));
1893  m_G4OverAFII_converted.reset(checked_own_cast<TH1*>(
1894  rootFile->Get("FastSim/es2015/ph_conv_scale_full_fast_peak_gaussian")));
1895  } else if (m_esmodel == egEnergyCorr::es2017 or
1902  m_G4OverAFII_electron.reset(checked_own_cast<TH1*>(
1903  rootFile->Get("FastSim/es2017/el_scale_full_fast_peak_gaussian")));
1904  m_G4OverAFII_unconverted.reset(checked_own_cast<TH1*>(rootFile->Get(
1905  "FastSim/es2017/ph_unconv_scale_full_fast_peak_gaussian")));
1906  m_G4OverAFII_converted.reset(checked_own_cast<TH1*>(
1907  rootFile->Get("FastSim/es2017/ph_conv_scale_full_fast_peak_gaussian")));
1908  } else if (m_esmodel == egEnergyCorr::es2017_R21_v1 ||
1912  m_G4OverAFII_electron_2D.reset(checked_own_cast<TH2*>(
1913  rootFile->Get("FastSim/es2017_v1/scale_Af2ToG4_elec_rel21")));
1914  m_G4OverAFII_electron_2D->SetDirectory(nullptr);
1915  m_G4OverAFII_unconverted_2D.reset(checked_own_cast<TH2*>(
1916  rootFile->Get("FastSim/es2017_v1/scale_Af2ToG4_unco_rel21")));
1917  m_G4OverAFII_converted_2D.reset(checked_own_cast<TH2*>(
1918  rootFile->Get("FastSim/es2017_v1/scale_Af2ToG4_conv_rel21")));
1919  }
1924  m_G4OverAFII_electron_2D.reset(checked_own_cast<TH2*>(
1925  rootFile->Get("FastSim/es2023_R22_Run2_v1/scale_AF3ToG4_elec_rel22")));
1926  m_G4OverAFII_electron_2D->SetDirectory(nullptr);
1927  m_G4OverAFII_unconverted_2D.reset(checked_own_cast<TH2*>(
1928  rootFile->Get("FastSim/es2023_R22_Run2_v1/scale_AF3ToG4_unco_rel22")));
1929  m_G4OverAFII_converted_2D.reset(checked_own_cast<TH2*>(
1930  rootFile->Get("FastSim/es2023_R22_Run2_v1/scale_AF3ToG4_conv_rel22")));
1931  }
1932  else { // run 1
1933  m_G4OverAFII_electron.reset(
1934  checked_own_cast<TH1*>(rootFile->Get("FastSim/hG4OverAF")));
1935  }
1936  m_G4OverFrSh.reset(
1937  checked_own_cast<TH1*>(rootFile->Get("FastSim/hG4OverFS")));
1938  // ... Leakage systematics
1939 
1954  m_leakageConverted.reset(
1955  checked_own_cast<TH1*>(rootFile->Get("Leakage/LeakageDiffConverted")));
1956  m_leakageUnconverted.reset(checked_own_cast<TH1*>(
1957  rootFile->Get("Leakage/LeakageDiffUnconverted")));
1960  m_leakageConverted.reset(checked_own_cast<TH1*>(
1961  rootFile->Get("Leakage/es2017_summer/LeakageDiffConverted")));
1962  m_leakageUnconverted.reset(checked_own_cast<TH1*>(
1963  rootFile->Get("Leakage/es2017_summer/LeakageDiffUnconverted")));
1964  } else {
1965  m_leakageConverted.reset(checked_own_cast<TH1*>(
1966  rootFile->Get("Leakage/es2023_R22_Run2_v0/LeakageDiffConverted")));
1967  m_leakageUnconverted.reset(checked_own_cast<TH1*>(
1968  rootFile->Get("Leakage/es2023_R22_Run2_v0/LeakageDiffUnconverted")));
1969  m_leakageElectron.reset(checked_own_cast<TH1*>(
1970  rootFile->Get("Leakage/es2023_R22_Run2_v0/LeakageDiffElectron")));
1971  m_leakageElectron->SetDirectory(nullptr);
1972  }
1973  if (m_leakageConverted.get() && m_leakageUnconverted.get()) {
1974  m_leakageConverted->SetDirectory(nullptr);
1975  m_leakageUnconverted->SetDirectory(nullptr);
1976  } else {
1977  ATH_MSG_INFO("No leakage systematic uncertainty for ES model "
1978  << m_esmodel);
1979  }
1980 
1981  // ... Zee S2 profile (needed for gain switch syst).
1982  m_zeeES2Profile.reset(
1983  checked_own_cast<TH1*>(rootFile->Get("ZeeEnergyProfiles/p2MC")));
1984  // mean Zee energy as function of eta
1985  m_meanZeeProfile.reset(checked_own_cast<TProfile*>(
1986  rootFile->Get("ZeeMeanET/MC_eta_vs_et_profiled")));
1987  // OK, now we are all initialized and everything went fine
1988  m_initialized = true;
1989  return 1;
1990 }
1991 
1992 // User interface
1993 // universal compact interface to getCorrectedEnergy(...)
1996  PATCore::ParticleType::Type ptype, double momentum, double trk_eta,
1997  egEnergyCorr::Scale::Variation scaleVar, double varSF) const {
1998 
1999  double correctedMomentum = momentum;
2000  double aeta = std::abs(trk_eta);
2001 
2002  if (ptype == PATCore::ParticleType::Electron &&
2004 
2005  double corr = 0;
2006  if (scaleVar == egEnergyCorr::Scale::MomentumUp)
2007  corr = m_trkSyst->GetBinContent(m_trkSyst->FindFixBin(aeta));
2008  else if (scaleVar == egEnergyCorr::Scale::MomentumDown)
2009  corr = -m_trkSyst->GetBinContent(m_trkSyst->FindFixBin(aeta));
2010 
2011  correctedMomentum *= 1. + corr * varSF;
2012  }
2013 
2014  return correctedMomentum;
2015 }
2016 
2017 // This method handles the main switches between data and the various MC
2018 // flavours. Called internally by getCorrectedEnergy(...)
2021  PATCore::ParticleType::Type ptype, double cl_eta, double cl_etaS2, double cl_etaCalo,
2022  double energy, double energyS2, double eraw, RandomNumber random_seed,
2025  egEnergyCorr::Resolution::resolutionType resType, double varSF) const {
2026  double fullyCorrectedEnergy = energy;
2027 
2028  // Correct fast sim flavours
2029 
2030  if (dataType == PATCore::ParticleDataType::FastShower) // Frozen shower sim
2031  fullyCorrectedEnergy = energy * this->applyFStoG4(cl_eta);
2032  else if (dataType == PATCore::ParticleDataType::Fast) // AtlFast2 sim
2033  {
2034  fullyCorrectedEnergy =
2035  energy *
2036  this->applyAFtoG4(cl_eta, 0.001 * energy / cosh(cl_eta), ptype);
2037  }
2038 
2039  // If nothing is to be done
2040 
2041  if (scaleVar == egEnergyCorr::Scale::None &&
2043  return fullyCorrectedEnergy;
2044 
2045  ATH_MSG_DEBUG(std::format("after sim fl = {:.2f}", fullyCorrectedEnergy));
2046 
2047  // main E-scale corrections
2048 
2049  if (dataType == PATCore::ParticleDataType::Data) { // ... Data
2050 
2051  if (scaleVar == egEnergyCorr::Scale::Nominal) {
2052  double alpha =
2053  getAlphaValue(runnumber, cl_eta, cl_etaS2, cl_etaCalo, fullyCorrectedEnergy,
2054  energyS2, eraw, ptype, scaleVar, varSF);
2055  fullyCorrectedEnergy /= (1 + alpha);
2056  // apply additional k.E+b corrections if histograms exist (like in
2057  // es2017_R21_v1)
2058  if (m_zeeFwdk && m_zeeFwdb && std::abs(cl_eta) > 2.5) { // calo eta?
2059  int ieta_k = m_zeeFwdk->GetXaxis()->FindFixBin(cl_eta);
2060  double value_k = m_zeeFwdk->GetBinContent(ieta_k);
2061  int ieta_b = m_zeeFwdb->GetXaxis()->FindFixBin(cl_eta);
2062  double value_b = m_zeeFwdb->GetBinContent(ieta_b);
2063  fullyCorrectedEnergy =
2064  value_k * fullyCorrectedEnergy +
2065  value_b * GeV; // value is stored in GeV in the histogram file
2066  }
2067  ATH_MSG_DEBUG(std::format("after alpha = {:.2f}", fullyCorrectedEnergy));
2068  }
2069 
2070  }
2071  else { // ... MC
2072 
2073  // Do the energy scale correction (for systematic variations)
2074 
2075  if (scaleVar != egEnergyCorr::Scale::None &&
2076  scaleVar != egEnergyCorr::Scale::Nominal) {
2077  double deltaAlpha = getAlphaUncertainty(runnumber, cl_eta, cl_etaS2, cl_etaCalo,
2078  fullyCorrectedEnergy, energyS2,
2079  eraw, ptype, scaleVar, varSF);
2080  ATH_MSG_DEBUG("alpha sys " << variationName(scaleVar) << " = "
2081  << deltaAlpha);
2082  fullyCorrectedEnergy *= (1 + deltaAlpha);
2083  ATH_MSG_DEBUG(std::format("after mc alpha = {:.2f}", fullyCorrectedEnergy));
2084  }
2085 
2086  // AF2 systematics (this will not be in the sum of all other NP in the 1 NP
2087  // model)
2089  (scaleVar == egEnergyCorr::Scale::afUp or scaleVar == egEnergyCorr::Scale::afDown)) {
2090  double daAF2 = 0.;
2091  double sign = (scaleVar == egEnergyCorr::Scale::afUp) ? 1. : -1.;
2093  daAF2 = 0.005*sign;
2094  }
2095  else if (m_esmodel >= egEnergyCorr::es2017_R21_v1 and
2097  daAF2 = 0.001*sign;
2098  }
2102  fullyCorrectedEnergy/cosh(cl_eta) < 20e3) {
2103  daAF2 = 0.003*sign;
2104  }
2105  else {
2106  daAF2 = 0.001*sign;
2107  }
2108  }
2109  fullyCorrectedEnergy *= (1 + daAF2);
2110  }
2111 
2112  // Do the resolution correction
2113  if (resVar != egEnergyCorr::Resolution::None)
2114  fullyCorrectedEnergy *=
2115  getSmearingCorrection(cl_eta, cl_etaCalo, fullyCorrectedEnergy,
2116  random_seed, ptype, dataType, resVar, resType);
2117 
2118  ATH_MSG_DEBUG(std::format("after resolution correction = {:.2f}", fullyCorrectedEnergy));
2119  }
2120 
2121  return fullyCorrectedEnergy;
2122 }
2123 
2124 // This method applied the overall energy corrections and systematic variations.
2125 // Called internally by getCorrectedEnergy(...).
2126 // convention is Edata = (1+alpha)*Emc, hence Edata -> Edata/(1+alpha) to match
2127 // the MC note : all energies in MeV
2128 
2129 // returns alpha_var. var = egEnergyCorr::Scale::Nominal or any systematic
2130 // variation
2131 
2133  long int runnumber, double cl_eta, double cl_etaS2, double cl_etaCalo,
2134  double energy, // input energy (not ET!!)
2135  double energyS2, // raw energy in S2
2136  double eraw, PATCore::ParticleType::Type ptype,
2137  egEnergyCorr::Scale::Variation var, double varSF) const {
2138 
2139  double meanET = getZeeMeanET(m_use_etaCalo_scales ? cl_etaCalo : cl_eta);
2140  ATH_MSG_DEBUG("getZeeMeanET() output " << meanET);
2141  ATH_MSG_DEBUG("getZeeMeanET() eta: "
2142  << double(m_use_etaCalo_scales ? cl_etaCalo : cl_eta));
2143  double meanE = meanET * std::cosh(cl_eta);
2144  double Et = energy / std::cosh(cl_eta);
2145 
2146  // Main Scale factor
2147 
2148  double alphaZee = getAlphaZee(
2149  runnumber, m_use_etaCalo_scales ? cl_etaCalo : cl_eta, var, varSF);
2150 
2151  // Sampling recalibration
2152 
2153  double daPS, daS12, linPS, linS12, linEacc, linPS_40_elec, linEacc_40_elec,
2154  linS12_40_elec;
2155  daPS = daS12 = linPS = linS12 = linEacc = linPS_40_elec = linEacc_40_elec =
2156  linS12_40_elec = 0.;
2157 
2158  double daE4 = 0., linE4 = 0.;
2159  // E4 contribution
2179  daE4 = getE4Uncertainty(cl_eta);
2181  daE4 *= -1;
2182  linE4 = getE4NonLinearity(cl_eta, energy, ptype) -
2184  }
2185 
2186  // wtots1 contribution
2187  double daWtots1 = 0.;
2188  if ((m_esmodel == egEnergyCorr::es2017 or
2205  daWtots1 = getWtots1Uncertainty(cl_eta, energy, ptype);
2207  daWtots1 = -daWtots1;
2208  }
2209 
2210  // ... Presampler contribution
2211 
2217 
2220  daPS = getLayerUncertainty(0, cl_eta, var, varSF);
2221  linPS = getLayerNonLinearity(0, cl_eta, energy, ptype) -
2222  getLayerNonLinearity(0, cl_eta, meanE,
2224  } else {
2225  daPS = getLayerUncertainty(0, cl_eta, var, varSF);
2226  linPS = getLayerNonLinearity(0, cl_eta, energy, ptype);
2227  linEacc = getLayerNonLinearity(
2228  6, m_use_etaCalo_scales ? cl_etaCalo : cl_eta, energy, ptype);
2229  linPS_40_elec = getLayerNonLinearity(0, cl_eta, meanE,
2231  linEacc_40_elec = getLayerNonLinearity(
2232  6, m_use_etaCalo_scales ? cl_etaCalo : cl_eta,
2233  meanET * std::cosh(m_use_etaCalo_scales ? cl_etaCalo : cl_eta),
2235  ATH_MSG_DEBUG(
2236  "es2023_R22_Run2_v0 PS non-linearity before Acc correction: "
2237  << linPS);
2238  linPS = linPS - linEacc * linPS_40_elec / linEacc_40_elec;
2239  ATH_MSG_DEBUG("es2023_R22_Run2_v0 PS non-linearity after Acc correction: "
2240  << linPS);
2241  }
2242  }
2243 
2244  // ... S1 / S2 contribution
2245 
2256  daS12 = getLayerUncertainty(1, cl_eta, var, varSF);
2257  linS12 = getLayerNonLinearity(1, cl_eta, energy, ptype) -
2258  getLayerNonLinearity(1, cl_eta, meanE,
2260  } else {
2261  daS12 = getLayerUncertainty(1, cl_eta, var, varSF) *
2262  -1.; // uncertainty applied to E2 is equal to -delta E1/E2 scale
2263  linS12 = getLayerNonLinearity(1, cl_eta, energy, ptype);
2264  linEacc = getLayerNonLinearity(
2265  6, m_use_etaCalo_scales ? cl_etaCalo : cl_eta, energy, ptype);
2266  linS12_40_elec = getLayerNonLinearity(1, cl_eta, meanE,
2268  linEacc_40_elec = getLayerNonLinearity(
2269  6, m_use_etaCalo_scales ? cl_etaCalo : cl_eta,
2270  meanET * std::cosh(m_use_etaCalo_scales ? cl_etaCalo : cl_eta),
2272  ATH_MSG_DEBUG(
2273  "es2023_R22_Run2_v0 S12 non-linearity before Acc correction: "
2274  << linS12);
2275  linS12 = linS12 - linEacc * linS12_40_elec / linEacc_40_elec;
2276  ATH_MSG_DEBUG(
2277  "es2023_R22_Run2_v0 S12 non-linearity after Acc correction: "
2278  << linS12);
2279  }
2280  }
2281 
2282  // Material contribution
2283 
2284  double daMatID, daMatCryo, daMatCalo;
2285  daMatID = daMatCryo = daMatCalo = 0;
2286 
2287  // for release 21 sensitivity use the same getMaterialNonLinearity for all
2288  // particles while in sensitivities derived from run 1 this is only used for
2289  // electrons
2290 
2291  if (ptype != PATCore::ParticleType::Electron &&
2300 
2301  daMatID = getAlphaMaterial(cl_eta, egEnergyCorr::MatID, ptype, var, varSF);
2302  daMatCryo =
2303  getAlphaMaterial(cl_eta, egEnergyCorr::MatCryo, ptype, var, varSF);
2304  daMatCalo =
2305  getAlphaMaterial(cl_eta, egEnergyCorr::MatCalo, ptype, var, varSF);
2306 
2307  } else {
2308 
2309  daMatID =
2311  varSF) -
2314  daMatCryo =
2316  var, varSF) -
2319  daMatCalo =
2321  var, varSF) -
2324  }
2325 
2326  // Pedestal subtraction
2327 
2328  double daPedestal =
2329  getAlphaPedestal(cl_eta, energy, eraw, ptype, false, var, varSF) -
2331  true, var, varSF);
2332 
2333  // double pedestal systematics for 2016, Guillaume 12/05/16
2335  daPedestal *= 2;
2336  }
2337 
2338  // Leakage contribution (electron-photon difference)
2339  double daLeakage = getAlphaLeakage2D(cl_etaS2, Et, ptype, var, varSF);
2340 
2341  // L1 Gain switch contribution
2342 
2343  double daL1GainSwitch = 0.;
2344 
2347 
2348  int eg_e1hg_ptype;
2349  if (ptype == PATCore::ParticleType::Electron)
2350  eg_e1hg_ptype = 0;
2351  else if (ptype == PATCore::ParticleType::UnconvertedPhoton)
2352  eg_e1hg_ptype = 1;
2353  else if (ptype == PATCore::ParticleType::ConvertedPhoton)
2354  eg_e1hg_ptype = 2;
2355  else
2356  return -1;
2357 
2358  daL1GainSwitch = m_e1hg_tool->getAlpha(eg_e1hg_ptype, energy, cl_eta, true);
2360  daL1GainSwitch = -daL1GainSwitch;
2361  }
2362 
2363  // L2 Gain switch contribution
2364 
2365  double daL2GainSwitch = 0.;
2366  double daL2MediumGainSwitch = 0.;
2367  double daL2LowGainSwitch = 0.;
2368 
2373  if (m_gain_tool) { // recipe for run1
2374  if (!(std::abs(cl_eta) < 1.52 && std::abs(cl_eta) > 1.37) &&
2375  std::abs(cl_eta) < 2.4) {
2376  double evar = m_gain_tool->CorrectionGainTool(cl_eta, energy / GeV,
2377  energyS2 / GeV, ptype);
2378  double meanES2 = m_zeeES2Profile->GetBinContent(
2379  m_zeeES2Profile->FindFixBin(cl_eta)); // in GeV already
2380  double eref = m_gain_tool->CorrectionGainTool(
2381  cl_eta, meanE / GeV, meanES2, PATCore::ParticleType::Electron);
2382  daL2GainSwitch = evar / energy - eref / meanE;
2384  daL2GainSwitch = -daL2GainSwitch;
2385  }
2386  } else if (m_gain_tool_run2) { // recipe for run 2, see ATLASEG-44
2387  daL2GainSwitch = m_gain_tool_run2->getUncertainty(cl_etaCalo, Et, ptype,
2390  daL2GainSwitch *= -1;
2391  ATH_MSG_DEBUG("L2 gain uncertainty: " << daL2GainSwitch);
2392  } else {
2393  ATH_MSG_ERROR(
2394  "trying to compute gain systematic, but no tool for doing it has "
2395  "been instantiated, setting sys to 0");
2396  daL2GainSwitch = 0.;
2397  }
2398  }
2399 
2403  if (m_gain_tool_run2) { // recipe for run 2, see ATLASEG-44
2404  daL2MediumGainSwitch = m_gain_tool_run2->getUncertainty(
2405  cl_etaCalo, Et, ptype, m_useL2GainCorrection,
2408  daL2MediumGainSwitch *= -1;
2409  ATH_MSG_DEBUG("L2 gain Medium uncertainty: " << daL2MediumGainSwitch);
2410  } else {
2411  ATH_MSG_ERROR(
2412  "trying to compute gain systematic, but no tool for doing it has "
2413  "been instantiated, setting sys to 0");
2414  daL2MediumGainSwitch = 0.;
2415  }
2416  }
2417 
2421  if (m_gain_tool_run2) { // recipe for run 2, see ATLASEG-44
2422  daL2LowGainSwitch = m_gain_tool_run2->getUncertainty(
2423  cl_etaCalo, Et, ptype, m_useL2GainCorrection,
2426  daL2LowGainSwitch *= -1;
2427  ATH_MSG_DEBUG("L2 gain Low uncertainty: " << daL2LowGainSwitch);
2428  } else {
2429  ATH_MSG_ERROR(
2430  "trying to compute Low gain systematic, but no tool for doing it has "
2431  "been instantiated, setting sys to 0");
2432  daL2LowGainSwitch = 0.;
2433  }
2434  }
2435 
2436  // pp0 (and IBL)
2437  double dapp0 = 0.;
2438  // values from the histogram already are 0 for the Z->ee electrons
2441 
2442  // new parameterization for release 21 reconstruction with mc16 geometries +
2443  // distortions
2452 
2453  if (std::abs(cl_eta) < 1.5)
2454  dapp0 = getMaterialEffect(egEnergyCorr::ConfigIBL, ptype, cl_eta,
2455  energy / GeV / cosh(cl_eta)) -
2458  getZeeMeanET(cl_eta) / GeV);
2459  else
2460  dapp0 = getMaterialEffect(egEnergyCorr::ConfigPP0, ptype, cl_eta,
2461  energy / GeV / cosh(cl_eta)) -
2464  getZeeMeanET(cl_eta) / GeV);
2465 
2467  dapp0 = -dapp0;
2468  }
2469  }
2470 
2471  // release 20 run 2 systematics for mc15 like geometries
2472  else {
2473  // Just pick the owned one from a unique_ptr per case
2474  const TH2* histo = nullptr;
2476  histo = m_pp0_elec.get();
2478  histo = m_pp0_conv.get();
2479  else if (ptype == PATCore::ParticleType::UnconvertedPhoton &&
2480  m_pp0_unconv)
2481  histo = m_pp0_unconv.get();
2482 
2483  if (histo) {
2484  const double aeta = std::abs(cl_eta);
2485  dapp0 = getValueHistAt(*histo, aeta, energy / GeV / cosh(cl_eta), false,
2486  true, false, true);
2488  dapp0 = -dapp0;
2489  }
2490 
2491  // normalize to pp0 systematics
2492  if (aeta > 1.5 and aeta < 2.0) {
2493  dapp0 *= 2.6;
2494  } else if (aeta >= 2.0 and aeta <= 2.5) {
2495  dapp0 *= 2.3;
2496  }
2497  }
2498  }
2499  }
2500 
2501  // Conversion systematics
2502 
2503  double daConvSyst = getAlphaConvSyst(cl_eta, energy, ptype, var, varSF);
2504 
2505  // topo cluster threshold systematics for release 21
2506  double daTopoCluster = 0;
2518  double Et = energy / cosh(cl_eta);
2519  double Et0 = 10000.;
2520  // Effect taken as 10**-3/(Et/10GeV) - order of magniture from
2521  // https://indico.cern.ch/event/669895/contributions/2745266/attachments/1535612/2405452/slides.pdf
2523  daTopoCluster = 1e-3 * (1. / (Et / Et0) - 1. / (meanET / Et0));
2525  daTopoCluster = -1e-3 * (1. / (Et / Et0) - 1. / (meanET / Et0));
2526  }
2527 
2528  // ADC non linearity correction. 30% of the effect from
2529  // https://indico.cern.ch/event/1001455/contributions/4205636/attachments/2179584/3681315/ADC-linearity-28jan2021.pdf
2530  // ?
2531  double daADCLin = 0;
2535  if (m_ADCLinearity_tool) {
2536  double corr = m_ADCLinearity_tool->getCorr(cl_etaCalo, Et, ptype) - 1.;
2537  daADCLin = 0.3 * corr;
2538  } else {
2540  "trying to compute ADC correction systematic, but no tool for doing "
2541  "it has been instantiated, setting sys to 0");
2542  daADCLin = 0.;
2543  }
2545  daADCLin *= -1;
2546  }
2547 
2548  // Total
2549  double alphaTot = alphaZee;
2550  alphaTot += daE4 * linE4;
2551  alphaTot += daPS * linPS;
2552  alphaTot += daS12 * linS12;
2553  alphaTot += daMatID + daMatCryo + daMatCalo;
2554  alphaTot += daLeakage;
2555  alphaTot += daL1GainSwitch;
2556  alphaTot += daL2GainSwitch;
2557  alphaTot += daL2MediumGainSwitch;
2558  alphaTot += daL2LowGainSwitch;
2559  alphaTot += daConvSyst;
2560  alphaTot += daPedestal;
2561  alphaTot += daWtots1;
2562  alphaTot += dapp0;
2563  alphaTot += daTopoCluster;
2564  alphaTot += daADCLin;
2565 
2566  ATH_MSG_DEBUG("alpha value for " << variationName(var) << " = " << alphaTot);
2567 
2568  return alphaTot;
2569 }
2570 
2571 // returns alpha_var - alpha_nom, for systematic variations.
2572 
2574  long int runnumber, double cl_eta, double cl_etaS2, double cl_etaCalo, double energy,
2575  double energyS2, double eraw, PATCore::ParticleType::Type ptype,
2576  egEnergyCorr::Scale::Variation var, double varSF) const {
2577 
2578  double alphaNom =
2579  getAlphaValue(runnumber, cl_eta, cl_etaS2, cl_etaCalo, energy, energyS2, eraw,
2581  double alphaVar = 0.;
2582 
2587  // not an ALLUP
2588  alphaVar = getAlphaValue(runnumber, cl_eta, cl_etaS2, cl_etaCalo, energy, energyS2,
2589  eraw, ptype, var, varSF) -
2590  alphaNom;
2591  } else if (var == egEnergyCorr::Scale::AllUp) {
2596  continue;
2597  const double v = getAlphaValue(runnumber, cl_eta, cl_etaS2, cl_etaCalo, energy,
2598  energyS2, eraw, ptype, ivar, varSF) -
2599  alphaNom;
2600  ATH_MSG_DEBUG("computing ALLUP, adding " << variationName(ivar) << ": "
2601  << v);
2602  alphaVar += pow(v, 2);
2603  }
2604  alphaVar = sqrt(alphaVar);
2605  } else if (var == egEnergyCorr::Scale::AllDown) {
2610  continue;
2611  const double v = getAlphaValue(runnumber, cl_eta, cl_etaS2, cl_etaCalo, energy,
2612  energyS2, eraw, ptype, ivar, varSF) -
2613  alphaNom;
2614  ATH_MSG_DEBUG("computing ALLDOWN, adding " << variationName(ivar) << ": "
2615  << v);
2616  alphaVar += pow(v, 2);
2617  }
2618  alphaVar = -sqrt(alphaVar);
2619  } else if (var == egEnergyCorr::Scale::AllCorrelatedUp) {
2628  continue;
2629  const double v = getAlphaValue(runnumber, cl_eta, cl_etaS2, cl_etaCalo, energy,
2630  energyS2, eraw, ptype, ivar, varSF) -
2631  alphaNom;
2632  alphaVar += pow(v, 2);
2633  }
2634  alphaVar = sqrt(alphaVar);
2644  continue;
2645  const double v = getAlphaValue(runnumber, cl_eta, cl_etaS2, cl_etaCalo, energy,
2646  energyS2, eraw, ptype, ivar, varSF) -
2647  alphaNom;
2648  alphaVar += pow(v, 2);
2649  }
2650  alphaVar = -sqrt(alphaVar);
2651  }
2652 
2653  return alphaVar;
2654 }
2655 
2656 // returns mean electron ET at given eta
2657 double egammaEnergyCorrectionTool::getZeeMeanET(double cl_eta) const {
2660  return 40000.;
2661  else {
2662  if (std::abs(cl_eta) >= 2.47)
2663  cl_eta = 2.46;
2664  return m_meanZeeProfile->GetBinContent(
2665  m_meanZeeProfile->FindBin(std::abs(cl_eta))) *
2666  1000;
2667  }
2668 }
2669 
2670 // RESOLUTION FUNCTIONS START HERE (MB)
2671 
2672 // sampling term inMC, parametrization from Iro Koletsou
2673 
2675 
2676  double aeta = std::abs(cl_eta);
2677  double sampling = 0.;
2678 
2679  if (aeta < 0.8)
2680  sampling = 0.091;
2681 
2682  else if (aeta < 1.37)
2683  sampling = 0.036 + 0.130 * aeta;
2684 
2685  else if (aeta < 1.52)
2686  sampling = 0.27;
2687 
2688  else if (aeta < 2.0)
2689  sampling = 0.85 - 0.36 * aeta;
2690 
2691  else if (aeta < 2.3)
2692  sampling = 0.16;
2693 
2694  else if (aeta < 2.5)
2695  sampling = -1.05 + 0.52 * aeta;
2696 
2697  return sampling;
2698 }
2699 
2700 // sampling term uncertainty
2701 
2703 
2704  (void)cl_eta; // not used
2705  return 0.1; // when will this be improved?
2706 }
2707 
2708 // noise term in MC (from Iro)
2709 
2711 
2712  double aeta = std::abs(cl_eta);
2713  double noise = 0.;
2714 
2715  double noise37[25] = {0.27, 0.27, 0.27, 0.27, 0.27, 0.26, 0.25, 0.23, 0.21,
2716  0.19, 0.17, 0.16, 0.15, 0.14, 0.27, 0.23, 0.17, 0.15,
2717  0.13, 0.10, 0.07, 0.06, 0.05, 0.04, 0.03};
2718 
2719  int ieta = (int)(aeta / 0.1);
2720 
2721  if (ieta >= 0 && ieta < 25)
2722  noise = noise37[ieta] * cosh(cl_eta); // the above parametrization is vs ET
2723 
2724  return noise;
2725 }
2726 
2727 // constant term in MC (local)
2728 
2730 
2731  double aeta = std::abs(cl_eta);
2732  double cst = 0.;
2733 
2734  if (aeta < 0.6)
2735  cst = 0.005;
2736 
2737  else if (aeta < 1.75)
2738  cst = 0.003;
2739 
2740  else if (aeta < 2.5)
2741  cst = 0.0055 * (2.69 - aeta);
2742 
2743  // cst = 0.005;
2744 
2745  return cst;
2746 }
2747 
2748 // constant term fitted in data (long range)
2749 
2751  return std::max(0., m_resNom->GetBinContent(m_resNom->FindFixBin(eta)));
2752 }
2753 
2755  return m_resSyst->GetBinContent(m_resSyst->FindFixBin(eta));
2756 }
2757 
2759  return m_resSystOFC->GetBinContent(m_resSystOFC->FindFixBin(eta));
2760 }
2761 
2762 // fitted Z peak resolution, data, in GeV
2763 
2765 
2766  return m_peakResData->GetBinContent(
2767  std::as_const(*m_peakResData).GetXaxis()->FindBin(cl_eta));
2768 }
2769 
2770 // fitted Z peak resolution, MC, in GeV
2771 
2773 
2774  return m_peakResMC->GetBinContent(
2775  std::as_const(*m_peakResMC).GetXaxis()->FindBin(cl_eta));
2776 }
2777 
2778 // correlated part of constant term uncertainty, in data (approx.)
2779 
2781  double cl_eta) const {
2782 
2783  double mz = 91.2;
2784 
2785  double resData = dataZPeakResolution(cl_eta);
2786  double resMC = mcZPeakResolution(cl_eta);
2787  double cmc = mcConstantTerm(cl_eta);
2788 
2789  double smpup = 1. + mcSamplingTermRelError(cl_eta);
2790  double smpdo = 1. - mcSamplingTermRelError(cl_eta);
2791 
2792  double central =
2793  sqrt(2 * (resData * resData - resMC * resMC) / mz / mz + cmc * cmc);
2794  double vardown =
2795  sqrt(2 * (resData * resData - resMC * resMC * smpup * smpup) / mz / mz +
2796  cmc * cmc);
2797  double varup =
2798  sqrt(2 * (resData * resData - resMC * resMC * smpdo * smpdo) / mz / mz +
2799  cmc * cmc);
2800 
2801  double errdown = std::abs(central - vardown);
2802  double errup = std::abs(central - varup);
2803 
2804  return .5 * (errup + errdown);
2805 }
2806 
2807 // get fractional uncertainty on resolution
2808 
2811  double etaCalo, PATCore::ParticleType::Type ptype,
2814 
2815 {
2816 
2817  int eg_resolution_ptype;
2818  if (ptype == PATCore::ParticleType::Electron)
2819  eg_resolution_ptype = 0;
2820  else if (ptype == PATCore::ParticleType::UnconvertedPhoton)
2821  eg_resolution_ptype = 1;
2822  else if (ptype == PATCore::ParticleType::ConvertedPhoton)
2823  eg_resolution_ptype = 2;
2824  else
2825  return -1;
2826 
2827  int isys = 0;
2830  isys = 0xFFFF;
2831  }
2834  isys = 0x1;
2835  }
2838  isys = 0x2;
2839  }
2842  isys = 0x4;
2843  }
2846  isys = 0x8;
2847  }
2850  isys = 0x10;
2851  }
2854  isys = 0x20;
2855  }
2858  isys = 0x40;
2859  }
2860 
2863  isys = 0x80;
2864  }
2867  isys = 0x100;
2868  }
2871  isys = 0x200;
2872  }
2875  isys = 0x400;
2876  }
2877 
2878  double sign = 1.;
2891  sign = -1.;
2892 
2893  double resolution;
2894  double resolution_error;
2895  double resolution_error_up;
2896  double resolution_error_down;
2897 
2898  getResolution_systematics(eg_resolution_ptype, energy, eta, etaCalo, isys,
2899  resolution, resolution_error, resolution_error_up,
2900  resolution_error_down, resType,
2902 
2903  // total resolution uncertainty
2906  resolution_error = resolution_error / resolution * sign;
2907  } else {
2908  if (sign == 1)
2909  resolution_error = resolution_error_up / resolution;
2910  else
2911  resolution_error = resolution_error_down / resolution;
2912  }
2913 
2914  return resolution_error;
2915 }
2916 
2917 // total resolution uncertainty (fractional) (OLD model)
2918 
2920  double cl_eta, double& errUp,
2921  double& errDown) const {
2922 
2923  double Cdata = dataConstantTerm(cl_eta);
2924  double Cdata_cor = dataConstantTermCorError(cl_eta);
2925  double Cdata_err = dataConstantTermError(cl_eta);
2926 
2927  double Cdata_unc = 0.;
2928  if (Cdata_err > Cdata_cor)
2929  Cdata_unc = sqrt(Cdata_err * Cdata_err - Cdata_cor * Cdata_cor);
2930  if (Cdata_unc < 0.001)
2931  Cdata_unc = 0.001; // preserve at least the stat error
2932 
2933  double Smc = mcSamplingTerm(cl_eta);
2934  double Smc_err = mcSamplingTermRelError(cl_eta);
2935 
2936  double central = fcn_sigma(energy, Cdata, 0., Smc, 0.);
2937 
2938  double err1 = fcn_sigma(energy, Cdata, Cdata_unc, Smc, 0.) - central;
2939  double err2 = fcn_sigma(energy, Cdata, -Cdata_unc, Smc, 0.) - central;
2940  double err3 = fcn_sigma(energy, Cdata, -Cdata_cor, Smc, Smc_err) - central;
2941  double err4 = -err3;
2942 
2943  errUp = 0;
2944  if (err1 > 0)
2945  errUp = sqrt(errUp * errUp + err1 * err1);
2946  if (err2 > 0)
2947  errUp = sqrt(errUp * errUp + err2 * err2);
2948  if (err3 > 0)
2949  errUp = sqrt(errUp * errUp + err3 * err3);
2950  if (err4 > 0)
2951  errUp = sqrt(errUp * errUp + err4 * err4);
2952 
2953  errDown = -errUp;
2954 }
2955 
2956 // total resolution (fractional)
2957 
2959  double energy, double cl_eta, double cl_etaCalo,
2960  PATCore::ParticleType::Type ptype, bool withCT, bool fast,
2962  int eg_resolution_ptype;
2963  if (ptype == PATCore::ParticleType::Electron)
2964  eg_resolution_ptype = 0;
2965  else if (ptype == PATCore::ParticleType::UnconvertedPhoton)
2966  eg_resolution_ptype = 1;
2967  else if (ptype == PATCore::ParticleType::ConvertedPhoton)
2968  eg_resolution_ptype = 2;
2969  else {
2970  ATH_MSG_FATAL("cannot understand particle type");
2971  return -1;
2972  }
2973 
2974  double sig2 = 0.;
2975 
2977  sig2 = pow(m_resolution_tool->getResolution(eg_resolution_ptype, energy,
2978  cl_eta, resType),
2979  2);
2980  const double et = energy / cosh(cl_eta);
2981  sig2 += pow(pileUpTerm(energy, cl_eta, eg_resolution_ptype) / et,
2982  2); // TODO: why et and not E?
2983  } else { // OLD model
2984 
2985  double energyGeV = energy / GeV;
2986  double a = mcSamplingTerm(cl_eta);
2987  double b = mcNoiseTerm(cl_eta);
2988  double c = mcConstantTerm(cl_eta);
2989  sig2 = a * a / energyGeV + b * b / energyGeV / energyGeV + c * c;
2990  }
2991 
2992  if (withCT and fast) {
2993  throw std::runtime_error(
2994  "It doesn't make sense to ask resolution fast sim + additional CT."
2995  " The resolution on data is FULL sim resolution + CT");
2996  }
2997 
2998  if (fast and std::abs(cl_eta) < 2.5) {
3020 
3021  double ratio_IQR_full_fast = 1.;
3022  const double ptGeV = energy / cosh(cl_eta) / 1E3;
3023 
3032  //
3033  // for es2017_R21_v1, histograms contain directly values of
3034  // deltaSigma**2 of relative energy resolution (FulSim-FastSIm) so need
3035  // to subtract this value to get the sigma**2 of FastSim
3036  bool interpolate_eta = false;
3037  bool interpolate_pt = false;
3039  // interpolate_eta = true;
3040  interpolate_pt = true;
3041  }
3042  if (ptype == PATCore::ParticleType::Electron)
3043  sig2 -= getValueHistAt(*m_G4OverAFII_resolution_electron, cl_eta,
3044  ptGeV, true, true, true, true,
3045  interpolate_eta, interpolate_pt);
3047  sig2 -= getValueHistAt(*m_G4OverAFII_resolution_unconverted, cl_eta,
3048  ptGeV, true, true, true, true,
3049  interpolate_eta, interpolate_pt);
3051  sig2 -= getValueHistAt(*m_G4OverAFII_resolution_converted, cl_eta,
3052  ptGeV, true, true, true, true,
3053  interpolate_eta, interpolate_pt);
3054  if (sig2 < 0.)
3055  sig2 = 0.;
3056  } else {
3057  if (ptype == PATCore::ParticleType::Electron) {
3058  ratio_IQR_full_fast = getValueHistAt(
3059  *m_G4OverAFII_resolution_electron, ptGeV, cl_eta, true, false);
3060  } else if (ptype == PATCore::ParticleType::UnconvertedPhoton) {
3061  ratio_IQR_full_fast = getValueHistAt(
3062  *m_G4OverAFII_resolution_unconverted, ptGeV, cl_eta, true, false);
3063  } else if (ptype == PATCore::ParticleType::ConvertedPhoton) {
3064  ratio_IQR_full_fast = getValueHistAt(
3065  *m_G4OverAFII_resolution_converted, ptGeV, cl_eta, true, false);
3066  }
3067 
3068  sig2 /= ratio_IQR_full_fast * ratio_IQR_full_fast;
3069  }
3070  }
3071  }
3072 
3073  // add the additional constant term from the Zee data/MC measurement
3074  if (withCT)
3075  sig2 += pow(
3076  dataConstantTerm(m_use_etaCalo_scales ? cl_etaCalo : cl_eta),
3077  2); // TODO: is it correct? Or should be += -c**2 + (c + deltac) ** 2 ?
3078 
3079  return sqrt(sig2);
3080 }
3081 
3082 // internal use only
3083 
3084 double egammaEnergyCorrectionTool::fcn_sigma(double energy, double Cdata,
3085  double Cdata_er, double S,
3086  double S_er) {
3087 
3088  double sigma2 = std::pow((Cdata + Cdata_er) * energy, 2) +
3089  std::pow(S * (1 + S_er) * std::sqrt(energy), 2);
3090 
3091  double sigma = 0;
3092  if (sigma2 > 0)
3093  sigma = sqrt(sigma2);
3094 
3095  return sigma / energy;
3096 }
3097 
3098 // derive smearing correction
3099 
3101  double cl_eta, double cl_etaCalo, double energy, RandomNumber seed,
3106 
3108  ATH_MSG_FATAL("Trying to compute smearing correction on data");
3109  }
3110 
3112  return 1.0;
3113 
3114  const double energyGeV = energy / GeV;
3115 
3116  // relative resolutions
3117  const double resMC =
3118  resolution(energy, cl_eta, cl_etaCalo, ptype, false, // no additional CT
3120  double resData =
3121  resolution(energy, cl_eta, cl_etaCalo, ptype, true, // with additional CT
3122  false, resType); // on top of Full simulation
3123 
3124  ATH_MSG_DEBUG("resolution in data: " << resData << " in MC: " << resMC);
3125 
3127  resData *= 1 + getResolutionError(dataType, energy, cl_eta, cl_etaCalo,
3128  ptype, value, resType);
3129  } else { // OLD model
3130  double errUp, errDown;
3131  resolutionError(energyGeV, cl_eta, errUp, errDown);
3133  resData += errDown;
3135  resData += errUp;
3137  // std::cout << "getSmearingCorrection : wrong value, return 1" <<
3138  // std::endl;
3139  return 1.0;
3140  }
3141  }
3142 
3143  ATH_MSG_DEBUG("resolution in data after systematics: " << resData);
3144 
3145  const double sigma2 =
3146  std::pow(resData * energyGeV, 2) - std::pow(resMC * energyGeV, 2);
3147 
3148  // TODO: for nominal case it can be simplified to:
3149  // const double sigma = dataConstantTerm(m_use_etaCalo_scales ? cl_etaCalo :
3150  // cl_eta) * energyGeV; which is just the additional constant term
3151  if (sigma2 <= 0) {
3152  return 1;
3153  }
3154 
3155  const double sigma = sqrt(sigma2);
3156 
3157  TRandom3 rng(seed);
3158 
3159  const double DeltaE0 = rng.Gaus(0, sigma);
3160  const double cor0 = (energyGeV + DeltaE0) / energyGeV;
3161 
3162  ATH_MSG_DEBUG("sigma|DeltaE0|cor0|seed = " << sigma << "|" << DeltaE0 << "|"
3163  << cor0 << "|" << rng.GetSeed());
3164 
3165  return cor0; // TODO: why not returning DeltaE0 and apply E -> E + DeltaE0 ?
3166 }
3167 
3168 // a calibration correction for crack electrons, to be applied to both data11
3169 // and MC11 not to be used in data12 / MC12
3170 
3172  double eta, double ET, PATCore::ParticleType::Type ptype) const {
3173 
3174  if (ptype != PATCore::ParticleType::Electron ||
3176  return 1.;
3177 
3178  double aeta = std::abs(eta);
3179 
3180  if (aeta < 1.42 || aeta > 1.55)
3181  return 1.;
3182 
3183  const int nBoundaries = 18;
3184  double ETBoundaries[nBoundaries] = {0., 5.4, 8.5, 12.9, 16., 20.,
3185  25., 30., 35., 40., 45., 50.,
3186  55., 60., 65., 70., 75., 99999.};
3187 
3188  double CalibFactors[nBoundaries - 1] = {
3189  0.884845, 0.898526, 0.902439, 0.91899, 0.925868, 0.929440,
3190  0.948080, 0.943788, 0.96026, 0.955709, 0.964285, 0.95762,
3191  0.970385, 0.963489, 0.968149, 0.970799, 0.961617};
3192 
3193  int i0 = -1;
3194  for (int i = 0; i < nBoundaries - 1; i++)
3195  if (ET / GeV > ETBoundaries[i] && ET / GeV <= ETBoundaries[i + 1])
3196  i0 = i;
3197 
3198  if (i0 >= 0 && i0 < nBoundaries - 1)
3199  return 1. / CalibFactors[i0];
3200 
3201  return 1.;
3202 }
3203 
3204 // AF -> G4 correction
3205 
3207  double eta, double ptGeV, PATCore::ParticleType::Type ptype) const {
3208  const double aeta = std::abs(eta);
3209  if (aeta > 2.47)
3210  return 1.;
3211 
3232 
3241  //
3242  // in es02017_R21_v1 : AF2 to FullSim correction is in a 2D eta-Pt
3243  // histogram
3244  bool interpolate_eta = false;
3245  bool interpolate_pt = false;
3247  // interpolate_eta = true;
3248  interpolate_pt = true;
3249  }
3250  if (ptype == PATCore::ParticleType::Electron) {
3251  return (1. + getValueHistAt(*m_G4OverAFII_electron_2D, aeta, ptGeV,
3252  true, true, true, true,
3253  interpolate_eta, interpolate_pt));
3254  } else if (ptype == PATCore::ParticleType::ConvertedPhoton) {
3255  return (1. + getValueHistAt(*m_G4OverAFII_converted_2D, aeta, ptGeV,
3256  true, true, true, true,
3257  interpolate_eta, interpolate_pt));
3258  } else if (ptype == PATCore::ParticleType::UnconvertedPhoton) {
3259  return (1. + getValueHistAt(*m_G4OverAFII_unconverted_2D, aeta, ptGeV,
3260  true, true, true, true,
3261  interpolate_eta, interpolate_pt));
3262  } else {
3263  throw std::runtime_error("particle not valid");
3264  }
3265  } else {
3266  if (ptype == PATCore::ParticleType::Electron) {
3267  return getValueHistoAt(*m_G4OverAFII_electron, aeta);
3268  } else if (ptype == PATCore::ParticleType::ConvertedPhoton) {
3269  return getValueHistoAt(*m_G4OverAFII_converted, aeta);
3270  } else if (ptype == PATCore::ParticleType::UnconvertedPhoton) {
3271  return getValueHistoAt(*m_G4OverAFII_unconverted, aeta);
3272  } else {
3273  throw std::runtime_error("particle not valid");
3274  }
3275  }
3276  } else {
3277  // run 1
3278  return m_G4OverAFII_electron->GetBinContent(
3279  std::as_const(*m_G4OverAFII_electron).GetXaxis()->FindBin(eta));
3280  }
3281 }
3282 
3283 // Frozen Showers -> G4 correction
3284 
3286 
3287  double aeta = std::abs(eta);
3288  if (aeta < 3.3 || aeta > 4.9)
3289  return 1.;
3290 
3291  return m_G4OverFrSh->GetBinContent(
3292  std::as_const(*m_G4OverFrSh).GetXaxis()->FindBin(aeta));
3293 }
3294 
3295 // functions for energy scale corrections
3296 
3298  long int runnumber, double eta, egEnergyCorr::Scale::Variation var,
3299  double varSF) const {
3300 
3301  if (!m_zeeNom) {
3302  ATH_MSG_FATAL("no data for Zee");
3303  return -999.0;
3304  }
3305 
3306  double value = 0.;
3309  int ieta = std::as_const(*m_zeeNom).GetXaxis()->FindBin(eta);
3310  value = m_zeeNom->GetBinContent(ieta);
3311  } else {
3312  if (runnumber > 341649 && runnumber <= 364292) {
3313  // 2018 runnumber range
3314  int ieta = std::as_const(*m_zeeNom).GetXaxis()->FindBin(eta);
3315  value = m_zeeNom->GetBinContent(ieta);
3316  } else if (runnumber > 364292) {
3318  "es2023_R22_Run2_v0/v1 is only valid for Run-2 data! using 2018 scales");
3319  int ieta = std::as_const(*m_zeeNom).GetXaxis()->FindBin(eta);
3320  value = m_zeeNom->GetBinContent(ieta);
3321  }
3322  }
3323 
3328  runnumber <= 341649 && runnumber >= 324320) {
3329  int ieta = std::as_const(*m_zeeNom_data2017).GetXaxis()->FindBin(eta);
3330  value = m_zeeNom_data2017->GetBinContent(ieta);
3331  }
3332 
3333  // for es2017_R21_v0 different set of scales for 2017, 2016 and 2015 data
3334  if (m_esmodel == egEnergyCorr::es2017_R21_v0 && runnumber < 322817 &&
3335  runnumber >= 297000) {
3336  int ieta = std::as_const(*m_zeeNom_data2016).GetXaxis()->FindBin(eta);
3337  value = m_zeeNom_data2016->GetBinContent(ieta);
3338  }
3339 
3345  runnumber < 322817 && runnumber >= 297000) {
3346  int ieta = std::as_const(*m_zeeNom_data2016).GetXaxis()->FindBin(eta);
3347  value = m_zeeNom_data2016->GetBinContent(ieta);
3348  }
3349 
3351  runnumber >= 297000) {
3352  int ieta = std::as_const(*m_zeeNom_data2016).GetXaxis()->FindBin(eta);
3353  value = m_zeeNom_data2016->GetBinContent(ieta);
3354  }
3355 
3357  int ieta = std::as_const(*m_zeeNom_data2015).GetXaxis()->FindBin(eta);
3358  value = m_zeeNom_data2015->GetBinContent(ieta);
3359  }
3360 
3362  int ieta = std::as_const(*m_zeeNom_data2018).GetXaxis()->FindBin(eta);
3363  value = m_zeeNom_data2018->GetBinContent(ieta);
3364  }
3365 
3367  int ieta = std::as_const(*m_zeeNom).GetXaxis()->FindBin(eta);
3368  value = m_zeeNom->GetBinContent(ieta);
3369  }
3370 
3371  if ((m_esmodel == egEnergyCorr::es2017 or
3382  runnumber < 297000) {
3383  // 2 sets of scales for this configuration
3384  // change histogram if 2015 data
3385  int ieta = std::as_const(*m_zeeNom_data2015).GetXaxis()->FindBin(eta);
3386  value = m_zeeNom_data2015->GetBinContent(ieta);
3387  }
3388 
3393  // special case for es2015PRE
3394  // additional correction due to LAr temperature effect
3395  // for extrapolation 2012 -> 2015 temperature change
3396  // numbers from Guillaume 20150506
3397  /*
3398  2012 (K) 22/04/2015 DeltaResponse 2015/2012 (-2%/K) deltaAlpha
3399  EndCap C 88.41 88.63 -0.45% -0.45%
3400  Barrel C 88.47 88.70 -0.46% -0.46%
3401  Barrel A 88.50 88.71 -0.42% -0.42%
3402  EndCap A 88.70 88.70 +0.00% +0.00%
3403  */
3404  if (eta >= 0) { // side A
3405  if (eta < 1.45)
3406  value += -0.42E-2;
3407  else if (eta < 3.2)
3408  value += 0.;
3409  } else { // side C
3410  if (eta > -1.45)
3411  value += -0.46E-2;
3412  else if (eta > -3.2)
3413  value += -0.45E-2;
3414  }
3415 
3416  // special case for es2015PRE
3417  // additional correction for uA->MeV first 2 weeks 2015 data
3418  if (runnumber >= 266904 and runnumber <= 267639 and
3420  const double uA2MeV_correction =
3421  m_uA2MeV_2015_first2weeks_correction->GetBinContent(
3422  m_uA2MeV_2015_first2weeks_correction->FindFixBin(std::abs(eta)));
3423  // this takes into account also O((uA2MeV_correction - 1) * alpha) terms
3424  // a simpler formula would be: value + uA2MeV_correction - 1
3425  value = uA2MeV_correction * (1 + value) - 1;
3426  }
3427  } // end special case for es2015PRE*
3428 
3432  // keep the correction 2012->2015 for |eta| > 2.5
3433  // if (eta > 2.5 and eta < 3.2) value += 0.;
3434  if (eta < -2.5 and eta > -3.2)
3435  value += -0.45E-2;
3436  }
3437 
3439  m_esmodel ==
3440  egEnergyCorr::es2016PRE) { // correction for the extrapolation from
3441  // es2015_summer
3442  if (runnumber >= 297000) { // only for 2016 data
3443  if (eta >= 0) { // side A
3444  if (eta < 1.45)
3445  value *= 1.00028;
3446  else if (eta < 3.2)
3447  value *= 1.00018;
3448  } else { // side C
3449  if (eta > -1.45)
3450  value *= 1.00028;
3451  else if (eta > -3.2)
3452  value *= 0.99986;
3453  }
3454  }
3455  }
3456 
3457  ATH_MSG_DEBUG("getAlphaZee, def alpha " << value << " at eta = " << eta);
3458 
3461  const double sign = (var == egEnergyCorr::Scale::ZeeStatUp) ? 1 : -1;
3462 
3463  TH1* h = ((TH1*)m_zeeNom.get());
3464 
3465  if ((m_esmodel == egEnergyCorr::es2017 or
3477  runnumber < 297000) {
3478  h = ((TH1*)m_zeeNom_data2015.get()); // special for 2015 with es2017
3479  }
3487  runnumber >= 297000 && runnumber < 322817) {
3488  h = m_zeeNom_data2016.get(); // 2016 data
3489  }
3491  h = m_zeeNom_data2018.get();
3492  }
3493  //egEnergyCorr::es2024_Run3_ofc0_v0 noting to do (have only m_zeeNom)
3494 
3499  runnumber >= 324320 && runnumber <= 341649) {
3500  h = ((TH1*)m_zeeNom_data2017.get()); // 2017 data
3501  }
3502  double stat_error = h->GetBinError(h->FindFixBin(eta));
3504  stat_error = stat_error / sqrt(h->GetNbinsX());
3505  }
3506  value += sign * stat_error * varSF;
3507  } else if (var == egEnergyCorr::Scale::ZeeSystUp && m_zeeSyst) {
3508  value += get_ZeeSyst(eta) * varSF;
3509 
3510  } else if (var == egEnergyCorr::Scale::ZeeSystDown && m_zeeSyst) {
3511  value -= get_ZeeSyst(eta) * varSF;
3512  } else if (var == egEnergyCorr::Scale::OFCUp && m_zeeSystOFC) {
3513  value += get_OFCSyst(eta) * varSF;
3514  } else if (var == egEnergyCorr::Scale::EXTRARUN3PREUp &&
3515  m_esmodel ==
3516  egEnergyCorr::es2022_R22_PRE) // as this is a flat 0.4% syst
3517  // hardcoded, need to switch on
3518  // only for es2022_R22_PRE. OFC
3519  // should be OK, as the OFC file
3520  // is only defined for this
3521  // pre-recommendation.
3522  {
3523  value +=
3524  0.4E-2 *
3525  varSF; // flat 0.4% syst (details:
3526  // https://indico.cern.ch/event/1250560/contributions/5253619/attachments/2586538/4462853/mc21-change.pdf)
3529  value -= 0.4E-2 * varSF;
3530  } else if (var == egEnergyCorr::Scale::OFCDown && m_zeeSystOFC) {
3531  value -= get_OFCSyst(eta) * varSF;
3532  } else if (var == egEnergyCorr::Scale::ZeePhysUp && m_zeePhys) {
3533 
3534  int ieta = std::as_const(*m_zeePhys).GetXaxis()->FindBin(eta);
3535  value += m_zeePhys->GetBinContent(ieta) * varSF;
3536 
3537  } else if (var == egEnergyCorr::Scale::ZeePhysDown && m_zeePhys) {
3538 
3539  int ieta = std::as_const(*m_zeePhys).GetXaxis()->FindBin(eta);
3540  value -= m_zeePhys->GetBinContent(ieta) * varSF;
3541 
3549  // special case only for es2015PRE
3550  // add LAr temperature effect for extrapolation 2012 -> 2015 temperature
3551  // change numbers from Guillaume 20150506
3552 
3553  const double aeta = std::abs(eta);
3554  const double sign =
3556  if (aeta < 1.45) {
3557  value += 0.15E-2 * sign;
3558  } else if (aeta > 1.45 and aeta < 3.2) {
3559  value += 0.25E-2 * sign;
3560  }
3561  }
3562 
3568  // keep 2012->2015 extrapolation correction for eta > 2.5
3569  const double aeta = std::abs(eta);
3570  const double sign =
3572  if (aeta > 2.5 and aeta < 3.2) {
3573  value += 0.25E-2 * sign;
3574  }
3575  }
3576 
3581  // special case for es2016PRE (extrapolation from 2015)
3582  const double sign =
3584  // temp + pileup
3585  value += qsum(0.05E-2, 0.02E-2) *
3586  sign; // Guillaume email 23/05/2016 + 26/5/2016
3587  }
3588 
3589  else if (var == egEnergyCorr::Scale::ZeeAllDown ||
3591 
3592  int ieta = std::as_const(*m_zeeNom).GetXaxis()->FindBin(eta);
3593  double diff = pow(m_zeeNom->GetBinError(ieta) * varSF, 2);
3594 
3595  if (m_zeeSyst) {
3596  diff += pow(get_ZeeSyst(eta) * varSF, 2);
3597  }
3598 
3599  if (m_zeePhys) {
3600  ieta = std::as_const(*m_zeePhys).GetXaxis()->FindBin(eta);
3601  diff += pow(m_zeePhys->GetBinContent(ieta) * varSF, 2);
3602  }
3603 
3605  value += sqrt(diff);
3607  value -= sqrt(diff);
3608  }
3609 
3610  return value;
3611 }
3612 
3614  const double aeta = std::abs(eta);
3615  if ((aeta > 1.6) or (aeta < 1.4)) {
3616  return 0.;
3617  }
3618 
3619  // numbers from Archil 20/5/2016
3620 
3621  double data_mc_difference = 0.;
3622  if (aeta < 1.46) {
3623  data_mc_difference = 1E-2;
3624  } // 1.4 - 1.46
3625  else if (aeta < 1.52) {
3626  data_mc_difference = 3E-2;
3627  } // 1.46 - 1.52
3628  else {
3629  data_mc_difference = 4.3E-2;
3630  } // 1.52 - 1.6
3631 
3632  const double em_scale = 2.4E-2;
3633  const double mbias = 1E-2; // Archil presentation 26/5/2016
3634  const double laser = 4E-2;
3635 
3636  return std::sqrt(data_mc_difference * data_mc_difference +
3637  em_scale * em_scale + mbias * mbias + laser * laser);
3638 }
3639 
3641  double cl_eta, double energy, PATCore::ParticleType::Type ptype) const {
3642  double value = 0;
3643 
3644  // Get slopes and wstot values
3645  // deltaE/E (Et, particle type ) = 2*A/mZ * ( wstot(Et,particle type)_data -
3646  // <wstot(40 GeV Et electrons)_data)> ) - 2*B/mZ* (wstot(Et,particle type)_MC
3647  // - <w wstot(40 GeV Et electrons)_MC>) factor 2 to go from slopes in dM/M to
3648  // dE/E
3649 
3650  //|eta|>2.4 => use last eta bin
3651  if (cl_eta < -2.4)
3652  cl_eta = -2.35;
3653  if (cl_eta > 2.4)
3654  cl_eta = 2.35;
3655 
3656  int bin = m_wstot_slope_A_data->FindFixBin(cl_eta);
3657  double A = m_wstot_slope_A_data->GetBinContent(bin);
3658  double B = m_wstot_slope_B_MC->GetBinContent(bin);
3659 
3660  // the wstot=f(pT) depends on the particle type
3661  double ETGeV = energy / cosh(cl_eta) / 1E3;
3662  double wstot_pT_data_p0 = 0.;
3663  double wstot_pT_data_p1 = 0.;
3664  double wstot_pT_MC_p0 = 0.;
3665  double wstot_pT_MC_p1 = 0.;
3666 
3667  double wstot_40_data =
3668  m_wstot_pT_data_p0_electrons->GetBinContent(bin) +
3669  (m_wstot_pT_data_p1_electrons->GetBinContent(bin)) / sqrt(40.);
3670  double wstot_40_MC =
3671  m_wstot_pT_MC_p0_electrons->GetBinContent(bin) +
3672  (m_wstot_pT_MC_p1_electrons->GetBinContent(bin)) / sqrt(40.);
3673 
3674  if (ptype == PATCore::ParticleType::Electron) {
3675  wstot_pT_data_p0 = m_wstot_pT_data_p0_electrons->GetBinContent(bin);
3676  wstot_pT_data_p1 = m_wstot_pT_data_p1_electrons->GetBinContent(bin);
3677  wstot_pT_MC_p0 = m_wstot_pT_MC_p0_electrons->GetBinContent(bin);
3678  wstot_pT_MC_p1 = m_wstot_pT_MC_p1_electrons->GetBinContent(bin);
3679  } else if (ptype == PATCore::ParticleType::UnconvertedPhoton) {
3680  wstot_pT_data_p0 =
3682  wstot_pT_data_p1 =
3684  wstot_pT_MC_p0 = m_wstot_pT_MC_p0_unconverted_photons->GetBinContent(bin);
3685  wstot_pT_MC_p1 = m_wstot_pT_MC_p1_unconverted_photons->GetBinContent(bin);
3686  } else if (ptype == PATCore::ParticleType::ConvertedPhoton) {
3687  wstot_pT_data_p0 = m_wstot_pT_data_p0_converted_photons->GetBinContent(bin);
3688  wstot_pT_data_p1 = m_wstot_pT_data_p1_converted_photons->GetBinContent(bin);
3689  wstot_pT_MC_p0 = m_wstot_pT_MC_p0_converted_photons->GetBinContent(bin);
3690  wstot_pT_MC_p1 = m_wstot_pT_MC_p1_converted_photons->GetBinContent(bin);
3691  }
3692 
3693  double wstot_pT_data = 0.;
3694  double wstot_pT_MC = 0.;
3695 
3696  // Initial parametrization: [0]+1*pT
3697  // wstot_pT_data = wstot_pT_data_p0+wstot_pT_data_p1*ETGeV;
3698  // prevent wstot_pT_data from being negative
3699  // if(wstot_pT_data<0) wstot_pT_data = 0.;
3700 
3701  // New parametrization: p0+p1/sqrt(pT)
3702  // flat uncertainty below 25 GeV
3703  if (ETGeV < 25.)
3704  ETGeV = 25.;
3705 
3706  wstot_pT_data = wstot_pT_data_p0 + wstot_pT_data_p1 / sqrt(ETGeV);
3707  wstot_pT_MC = wstot_pT_MC_p0 + wstot_pT_MC_p1 / sqrt(ETGeV);
3708 
3709  value = 2 * A / 91.2 * (wstot_pT_data - wstot_40_data) -
3710  2 * B / 91.2 * (wstot_pT_MC - wstot_40_MC);
3711 
3712  return value;
3713 }
3714 
3715 // Layer scale uncertainties and induced non-linearity
3717 
3719  int iLayer, double cl_eta, egEnergyCorr::Scale::Variation var,
3720  double varSF) const {
3721 
3722  double value = 0.;
3723 
3725  return value;
3726 
3727  // nearest eta outside of crack (for PS scale values and uncertainties)
3728  double nearestEta = cl_eta;
3731  nearestEta = nearestEtaBEC(cl_eta);
3732  }
3733 
3734  if (iLayer == 0) { // use nearestEta
3735 
3737  value = m_aPSNom->GetBinError(m_aPSNom->FindFixBin(nearestEta));
3738 
3739  else if (var == egEnergyCorr::Scale::PSDown && m_aPSNom)
3740  value = -m_aPSNom->GetBinError(m_aPSNom->FindFixBin(nearestEta));
3741 
3743  value = m_daPSb12->GetBinContent(m_daPSb12->FindFixBin(nearestEta));
3744 
3746  value = -m_daPSb12->GetBinContent(m_daPSb12->FindFixBin(nearestEta));
3747 
3749  value = m_daPSCor->GetBinContent(m_daPSCor->FindFixBin(nearestEta));
3750 
3752  value = -m_daPSCor->GetBinContent(m_daPSCor->FindFixBin(nearestEta));
3753 
3754  }
3755 
3756  else if (iLayer == 1) { // use cl_eta
3757 
3759  value = m_aS12Nom->GetBinError(m_aS12Nom->FindFixBin(cl_eta));
3760  } else if (var == egEnergyCorr::Scale::S12Down && m_aS12Nom) {
3761  value = -m_aS12Nom->GetBinError(m_aS12Nom->FindFixBin(cl_eta));
3762  } else if (var == egEnergyCorr::Scale::LArCalibUp && m_daS12Cor) {
3763  value = m_daS12Cor->GetBinContent(m_daS12Cor->FindFixBin(cl_eta));
3765  value = -m_daS12Cor->GetBinContent(m_daS12Cor->FindFixBin(cl_eta));
3778  // special case for es2015PRE and also for es2015c_summer and also for
3779  // es2017 numbers from Lydia and Christophe,
3780  // https://indico.cern.ch/event/395345/contribution/2/material/slides/0.pdf
3781  // assuming constant uncertainty
3782  // es2017_summer: increased to 5% in the endcap
3783  const double aeta = std::abs(cl_eta);
3784  // endcap
3785  if (aeta >= 1.37 and aeta < 2.5) {
3790  value = 5.0E-2;
3791  else
3792  value = 1.5E-2;
3793  } else { // barrel
3795  value = 2.5E-2;
3796  else
3797  value = 1.5E-2;
3798  }
3811  const double aeta = std::abs(cl_eta);
3812  // endcap
3813  if (aeta >= 1.37 and aeta < 2.5) {
3818  value = -5.0E-2;
3819  else
3820  value = -1.5E-2;
3821  } else { // barrel
3824  value = -2.5E-2;
3825  else
3826  value = -1.5E-2;
3827  }
3828  }
3829 
3832  // special large sys for run2 in the last eta-bin in es2017, see
3833  // ATLASEG-42
3839  const double aeta = std::abs(cl_eta);
3840  if (aeta >= 2.4 and aeta < 2.5) {
3842  value = 25E-2;
3843  else
3844  value = -25E-2;
3845  }
3846  }
3847  }
3848  }
3849 
3850  return value * varSF;
3851 }
3852 
3854  double cl_eta, double energy, PATCore::ParticleType::Type ptype) const {
3855  double value = 0;
3856  const double aeta = std::abs(cl_eta);
3857  const double ETGeV = energy / cosh(cl_eta) / 1E3;
3858 
3859  // This will point to the return of get() of a unique_ptr
3860  const TAxis* axis;
3861  const TList* graphs;
3862 
3863  if (ptype == PATCore::ParticleType::Electron) {
3864  axis = m_E4ElectronEtaBins.get();
3865  graphs = m_E4ElectronGraphs.get();
3866  } else if (ptype == PATCore::ParticleType::UnconvertedPhoton) {
3867  axis = m_E4UnconvertedEtaBins.get();
3868  graphs = m_E4UnconvertedGraphs.get();
3869  } else if (ptype == PATCore::ParticleType::ConvertedPhoton) {
3870  axis = m_E4ConvertedEtaBins.get();
3871  graphs = m_E4ConvertedGraphs.get();
3872  } else {
3873  ATH_MSG_FATAL("invalid particle type");
3874  return -1;
3875  }
3876 
3877  const int ieta = axis->FindFixBin(aeta) - 1;
3878  if (ieta >= 0 and ieta < graphs->GetSize()) {
3879  value = static_cast<TGraph*>(graphs->At(ieta))->Eval(ETGeV);
3880  }
3881 
3882  return value;
3883 }
3884 
3886  int iLayer, double cl_eta, double energy,
3887  PATCore::ParticleType::Type ptype) const {
3888 
3889  double value = 0;
3890  // Accordion histogram specicif condition
3891  if (iLayer == 6 && std::abs(cl_eta) >= 2.47)
3892  cl_eta = 2.46;
3893  double aeta = std::abs(cl_eta);
3894  double ET = energy / cosh(cl_eta);
3895 
3896  // move out of crack
3899  aeta = nearestEtaBEC(aeta);
3900 
3901  // argument ET is transverse energy in MeV
3902 
3903  if (iLayer == 0 && aeta >= 1.82)
3904  return value;
3905 
3906  if (ptype == PATCore::ParticleType::Electron) {
3907 
3908  if (iLayer == 0) {
3909 
3910  const int ieta = m_psElectronEtaBins->FindFixBin(aeta) - 1;
3911  if (ieta >= 0 and ieta < m_psElectronGraphs->GetSize()) {
3912  value = ((TF1*)m_psElectronGraphs->At(ieta))->Eval(ET);
3913  }
3914  } else if (iLayer == 1) {
3915 
3916  const int ieta = m_s12ElectronEtaBins->FindFixBin(aeta) - 1;
3917  if (ieta >= 0 and ieta < m_s12ElectronGraphs->GetSize()) {
3918  value = ((TF1*)m_s12ElectronGraphs->At(ieta))->Eval(ET);
3919  }
3920  } else if (iLayer == 6) { // Accordion correction (for Precision Run-2)
3921 
3922  const int ieta = m_EaccElectronEtaBins->FindFixBin(aeta) - 1;
3923  if (ieta >= 0 && ieta < m_EaccElectronGraphs->GetSize()) {
3924  value = ((TF1*)m_EaccElectronGraphs->At(ieta))->Eval(ET);
3925  }
3926  }
3927 
3928  } else if (ptype == PATCore::ParticleType::UnconvertedPhoton) {
3929 
3930  if (iLayer == 0) {
3931 
3932  const int ieta = m_psUnconvertedEtaBins->FindFixBin(aeta) - 1;
3933  if (ieta >= 0 and ieta < m_psUnconvertedGraphs->GetSize()) {
3934  value = ((TF1*)m_psUnconvertedGraphs->At(ieta))->Eval(ET);
3935  }
3936 
3937  } else if (iLayer == 1) {
3938 
3939  const int ieta = m_s12UnconvertedEtaBins->FindFixBin(aeta) - 1;
3940  if (ieta >= 0 and ieta < m_s12UnconvertedGraphs->GetSize()) {
3941  value = ((TF1*)m_s12UnconvertedGraphs->At(ieta))->Eval(ET);
3942  }
3943  } else if (iLayer == 6) { // Accordion correction (for Precision Run-2)
3944 
3945  const int ieta = m_EaccUnconvertedEtaBins->FindFixBin(aeta) - 1;
3946  if (ieta >= 0 && ieta < m_EaccUnconvertedGraphs->GetSize()) {
3947  value = ((TF1*)m_EaccUnconvertedGraphs->At(ieta))->Eval(ET);
3948  }
3949  }
3950 
3951  } else if (ptype == PATCore::ParticleType::ConvertedPhoton) {
3952 
3953  if (iLayer == 0) {
3954 
3955  const int ieta = m_psConvertedEtaBins->FindFixBin(aeta) - 1;
3956  if (ieta >= 0 and ieta < m_psConvertedGraphs->GetSize()) {
3957  value = ((TF1*)m_psConvertedGraphs->At(ieta))->Eval(ET);
3958  }
3959 
3960  } else if (iLayer == 1) {
3961 
3962  const int ieta = m_s12ConvertedEtaBins->FindFixBin(aeta) - 1;
3963  if (ieta >= 0 and ieta < m_s12ConvertedGraphs->GetSize()) {
3964  value = ((TF1*)m_s12ConvertedGraphs->At(ieta))->Eval(ET);
3965  }
3966  } else if (iLayer == 6) { // Accordion correction (for Precision Run-2)
3967 
3968  const int ieta = m_EaccConvertedEtaBins->FindFixBin(aeta) - 1;
3969  if (ieta >= 0 && ieta < m_EaccConvertedGraphs->GetSize()) {
3970  if (ET < 10000. && (aeta < 1.2 || (aeta >= 1.59 && aeta < 1.73))) {
3971  // harcoded condition to correct bad beahviour of function at low ET
3972  // <10GeV
3973  value = ((TF1*)m_EaccConvertedGraphs->At(ieta))->Eval(10000.);
3974  } else {
3975  value = ((TF1*)m_EaccConvertedGraphs->At(ieta))->Eval(ET);
3976  }
3977  }
3978  }
3979  }
3980 
3981  ATH_MSG_DEBUG("Layer non-linearity: " << iLayer << " value: " << value);
3982 
3983  if (value < 0) {
3984  ATH_MSG_DEBUG("Value is negative -> set to 0");
3985  value = 0;
3986  }
3987 
3988  return value;
3989 }
3990 
3991 // passive material correction
3993 
3994 // ... material look-up function, called internally by getAlphaMaterial() and
3995 // getMaterialNonLinearity()
3996 
3998  double cl_eta, egEnergyCorr::MaterialCategory imat,
4000 
4001  double value = 0.;
4002  double aeta = std::abs(cl_eta);
4003 
4004  // "ID" : inner detector material; bottom-up (from construction/simulation
4005  // accuracy : ConfigA)
4006 
4007  if (imat == egEnergyCorr::MatID && m_dX_ID_Nom) {
4008 
4009  // ... NOTE : watch out here : this histo does not follow the usual
4010  // value/error look-up convention
4011 
4013  value += m_dX_ID_Nom->GetBinContent(m_dX_ID_Nom->FindFixBin(aeta));
4014  else if (var == egEnergyCorr::Scale::MatIDDown)
4015  value -= m_dX_ID_Nom->GetBinContent(m_dX_ID_Nom->FindFixBin(aeta));
4016 
4017  // "Cryo" : integral from IP to PS or Acc, depending on eta
4018 
4019  } else if (imat == egEnergyCorr::MatCryo && aeta < 1.82 &&
4020  m_dX_IPPS_Nom) { // Integral between IP and PS
4021 
4022  value = m_dX_IPPS_Nom->GetBinContent(m_dX_IPPS_Nom->FindFixBin(aeta));
4023 
4025  value += m_dX_IPPS_Nom->GetBinError(m_dX_IPPS_Nom->FindFixBin(aeta));
4027  value -= m_dX_IPPS_Nom->GetBinError(m_dX_IPPS_Nom->FindFixBin(aeta));
4028 
4029  // ... careful : sign below should be opposite to the effect of this source
4030  // on the PS scale!
4032  value -= m_dX_IPPS_LAr->GetBinContent(m_dX_IPPS_LAr->FindFixBin(aeta));
4034  value += m_dX_IPPS_LAr->GetBinContent(m_dX_IPPS_LAr->FindFixBin(aeta));
4035 
4036  } else if (imat == egEnergyCorr::MatCryo && aeta > 1.82 &&
4037  m_dX_IPAcc_Nom) { // Integral between IP and Accordion
4038 
4039  value = m_dX_IPAcc_Nom->GetBinContent(m_dX_IPAcc_Nom->FindFixBin(aeta));
4040 
4042  value += m_dX_IPAcc_Nom->GetBinError(m_dX_IPAcc_Nom->FindFixBin(aeta));
4044  value -= m_dX_IPAcc_Nom->GetBinError(m_dX_IPAcc_Nom->FindFixBin(aeta));
4045 
4047  value += m_dX_IPAcc_LAr->GetBinContent(m_dX_IPAcc_LAr->FindFixBin(aeta));
4049  value -= m_dX_IPAcc_LAr->GetBinContent(m_dX_IPAcc_LAr->FindFixBin(aeta));
4050 
4052  value += m_dX_IPAcc_G4->GetBinContent(m_dX_IPAcc_G4->FindFixBin(aeta));
4054  value -= m_dX_IPAcc_G4->GetBinContent(m_dX_IPAcc_G4->FindFixBin(aeta));
4055 
4057  value += m_dX_IPAcc_GL1->GetBinContent(m_dX_IPAcc_GL1->FindFixBin(aeta));
4059  value -= m_dX_IPAcc_GL1->GetBinContent(m_dX_IPAcc_GL1->FindFixBin(aeta));
4060 
4061  // "Calo" : between PS and Strips
4062 
4063  } else if (imat == egEnergyCorr::MatCalo && aeta < 1.82 && m_dX_PSAcc_Nom) {
4064 
4065  value = m_dX_PSAcc_Nom->GetBinContent(m_dX_PSAcc_Nom->FindFixBin(aeta));
4066 
4068  value += m_dX_PSAcc_Nom->GetBinError(m_dX_PSAcc_Nom->FindFixBin(aeta));
4070  value -= m_dX_PSAcc_Nom->GetBinError(m_dX_PSAcc_Nom->FindFixBin(aeta));
4071 
4073  value += m_dX_PSAcc_LAr->GetBinContent(m_dX_PSAcc_LAr->FindFixBin(aeta));
4075  value -= m_dX_PSAcc_LAr->GetBinContent(m_dX_PSAcc_LAr->FindFixBin(aeta));
4076 
4078  value += m_dX_PSAcc_G4->GetBinContent(m_dX_PSAcc_G4->FindFixBin(aeta));
4080  value -= m_dX_PSAcc_G4->GetBinContent(m_dX_PSAcc_G4->FindFixBin(aeta));
4081  }
4082 
4083  return value;
4084 }
4085 
4086 // returns the impact of material variation on response.
4087 // non-zero for photons only (the average effect is absorbed by the effective Z
4088 // scales for electrons).
4089 
4090 // Strategy for material before the PS :
4091 // - consider ID material and uncertainty fixed to ConfigA
4092 // - attribute measured material to ConfigL, with uncertainty from difference
4093 // between measurement and ConfigA
4094 // I.e : DX_A = 0 +- dA ; DX_L = DX_Meas +- (dMeas ++ dA)
4095 
4096 // Strategy for material after the PS :
4097 // - direct measurement
4098 // I.e : DX_M = DX_Meas +- dMeas
4099 
4100 // Then calculate the impact on the scale accordingly.
4101 
4103  double cl_eta, egEnergyCorr::MaterialCategory imat,
4105  double varSF) const {
4106 
4107  double value = 0.;
4108  if (ptype == PATCore::ParticleType::Electron)
4109  return value;
4111  return value;
4112 
4113  egEnergyCorr::Geometry geoID, geoCryo, geoCalo, geoGp;
4114  geoID = egEnergyCorr::ConfigA;
4115  if (std::abs(cl_eta) < 2.)
4116  geoCryo = egEnergyCorr::ConfigEL;
4117  else
4118  geoCryo = egEnergyCorr::ConfigFMX;
4119  geoCalo = egEnergyCorr::ConfigFMX;
4120  geoGp = egEnergyCorr::ConfigGp;
4121 
4122  // look up material bias
4123 
4124  double DeltaX = getDeltaX(cl_eta, imat, var) -
4125  getDeltaX(cl_eta, imat, egEnergyCorr::Scale::Nominal);
4126 
4127  // calculate scale change per unit added material
4128 
4129  double DAlphaDXID, DAlphaDXCryo, DAlphaDXCalo, DAlphaDXGp;
4130  DAlphaDXID = DAlphaDXCryo = DAlphaDXCalo = DAlphaDXGp = 0;
4132  DAlphaDXGp = m_matUnconvertedScale[geoGp]->GetBinContent(
4133  m_matUnconvertedScale[geoGp]->FindBin(cl_eta));
4134  DAlphaDXID = m_matUnconvertedScale[geoID]->GetBinContent(
4135  m_matUnconvertedScale[geoID]->FindBin(cl_eta));
4136  DAlphaDXCryo = m_matUnconvertedScale[geoCryo]->GetBinContent(
4137  m_matUnconvertedScale[geoCryo]->FindBin(cl_eta));
4138  DAlphaDXCalo = m_matUnconvertedScale[geoCalo]->GetBinContent(
4139  m_matUnconvertedScale[geoCalo]->FindBin(cl_eta));
4140  } else if (ptype == PATCore::ParticleType::ConvertedPhoton) {
4141  DAlphaDXGp = m_matConvertedScale[geoGp]->GetBinContent(
4142  m_matConvertedScale[geoGp]->FindBin(cl_eta));
4143  DAlphaDXID = m_matConvertedScale[geoID]->GetBinContent(
4144  m_matConvertedScale[geoID]->FindBin(cl_eta));
4145  DAlphaDXCryo = m_matConvertedScale[geoCryo]->GetBinContent(
4146  m_matConvertedScale[geoCryo]->FindBin(cl_eta));
4147  DAlphaDXCalo = m_matConvertedScale[geoCalo]->GetBinContent(
4148  m_matConvertedScale[geoCalo]->FindBin(cl_eta));
4149  }
4150 
4151  // when in crack, use G', exit
4152 
4153  if (isInCrack(cl_eta)) {
4155  value = DAlphaDXGp;
4156  else if (imat == egEnergyCorr::MatID &&
4158  value = -DAlphaDXGp;
4159  return value;
4160  }
4161 
4162  // normal case
4163 
4164  int idx = m_matX0Additions[geoID]->FindBin(std::abs(cl_eta));
4165  if (idx < 1 || idx > m_matX0Additions[geoID]->GetNbinsX())
4166  DAlphaDXID = 0;
4167  else
4168  DAlphaDXID /= m_matX0Additions[geoID]->GetBinContent(idx);
4169 
4170  idx = m_matX0Additions[geoCryo]->FindBin(std::abs(cl_eta));
4171  if (idx < 1 || idx > m_matX0Additions[geoCryo]->GetNbinsX())
4172  DAlphaDXCryo = 0;
4173  else
4174  DAlphaDXCryo /= m_matX0Additions[geoCryo]->GetBinContent(idx);
4175 
4176  idx = m_matX0Additions[geoCalo]->FindBin(std::abs(cl_eta));
4177  if (idx < 1 || idx > m_matX0Additions[geoCalo]->GetNbinsX())
4178  DAlphaDXCalo = 0;
4179  else
4180  DAlphaDXCalo /= m_matX0Additions[geoCalo]->GetBinContent(idx);
4181 
4182  // final value
4183 
4184  if (imat == egEnergyCorr::MatID)
4185  value = DeltaX * (DAlphaDXID - DAlphaDXCryo);
4186  else if (imat == egEnergyCorr::MatCryo)
4187  value = DeltaX * DAlphaDXCryo;
4188  else if (imat == egEnergyCorr::MatCalo)
4189  value = DeltaX * DAlphaDXCalo;
4190 
4191  return value * varSF;
4192 }
4193 
4196  double cl_eta, double ET) const {
4197 
4198  // Again this does no need to be ptr just get the one owned
4199  TH2D* hmat;
4200 
4201  if (ptype == PATCore::ParticleType::Electron) {
4202  if (geo == egEnergyCorr::ConfigA)
4203  hmat = ((TH2D*)m_electronBias_ConfigA.get());
4204  else if (geo == egEnergyCorr::ConfigEL)
4205  hmat = ((TH2D*)m_electronBias_ConfigEpLp.get());
4206  else if (geo == egEnergyCorr::ConfigFMX)
4207  hmat = ((TH2D*)m_electronBias_ConfigFpMX.get());
4208  else if (geo == egEnergyCorr::ConfigN)
4209  hmat = ((TH2D*)m_electronBias_ConfigN.get());
4210  else if (geo == egEnergyCorr::ConfigIBL)
4211  hmat = ((TH2D*)m_electronBias_ConfigIBL.get());
4212  else if (geo == egEnergyCorr::ConfigPP0)
4213  hmat = ((TH2D*)m_electronBias_ConfigPP0.get());
4214  else
4215  return 0;
4216  } else if (ptype == PATCore::ParticleType::UnconvertedPhoton) {
4217  if (geo == egEnergyCorr::ConfigA)
4218  hmat = ((TH2D*)m_unconvertedBias_ConfigA.get());
4219  else if (geo == egEnergyCorr::ConfigEL)
4220  hmat = ((TH2D*)m_unconvertedBias_ConfigEpLp.get());
4221  else if (geo == egEnergyCorr::ConfigFMX)
4222  hmat = ((TH2D*)m_unconvertedBias_ConfigFpMX.get());
4223  else if (geo == egEnergyCorr::ConfigN)
4224  hmat = ((TH2D*)m_unconvertedBias_ConfigN.get());
4225  else if (geo == egEnergyCorr::ConfigIBL)
4226  hmat = ((TH2D*)m_unconvertedBias_ConfigIBL.get());
4227  else if (geo == egEnergyCorr::ConfigPP0)
4228  hmat = ((TH2D*)m_unconvertedBias_ConfigIBL.get());
4229  else
4230  return 0;
4231  } else if (ptype == PATCore::ParticleType::ConvertedPhoton) {
4232  if (geo == egEnergyCorr::ConfigA)
4233  hmat = ((TH2D*)m_convertedBias_ConfigA.get());
4234  else if (geo == egEnergyCorr::ConfigEL)
4235  hmat = ((TH2D*)m_convertedBias_ConfigEpLp.get());
4236  else if (geo == egEnergyCorr::ConfigFMX)
4237  hmat = ((TH2D*)m_convertedBias_ConfigFpMX.get());
4238  else if (geo == egEnergyCorr::ConfigN)
4239  hmat = ((TH2D*)m_convertedBias_ConfigN.get());
4240  else if (geo == egEnergyCorr::ConfigIBL)
4241  hmat = ((TH2D*)m_convertedBias_ConfigIBL.get());
4242  else if (geo == egEnergyCorr::ConfigPP0)
4243  hmat = ((TH2D*)m_convertedBias_ConfigPP0.get());
4244  else
4245  return 0;
4246  } else
4247  return 0;
4248 
4249  // use one bin in eta and linear interpolation in Et between 2 bins
4250 
4251  double aeta = std::abs(cl_eta);
4252  int ieta = hmat->GetXaxis()->FindBin(aeta);
4253 
4254  int ipt = hmat->GetYaxis()->FindBin(ET);
4255  double ptBin = hmat->GetYaxis()->GetBinCenter(ipt);
4256 
4257  int i1, i2;
4258  double pt1, pt2;
4259  if (ET > ptBin) {
4260  i1 = ipt;
4261  i2 = ipt + 1;
4262  pt1 = ptBin;
4263  pt2 = hmat->GetYaxis()->GetBinCenter(i2);
4264  } else {
4265  i1 = ipt - 1;
4266  i2 = ipt;
4267  pt1 = hmat->GetYaxis()->GetBinCenter(i1);
4268  pt2 = ptBin;
4269  }
4270 
4271  int nbins = hmat->GetYaxis()->GetNbins();
4272  double value = 0;
4273  if (i1 >= 1 && i1 < nbins) {
4274  double v1 = hmat->GetBinContent(ieta, i1);
4275  double v2 = hmat->GetBinContent(ieta, i2);
4276  value = (v1 * (pt2 - ET) + v2 * (ET - pt1)) / (pt2 - pt1);
4277  } else {
4278  if (ipt < 1)
4279  ipt = 1;
4280  if (ipt > nbins)
4281  ipt = nbins;
4282  value = hmat->GetBinContent(ieta, ipt);
4283  }
4284  return value;
4285 }
4286 
4287 // returns the energy dependence of the above (non-zero for electrons only).
4288 
4290  double cl_eta, double energy, egEnergyCorr::MaterialCategory imat,
4292  double varSF) const {
4293 
4294  double value = 0;
4295  double ET = energy / cosh(cl_eta) / GeV;
4296 
4297  if ((ptype != PATCore::ParticleType::Electron &&
4307  return value;
4308 
4309  egEnergyCorr::Geometry geoID, geoCryo, geoCalo, geoGp;
4310  geoID = egEnergyCorr::ConfigA;
4311  if (std::abs(cl_eta) < 2.)
4312  geoCryo = egEnergyCorr::ConfigEL;
4313  else
4314  geoCryo = egEnergyCorr::ConfigFMX;
4315 
4316  // G.Unal 21.08.2018
4317  // for Calo material use correctly ConfigN material for endcap (PS to Calo) in
4318  // release 21 (not done for run 1, which used FMX in this case)
4319  if (std::abs(cl_eta) > 1.52 &&
4328  geoCalo = egEnergyCorr::ConfigN;
4329  else
4330  geoCalo = egEnergyCorr::ConfigFMX;
4331  geoGp = egEnergyCorr::ConfigGp;
4332 
4333  // look up material bias
4334 
4335  double DeltaX = getDeltaX(cl_eta, imat, var) -
4336  getDeltaX(cl_eta, imat, egEnergyCorr::Scale::Nominal);
4337 
4338  // calculate scale change per unit added material
4339 
4340  // G.Unal 21.08.2019 new code called for release 21 sensivitities
4341 
4342  double DAlphaDXGp, DAlphaDXID, DAlphaDXCryo, DAlphaDXCalo;
4343 
4352  DAlphaDXGp =
4354  ET); // no G' in release 21, use FMX for the crack
4355  DAlphaDXID = getMaterialEffect(geoID, ptype, cl_eta, ET);
4356  DAlphaDXCryo = getMaterialEffect(geoCryo, ptype, cl_eta, ET);
4357  DAlphaDXCalo = getMaterialEffect(geoCalo, ptype, cl_eta, ET);
4358 
4359  } else {
4360  int ialpha = m_matElectronEtaBins->FindFixBin(std::abs(cl_eta)) - 1;
4361  if (ialpha < 0 || ialpha >= m_matElectronGraphs[geoGp]->GetSize())
4362  return 0.;
4363 
4364  DAlphaDXGp = ((TGraphErrors*)m_matElectronGraphs[geoGp]->At(ialpha))
4365  ->GetFunction("fNonLin")
4366  ->Eval(ET);
4367  DAlphaDXID = ((TGraphErrors*)m_matElectronGraphs[geoID]->At(ialpha))
4368  ->GetFunction("fNonLin")
4369  ->Eval(ET);
4370  DAlphaDXCryo = ((TGraphErrors*)m_matElectronGraphs[geoCryo]->At(ialpha))
4371  ->GetFunction("fNonLin")
4372  ->Eval(ET);
4373  DAlphaDXCalo = ((TGraphErrors*)m_matElectronGraphs[geoCalo]->At(ialpha))
4374  ->GetFunction("fNonLin")
4375  ->Eval(ET);
4376  }
4377 
4378  // when in crack, use G', exit
4379 
4380  if (isInCrack(cl_eta)) {
4382  value = DAlphaDXGp;
4383  else if (imat == egEnergyCorr::MatID &&
4385  value = -DAlphaDXGp;
4386  return value;
4387  }
4388 
4389  int idx = m_matX0Additions[geoID]->FindBin(std::abs(cl_eta));
4390  if (idx < 1 || idx > m_matX0Additions[geoID]->GetNbinsX())
4391  DAlphaDXID = 0;
4392  else {
4393  if (m_matX0Additions[geoID]->GetBinContent(idx) > 0.)
4394  DAlphaDXID /= m_matX0Additions[geoID]->GetBinContent(idx);
4395  else
4396  DAlphaDXID = 0.;
4397  }
4398 
4399  idx = m_matX0Additions[geoCryo]->FindBin(std::abs(cl_eta));
4400  if (idx < 1 || idx > m_matX0Additions[geoCryo]->GetNbinsX())
4401  DAlphaDXCryo = 0;
4402  else {
4403  if (m_matX0Additions[geoCryo]->GetBinContent(idx) > 0.)
4404  DAlphaDXCryo /= m_matX0Additions[geoCryo]->GetBinContent(idx);
4405  else
4406  DAlphaDXCryo = 0.;
4407  }
4408 
4409  idx = m_matX0Additions[geoCalo]->FindBin(std::abs(cl_eta));
4410  if (idx < 1 || idx > m_matX0Additions[geoCalo]->GetNbinsX())
4411  DAlphaDXCalo = 0;
4412  else {
4413  if (m_matX0Additions[geoCalo]->GetBinContent(idx) > 0.)
4414  DAlphaDXCalo /= m_matX0Additions[geoCalo]->GetBinContent(idx);
4415  else
4416  DAlphaDXCalo = 0.;
4417  }
4418 
4419  // final value
4420 
4421  if (imat == egEnergyCorr::MatID)
4422  value = DeltaX * (DAlphaDXID - DAlphaDXCryo);
4423  else if (imat == egEnergyCorr::MatCryo)
4424  value = DeltaX * DAlphaDXCryo;
4425  else if (imat == egEnergyCorr::MatCalo)
4426  value = DeltaX * DAlphaDXCalo;
4427 
4428  return value * varSF;
4429 }
4430 
4432  double cl_eta, PATCore::ParticleType::Type ptype,
4433  egEnergyCorr::Scale::Variation var, double varSF) const {
4434 
4435  double alpha = 0.;
4436  double aeta = std::abs(cl_eta);
4437 
4440  return alpha;
4441 
4443 
4445  alpha = m_leakageUnconverted->GetBinContent(
4446  m_leakageUnconverted->FindFixBin(aeta));
4448  alpha = -m_leakageUnconverted->GetBinContent(
4449  m_leakageUnconverted->FindFixBin(aeta));
4450  }
4451 
4452  } else if (ptype == PATCore::ParticleType::ConvertedPhoton) {
4453 
4455  alpha = m_leakageConverted->GetBinContent(
4456  m_leakageConverted->FindFixBin(aeta));
4457  } else if (var == egEnergyCorr::Scale::LeakageConvDown) {
4458  alpha = -m_leakageConverted->GetBinContent(
4459  m_leakageConverted->FindFixBin(aeta));
4460  }
4461  }
4462 
4463  return alpha * varSF;
4464 }
4465 
4467  double cl_eta, double et, PATCore::ParticleType::Type ptype,
4468  egEnergyCorr::Scale::Variation var, double varSF) const {
4469 
4470  // To be on the safe side
4473  return getAlphaLeakage(cl_eta, ptype, var, varSF);
4474  }
4475 
4476  // No correction for electron
4477  if (ptype == PATCore::ParticleType::Electron &&
4480  return 0.;
4481 
4482  // Outside acceptance. Should never happen
4483  double aeta = std::abs(cl_eta);
4484  if (aeta > 2.47) {
4485  ATH_MSG_WARNING("Very high |eta| object, eta = " << cl_eta);
4486  return 0.;
4487  }
4488 
4489  // If no correction applied, can only be the egEnergyCorr::Scale::LeakageXXX
4490  // syst
4497  return 0.;
4498 
4499  double etGeV = et / GeV;
4500  double alpha = 0, dalpha = 0;
4503  dalpha = getAlphaUncAlpha(*m_leakageElectron, aeta, etGeV,
4505  .first;
4507  dalpha *= -1;
4508  if (ptype == PATCore::ParticleType::Electron)
4509  return dalpha;
4510  }
4511 
4512  bool isConv = ptype == PATCore::ParticleType::ConvertedPhoton;
4513  TH1* hh = isConv ? m_leakageConverted.get() : m_leakageUnconverted.get();
4514  std::pair<double, double> p =
4516 
4517  if (m_useLeakageCorrection) {
4518  alpha = p.first;
4519  }
4520  if ((isConv && (var == egEnergyCorr::Scale::LeakageConvDown ||
4522  (!isConv && (var == egEnergyCorr::Scale::LeakageUnconvDown ||
4524  // If we correct, use uncertainty. Else use full size of the effect
4525  // for es2023_R22_Run2_v0, use full size of correction as uncertainty
4526  if (m_useLeakageCorrection &&
4529  dalpha = p.second;
4530  else
4531  dalpha = alpha;
4532 
4535  dalpha *= -1;
4536  }
4537  alpha += dalpha;
4538 
4540  "In leakage2D alpha = " << alpha << " from var = " << variationName(var));
4541 
4542  return alpha * varSF;
4543 }
4544 
4546  const TH1& hh, double aeta, double et, bool useInterp) const {
4547 
4548  // stay within the histogram limits in pT
4549  // no warning to say the pT is not in the "validity" range...
4550  int ibeta = hh.GetXaxis()->FindBin(aeta);
4551  int nbpT = hh.GetYaxis()->GetNbins();
4552  int ibpT = hh.GetYaxis()->FindBin(et);
4553  bool isOUFlow = false;
4554  if (ibpT > nbpT) {
4555  ibpT = nbpT;
4556  isOUFlow = true;
4557  } else if (ibpT == 0) {
4558  ibpT = 1;
4559  isOUFlow = true;
4560  }
4561  double alpha = 0.;
4562  double pTp = hh.GetYaxis()->GetBinCenter(ibpT), pTn = pTp;
4563  if (!useInterp || isOUFlow || (ibpT == nbpT && et > pTp) ||
4564  (ibpT == 1 && et < pTp))
4565  alpha = hh.GetBinContent(ibeta, ibpT);
4566  else {
4567  int jp = ibpT, jn = ibpT - 1;
4568  if (et > pTp) {
4569  jp = ibpT + 1;
4570  jn = ibpT;
4571  pTn = pTp;
4572  pTp = hh.GetYaxis()->GetBinCenter(jp);
4573  } else {
4574  pTn = hh.GetYaxis()->GetBinCenter(jn);
4575  }
4576  double aPos = hh.GetBinContent(ibeta, jp);
4577  double aNeg = hh.GetBinContent(ibeta, jn);
4578  alpha = (aPos * (et - pTn) + aNeg * (pTp - et)) / (pTp - pTn);
4579  ATH_MSG_VERBOSE("interp et = " << et << " alpha+ = " << aPos << " alpha- = "
4580  << aNeg << " alpha = " << alpha);
4581  }
4582  double dalpha = hh.GetBinError(ibeta, ibpT);
4583 
4584  return std::make_pair(alpha, dalpha);
4585 }
4586 
4588  double cl_eta, double energy, PATCore::ParticleType::Type ptype,
4589  egEnergyCorr::Scale::Variation var, double varSF) const {
4590 
4591  double alpha = 0.;
4592  double aeta = std::abs(cl_eta);
4593  if (aeta > 2.37)
4594  aeta = 2.36;
4595  double ET = energy / std::cosh(cl_eta);
4596 
4599  return alpha;
4600 
4602 
4606  alpha = m_convRecoEfficiency->GetBinContent(
4607  m_convRecoEfficiency->FindFixBin(aeta));
4611  alpha = -m_convRecoEfficiency->GetBinContent(
4612  m_convRecoEfficiency->FindFixBin(aeta));
4613  else if (var == egEnergyCorr::Scale::ConvRecoUp &&
4617  else if (var == egEnergyCorr::Scale::ConvRecoDown &&
4620  alpha =
4622 
4623  } else if (ptype == PATCore::ParticleType::ConvertedPhoton) {
4624 
4628  alpha = m_convFakeRate->GetBinContent(m_convFakeRate->FindFixBin(aeta));
4632  alpha = -m_convFakeRate->GetBinContent(m_convFakeRate->FindFixBin(aeta));
4633  else if (var == egEnergyCorr::Scale::ConvRecoUp &&
4637  else if (var == egEnergyCorr::Scale::ConvRecoDown &&
4640  alpha = -1. * getInterpolateConvSyst2D(*m_convFakeRate_2D, aeta, ET);
4642  alpha =
4643  m_convRadius->GetBinContent(m_convRadius->FindFixBin(aeta, ET / GeV));
4645  alpha = -m_convRadius->GetBinContent(
4646  m_convRadius->FindFixBin(aeta, ET / GeV));
4647  }
4648 
4649  return alpha * varSF;
4650 }
4651 
4653  const TH2& conv_hist, double aeta, double ET) const {
4654 
4655  // use one bin in eta and linear interpolation in Et between 2 bins
4656  int ieta = conv_hist.GetXaxis()->FindBin(aeta);
4657 
4658  int ipt = conv_hist.GetYaxis()->FindBin(ET);
4659  double ptBin = conv_hist.GetYaxis()->GetBinCenter(ipt);
4660 
4661  int i1, i2;
4662  double pt1, pt2;
4663  if (ET > ptBin) {
4664  i1 = ipt;
4665  i2 = ipt + 1;
4666  pt1 = ptBin;
4667  pt2 = conv_hist.GetYaxis()->GetBinCenter(i2);
4668  } else {
4669  i1 = ipt - 1;
4670  i2 = ipt;
4671  pt1 = conv_hist.GetYaxis()->GetBinCenter(i1);
4672  pt2 = ptBin;
4673  }
4674 
4675  int nbins = conv_hist.GetYaxis()->GetNbins();
4676  double value = 0;
4677  if (i1 >= 1 && i1 < nbins) {
4678  double v1 = conv_hist.GetBinContent(ieta, i1);
4679  double v2 = conv_hist.GetBinContent(ieta, i2);
4680  value = (v1 * (pt2 - ET) + v2 * (ET - pt1)) / (pt2 - pt1);
4681  } else {
4682  if (ipt < 1)
4683  ipt = 1;
4684  if (ipt > nbins)
4685  ipt = nbins;
4686  value = conv_hist.GetBinContent(ieta, ipt);
4687  }
4688 
4689  return value;
4690 }
4691 
4693  double cl_eta, double energy, double eraw,
4694  PATCore::ParticleType::Type ptype, bool isRef,
4695  egEnergyCorr::Scale::Variation var, double varSF) const {
4696  double alpha = 0.;
4700  const double delta =
4701  getValueHistoAt(*m_pedestals_es2017, std::abs(cl_eta));
4702  alpha = delta / (energy / cosh(cl_eta));
4704  alpha *= -1;
4705  } else if (m_esmodel == egEnergyCorr::es2017_summer or
4719  // Et uncertainty band: 10 MeV for the corrected cluster
4720  alpha = 10. / (energy / cosh(cl_eta));
4722  alpha *= -1;
4723  } else {
4724  // observed pedestal corrected as a systematic on MC for now.
4725  // TODO : correct for it in the data
4726 
4727  double pedestal = getLayerPedestal(cl_eta, ptype, 0, var, varSF) +
4728  getLayerPedestal(cl_eta, ptype, 1, var, varSF) +
4729  getLayerPedestal(cl_eta, ptype, 2, var, varSF) +
4730  getLayerPedestal(cl_eta, ptype, 3, var, varSF);
4731 
4732  if (isRef)
4733  alpha = pedestal / energy *
4734  1.06; // approximate average ratio between calibrated and raw
4735  else
4736  alpha = pedestal / eraw;
4737  }
4738  }
4739 
4740  return alpha * varSF;
4741 }
4742 
4744  double cl_eta, PATCore::ParticleType::Type ptype, int iLayer,
4745  egEnergyCorr::Scale::Variation var, double varSF) const {
4746 
4747  double pedestal = 0.;
4748  double aeta = std::abs(cl_eta);
4749 
4752 
4753  if (iLayer == 0)
4754  pedestal = m_pedestalL0->GetBinContent(m_pedestalL0->FindFixBin(aeta));
4755  else if (iLayer == 1)
4756  pedestal = m_pedestalL1->GetBinContent(m_pedestalL1->FindFixBin(aeta));
4757  else if (iLayer == 2)
4758  pedestal = m_pedestalL2->GetBinContent(m_pedestalL2->FindFixBin(aeta));
4759  else if (iLayer == 3)
4760  pedestal = m_pedestalL3->GetBinContent(m_pedestalL3->FindFixBin(aeta));
4761 
4762  if (ptype == PATCore::ParticleType::UnconvertedPhoton && aeta < 1.4) {
4763  if (iLayer <= 1)
4764  pedestal /= 1.5;
4765  else if (iLayer == 2)
4766  pedestal *= 15. / 21.;
4767  }
4768 
4770  pedestal *= -1.;
4771  }
4772 
4773  return pedestal * varSF;
4774 }
4775 
4777 
4778  return std::abs(cl_eta) >= 1.35 && std::abs(cl_eta) <= 1.55;
4779 }
4780 
4782 
4783  double newEta = cl_eta;
4784 
4785  if (!isInCrack(newEta))
4786  return newEta;
4787 
4788  if (newEta >= 1.35 && newEta <= 1.45)
4789  newEta = 1.349;
4790  if (newEta >= 1.45 && newEta <= 1.55)
4791  newEta = 1.551;
4792 
4793  if (newEta >= -1.55 && newEta <= -1.45)
4794  newEta = -1.551;
4795  if (newEta >= -1.45 && newEta <= -1.35)
4796  newEta = -1.349;
4797 
4798  return newEta;
4799 }
4800 
4802  int particle_type) const {
4803 
4804  double pileupNoise;
4805 
4806  // release 21 for <mu> =32 (combined 2015-2016-2017 dataset), pileup noise =
4807  // f(Et) for superclusters
4817  double avgmu = 32;
4820  avgmu = 34.;
4821 
4822  double et = energy / cosh(eta);
4823  if (et < 5000.)
4824  et = 5000.;
4825  if (et > 50000.)
4826  et = 50000.;
4827  pileupNoise = sqrt(avgmu) * (60. + 40. * log(et / 10000.) / log(5.));
4828  } else {
4829  // approximate pileup noise addition to the total noise in MeV for
4830  // <mu_data> (2012) = 20 converted photons and electrons
4831  pileupNoise = 240.;
4832  // unconverted photons, different values in barrel and end-cap
4833  if (particle_type == 1) {
4834  if (std::abs(eta) < 1.4)
4835  pileupNoise = 200.;
4836  }
4837  }
4838  return pileupNoise;
4839 }
4840 
4842  int particle_type, double energy, double eta, double etaCalo, int syst_mask,
4843  double& resolution, double& resolution_error, double& resolution_error_up,
4844  double& resolution_error_down, int resol_type, bool fast) const {
4845 
4846  double pileupNoise = pileUpTerm(energy, eta, particle_type);
4847  double et = energy / cosh(eta);
4848 
4849  resolution =
4850  m_resolution_tool->getResolution(particle_type, energy, eta, resol_type);
4851  // std::cout << " resolution from tool " << resolution << std::endl;
4852  double smearingZ = dataConstantTerm(m_use_etaCalo_scales ? etaCalo : eta);
4853  double esmearingZ =
4855  double esmearingOFC = m_esmodel == egEnergyCorr::es2022_R22_PRE
4857  : 0.;
4858  double resolution2 = resolution * resolution + smearingZ * smearingZ +
4859  (pileupNoise * pileupNoise) / (et * et);
4860  resolution = sqrt(resolution2);
4861 
4862  double_t sum_sigma_resolution2 = 0.;
4863  double sum_deltaDown = 0.;
4864  double sum_deltaUp = 0.;
4865 
4866  for (int isys = 0; isys < 11; isys++) {
4867 
4868  if (syst_mask & (1 << isys)) {
4869 
4870  double sigma2 = 0.;
4871  double sigma2up = 0.;
4872  double sigma2down = 0.;
4873 
4874  // systematics on Z smearing measurement
4875  if (isys == 0) {
4876  double d1 = (smearingZ + esmearingZ) * (smearingZ + esmearingZ) -
4877  smearingZ * smearingZ;
4878  double d2 = smearingZ * smearingZ -
4879  (smearingZ - esmearingZ) * (smearingZ - esmearingZ);
4880  double d = 0.5 * (d1 + d2);
4881  sigma2up = d1;
4882  sigma2down = -d2;
4883  sigma2 = d;
4884  ATH_MSG_DEBUG(
4885  std::format("sys resolution Zsmearing: {:.7f} {:.7f} {:.7f}", sigma2, sigma2up, sigma2down));
4886  }
4887 
4888  // systematics on intrinsic resolution
4889  if (isys == 1) {
4890  double resolutionZ = m_resolution_tool->getResolution(
4891  3, 40000. * cosh(eta), eta, resol_type);
4892  double deltaSigma2 = (1.1 * resolutionZ) * (1.1 * resolutionZ) -
4893  resolutionZ * resolutionZ;
4894  double resolution1 =
4895  m_resolution_tool->getResolution(3, energy, eta, resol_type);
4896  sigma2up = (1.1 * resolution1) * (1.1 * resolution1) -
4897  resolution1 * resolution1 - deltaSigma2;
4898  deltaSigma2 = (0.9 * resolutionZ) * (0.9 * resolutionZ) -
4899  resolutionZ * resolutionZ;
4900  sigma2down = (0.9 * resolution1) * (0.9 * resolution1) -
4901  resolution1 * resolution1 - deltaSigma2;
4902  sigma2 = 0.5 * (sigma2up - sigma2down);
4903  ATH_MSG_DEBUG(
4904  std::format("sys resolution intrinsic: {:.7f} {:.7f} {:.7f}", sigma2, sigma2up, sigma2down));
4905  }
4906 
4907  // systematics from configA ID material
4908  else if (isys == 2) {
4909  double sigmaA =
4910  m_getMaterialDelta->getDelta(particle_type, energy, eta, 1, 0);
4911  sigma2 = sigmaA * sigmaA;
4912  sigma2up = sigma2;
4913  sigma2down = -1. * sigma2;
4914  ATH_MSG_DEBUG(
4915  std::format("sys resolution configA ID material: {:.7f} {:.7f} {:.7f}", sigma2, sigma2up, sigma2down));
4916  }
4917 
4918  // systematics from material presampler-layer 1 in barrel (based on half
4919  // config M )
4920  else if (isys == 3) {
4921  if (std::abs(eta) < 1.45) {
4922  double sigmaM =
4923  m_getMaterialDelta->getDelta(particle_type, energy, eta, 1, 3);
4924  sigma2 = 0.5 * sigmaM * sigmaM;
4925  } else
4926  sigma2 = 0.;
4927  sigma2up = sigma2;
4928  sigma2down = -1. * sigma2;
4929  ATH_MSG_DEBUG(
4930  std::format("sys resolution presampler-layer1: {:.7f} {:.7f} {:.7f}", sigma2, sigma2up, sigma2down));
4931  }
4932 
4933  // systematic from material in barrel-endcap gap (using full config X for
4934  // now)
4935  else if (isys == 4) {
4936  if (std::abs(eta) > 1.52 && std::abs(eta) < 1.82) {
4937  double sigmaX =
4938  m_getMaterialDelta->getDelta(particle_type, energy, eta, 1, 3);
4939  sigma2 = sigmaX * sigmaX;
4940  } else
4941  sigma2 = 0.;
4942  sigma2up = sigma2;
4943  sigma2down = -1. * sigma2;
4944  ATH_MSG_DEBUG(
4945  std::format("sys resolution barrel-endcap gap: {:.7f} {:.7f} {:.7f}", sigma2, sigma2up, sigma2down));
4946  }
4947 
4948  // systematics from material in cryostat area (using half config EL,
4949  // FIXME: could use clever eta dependent scaling)
4950  else if (isys == 5) {
4951  double sigmaEL =
4952  m_getMaterialDelta->getDelta(particle_type, energy, eta, 1, 2);
4953  sigma2 = 0.5 * sigmaEL * sigmaEL;
4954  sigma2up = sigma2;
4955  sigma2down = -1. * sigma2;
4956  ATH_MSG_DEBUG(
4957  std::format("sys resolution cryostat area: {:.7f} {:.7f} {:.7f}", sigma2, sigma2up, sigma2down));
4958  }
4959 
4960  // systematics from pileup noise on total noise (200 MeV in quadrature,
4961  // somewhat conservative)
4962  else if (isys == 6) {
4963  double et = energy / cosh(eta);
4964  double sigmaPileUp = 0.;
4965  double sigmaZ = 0.;
4966  // release 21 - 10% uncertainty on pileup noise
4974  double deltaNoise =
4975  sqrt(1.1 * 1.1 - 1.0) *
4976  pileupNoise; // uncertainty in quadrature 1.1*noise - noise
4977  sigmaPileUp = deltaNoise / et; // sigmaE/E impact
4978  sigmaZ = deltaNoise / 40000.; // sigmaE/E for Z->ee electrons
4979  // (absorbed in smearing correction)
4980  }
4981  // no pileup noise uncertainty for es2017_R21_ofc0_v1 and egEnergyCorr::es2024_Run3_ofc0_v0
4983  sigmaPileUp = 0.;
4984  sigmaZ = 0.;
4985  } else {
4986  // older models
4987  double deltaPileupNoise = 100.; // MeV
4988  if (std::abs(eta) >= 1.4 && std::abs(eta) < 1.8)
4989  deltaPileupNoise = 200.; // larger systematic in this eta bin
4990  double scaleNcells = 1;
4991  if (particle_type == 1 && std::abs(eta) < 1.4)
4992  scaleNcells = sqrt(3. / 5.); // cluster=3X5 instead of 3x7, rms
4993  // scales with cluster area
4994  sigmaPileUp = deltaPileupNoise * scaleNcells / et;
4995  sigmaZ =
4996  deltaPileupNoise / (40000.); // effect for Z->ee at Et=40 GeV
4997  }
4998  sigma2 = sigmaPileUp * sigmaPileUp - sigmaZ * sigmaZ;
4999  sigma2up = sigma2;
5000  sigma2down = -1. * sigma2;
5001  ATH_MSG_DEBUG(std::format("sys resolution pileup noise: {:.7f} {:.7f} {:.7f}", sigma2, sigma2up, sigma2down));
5002  }
5003 
5004  // systematics from material in IBL+PP0 for barrel
5005  else if (isys == 7 && std::abs(eta) < 1.5 &&
5020  double sigmaE =
5021  m_getMaterialDelta->getDelta(particle_type, energy, eta, 1, 5);
5022  sigma2 = sigmaE * sigmaE;
5023  sigma2up = sigma2;
5024  sigma2down = -1. * sigma2;
5025  ATH_MSG_DEBUG(
5026  std::format("sys resolution ibl material: {:.7f} {:.7f} {:.7f}", sigma2, sigma2up, sigma2down));
5027  }
5028 
5029  // systematics from material in IBL+PP0 for end-cap
5030  else if (isys == 8 && std::abs(eta) > 1.5 &&
5045  double sigmaE =
5046  m_getMaterialDelta->getDelta(particle_type, energy, eta, 1, 5);
5047  // scale factor 2.3 in X0 => sqrt(2) in resolution or 2 in resolution**2
5048  sigma2 = 2.3 * sigmaE * sigmaE;
5049  sigma2up = sigma2;
5050  sigma2down = -1. * sigma2;
5051  ATH_MSG_DEBUG(
5052  std::format("sys resolution pp0 material: {:.7f} {:.7f} {:.7f}", sigma2, sigma2up, sigma2down));
5053 
5054  }
5055 
5056  // AF2 resolution systematics for es2017_R21_v1 model (neglected before
5057  // that...)
5058  else if (isys == 9 &&
5067  fast) {
5068  const double ptGeV = et / 1e3;
5069  bool interpolate_eta = false;
5070  bool interpolate_pt = false;
5072  // interpolate_eta = true;
5073  interpolate_pt = true;
5074  }
5075  if (particle_type == 0)
5076  sigma2 = getValueHistAt(*m_G4OverAFII_resolution_electron, eta, ptGeV,
5077  true, true, true, true,
5078  interpolate_eta, interpolate_pt);
5079  if (particle_type == 1)
5080  sigma2 = getValueHistAt(*m_G4OverAFII_resolution_unconverted, eta,
5081  ptGeV, true, true, true, true,
5082  interpolate_eta, interpolate_pt);
5083  if (particle_type == 2)
5084  sigma2 = getValueHistAt(*m_G4OverAFII_resolution_converted, eta,
5085  ptGeV, true, true, true, true,
5086  interpolate_eta, interpolate_pt);
5087  sigma2up = -1. * sigma2; // AF2 resolution worse than full Sim,
5088  // sigma2up gives back AF2 resolution
5089  sigma2down = sigma2;
5090  }
5091 
5092  // OFC resolution systematics for for es2022_RUN3_PRE
5093  else if (isys == 10 && (m_esmodel == egEnergyCorr::es2022_R22_PRE)) {
5094  double d1 = (smearingZ + esmearingOFC) * (smearingZ + esmearingOFC) -
5095  smearingZ * smearingZ;
5096  double d2 = smearingZ * smearingZ -
5097  (smearingZ - esmearingOFC) * (smearingZ - esmearingOFC);
5098  double d = 0.5 * (d1 + d2);
5099  sigma2up = d1;
5100  sigma2down = -d2;
5101  sigma2 = d;
5102  ATH_MSG_DEBUG(std::format("sys resolution OFC unc.: {:.7f} {:.7f} {:.7f}", sigma2, sigma2up, sigma2down));
5103  }
5104 
5105  // old method to use max of up and down for All
5106  /*
5107  double rr1 = sqrt(resolution2+sigma2); // nominal (data) +
5108  average error double rr2=0.; if((resolution2-sigma2) > 0.) rr2 =
5109  sqrt(resolution2-sigma2); // max(0, nominal (data) - average error)
5110  double deltaSigma_sys;
5111  if ((rr1-resolution) > (resolution-rr2) ) deltaSigma_sys =
5112  rr1-resolution; else deltaSigma_sys = resolution-rr2; deltaSigma_sys =
5113  deltaSigma_sys / resolution;
5114  */
5115 
5116  // use average of up and down for symmetric uncertainty for All
5117 
5118  double rr1 = 0.;
5119  if ((resolution2 + sigma2up) > 0.)
5120  rr1 = sqrt(resolution2 + sigma2up); // nominal (data) + up error
5121  double rr2 = 0.;
5122  if ((resolution2 + sigma2down) > 0.)
5123  rr2 = sqrt(resolution2 +
5124  sigma2down); // max(0, nominal (data) + down error
5125  double deltaSigma_sys;
5126  deltaSigma_sys =
5127  0.5 * (rr1 - rr2); // average of up and down uncertainties
5128  deltaSigma_sys =
5129  deltaSigma_sys / resolution; // relative resolution uncertainty
5130 
5131  sum_sigma_resolution2 += deltaSigma_sys * deltaSigma_sys;
5132 
5133  if ((resolution2 + sigma2up) > 0.)
5134  rr1 = sqrt(resolution2 + sigma2up);
5135  else
5136  rr1 = 0.;
5137  double deltaSigmaUp = (rr1 - resolution) / resolution;
5138  ATH_MSG_VERBOSE("relative resolution change Up " << deltaSigmaUp);
5139 
5140  if ((resolution2 + sigma2down) > 0.)
5141  rr2 = sqrt(resolution2 + sigma2down);
5142  else
5143  rr2 = 0.;
5144  double deltaSigmaDown = (rr2 - resolution) / resolution;
5145  ATH_MSG_VERBOSE("relative resolution change Down " << deltaSigmaDown);
5146 
5147  sum_deltaUp += deltaSigmaUp;
5148  sum_deltaDown += deltaSigmaDown;
5149  }
5150  }
5151 
5152  resolution = resolution * energy; // to return final resolution in MeV
5153  resolution_error = sqrt(sum_sigma_resolution2) *
5154  resolution; // to return resolution uncertainty in MeV
5155 
5156  resolution_error_up = sum_deltaUp * resolution;
5157  resolution_error_down = sum_deltaDown * resolution;
5158 
5159  ATH_MSG_VERBOSE("Resolution (MeV): "
5160  << resolution
5161  << " Resolution Error (MeV): " << resolution_error << " down "
5162  << resolution_error_down << " up " << resolution_error_up
5163  << " Z smearing " << smearingZ << " +- " << esmearingZ
5164  << " using mask " << syst_mask);
5165 }
5166 
5169  switch (var) {
5171  return "None";
5173  return "Nominal";
5175  return "topoClusterThresUp";
5177  return "topoClusterThresDown";
5179  return "MomentumUp";
5181  return "MomentumDown";
5183  return "ZeeStatUp";
5185  return "ZeeStatDown";
5187  return "ZeeSystUp";
5189  return "ZeeSystDown";
5191  return "ZeePhysUp";
5193  return "ZeePhysDown";
5195  return "ZeeAllUp";
5197  return "ZeeAllDown";
5199  return "LArCalibUp";
5201  return "LArCalibDown";
5203  return "LArUnconvCalibUp";
5205  return "LArUnconvCalibDown";
5207  return "LArElecCalibUp";
5209  return "LArElecCalibDown";
5211  return "LArCalibExtra2015PreUp";
5213  return "LArCalibExtra2015PreDown";
5215  return "LArElecUnconvUp";
5217  return "LArElecUnconvDown";
5219  return "G4Up";
5221  return "G4Down";
5223  return "PSUp";
5225  return "PSDown";
5227  return "PSb12Up";
5229  return "PSb12Down";
5231  return "S12Up";
5233  return "S12Down";
5235  return "S12ExtraLastEtaBinRun2Up";
5237  return "S12ExtraLastEtaBinRun2Down";
5239  return "MatIDUp";
5241  return "MatIDDown";
5243  return "MatCryoUp";
5245  return "MatCryoDown";
5247  return "MatCaloUp";
5249  return "MatCaloDown";
5251  return "L1GainUp";
5253  return "L1GainDown";
5255  return "L2GainUp";
5257  return "L2GainDown";
5259  return "L2LowGainDown";
5261  return "L2LowGainUp";
5263  return "L2MediumGainDown";
5265  return "L2MediumGainUp";
5267  return "ADCLinUp";
5269  return "ADCLinDown";
5271  return "LeakageElecUp";
5273  return "LeakageElecDown";
5275  return "ConvRecoUp";
5277  return "ConvRecoDown";
5279  return "afUp";
5281  return "afDown";
5283  return "LeakageUnconvUp";
5285  return "LeakageUnconvDown";
5287  return "LeakageConvUp";
5289  return "LeakageConvDown";
5291  return "ConvEfficiencyUp";
5293  return "ConvEfficiencyDown";
5295  return "ConvFakeRateUp";
5297  return "ConvFakeRateDown";
5299  return "ConvRadiusUp";
5301  return "ConvRadiusDown";
5303  return "PedestalUp";
5305  return "PedestalDown";
5307  return "AllUp";
5309  return "AllDown";
5311  return "AllCorrelatedUp";
5313  return "AllCorrelatedDown";
5315  return "LArTemperature2015PreUp";
5317  return "LArTemperature2015PreDown";
5319  return "LArTemperature2016PreUp";
5321  return "LArTemperature2016PreDown";
5323  return "E4ScintillatorUp";
5325  return "E4ScintillatorDown";
5327  return "MatPP0Up";
5329  return "MatPP0Down";
5331  return "Wtots1Up";
5333  return "Wtots1Down";
5335  return "LastScaleVariation";
5337  return "OFCUp";
5339  return "OFCDown";
5341  return "EXTRARUN3PREUp";
5343  return "EXTRARUN3PREDown";
5344  default:
5345  return "Unknown";
5346  }
5347 }
5348 
5351  switch (var) {
5353  return "Resolution::None";
5355  return "Resolution::Nominal";
5357  return "Resolution::AllDown";
5359  return "Resolution::AllUp";
5361  return "Resolution::ZSmearingUp";
5363  return "Resolution::ZSmearingDown";
5365  return "Resolution::SamplingTermUp";
5367  return "Resolution::SamplingTermDown";
5369  return "Resolution::MaterialUp";
5371  return "Resolution::MaterialDown";
5373  return "Resolution::MaterialUp";
5375  return "Resolution::MaterialDown";
5377  return "Resolution::MaterialUp";
5379  return "Resolution::MaterialDown";
5381  return "Resolution::MaterialUp";
5383  return "Resolution::MaterialDown";
5385  return "Resolution::PileUpUp";
5387  return "Resolution::PileUpDown";
5389  return "Resolution::MaterialPP0Up";
5391  return "Resolution::MaterialPP0Down";
5393  return "Resolution::MaterialIBLUp";
5395  return "Resolution::MaterialIBLDown";
5397  return "Resolution::afUp";
5399  return "Resolution::afDown";
5401  return "Resolution::OFCUp";
5403  return "Resolution::OFCDown";
5405  return "LastResolutionVariation";
5406  default:
5407  return "Resolution::Unknown";
5408  }
5409 }
5410 
5412  const auto ieta = std::as_const(*m_zeeSyst).GetXaxis()->FindFixBin(eta);
5413  auto value_histo = m_zeeSyst->GetBinContent(ieta);
5414 
5415  return value_histo;
5416 }
5417 
5419  const auto ieta = std::as_const(*m_zeeSystOFC).GetXaxis()->FindFixBin(eta);
5420  auto value_histo = m_zeeSystOFC->GetBinContent(ieta);
5421 
5422  return value_histo;
5423 }
5424 
5426  return *std::as_const(*m_zeeNom).GetXaxis();
5427 }
5428 
5429 } // namespace AtlasRoot
AtlasRoot::egammaEnergyCorrectionTool::m_dX_IPPS_LAr
std::unique_ptr< TH1 > m_dX_IPPS_LAr
Definition: egammaEnergyCorrectionTool.h:668
AtlasRoot::egammaEnergyCorrectionTool::get_ZeeStat_eta_axis
const TAxis & get_ZeeStat_eta_axis() const
Definition: egammaEnergyCorrectionTool.cxx:5425
egEnergyCorr::Scale::ZeeSystDown
@ ZeeSystDown
Definition: egammaEnergyCorrectionTool.h:147
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
egEnergyCorr::Resolution::MaterialPP0Up
@ MaterialPP0Up
Definition: egammaEnergyCorrectionTool.h:93
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
AtlasRoot::egammaEnergyCorrectionTool::m_resSyst
std::unique_ptr< TH1 > m_resSyst
Definition: egammaEnergyCorrectionTool.h:660
beamspotnt.var
var
Definition: bin/beamspotnt.py:1394
AtlasRoot::egammaEnergyCorrectionTool::m_rootFileName
std::string m_rootFileName
Definition: egammaEnergyCorrectionTool.h:631
egEnergyCorr::Scale::OFCDown
@ OFCDown
Definition: egammaEnergyCorrectionTool.h:266
AtlasRoot::egammaEnergyCorrectionTool::m_zeeNom_data2015
std::unique_ptr< TH1 > m_zeeNom_data2015
Definition: egammaEnergyCorrectionTool.h:646
AtlasRoot::egammaEnergyCorrectionTool::m_wstot_pT_MC_p0_unconverted_photons
std::unique_ptr< TH1 > m_wstot_pT_MC_p0_unconverted_photons
Definition: egammaEnergyCorrectionTool.h:740
egEnergyCorr::Scale::PSDown
@ PSDown
Definition: egammaEnergyCorrectionTool.h:184
PATCore::ParticleType::UnconvertedPhoton
@ UnconvertedPhoton
Definition: PATCoreEnums.h:38
AtlasRoot::egammaEnergyCorrectionTool::m_wstot_pT_data_p0_electrons
std::unique_ptr< TH1 > m_wstot_pT_data_p0_electrons
Definition: egammaEnergyCorrectionTool.h:732
AtlasRoot::egammaEnergyCorrectionTool::m_matElectronCstTerm
std::vector< std::unique_ptr< TH1 > > m_matElectronCstTerm
Definition: egammaEnergyCorrectionTool.h:750
et
Extra patterns decribing particle interation process.
egEnergyCorr::Resolution::SamplingTermUp
@ SamplingTermUp
Definition: egammaEnergyCorrectionTool.h:74
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
egEnergyCorr::es2011c
@ es2011c
Definition: egammaEnergyCorrectionTool.h:289
egEnergyCorr::ConfigIBL
@ ConfigIBL
Definition: egammaEnergyCorrectionTool.h:347
pdg_comparison.sigma
sigma
Definition: pdg_comparison.py:324
egEnergyCorr::Scale::LArCalibExtra2015PreDown
@ LArCalibExtra2015PreDown
Definition: egammaEnergyCorrectionTool.h:166
egEnergyCorr::Scale::LastScaleVariation
@ LastScaleVariation
Definition: egammaEnergyCorrectionTool.h:278
add-xsec-uncert-quadrature-N.alpha
alpha
Definition: add-xsec-uncert-quadrature-N.py:110
mc.random_seed
random_seed
Definition: mc.PhPy8EG_Hto4l_NNLOPS_nnlo_30_ggH125_ZZ4l.py:43
AtlasRoot::egammaEnergyCorrectionTool::mcSamplingTermRelError
static double mcSamplingTermRelError(double cl_eta)
Definition: egammaEnergyCorrectionTool.cxx:2702
AtlasRoot::egammaEnergyCorrectionTool::m_initialized
bool m_initialized
Definition: egammaEnergyCorrectionTool.h:805
AtlasRoot::egammaEnergyCorrectionTool::m_unconvertedBias_ConfigN
std::unique_ptr< TH2 > m_unconvertedBias_ConfigN
Definition: egammaEnergyCorrectionTool.h:769
egEnergyCorr::es2011d
@ es2011d
Definition: egammaEnergyCorrectionTool.h:291
egEnergyCorr::Scale::OFCUp
@ OFCUp
Definition: egammaEnergyCorrectionTool.h:265
egEnergyCorr::Scale::MatIDDown
@ MatIDDown
Definition: egammaEnergyCorrectionTool.h:216
beamspotman.sigmaZ
sigmaZ
Definition: beamspotman.py:1625
vtune_athena.format
format
Definition: vtune_athena.py:14
AtlasRoot::egammaEnergyCorrectionTool::m_convertedBias_ConfigA
std::unique_ptr< TH2 > m_convertedBias_ConfigA
Definition: egammaEnergyCorrectionTool.h:772
AtlasRoot::egammaEnergyCorrectionTool::m_unconvertedBias_ConfigPP0
std::unique_ptr< TH2 > m_unconvertedBias_ConfigPP0
Definition: egammaEnergyCorrectionTool.h:771
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
PATCore::ParticleType::Type
Type
Definition: PATCoreEnums.h:35
AtlasRoot::egammaEnergyCorrectionTool::m_resNom
std::unique_ptr< TH1 > m_resNom
Definition: egammaEnergyCorrectionTool.h:659
DiTauMassTools::TauTypes::hh
@ hh
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:53
AtlasRoot::egammaEnergyCorrectionTool::m_EaccUnconvertedGraphs
std::unique_ptr< TList > m_EaccUnconvertedGraphs
Definition: egammaEnergyCorrectionTool.h:703
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
egEnergyCorr::Scale::afUp
@ afUp
Definition: egammaEnergyCorrectionTool.h:245
xAOD::et
et
Definition: TrigEMCluster_v1.cxx:25
AtlasRoot::egammaEnergyCorrectionTool::m_psElectronGraphs
std::unique_ptr< TList > m_psElectronGraphs
Definition: egammaEnergyCorrectionTool.h:680
egEnergyCorr::Scale::LArTemperature2016PreUp
@ LArTemperature2016PreUp
Definition: egammaEnergyCorrectionTool.h:171
egEnergyCorr::Scale::AllCorrelatedDown
@ AllCorrelatedDown
Definition: egammaEnergyCorrectionTool.h:275
AtlasRoot::egammaEnergyCorrectionTool::m_endRunNumber
unsigned int m_endRunNumber
Definition: egammaEnergyCorrectionTool.h:634
AtlasRoot::egammaEnergyCorrectionTool::m_leakageElectron
std::unique_ptr< TH1 > m_leakageElectron
Definition: egammaEnergyCorrectionTool.h:722
AtlasRoot::egammaEnergyCorrectionTool::applyAFtoG4
double applyAFtoG4(double eta, double ptGeV, PATCore::ParticleType::Type ptype) const
MC calibration corrections.
Definition: egammaEnergyCorrectionTool.cxx:3206
egEnergyCorr::Scale::ConvFakeRateDown
@ ConvFakeRateDown
Definition: egammaEnergyCorrectionTool.h:255
graphs
Definition: graphs.py:1
egEnergyCorr::Resolution::ZSmearingUp
@ ZSmearingUp
Definition: egammaEnergyCorrectionTool.h:70
egEnergyCorr::Scale::G4Down
@ G4Down
Definition: egammaEnergyCorrectionTool.h:176
egEnergyCorr::Scale::AllDown
@ AllDown
Definition: egammaEnergyCorrectionTool.h:273
hist_file_dump.d
d
Definition: hist_file_dump.py:137
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
RootHelpers::FindBin
Int_t FindBin(const TAxis *axis, const double x)
Definition: RootHelpers.cxx:14
AtlasRoot::egammaEnergyCorrectionTool::m_applyS12Correction
bool m_applyS12Correction
Definition: egammaEnergyCorrectionTool.h:803
AtlasRoot::egammaEnergyCorrectionTool::m_s12ConvertedEtaBins
std::unique_ptr< TAxis > m_s12ConvertedEtaBins
Definition: egammaEnergyCorrectionTool.h:697
AtlasRoot::egammaEnergyCorrectionTool::m_zeeES2Profile
std::unique_ptr< TH1 > m_zeeES2Profile
Definition: egammaEnergyCorrectionTool.h:724
AtlasRoot::egammaEnergyCorrectionTool::m_wstot_slope_B_MC
std::unique_ptr< TH1 > m_wstot_slope_B_MC
Definition: egammaEnergyCorrectionTool.h:731
egEnergyCorr::Scale::L2GainDown
@ L2GainDown
Definition: egammaEnergyCorrectionTool.h:226
AtlasRoot::egammaEnergyCorrectionTool::getResolutionError
double getResolutionError(PATCore::ParticleDataType::DataType dataType, double energy, double eta, double etaCalo, PATCore::ParticleType::Type ptype, egEnergyCorr::Resolution::Variation value, egEnergyCorr::Resolution::resolutionType resType=egEnergyCorr::Resolution::SigmaEff90) const
Definition: egammaEnergyCorrectionTool.cxx:2809
AtlasRoot::egammaEnergyCorrectionTool::getE4NonLinearity
double getE4NonLinearity(double cl_eta, double meanE, PATCore::ParticleType::Type) const
Definition: egammaEnergyCorrectionTool.cxx:3853
AtlasRoot::egammaEnergyCorrectionTool::m_pp0_elec
std::unique_ptr< TH2 > m_pp0_elec
Definition: egammaEnergyCorrectionTool.h:726
AtlasRoot::egammaEnergyCorrectionTool::getAlphaValue
double getAlphaValue(long int runnumber, double cl_eta, double cl_etaS2, double cl_etaCalo, double energy, double energyS2, double eraw, PATCore::ParticleType::Type ptype=PATCore::ParticleType::Electron, egEnergyCorr::Scale::Variation var=egEnergyCorr::Scale::Nominal, double varSF=1.) const
Definition: egammaEnergyCorrectionTool.cxx:2132
egEnergyCorr::Scale::LArTemperature2015PreDown
@ LArTemperature2015PreDown
Definition: egammaEnergyCorrectionTool.h:168
egEnergyCorr::Scale::LArElecUnconvUp
@ LArElecUnconvUp
Definition: egammaEnergyCorrectionTool.h:161
AtlasRoot::egammaEnergyCorrectionTool::m_unconvertedBias_ConfigEpLp
std::unique_ptr< TH2 > m_unconvertedBias_ConfigEpLp
Definition: egammaEnergyCorrectionTool.h:767
AtlasRoot::egammaEnergyCorrectionTool::getResolution_systematics
void getResolution_systematics(int particle_type, double energy, double eta, double etaCalo, int syst_mask, double &resolution, double &resolution_error, double &resolution_error_up, double &resolution_error_down, int resol_type=0, bool fast=false) const
get resolution and its uncertainty)
Definition: egammaEnergyCorrectionTool.cxx:4841
AtlasRoot::egammaEnergyCorrectionTool::m_psConvertedGraphs
std::unique_ptr< TList > m_psConvertedGraphs
Definition: egammaEnergyCorrectionTool.h:684
AtlasRoot::egammaEnergyCorrectionTool::m_s12ConvertedGraphs
std::unique_ptr< TList > m_s12ConvertedGraphs
Definition: egammaEnergyCorrectionTool.h:698
PATCore::ParticleDataType::Fast
@ Fast
Definition: PATCoreEnums.h:22
AtlasRoot::egammaEnergyCorrectionTool::getDeltaX
double getDeltaX(double cl_eta, egEnergyCorr::MaterialCategory imat, egEnergyCorr::Scale::Variation var=egEnergyCorr::Scale::Nominal) const
Definition: egammaEnergyCorrectionTool.cxx:3997
egEnergyCorr::Scale::LArElecCalibUp
@ LArElecCalibUp
Definition: egammaEnergyCorrectionTool.h:159
egEnergyCorr::Scale::MatIDUp
@ MatIDUp
Definition: egammaEnergyCorrectionTool.h:215
egEnergyCorr::es2017_R21_v1
@ es2017_R21_v1
Definition: egammaEnergyCorrectionTool.h:320
egEnergyCorr::Scale::LeakageElecUp
@ LeakageElecUp
Definition: egammaEnergyCorrectionTool.h:197
yodamerge_tmp.axis
list axis
Definition: yodamerge_tmp.py:241
AtlasRoot::egammaEnergyCorrectionTool::m_E4ConvertedEtaBins
std::unique_ptr< TAxis > m_E4ConvertedEtaBins
Definition: egammaEnergyCorrectionTool.h:690
AtlasRoot::egammaEnergyCorrectionTool::m_gain_tool
std::unique_ptr< egGain::GainTool > m_gain_tool
Definition: egammaEnergyCorrectionTool.h:464
egEnergyCorr::Scale::LeakageConvDown
@ LeakageConvDown
Definition: egammaEnergyCorrectionTool.h:204
egEnergyCorr::Scale::MatPP0Down
@ MatPP0Down
Definition: egammaEnergyCorrectionTool.h:242
AtlasRoot::egammaEnergyCorrectionTool::m_aS12Nom
std::unique_ptr< TH1 > m_aS12Nom
Definition: egammaEnergyCorrectionTool.h:642
egEnergyCorr::es2015PRE_res_improved
@ es2015PRE_res_improved
Definition: egammaEnergyCorrectionTool.h:304
AtlasRoot::egammaEnergyCorrectionTool::m_dX_ID_Nom
std::unique_ptr< TH1 > m_dX_ID_Nom
Definition: egammaEnergyCorrectionTool.h:665
AtlasRoot::egammaEnergyCorrectionTool::get_ZeeSyst
double get_ZeeSyst(double eta) const
Definition: egammaEnergyCorrectionTool.cxx:5411
asg
Definition: DataHandleTestTool.h:28
egammaEnergyCorrectionTool.h
bin
Definition: BinsDiffFromStripMedian.h:43
EgammaARTmonitoring_plotsMaker.particle_type
particle_type
Definition: EgammaARTmonitoring_plotsMaker.py:633
AtlasRoot::egammaEnergyCorrectionTool::m_matUnconvertedScale
std::vector< std::unique_ptr< TH1 > > m_matUnconvertedScale
Definition: egammaEnergyCorrectionTool.h:748
egEnergyCorr::Scale::Nominal
@ Nominal
Definition: egammaEnergyCorrectionTool.h:132
downloadSingle.dataType
string dataType
Definition: downloadSingle.py:18
mc.diff
diff
Definition: mc.SFGenPy8_MuMu_DD.py:14
AtlasRoot::egammaEnergyCorrectionTool::mcZPeakResolution
double mcZPeakResolution(double cl_eta) const
Definition: egammaEnergyCorrectionTool.cxx:2772
egEnergyCorr::Scale::EXTRARUN3PREDown
@ EXTRARUN3PREDown
Definition: egammaEnergyCorrectionTool.h:270
AtlasRoot::egammaEnergyCorrectionTool::m_s12UnconvertedGraphs
std::unique_ptr< TList > m_s12UnconvertedGraphs
Definition: egammaEnergyCorrectionTool.h:696
egEnergyCorr::Scale::S12Up
@ S12Up
Definition: egammaEnergyCorrectionTool.h:185
dq_defect_virtual_defect_validation.d1
d1
Definition: dq_defect_virtual_defect_validation.py:79
AtlasRoot::egammaEnergyCorrectionTool::m_daS12Cor
std::unique_ptr< TH1 > m_daS12Cor
Definition: egammaEnergyCorrectionTool.h:643
egEnergyCorr::Scale::L2LowGainDown
@ L2LowGainDown
Definition: egammaEnergyCorrectionTool.h:229
AtlasRoot::egammaEnergyCorrectionTool::m_e1hg_tool
std::unique_ptr< e1hg_systematics > m_e1hg_tool
Definition: egammaEnergyCorrectionTool.h:470
athena.value
value
Definition: athena.py:124
egEnergyCorr::Scale::ZeeStatUp
@ ZeeStatUp
Definition: egammaEnergyCorrectionTool.h:144
AtlasRoot::egammaEnergyCorrectionTool::dataConstantTerm
double dataConstantTerm(double eta) const
Definition: egammaEnergyCorrectionTool.cxx:2750
egEnergyCorr::es2011dMedium
@ es2011dMedium
Definition: egammaEnergyCorrectionTool.h:292
AtlasRoot::egammaEnergyCorrectionTool::m_meanZeeProfile
std::unique_ptr< TProfile > m_meanZeeProfile
Definition: egammaEnergyCorrectionTool.h:657
AtlasRoot::egammaEnergyCorrectionTool::getAlphaPedestal
double getAlphaPedestal(double cl_eta, double energy, double eraw, PATCore::ParticleType::Type ptype, bool isRef, egEnergyCorr::Scale::Variation var=egEnergyCorr::Scale::Nominal, double varSF=1.) const
Definition: egammaEnergyCorrectionTool.cxx:4692
AtlasRoot::egammaEnergyCorrectionTool::mcNoiseTerm
static double mcNoiseTerm(double cl_eta)
Definition: egammaEnergyCorrectionTool.cxx:2710
AtlasRoot::egammaEnergyCorrectionTool::m_uA2MeV_2015_first2weeks_correction
std::unique_ptr< TH1 > m_uA2MeV_2015_first2weeks_correction
Definition: egammaEnergyCorrectionTool.h:656
AtlasRoot::egammaEnergyCorrectionTool::m_pedestalL1
std::unique_ptr< TH1 > m_pedestalL1
Definition: egammaEnergyCorrectionTool.h:708
e1hg_systematics.h
egEnergyCorr::Resolution::afDown
@ afDown
Definition: egammaEnergyCorrectionTool.h:98
AtlasRoot::egammaEnergyCorrectionTool::variationName
static std::string variationName(egEnergyCorr::Scale::Variation &var)
Definition: egammaEnergyCorrectionTool.cxx:5167
egEnergyCorr::Scale::ConvRadiusUp
@ ConvRadiusUp
Definition: egammaEnergyCorrectionTool.h:256
egEnergyCorr::Scale::Wtots1Up
@ Wtots1Up
Definition: egammaEnergyCorrectionTool.h:237
egEnergyCorr::Scale::MatCryoDown
@ MatCryoDown
Definition: egammaEnergyCorrectionTool.h:218
AtlasRoot::egammaEnergyCorrectionTool::m_peakResData
std::unique_ptr< TH1 > m_peakResData
Definition: egammaEnergyCorrectionTool.h:662
AtlasRoot::egammaEnergyCorrectionTool::m_unconvertedBias_ConfigFpMX
std::unique_ptr< TH2 > m_unconvertedBias_ConfigFpMX
Definition: egammaEnergyCorrectionTool.h:768
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
AtlasRoot::egammaEnergyCorrectionTool::m_convFakeRate_2D
std::unique_ptr< TH2 > m_convFakeRate_2D
Definition: egammaEnergyCorrectionTool.h:717
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
beamspotman.sigmaX
sigmaX
Definition: beamspotman.py:1625
egEnergyCorr::es2023_R22_Run2_v1
@ es2023_R22_Run2_v1
Definition: egammaEnergyCorrectionTool.h:330
egEnergyCorr::Scale::ConvRecoDown
@ ConvRecoDown
Definition: egammaEnergyCorrectionTool.h:262
egEnergyCorr::Scale::LeakageConvUp
@ LeakageConvUp
Definition: egammaEnergyCorrectionTool.h:203
AtlasRoot::egammaEnergyCorrectionTool::m_s12ElectronGraphs
std::unique_ptr< TList > m_s12ElectronGraphs
Definition: egammaEnergyCorrectionTool.h:694
AtlasRoot::egammaEnergyCorrectionTool::RandomNumber
unsigned int RandomNumber
Definition: egammaEnergyCorrectionTool.h:369
D3PDTest::rng
uint32_t rng()
Definition: FillerAlg.cxx:40
x
#define x
JetTiledMap::S
@ S
Definition: TiledEtaPhiMap.h:44
egEnergyCorr::Scale::ZeeSystUp
@ ZeeSystUp
Definition: egammaEnergyCorrectionTool.h:146
egGain::GainUncertainty::GainType::MEDIUM
@ MEDIUM
egEnergyCorr::Resolution::PileUpUp
@ PileUpUp
Definition: egammaEnergyCorrectionTool.h:88
Dedxcorrection::resolution
double resolution[nGasTypes][nParametersResolution]
Definition: TRT_ToT_Corrections.h:46
AtlasRoot::egammaEnergyCorrectionTool::m_begRunNumber
unsigned int m_begRunNumber
Definition: egammaEnergyCorrectionTool.h:633
AtlasRoot::egammaEnergyCorrectionTool::m_wstot_pT_MC_p1_electrons
std::unique_ptr< TH1 > m_wstot_pT_MC_p1_electrons
Definition: egammaEnergyCorrectionTool.h:739
PATCore::ParticleDataType::Data
@ Data
Definition: PATCoreEnums.h:22
AtlasRoot::egammaEnergyCorrectionTool::getInterpolateConvSyst2D
double getInterpolateConvSyst2D(const TH2 &conv_hist, double aeta, double ET) const
Definition: egammaEnergyCorrectionTool.cxx:4652
makeTRTBarrelCans.y1
tuple y1
Definition: makeTRTBarrelCans.py:15
AtlasRoot::egammaEnergyCorrectionTool::m_leakageUnconverted
std::unique_ptr< TH1 > m_leakageUnconverted
Definition: egammaEnergyCorrectionTool.h:721
egEnergyCorr::ConfigN
@ ConfigN
Definition: egammaEnergyCorrectionTool.h:346
egEnergyCorr::Scale::L2GainUp
@ L2GainUp
Definition: egammaEnergyCorrectionTool.h:225
AtlasRoot::egammaEnergyCorrectionTool::m_EaccConvertedEtaBins
std::unique_ptr< TAxis > m_EaccConvertedEtaBins
Definition: egammaEnergyCorrectionTool.h:704
PATCore::ParticleDataType::DataType
DataType
Definition: PATCoreEnums.h:22
egEnergyCorr::Scale::AllCorrelatedUp
@ AllCorrelatedUp
Definition: egammaEnergyCorrectionTool.h:274
egEnergyCorr::Scale::MatCaloDown
@ MatCaloDown
Definition: egammaEnergyCorrectionTool.h:220
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
egEnergyCorr::Resolution::MaterialGapUp
@ MaterialGapUp
Definition: egammaEnergyCorrectionTool.h:82
egEnergyCorr::es2017_R21_v0
@ es2017_R21_v0
Definition: egammaEnergyCorrectionTool.h:318
AtlasRoot::egammaEnergyCorrectionTool::mcConstantTerm
static double mcConstantTerm(double cl_eta)
Definition: egammaEnergyCorrectionTool.cxx:2729
AtlasRoot::egammaEnergyCorrectionTool::m_G4OverAFII_resolution_unconverted
std::unique_ptr< TH2 > m_G4OverAFII_resolution_unconverted
Definition: egammaEnergyCorrectionTool.h:790
egEnergyCorr::Scale::LeakageElecDown
@ LeakageElecDown
Definition: egammaEnergyCorrectionTool.h:198
AtlasRoot::egammaEnergyCorrectionTool::m_unconvertedBias_ConfigIBL
std::unique_ptr< TH2 > m_unconvertedBias_ConfigIBL
Definition: egammaEnergyCorrectionTool.h:770
AtlasRoot::egammaEnergyCorrectionTool::m_zeeFwdk
std::unique_ptr< const TH1 > m_zeeFwdk
Definition: egammaEnergyCorrectionTool.h:650
AtlasRoot::egammaEnergyCorrectionTool::getLayerNonLinearity
double getLayerNonLinearity(int iLayer, double cl_eta, double energy, PATCore::ParticleType::Type ptype) const
Definition: egammaEnergyCorrectionTool.cxx:3885
AtlasRoot::egammaEnergyCorrectionTool::m_E4ConvertedGraphs
std::unique_ptr< TList > m_E4ConvertedGraphs
Definition: egammaEnergyCorrectionTool.h:691
egEnergyCorr::Scale::L2LowGainUp
@ L2LowGainUp
Definition: egammaEnergyCorrectionTool.h:230
egEnergyCorr::ConfigPP0
@ ConfigPP0
Definition: egammaEnergyCorrectionTool.h:348
AtlasRoot::egammaEnergyCorrectionTool::m_use_stat_error_scaling
bool m_use_stat_error_scaling
Definition: egammaEnergyCorrectionTool.h:807
eg_resolution.h
AtlasRoot::egammaEnergyCorrectionTool::m_usepTInterpolationForLeakage
bool m_usepTInterpolationForLeakage
Definition: egammaEnergyCorrectionTool.h:812
AtlasRoot::egammaEnergyCorrectionTool::getAlphaLeakage2D
double getAlphaLeakage2D(double cl_eta, double et, PATCore::ParticleType::Type ptype, egEnergyCorr::Scale::Variation var=egEnergyCorr::Scale::Nominal, double varSF=1.) const
Definition: egammaEnergyCorrectionTool.cxx:4466
AtlasRoot::egammaEnergyCorrectionTool::m_psUnconvertedEtaBins
std::unique_ptr< TAxis > m_psUnconvertedEtaBins
Definition: egammaEnergyCorrectionTool.h:681
AtlasRoot::egammaEnergyCorrectionTool::m_dX_IPPS_Nom
std::unique_ptr< TH1 > m_dX_IPPS_Nom
Definition: egammaEnergyCorrectionTool.h:667
egEnergyCorr::Scale::MomentumUp
@ MomentumUp
Definition: egammaEnergyCorrectionTool.h:137
AtlasRoot::egammaEnergyCorrectionTool::m_RunNumber
unsigned int m_RunNumber
Definition: egammaEnergyCorrectionTool.h:635
PATCore::ParticleType::ConvertedPhoton
@ ConvertedPhoton
Definition: PATCoreEnums.h:39
AtlasRoot::egammaEnergyCorrectionTool::m_use_etaCalo_scales
bool m_use_etaCalo_scales
Definition: egammaEnergyCorrectionTool.h:799
egEnergyCorr::es2015cPRE
@ es2015cPRE
Definition: egammaEnergyCorrectionTool.h:305
AtlasRoot::egammaEnergyCorrectionTool::getAlphaMaterial
double getAlphaMaterial(double cl_eta, egEnergyCorr::MaterialCategory imat, PATCore::ParticleType::Type ptype, egEnergyCorr::Scale::Variation var=egEnergyCorr::Scale::Nominal, double varSF=1.) const
Definition: egammaEnergyCorrectionTool.cxx:4102
AtlasRoot::egammaEnergyCorrectionTool::m_s12ElectronEtaBins
std::unique_ptr< TAxis > m_s12ElectronEtaBins
Definition: egammaEnergyCorrectionTool.h:693
AtlasRoot::egammaEnergyCorrectionTool::m_wstot_pT_MC_p1_converted_photons
std::unique_ptr< TH1 > m_wstot_pT_MC_p1_converted_photons
Definition: egammaEnergyCorrectionTool.h:743
egEnergyCorr::Scale::LArTemperature2015PreUp
@ LArTemperature2015PreUp
Definition: egammaEnergyCorrectionTool.h:167
egEnergyCorr::Scale::AllUp
@ AllUp
Definition: egammaEnergyCorrectionTool.h:272
AtlasRoot::egammaEnergyCorrectionTool::pileUpTerm
double pileUpTerm(double energy, double eta, int particle_type) const
Definition: egammaEnergyCorrectionTool.cxx:4801
AtlasRoot::egammaEnergyCorrectionTool::m_dX_PSAcc_LAr
std::unique_ptr< TH1 > m_dX_PSAcc_LAr
Definition: egammaEnergyCorrectionTool.h:677
AtlasRoot::egammaEnergyCorrectionTool::m_wstot_pT_data_p1_electrons
std::unique_ptr< TH1 > m_wstot_pT_data_p1_electrons
Definition: egammaEnergyCorrectionTool.h:733
egEnergyCorr::Scale::L1GainDown
@ L1GainDown
Definition: egammaEnergyCorrectionTool.h:224
egEnergyCorr::Resolution::ZSmearingDown
@ ZSmearingDown
Definition: egammaEnergyCorrectionTool.h:69
A
AtlasRoot::egammaEnergyCorrectionTool::m_convFakeRate
std::unique_ptr< TH1 > m_convFakeRate
Definition: egammaEnergyCorrectionTool.h:715
AtlasRoot::egammaEnergyCorrectionTool::m_matX0Additions
std::vector< std::unique_ptr< TH1 > > m_matX0Additions
Definition: egammaEnergyCorrectionTool.h:751
AtlasRoot::egammaEnergyCorrectionTool::m_resolution_tool
std::unique_ptr< eg_resolution > m_resolution_tool
Definition: egammaEnergyCorrectionTool.h:468
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
egEnergyCorr::es2015_day0_3percent
@ es2015_day0_3percent
Definition: egammaEnergyCorrectionTool.h:301
egEnergyCorr::Scale::LArCalibUp
@ LArCalibUp
Definition: egammaEnergyCorrectionTool.h:155
egEnergyCorr::Resolution::MaterialPP0Down
@ MaterialPP0Down
Definition: egammaEnergyCorrectionTool.h:94
egEnergyCorr::es2010
@ es2010
Definition: egammaEnergyCorrectionTool.h:287
egEnergyCorr::Geometry
Geometry
Definition: egammaEnergyCorrectionTool.h:340
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
egEnergyCorr::Scale::LeakageUnconvDown
@ LeakageUnconvDown
Definition: egammaEnergyCorrectionTool.h:202
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
beamspotnt.graphs
graphs
Definition: bin/beamspotnt.py:1538
egEnergyCorr::MatCalo
@ MatCalo
Definition: egammaEnergyCorrectionTool.h:356
AtlasRoot::egammaEnergyCorrectionTool::m_EaccConvertedGraphs
std::unique_ptr< TList > m_EaccConvertedGraphs
Definition: egammaEnergyCorrectionTool.h:705
UNDEFINED
@ UNDEFINED
Definition: sTGCenumeration.h:18
egEnergyCorr::Resolution::MaterialCryoUp
@ MaterialCryoUp
Definition: egammaEnergyCorrectionTool.h:84
egEnergyCorr::es2017_R21_PRE
@ es2017_R21_PRE
Definition: egammaEnergyCorrectionTool.h:316
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
AtlasRoot::egammaEnergyCorrectionTool::m_dX_PSAcc_Nom
std::unique_ptr< TH1 > m_dX_PSAcc_Nom
Definition: egammaEnergyCorrectionTool.h:675
AtlasRoot::egammaEnergyCorrectionTool::m_psConvertedEtaBins
std::unique_ptr< TAxis > m_psConvertedEtaBins
Definition: egammaEnergyCorrectionTool.h:683
egEnergyCorr::Scale::L1GainUp
@ L1GainUp
Definition: egammaEnergyCorrectionTool.h:223
egEnergyCorr::es2015cPRE_res_improved
@ es2015cPRE_res_improved
Definition: egammaEnergyCorrectionTool.h:306
lumiFormat.i
int i
Definition: lumiFormat.py:85
egEnergyCorr::Scale::topoClusterThresUp
@ topoClusterThresUp
Definition: egammaEnergyCorrectionTool.h:207
egEnergyCorr::Scale::ConvEfficiencyDown
@ ConvEfficiencyDown
Definition: egammaEnergyCorrectionTool.h:253
LinearityADC.h
AtlasRoot::egammaEnergyCorrectionTool::m_wstot_pT_MC_p0_converted_photons
std::unique_ptr< TH1 > m_wstot_pT_MC_p0_converted_photons
Definition: egammaEnergyCorrectionTool.h:742
AtlasRoot::egammaEnergyCorrectionTool::getAlphaZee
double getAlphaZee(long int runnumber, double eta, egEnergyCorr::Scale::Variation var=egEnergyCorr::Scale::Nominal, double varSF=1.) const
Definition: egammaEnergyCorrectionTool.cxx:3297
egEnergyCorr::Scale::LArElecUnconvDown
@ LArElecUnconvDown
Definition: egammaEnergyCorrectionTool.h:162
AtlasRoot::egammaEnergyCorrectionTool::m_use_new_resolution_model
bool m_use_new_resolution_model
Definition: egammaEnergyCorrectionTool.h:806
AtlasRoot::egammaEnergyCorrectionTool::m_psElectronEtaBins
std::unique_ptr< TAxis > m_psElectronEtaBins
Definition: egammaEnergyCorrectionTool.h:679
GainUncertainty.h
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AtlasRoot::egammaEnergyCorrectionTool::m_pp0_unconv
std::unique_ptr< TH2 > m_pp0_unconv
Definition: egammaEnergyCorrectionTool.h:727
AtlasRoot::egammaEnergyCorrectionTool::m_wstot_pT_data_p1_unconverted_photons
std::unique_ptr< TH1 > m_wstot_pT_data_p1_unconverted_photons
Definition: egammaEnergyCorrectionTool.h:735
AtlasRoot::egammaEnergyCorrectionTool::m_wstot_pT_data_p0_unconverted_photons
std::unique_ptr< TH1 > m_wstot_pT_data_p0_unconverted_photons
Definition: egammaEnergyCorrectionTool.h:734
egEnergyCorr::Resolution::afUp
@ afUp
Definition: egammaEnergyCorrectionTool.h:97
fitman.mz
mz
Definition: fitman.py:526
egEnergyCorr::Scale::LeakageUnconvUp
@ LeakageUnconvUp
Definition: egammaEnergyCorrectionTool.h:201
egEnergyCorr::Scale::MomentumDown
@ MomentumDown
Definition: egammaEnergyCorrectionTool.h:138
egEnergyCorr::Scale::ConvRecoUp
@ ConvRecoUp
Definition: egammaEnergyCorrectionTool.h:261
AtlasRoot::egammaEnergyCorrectionTool::m_zeePhys
std::unique_ptr< TH1 > m_zeePhys
Definition: egammaEnergyCorrectionTool.h:655
AtlasRoot::egammaEnergyCorrectionTool::getWtots1Uncertainty
double getWtots1Uncertainty(double cl_eta, double energy, PATCore::ParticleType::Type ptype) const
Definition: egammaEnergyCorrectionTool.cxx:3640
AtlasRoot::egammaEnergyCorrectionTool::m_use_uA2MeV_2015_first2weeks_correction
bool m_use_uA2MeV_2015_first2weeks_correction
Definition: egammaEnergyCorrectionTool.h:816
egEnergyCorr::Resolution::Nominal
@ Nominal
Definition: egammaEnergyCorrectionTool.h:62
plotBeamSpotCompare.ivar
int ivar
Definition: plotBeamSpotCompare.py:383
AtlasRoot::egammaEnergyCorrectionTool::isInCrack
static bool isInCrack(double cl_eta)
Definition: egammaEnergyCorrectionTool.cxx:4776
AtlasRoot::egammaEnergyCorrectionTool::fcn_sigma
static double fcn_sigma(double energy, double Cdata, double Cdata_er, double S, double S_er)
Definition: egammaEnergyCorrectionTool.cxx:3084
AtlasRoot::egammaEnergyCorrectionTool::m_esmodel
egEnergyCorr::ESModel m_esmodel
Definition: egammaEnergyCorrectionTool.h:795
egEnergyCorr::MaterialCategory
MaterialCategory
Definition: egammaEnergyCorrectionTool.h:353
AtlasRoot::egammaEnergyCorrectionTool::m_dX_IPAcc_Nom
std::unique_ptr< TH1 > m_dX_IPAcc_Nom
Definition: egammaEnergyCorrectionTool.h:670
asg::AsgMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AsgMessaging.cxx:49
egEnergyCorr::es2012a
@ es2012a
Definition: egammaEnergyCorrectionTool.h:295
AtlasRoot::egammaEnergyCorrectionTool::m_applyPSCorrection
bool m_applyPSCorrection
Definition: egammaEnergyCorrectionTool.h:802
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:107
AtlasRoot::egammaEnergyCorrectionTool::m_use_temp_correction201516
bool m_use_temp_correction201516
Definition: egammaEnergyCorrectionTool.h:815
AtlasRoot::egammaEnergyCorrectionTool::m_zeeNom_data2016
std::unique_ptr< TH1 > m_zeeNom_data2016
Definition: egammaEnergyCorrectionTool.h:647
AtlasRoot::egammaEnergyCorrectionTool::m_convertedBias_ConfigEpLp
std::unique_ptr< TH2 > m_convertedBias_ConfigEpLp
Definition: egammaEnergyCorrectionTool.h:773
AtlasRoot::egammaEnergyCorrectionTool::m_aPSNom
std::unique_ptr< TH1 > m_aPSNom
Definition: egammaEnergyCorrectionTool.h:639
egEnergyCorr::Scale::S12Down
@ S12Down
Definition: egammaEnergyCorrectionTool.h:186
egEnergyCorr::es2017_summer
@ es2017_summer
Definition: egammaEnergyCorrectionTool.h:310
AtlasRoot::egammaEnergyCorrectionTool::getAlphaLeakage
double getAlphaLeakage(double cl_eta, PATCore::ParticleType::Type ptype, egEnergyCorr::Scale::Variation var=egEnergyCorr::Scale::Nominal, double varSF=1.) const
Definition: egammaEnergyCorrectionTool.cxx:4431
makeComparison.rootFile
rootFile
Definition: makeComparison.py:27
egEnergyCorr::es2015c_summer
@ es2015c_summer
Definition: egammaEnergyCorrectionTool.h:307
AtlasRoot::egammaEnergyCorrectionTool::m_zeeFwdb
std::unique_ptr< const TH1 > m_zeeFwdb
Definition: egammaEnergyCorrectionTool.h:651
egEnergyCorr::Scale::G4Up
@ G4Up
Definition: egammaEnergyCorrectionTool.h:175
AtlasRoot::egammaEnergyCorrectionTool::nearestEtaBEC
static double nearestEtaBEC(double cl_eta)
Definition: egammaEnergyCorrectionTool.cxx:4781
AtlasRoot::egammaEnergyCorrectionTool::m_matElectronEtaBins
std::unique_ptr< TAxis > m_matElectronEtaBins
Definition: egammaEnergyCorrectionTool.h:755
AtlasRoot::egammaEnergyCorrectionTool::m_leakageConverted
std::unique_ptr< TH1 > m_leakageConverted
Definition: egammaEnergyCorrectionTool.h:720
egEnergyCorr::Scale::L2MediumGainUp
@ L2MediumGainUp
Definition: egammaEnergyCorrectionTool.h:228
egEnergyCorr::Scale::None
@ None
Definition: egammaEnergyCorrectionTool.h:129
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
AtlasRoot::egammaEnergyCorrectionTool::m_G4OverAFII_converted_2D
std::unique_ptr< TH2 > m_G4OverAFII_converted_2D
Definition: egammaEnergyCorrectionTool.h:785
AtlasRoot::egammaEnergyCorrectionTool::m_convRadius
std::unique_ptr< TH1 > m_convRadius
Definition: egammaEnergyCorrectionTool.h:714
MuonR4::SegmentFit::ParamDefs::x0
@ x0
egEnergyCorr::Resolution::MaterialCryoDown
@ MaterialCryoDown
Definition: egammaEnergyCorrectionTool.h:83
egEnergyCorr::UNDEFINED
@ UNDEFINED
Definition: egammaEnergyCorrectionTool.h:334
egEnergyCorr::Scale::MatCaloUp
@ MatCaloUp
Definition: egammaEnergyCorrectionTool.h:219
GainTool.h
egEnergyCorr::MatCryo
@ MatCryo
Definition: egammaEnergyCorrectionTool.h:355
AtlasRoot::egammaEnergyCorrectionTool::m_pedestalL3
std::unique_ptr< TH1 > m_pedestalL3
Definition: egammaEnergyCorrectionTool.h:710
egEnergyCorr::ConfigGp
@ ConfigGp
Definition: egammaEnergyCorrectionTool.h:345
get_MaterialResolutionEffect.h
egEnergyCorr::Scale::ZeeStatDown
@ ZeeStatDown
Definition: egammaEnergyCorrectionTool.h:145
AtlasRoot::egammaEnergyCorrectionTool::m_zeeSystOFC
std::unique_ptr< TH1 > m_zeeSystOFC
Definition: egammaEnergyCorrectionTool.h:654
AtlasRoot::egammaEnergyCorrectionTool::m_EaccElectronGraphs
std::unique_ptr< TList > m_EaccElectronGraphs
Definition: egammaEnergyCorrectionTool.h:701
AtlasRoot::egammaEnergyCorrectionTool::m_electronBias_ConfigA
std::unique_ptr< TH2 > m_electronBias_ConfigA
Definition: egammaEnergyCorrectionTool.h:760
AtlasRoot::egammaEnergyCorrectionTool::m_gain_tool_run2
std::unique_ptr< egGain::GainUncertainty > m_gain_tool_run2
Definition: egammaEnergyCorrectionTool.h:466
egEnergyCorr::Scale::PedestalUp
@ PedestalUp
Definition: egammaEnergyCorrectionTool.h:233
DeMoScan.runnumber
runnumber
Definition: DeMoScan.py:266
AtlasRoot::egammaEnergyCorrectionTool::getMaterialNonLinearity
double getMaterialNonLinearity(double cl_eta, double energy, egEnergyCorr::MaterialCategory imat, PATCore::ParticleType::Type ptype, egEnergyCorr::Scale::Variation var=egEnergyCorr::Scale::Nominal, double varSF=1.) const
Definition: egammaEnergyCorrectionTool.cxx:4289
egEnergyCorr::Resolution::None
@ None
Definition: egammaEnergyCorrectionTool.h:59
AtlasRoot::egammaEnergyCorrectionTool::m_E4UnconvertedEtaBins
std::unique_ptr< TAxis > m_E4UnconvertedEtaBins
Definition: egammaEnergyCorrectionTool.h:688
egEnergyCorr::Resolution::PileUpDown
@ PileUpDown
Definition: egammaEnergyCorrectionTool.h:87
AtlasRoot::egammaEnergyCorrectionTool::m_convertedBias_ConfigFpMX
std::unique_ptr< TH2 > m_convertedBias_ConfigFpMX
Definition: egammaEnergyCorrectionTool.h:774
egEnergyCorr::Scale::E4ScintillatorUp
@ E4ScintillatorUp
Definition: egammaEnergyCorrectionTool.h:179
AtlasRoot::egammaEnergyCorrectionTool::m_G4OverAFII_converted
std::unique_ptr< TH1 > m_G4OverAFII_converted
Definition: egammaEnergyCorrectionTool.h:782
egEnergyCorr::Scale::ZeePhysDown
@ ZeePhysDown
Definition: egammaEnergyCorrectionTool.h:149
egEnergyCorr::Scale::Variation
Variation
Definition: egammaEnergyCorrectionTool.h:126
AtlasRoot::egammaEnergyCorrectionTool::resolutionError
void resolutionError(double energy, double cl_eta, double &errUp, double &errDown) const
Definition: egammaEnergyCorrectionTool.cxx:2919
AtlasRoot::egammaEnergyCorrectionTool::m_convRecoEfficiency_2D
std::unique_ptr< TH2 > m_convRecoEfficiency_2D
Definition: egammaEnergyCorrectionTool.h:718
MuonR4::SegmentFit::ParamDefs::y0
@ y0
egEnergyCorr::ConfigEL
@ ConfigEL
Definition: egammaEnergyCorrectionTool.h:343
AtlasRoot::egammaEnergyCorrectionTool::m_electronBias_ConfigN
std::unique_ptr< TH2 > m_electronBias_ConfigN
Definition: egammaEnergyCorrectionTool.h:763
PathResolver.h
AtlasRoot::egammaEnergyCorrectionTool::m_EaccUnconvertedEtaBins
std::unique_ptr< TAxis > m_EaccUnconvertedEtaBins
Definition: egammaEnergyCorrectionTool.h:702
AtlasRoot::egammaEnergyCorrectionTool::resolution
double resolution(double energy, double cl_eta, double cl_etaCalo, PATCore::ParticleType::Type ptype, bool withCT, bool fast, egEnergyCorr::Resolution::resolutionType resType=egEnergyCorr::Resolution::SigmaEff90) const
Definition: egammaEnergyCorrectionTool.cxx:2958
AtlasRoot::egammaEnergyCorrectionTool::m_pedestalL0
std::unique_ptr< TH1 > m_pedestalL0
Definition: egammaEnergyCorrectionTool.h:707
AtlasRoot::egammaEnergyCorrectionTool::m_daPSCor
std::unique_ptr< TH1 > m_daPSCor
Definition: egammaEnergyCorrectionTool.h:640
AtlasRoot
Definition: egammaEnergyCorrectionTool.h:361
egEnergyCorr::Scale::LArCalibExtra2015PreUp
@ LArCalibExtra2015PreUp
Definition: egammaEnergyCorrectionTool.h:165
AtlasRoot::egammaEnergyCorrectionTool::m_convertedBias_ConfigIBL
std::unique_ptr< TH2 > m_convertedBias_ConfigIBL
Definition: egammaEnergyCorrectionTool.h:776
AtlasRoot::egammaEnergyCorrectionTool::m_useLeakageCorrection
bool m_useLeakageCorrection
Definition: egammaEnergyCorrectionTool.h:811
AtlasRoot::egammaEnergyCorrectionTool::getAlphaConvSyst
double getAlphaConvSyst(double cl_eta, double energy, PATCore::ParticleType::Type ptype, egEnergyCorr::Scale::Variation var=egEnergyCorr::Scale::Nominal, double varSF=1.) const
Definition: egammaEnergyCorrectionTool.cxx:4587
VP1PartSpect::E
@ E
Definition: VP1PartSpectFlags.h:21
egEnergyCorr::Resolution::MaterialIBLUp
@ MaterialIBLUp
Definition: egammaEnergyCorrectionTool.h:91
egEnergyCorr::Resolution::Variation
Variation
Definition: egammaEnergyCorrectionTool.h:55
AtlasRoot::egammaEnergyCorrectionTool::m_psUnconvertedGraphs
std::unique_ptr< TList > m_psUnconvertedGraphs
Definition: egammaEnergyCorrectionTool.h:682
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
egEnergyCorr::es2016PRE
@ es2016PRE
Definition: egammaEnergyCorrectionTool.h:308
egEnergyCorr::MatID
@ MatID
Definition: egammaEnergyCorrectionTool.h:354
AtlasRoot::egammaEnergyCorrectionTool::m_pedestalL2
std::unique_ptr< TH1 > m_pedestalL2
Definition: egammaEnergyCorrectionTool.h:709
egEnergyCorr::es2017_summer_final
@ es2017_summer_final
Definition: egammaEnergyCorrectionTool.h:312
AtlasRoot::egammaEnergyCorrectionTool::getMaterialEffect
double getMaterialEffect(egEnergyCorr::Geometry geo, PATCore::ParticleType::Type ptype, double cl_eta, double ET) const
Definition: egammaEnergyCorrectionTool.cxx:4194
egGain::GainUncertainty::GainType::LOW
@ LOW
egEnergyCorr::Scale::ADCLinUp
@ ADCLinUp
Definition: egammaEnergyCorrectionTool.h:193
egEnergyCorr::Scale::ZeeAllDown
@ ZeeAllDown
Definition: egammaEnergyCorrectionTool.h:151
egEnergyCorr::Resolution::OFCUp
@ OFCUp
Definition: egammaEnergyCorrectionTool.h:101
egEnergyCorr::Scale::MatPP0Up
@ MatPP0Up
Definition: egammaEnergyCorrectionTool.h:241
egEnergyCorr::es2012XX
@ es2012XX
Definition: egammaEnergyCorrectionTool.h:302
egEnergyCorr::Scale::ADCLinDown
@ ADCLinDown
Definition: egammaEnergyCorrectionTool.h:194
SCT_CalibAlgs::nbins
@ nbins
Definition: SCT_CalibNumbers.h:10
egEnergyCorr::Scale::S12ExtraLastEtaBinRun2Down
@ S12ExtraLastEtaBinRun2Down
Definition: egammaEnergyCorrectionTool.h:212
egEnergyCorr::ConfigFMX
@ ConfigFMX
Definition: egammaEnergyCorrectionTool.h:344
egEnergyCorr::es2023_R22_Run2_v0
@ es2023_R22_Run2_v0
Definition: egammaEnergyCorrectionTool.h:329
egEnergyCorr::es2012c
@ es2012c
Definition: egammaEnergyCorrectionTool.h:297
egEnergyCorr::Resolution::OFCDown
@ OFCDown
Definition: egammaEnergyCorrectionTool.h:102
egEnergyCorr::Scale::PSb12Down
@ PSb12Down
Definition: egammaEnergyCorrectionTool.h:190
egEnergyCorr::es2017
@ es2017
Definition: egammaEnergyCorrectionTool.h:309
egEnergyCorr::es2018_R21_v1
@ es2018_R21_v1
Definition: egammaEnergyCorrectionTool.h:325
AtlasRoot::egammaEnergyCorrectionTool::m_resSystOFC
std::unique_ptr< TH1 > m_resSystOFC
Definition: egammaEnergyCorrectionTool.h:661
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:431
AtlasRoot::egammaEnergyCorrectionTool::getSmearingCorrection
double getSmearingCorrection(double eta, double etaCalo, double energy, RandomNumber seed, PATCore::ParticleType::Type ptype=PATCore::ParticleType::Electron, PATCore::ParticleDataType::DataType dataType=PATCore::ParticleDataType::Full, egEnergyCorr::Resolution::Variation value=egEnergyCorr::Resolution::Nominal, egEnergyCorr::Resolution::resolutionType resType=egEnergyCorr::Resolution::SigmaEff90) const
smearing corrections
Definition: egammaEnergyCorrectionTool.cxx:3100
AtlasRoot::egammaEnergyCorrectionTool::m_pp0_conv
std::unique_ptr< TH2 > m_pp0_conv
Definition: egammaEnergyCorrectionTool.h:728
AtlasRoot::egammaEnergyCorrectionTool::m_matConvertedScale
std::vector< std::unique_ptr< TH1 > > m_matConvertedScale
Definition: egammaEnergyCorrectionTool.h:749
AtlasRoot::egammaEnergyCorrectionTool::m_useL2GainInterpolation
bool m_useL2GainInterpolation
Definition: egammaEnergyCorrectionTool.h:810
ReadCellNoiseFromCoolCompare.v2
v2
Definition: ReadCellNoiseFromCoolCompare.py:364
AtlasRoot::egammaEnergyCorrectionTool::mcSamplingTerm
static double mcSamplingTerm(double cl_eta)
Definition: egammaEnergyCorrectionTool.cxx:2674
python.AthDsoLogger.fname
string fname
Definition: AthDsoLogger.py:67
fast
bool fast
Definition: TrigGlobEffCorrValidation.cxx:190
egEnergyCorr::Scale::LArUnconvCalibDown
@ LArUnconvCalibDown
Definition: egammaEnergyCorrectionTool.h:158
python.PyAthena.v
v
Definition: PyAthena.py:154
egEnergyCorr::Scale::ConvEfficiencyUp
@ ConvEfficiencyUp
Definition: egammaEnergyCorrectionTool.h:252
egEnergyCorr::Scale::PSb12Up
@ PSb12Up
Definition: egammaEnergyCorrectionTool.h:189
AtlasRoot::egammaEnergyCorrectionTool::m_G4OverAFII_resolution_electron
std::unique_ptr< TH2 > m_G4OverAFII_resolution_electron
Definition: egammaEnergyCorrectionTool.h:789
AtlasRoot::egammaEnergyCorrectionTool::m_getMaterialDelta
std::unique_ptr< get_MaterialResolutionEffect > m_getMaterialDelta
Definition: egammaEnergyCorrectionTool.h:469
egEnergyCorr::Scale::E4ScintillatorDown
@ E4ScintillatorDown
Definition: egammaEnergyCorrectionTool.h:180
AtlasRoot::egammaEnergyCorrectionTool::m_pedestals_es2017
std::unique_ptr< TH1 > m_pedestals_es2017
Definition: egammaEnergyCorrectionTool.h:712
egEnergyCorr::Resolution::MaterialIDDown
@ MaterialIDDown
Definition: egammaEnergyCorrectionTool.h:77
egEnergyCorr::Scale::ConvFakeRateUp
@ ConvFakeRateUp
Definition: egammaEnergyCorrectionTool.h:254
AtlasRoot::egammaEnergyCorrectionTool::m_convRecoEfficiency
std::unique_ptr< TH1 > m_convRecoEfficiency
Definition: egammaEnergyCorrectionTool.h:716
a
TList * a
Definition: liststreamerinfos.cxx:10
egEnergyCorr::Resolution::MaterialIDUp
@ MaterialIDUp
Definition: egammaEnergyCorrectionTool.h:78
AtlasRoot::egammaEnergyCorrectionTool::m_EaccElectronEtaBins
std::unique_ptr< TAxis > m_EaccElectronEtaBins
Definition: egammaEnergyCorrectionTool.h:700
AtlasRoot::egammaEnergyCorrectionTool::m_wstot_pT_data_p1_converted_photons
std::unique_ptr< TH1 > m_wstot_pT_data_p1_converted_photons
Definition: egammaEnergyCorrectionTool.h:737
egEnergyCorr::Scale::Wtots1Down
@ Wtots1Down
Definition: egammaEnergyCorrectionTool.h:238
egEnergyCorr::Scale::PSUp
@ PSUp
Definition: egammaEnergyCorrectionTool.h:183
y
#define y
h
AtlasRoot::egammaEnergyCorrectionTool::m_peakResMC
std::unique_ptr< TH1 > m_peakResMC
Definition: egammaEnergyCorrectionTool.h:663
AtlasRoot::egammaEnergyCorrectionTool::m_G4OverFrSh
std::unique_ptr< TH1 > m_G4OverFrSh
Definition: egammaEnergyCorrectionTool.h:787
AtlasRoot::egammaEnergyCorrectionTool::getCorrectedMomentum
double getCorrectedMomentum(PATCore::ParticleDataType::DataType dataType, PATCore::ParticleType::Type ptype, double momentum, double trk_eta, egEnergyCorr::Scale::Variation scaleVar=egEnergyCorr::Scale::None, double varSF=1.0) const
take eta and uncorrected energy of electron, return corrected energy, apply given variation,...
Definition: egammaEnergyCorrectionTool.cxx:1994
egEnergyCorr::es2017_summer_improved
@ es2017_summer_improved
Definition: egammaEnergyCorrectionTool.h:311
AtlasRoot::egammaEnergyCorrectionTool::dataConstantTermCorError
double dataConstantTermCorError(double cl_eta) const
Definition: egammaEnergyCorrectionTool.cxx:2780
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
egEnergyCorr::Scale::LArElecCalibDown
@ LArElecCalibDown
Definition: egammaEnergyCorrectionTool.h:160
AtlasRoot::egammaEnergyCorrectionTool::egammaEnergyCorrectionTool
egammaEnergyCorrectionTool()
Definition: egammaEnergyCorrectionTool.cxx:181
AtlasRoot::egammaEnergyCorrectionTool::m_zeeNom
std::unique_ptr< TH1 > m_zeeNom
Definition: egammaEnergyCorrectionTool.h:645
egEnergyCorr::Scale::ZeeAllUp
@ ZeeAllUp
Definition: egammaEnergyCorrectionTool.h:150
LArCellConditions.geo
bool geo
Definition: LArCellConditions.py:46
AtlasRoot::egammaEnergyCorrectionTool::m_E4UnconvertedGraphs
std::unique_ptr< TList > m_E4UnconvertedGraphs
Definition: egammaEnergyCorrectionTool.h:689
egEnergyCorr::es2011dTight
@ es2011dTight
Definition: egammaEnergyCorrectionTool.h:293
egEnergyCorr::Resolution::LastResolutionVariation
@ LastResolutionVariation
Definition: egammaEnergyCorrectionTool.h:105
AtlasRoot::egammaEnergyCorrectionTool::m_ADCLinearity_tool
std::shared_ptr< LinearityADC > m_ADCLinearity_tool
Definition: egammaEnergyCorrectionTool.h:467
AtlasRoot::egammaEnergyCorrectionTool::m_wstot_pT_MC_p0_electrons
std::unique_ptr< TH1 > m_wstot_pT_MC_p0_electrons
Definition: egammaEnergyCorrectionTool.h:738
AtlasRoot::egammaEnergyCorrectionTool::m_G4OverAFII_unconverted
std::unique_ptr< TH1 > m_G4OverAFII_unconverted
Definition: egammaEnergyCorrectionTool.h:783
dq_defect_virtual_defect_validation.d2
d2
Definition: dq_defect_virtual_defect_validation.py:81
egEnergyCorr::es2024_Run3_ofc0_v0
@ es2024_Run3_ofc0_v0
Definition: egammaEnergyCorrectionTool.h:331
egEnergyCorr::Resolution::MaterialCaloUp
@ MaterialCaloUp
Definition: egammaEnergyCorrectionTool.h:80
AtlasRoot::egammaEnergyCorrectionTool::m_electronBias_ConfigPP0
std::unique_ptr< TH2 > m_electronBias_ConfigPP0
Definition: egammaEnergyCorrectionTool.h:765
AtlasRoot::egammaEnergyCorrectionTool::getAlphaUncAlpha
std::pair< double, double > getAlphaUncAlpha(const TH1 &hh, double cl_eta, double et, bool useInterp) const
Definition: egammaEnergyCorrectionTool.cxx:4545
egEnergyCorr::Resolution::SamplingTermDown
@ SamplingTermDown
Definition: egammaEnergyCorrectionTool.h:73
AtlasRoot::egammaEnergyCorrectionTool::m_wstot_pT_data_p0_converted_photons
std::unique_ptr< TH1 > m_wstot_pT_data_p0_converted_photons
Definition: egammaEnergyCorrectionTool.h:736
AtlasRoot::egammaEnergyCorrectionTool::m_wstot_slope_A_data
std::unique_ptr< TH1 > m_wstot_slope_A_data
Definition: egammaEnergyCorrectionTool.h:730
AtlasRoot::egammaEnergyCorrectionTool::m_G4OverAFII_electron
std::unique_ptr< TH1 > m_G4OverAFII_electron
Definition: egammaEnergyCorrectionTool.h:781
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
AtlasRoot::egammaEnergyCorrectionTool::m_G4OverAFII_electron_2D
std::unique_ptr< TH2 > m_G4OverAFII_electron_2D
Definition: egammaEnergyCorrectionTool.h:784
AtlasRoot::egammaEnergyCorrectionTool::initialize
int initialize()
Definition: egammaEnergyCorrectionTool.cxx:238
egEnergyCorr::Scale::afDown
@ afDown
Definition: egammaEnergyCorrectionTool.h:246
AtlasRoot::egammaEnergyCorrectionTool::dataConstantTermError
double dataConstantTermError(double eta) const
Definition: egammaEnergyCorrectionTool.cxx:2754
AtlasRoot::egammaEnergyCorrectionTool::m_dX_IPAcc_G4
std::unique_ptr< TH1 > m_dX_IPAcc_G4
Definition: egammaEnergyCorrectionTool.h:671
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
AtlasRoot::egammaEnergyCorrectionTool::m_wstot_pT_MC_p1_unconverted_photons
std::unique_ptr< TH1 > m_wstot_pT_MC_p1_unconverted_photons
Definition: egammaEnergyCorrectionTool.h:741
egEnergyCorr::Scale::L2MediumGainDown
@ L2MediumGainDown
Definition: egammaEnergyCorrectionTool.h:227
AtlasRoot::egammaEnergyCorrectionTool::m_useL2GainCorrection
bool m_useL2GainCorrection
Definition: egammaEnergyCorrectionTool.h:809
egEnergyCorr::Resolution::MaterialGapDown
@ MaterialGapDown
Definition: egammaEnergyCorrectionTool.h:81
egEnergyCorr::es2017_R21_ofc0_v1
@ es2017_R21_ofc0_v1
Definition: egammaEnergyCorrectionTool.h:322
AtlasRoot::egammaEnergyCorrectionTool::dataConstantTermOFCError
double dataConstantTermOFCError(double eta) const
Definition: egammaEnergyCorrectionTool.cxx:2758
egEnergyCorr::Scale::ZeePhysUp
@ ZeePhysUp
Definition: egammaEnergyCorrectionTool.h:148
AtlasRoot::egammaEnergyCorrectionTool::m_s12UnconvertedEtaBins
std::unique_ptr< TAxis > m_s12UnconvertedEtaBins
Definition: egammaEnergyCorrectionTool.h:695
egEnergyCorr::ConfigA
@ ConfigA
Definition: egammaEnergyCorrectionTool.h:341
egEnergyCorr::Scale::EXTRARUN3PREUp
@ EXTRARUN3PREUp
Definition: egammaEnergyCorrectionTool.h:269
AtlasRoot::egammaEnergyCorrectionTool::applyFStoG4
double applyFStoG4(double eta) const
Definition: egammaEnergyCorrectionTool.cxx:3285
egEnergyCorr::Scale::LArTemperature2016PreDown
@ LArTemperature2016PreDown
Definition: egammaEnergyCorrectionTool.h:172
egEnergyCorr::Resolution::resolutionType
resolutionType
Definition: egammaEnergyCorrectionTool.h:110
egEnergyCorr::es2022_R22_PRE
@ es2022_R22_PRE
Definition: egammaEnergyCorrectionTool.h:328
AtlasRoot::egammaEnergyCorrectionTool::getCorrectedEnergy
double getCorrectedEnergy(unsigned int runnumber, PATCore::ParticleDataType::DataType dataType, PATCore::ParticleType::Type ptype, double cl_eta, double cl_etaS2, double cl_etaCalo, double energy, double energyS2, double eraw, RandomNumber seed, egEnergyCorr::Scale::Variation scaleVar=egEnergyCorr::Scale::None, egEnergyCorr::Resolution::Variation resVar=egEnergyCorr::Resolution::None, egEnergyCorr::Resolution::resolutionType resType=egEnergyCorr::Resolution::SigmaEff90, double varSF=1.0) const
Definition: egammaEnergyCorrectionTool.cxx:2019
egEnergyCorr::Scale::PedestalDown
@ PedestalDown
Definition: egammaEnergyCorrectionTool.h:234
AtlasRoot::egammaEnergyCorrectionTool::m_trkSyst
std::unique_ptr< TH1 > m_trkSyst
Definition: egammaEnergyCorrectionTool.h:637
egEnergyCorr::Scale::ConvRadiusDown
@ ConvRadiusDown
Definition: egammaEnergyCorrectionTool.h:257
egEnergyCorr::Scale::LArCalibDown
@ LArCalibDown
Definition: egammaEnergyCorrectionTool.h:156
PATCore::ParticleType::Electron
@ Electron
Definition: PATCoreEnums.h:40
PATCore::ParticleDataType::FastShower
@ FastShower
Definition: PATCoreEnums.h:22
AtlasRoot::egammaEnergyCorrectionTool::m_electronBias_ConfigFpMX
std::unique_ptr< TH2 > m_electronBias_ConfigFpMX
Definition: egammaEnergyCorrectionTool.h:762
AtlasRoot::egammaEnergyCorrectionTool::m_zeeNom_data2017
std::unique_ptr< TH1 > m_zeeNom_data2017
Definition: egammaEnergyCorrectionTool.h:648
AtlasRoot::egammaEnergyCorrectionTool::m_convertedBias_ConfigN
std::unique_ptr< TH2 > m_convertedBias_ConfigN
Definition: egammaEnergyCorrectionTool.h:775
AtlasRoot::egammaEnergyCorrectionTool::getZeeMeanET
double getZeeMeanET(double cl_eta) const
Definition: egammaEnergyCorrectionTool.cxx:2657
AtlasRoot::egammaEnergyCorrectionTool::m_dX_IPAcc_LAr
std::unique_ptr< TH1 > m_dX_IPAcc_LAr
Definition: egammaEnergyCorrectionTool.h:672
AtlasRoot::egammaEnergyCorrectionTool::m_electronBias_ConfigEpLp
std::unique_ptr< TH2 > m_electronBias_ConfigEpLp
Definition: egammaEnergyCorrectionTool.h:761
AtlasRoot::egammaEnergyCorrectionTool::m_electronBias_ConfigIBL
std::unique_ptr< TH2 > m_electronBias_ConfigIBL
Definition: egammaEnergyCorrectionTool.h:764
plotBeamSpotCompare.histo
histo
Definition: plotBeamSpotCompare.py:415
AtlasRoot::egammaEnergyCorrectionTool::m_use_temp_correction201215
bool m_use_temp_correction201215
Definition: egammaEnergyCorrectionTool.h:814
python.PyAthena.obj
obj
Definition: PyAthena.py:132
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
AtlasRoot::egammaEnergyCorrectionTool::m_unconvertedBias_ConfigA
std::unique_ptr< TH2 > m_unconvertedBias_ConfigA
Definition: egammaEnergyCorrectionTool.h:766
egEnergyCorr::Scale::MatCryoUp
@ MatCryoUp
Definition: egammaEnergyCorrectionTool.h:217
AtlasRoot::egammaEnergyCorrectionTool::m_matElectronGraphs
std::vector< std::unique_ptr< TList > > m_matElectronGraphs
Definition: egammaEnergyCorrectionTool.h:756
AtlasRoot::egammaEnergyCorrectionTool::~egammaEnergyCorrectionTool
virtual ~egammaEnergyCorrectionTool()
Definition: egammaEnergyCorrectionTool.cxx:233
AtlasRoot::egammaEnergyCorrectionTool::m_G4OverAFII_unconverted_2D
std::unique_ptr< TH2 > m_G4OverAFII_unconverted_2D
Definition: egammaEnergyCorrectionTool.h:786
python.compressB64.c
def c
Definition: compressB64.py:93
egEnergyCorr::es2015_5TeV
@ es2015_5TeV
Definition: egammaEnergyCorrectionTool.h:314
egEnergyCorr::Resolution::AllUp
@ AllUp
Definition: egammaEnergyCorrectionTool.h:66
egEnergyCorr::Resolution::MaterialCaloDown
@ MaterialCaloDown
Definition: egammaEnergyCorrectionTool.h:79
AtlasRoot::egammaEnergyCorrectionTool::m_G4OverAFII_resolution_converted
std::unique_ptr< TH2 > m_G4OverAFII_resolution_converted
Definition: egammaEnergyCorrectionTool.h:791
AtlasRoot::egammaEnergyCorrectionTool::getLayerUncertainty
double getLayerUncertainty(int iLayer, double cl_eta, egEnergyCorr::Scale::Variation var=egEnergyCorr::Scale::Nominal, double varSF=1.) const
Definition: egammaEnergyCorrectionTool.cxx:3718
egEnergyCorr::Scale::S12ExtraLastEtaBinRun2Up
@ S12ExtraLastEtaBinRun2Up
Definition: egammaEnergyCorrectionTool.h:211
AtlasRoot::egammaEnergyCorrectionTool::m_convertedBias_ConfigPP0
std::unique_ptr< TH2 > m_convertedBias_ConfigPP0
Definition: egammaEnergyCorrectionTool.h:777
AtlasRoot::egammaEnergyCorrectionTool::m_daPSb12
std::unique_ptr< TH1 > m_daPSb12
Definition: egammaEnergyCorrectionTool.h:641
AtlasRoot::egammaEnergyCorrectionTool::getLayerPedestal
double getLayerPedestal(double cl_eta, PATCore::ParticleType::Type ptype, int iLayer, egEnergyCorr::Scale::Variation var=egEnergyCorr::Scale::Nominal, double varSF=1.) const
Definition: egammaEnergyCorrectionTool.cxx:4743
egEnergyCorr::es2018_R21_v0
@ es2018_R21_v0
Definition: egammaEnergyCorrectionTool.h:324
egEnergyCorr::es2015PRE
@ es2015PRE
Definition: egammaEnergyCorrectionTool.h:303
AtlasRoot::egammaEnergyCorrectionTool::m_zeeSyst
std::unique_ptr< TH1 > m_zeeSyst
Definition: egammaEnergyCorrectionTool.h:653
AtlasRoot::egammaEnergyCorrectionTool::dataZPeakResolution
double dataZPeakResolution(double cl_eta) const
Definition: egammaEnergyCorrectionTool.cxx:2764
AtlasRoot::egammaEnergyCorrectionTool::applyMCCalibration
double applyMCCalibration(double eta, double ET, PATCore::ParticleType::Type ptype) const
Definition: egammaEnergyCorrectionTool.cxx:3171
AtlasRoot::egammaEnergyCorrectionTool::getAlphaUncertainty
double getAlphaUncertainty(long int runnumber, double cl_eta, double cl_etaS2, double cl_etaCalo, double energy, double energyS2, double eraw, PATCore::ParticleType::Type ptype=PATCore::ParticleType::Electron, egEnergyCorr::Scale::Variation var=egEnergyCorr::Scale::Nominal, double varSF=1.) const
Definition: egammaEnergyCorrectionTool.cxx:2573
WriteCellNoiseToCool.noise
noise
Definition: WriteCellNoiseToCool.py:380
AtlasRoot::egammaEnergyCorrectionTool::getE4Uncertainty
static double getE4Uncertainty(double eta)
Definition: egammaEnergyCorrectionTool.cxx:3613
AtlasRoot::egammaEnergyCorrectionTool::m_dX_PSAcc_G4
std::unique_ptr< TH1 > m_dX_PSAcc_G4
Definition: egammaEnergyCorrectionTool.h:676
egEnergyCorr
Definition: egammaEnergyCorrectionTool.h:44
AtlasRoot::egammaEnergyCorrectionTool::get_OFCSyst
double get_OFCSyst(double eta) const
Definition: egammaEnergyCorrectionTool.cxx:5418
egEnergyCorr::Scale::topoClusterThresDown
@ topoClusterThresDown
Definition: egammaEnergyCorrectionTool.h:208
egEnergyCorr::Resolution::MaterialIBLDown
@ MaterialIBLDown
Definition: egammaEnergyCorrectionTool.h:92
AtlasRoot::egammaEnergyCorrectionTool::m_E4ElectronEtaBins
std::unique_ptr< TAxis > m_E4ElectronEtaBins
Definition: egammaEnergyCorrectionTool.h:686
egEnergyCorr::Scale::LArUnconvCalibUp
@ LArUnconvCalibUp
Definition: egammaEnergyCorrectionTool.h:157
AtlasRoot::egammaEnergyCorrectionTool::m_E4ElectronGraphs
std::unique_ptr< TList > m_E4ElectronGraphs
Definition: egammaEnergyCorrectionTool.h:687
AtlasRoot::egammaEnergyCorrectionTool::m_zeeNom_data2018
std::unique_ptr< TH1 > m_zeeNom_data2018
Definition: egammaEnergyCorrectionTool.h:649
egEnergyCorr::Resolution::AllDown
@ AllDown
Definition: egammaEnergyCorrectionTool.h:65
AtlasRoot::egammaEnergyCorrectionTool::m_dX_IPAcc_GL1
std::unique_ptr< TH1 > m_dX_IPAcc_GL1
Definition: egammaEnergyCorrectionTool.h:673