ATLAS Offline Software
IsolationCorrection.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // Header for the ROOT tool of this package
7 #include "TFile.h"
8 #include "TGraphAsymmErrors.h"
9 #include "TRandom3.h"
10 #include "TTree.h"
11 #include "TVector.h"
12 // xAOD
14 #include "xAODEgamma/Electron.h"
15 #include "xAODEgamma/Photon.h"
16 #include "xAODEgamma/EgammaDefs.h"
19 
21 
22 #include <typeinfo>
23 #include <utility>
24 #include <cmath>
25 
26 
27 namespace{
28 const float GeV(1000);
29 }
30 
31 namespace CP {
32 
34  : asg::AsgMessaging(name),
35  m_tool_ver(REL21),
36  m_nBinsEtaFine(10),
37  m_nBinsEtaCoarse(5),
38  m_corr_file(""),
39  m_corr_ddshift_file(""),
40  m_corr_ddsmearing_file(""), // in run I, there was a shift and a smearing
41  m_is_mc(false),
42  m_AFII_corr(false),
43  m_set_mc(false),
44  m_correct_etcone(false),
45  m_trouble_categories(false),
46  m_useLogLogFit(false),
47  m_forcePartType(-1),
48  m_shower(nullptr),
49  m_previousYear("2000")
50  {
51  // 3 possible periods
52  for (int i = 0; i < 3; i++) {
53  // 2 simulation flavour
54  for (int j = 0; j < 2; j++)
55  m_corrInitialized[i][j] = false;
56  }
57  }
58 
59  void IsolationCorrection::SetCorrectionFile(const std::string& corr_file, const std::string& corr_ddshift_file, const std::string& corr_ddsmearing_file) {
60  // the leakage parameterisation
62  // the DD shifts (for photons)
64  // And an eventual smearing (run I)
65  m_corr_ddsmearing_file = PathResolverFindCalibFile(corr_ddsmearing_file);
66  }
67 
69 
70  setEtaBins();
71  setIsolCorr();
74 
75  return StatusCode::SUCCESS;
76  }
77 
79  m_tool_ver = ver;
80  }
81 
82 
84  float corrected_isolation = input.isolationValue(isol) - GetPtCorrection(input, isol);
85  return corrected_isolation;
86 
87  }
88 
89 
91  /*
92  - nPV: number of primary vertices (corrections were derived requiring >= 2 tracks/vertex in 2011 data)
93 
94  - Etcone40: (ph_Etcone40) *** in MeV!
95  - Etcone40_ED_corrected: ED corrected version of Etcone40 (ph_Etcone40_ED_corrected) *** in Mev!
96 
97  - energy: cluster energy (ph_cl_E) *** in MeV!
98  - etaS2: eta in the 2nd calo sampling (ph_etas2)
99  - etaPointing: pointing eta -> from 1st and 2nd calo samplings (ph_etap)
100  - etaCluster: cluster eta (ph_cl_eta)
101  - radius: radius of the input EtconeXX variable. Can be given as, e.g., .20 or 20
102  - is_mc: set to true if running on MC
103  - Etcone_value: value of uncorrected EtconeXX variable (ph_EtconeXX) *** in MeV!
104  - isConversion: photons only: conversion flag (ph_isConv)
105  - parttype: ELECTRON or PHOTON, enum defined below
106  - version: REL22, REL21, REL20_2, REL17_2, REL17 or REL16, enum defined below
107  */
108  float isolation_ptcorrection = 0;
109  float energy = 0;
110 
111  //energy = input.caloCluster()->energyBE(1) + input.caloCluster()->energyBE(2) + input.caloCluster()->energyBE(3); //input.e()
112  if (input.caloCluster() == nullptr) {
113  ATH_MSG_WARNING("The associated cluster of the object does not exist ! Maybe the thinning was too agressive... No leakage correction computed.");
114  return 0.;
115  }
116  if (m_tool_ver == REL22 || m_tool_ver == REL21 || m_tool_ver == REL20_2)
117  energy = input.caloCluster()->energyBE(1) + input.caloCluster()->energyBE(2) + input.caloCluster()->energyBE(3);
118  else
119  energy = input.caloCluster()->e();
120 
121  bool is_mc = m_is_mc;
123  bool convFlag = false;
124 
125  float etaS2 = input.caloCluster()->etaBE(2);
126  float etaS1 = input.caloCluster()->etaBE(1);
127  float etaCluster = input.caloCluster()->eta();
128  float phiCluster = input.caloCluster()->phi();
129 
130  if(part_type == IsolationCorrection::PHOTON && fabs(etaS2) > 2.37) return 0.;
131  if(part_type == IsolationCorrection::ELECTRON && fabs(etaS2) > 2.47) return 0.;
132 
133  if(fabs(etaS1) > 2.5) return 0.;
134  if(fabs(phiCluster) > float(M_PI)) return 0.;
135 
136  if (part_type == IsolationCorrection::ELECTRON && energy > 15e3)
137  ATH_MSG_VERBOSE("Electron ? " << (part_type == IsolationCorrection::ELECTRON) << " Input E = " << input.caloCluster()->e() << " E used " << energy << " author = " << input.author() << " pT = " << input.pt() << " phi = " << input.phi());
138 
139  int convFlag_int = 0;
140  float conv_radius = 0.;
141  float conv_ratio = 0.;
142 
143  if(part_type == IsolationCorrection::PHOTON){
144  const xAOD::Photon* ph_input = ((const xAOD::Photon_v1*) &input);
145 
146  convFlag_int = xAOD::EgammaHelpers::conversionType(ph_input);
147  if(convFlag_int == 3 ) convFlag_int = 2;
148  else if(convFlag_int != 0) convFlag_int = 1;
149 
150  if(convFlag_int != 0) convFlag = true;
151  conv_radius = xAOD::EgammaHelpers::conversionRadius(ph_input);
152 
153  if(convFlag_int == 2){
154  const xAOD::Vertex* phVertex = ph_input->vertex();
155 
156  static const SG::AuxElement::Accessor<float> accPt1("pt1");
157  static const SG::AuxElement::Accessor<float> accPt2("pt2");
158  const xAOD::TrackParticle* tp0 = phVertex->trackParticle(0);
159  const xAOD::TrackParticle* tp1 = phVertex->trackParticle(1);
160 
161  float pt1conv, pt2conv;
162  if (accPt1.isAvailable(*phVertex) && accPt2.isAvailable(*phVertex) ){
163  pt1conv = accPt1(*phVertex);
164  pt2conv = accPt2(*phVertex);
165  }else{
166  pt1conv = getPtAtFirstMeasurement( tp0 );
167  pt2conv = getPtAtFirstMeasurement( tp1 );
168  }
169 
170  if(pt1conv > pt2conv) conv_ratio = pt2conv/pt1conv;
171  else conv_ratio = pt1conv/pt2conv;
172  }
173  }
174  int author = input.author();
175 
176  // for test
177  if (part_type == IsolationCorrection::ELECTRON && m_forcePartType) {
178  if (input.phi() > 0)
179  author = 1;
180  else
181  author = 16;
182  }
183 
184  //using std::optional
185  auto etaPointing = m_shower->getCaloPointingEta(etaS1, etaS2, phiCluster, is_mc);
186  if (!etaPointing.has_value()) return 0.;
187 
188  float radius = xAOD::Iso::coneSize(isol);
189  bool is_topo = xAOD::Iso::isolationFlavour(isol) == xAOD::Iso::topoetcone;
190 
191  if(is_topo){
192 
193  isolation_ptcorrection = GetPtCorrectionTopo( energy,
194  etaS2,
195  etaPointing.value(),
196  etaCluster,
197  radius,
198  is_mc,
199  convFlag,
200  part_type,
201  m_tool_ver,
202  convFlag_int,
203  author,
204  conv_radius,
205  conv_ratio);
206  }else{
207  isolation_ptcorrection = GetPtCorrection( energy,
208  etaS2,
209  etaPointing.value(),
210  etaCluster,
211  radius,
212  is_mc,
213  convFlag,
214  part_type);
215  }
216 
217  return isolation_ptcorrection;
218  }
219 
221  {
222  if (!tp) return 0;
223  for (unsigned int i = 0; i < tp->numberOfParameters(); ++i)
224  if (tp->parameterPosition(i) == xAOD::FirstMeasurement)
225  return hypot(tp->parameterPX(i), tp->parameterPY(i));
226  return tp->pt();
227  }
228 
229  // I also include the DD from 2015 study because it is done in the same way as 2015-2016 or 2017
231 
232  if (m_corr_ddshift_file.empty()){
233  ATH_MSG_WARNING("IsolationCorrection::GetDDCorrection " << year << ", unknown correction file name.\nNo correction is applied.\n");
234  return StatusCode::FAILURE;
235  }
236 
237  int ii = year == "2017" ? 2 : (year == "2015_2016" ? 1 : 0);
238  int jj = m_AFII_corr ? 1 : 0;
239 
240  if (year == m_previousYear && m_corrInitialized[ii][jj])
241  return StatusCode::SUCCESS;
242 
243  ATH_MSG_VERBOSE("Will setup the tool to retrieve " << year << " DD corrections");
244 
246  if (year == "2015") {
248  m_crackBin = 2;
253  } else if (year == "2015_2016") {
255  m_crackBin = 4;
260  } else if (year == "2017") {
262  m_crackBin = 4;
267  } else {
268  ATH_MSG_WARNING("Year " << year << " is not known in IsolationCorrection ! Check your input ! No correction is applied");
269  return StatusCode::FAILURE;
270  }
271 
272  if (!m_corrInitialized[ii][jj]) {
273 
274  ATH_MSG_VERBOSE("DD corrections for year " << year << " not loaded yet. Doing it know");
275 
276  std::unique_ptr< TFile > file_ptleakagecorr( TFile::Open( m_corr_ddshift_file.c_str(), "READ" ) );
277  if (!file_ptleakagecorr) {
278  ATH_MSG_ERROR("file " << m_corr_ddshift_file << " not found ! Check your inputs");
279  return StatusCode::FAILURE;
280  }
281  TString baseN = year + "/" + (m_AFII_corr ? "AF2/" : "FullSim/");
282  TVector *veta = (TVector*)file_ptleakagecorr->Get(baseN+"/etaBinning");
283  m_feta_bins_dd->resize(veta->GetNrows());
284  for (int ieta = 0; ieta < veta->GetNrows(); ieta++) m_feta_bins_dd->at(ieta) = (*veta)[ieta];
285  TTree *tbinLabel = (TTree*)file_ptleakagecorr->Get(baseN+"tbinLabel");
286  TBranch *bbinLabel(nullptr);
287  TString *binLabel(nullptr); tbinLabel->SetBranchAddress("binLabel",&binLabel,&bbinLabel);
288  for (unsigned int ieta = 0; ieta < m_feta_bins_dd->size()-2; ieta++) {
289  tbinLabel->GetEntry(ieta);
290  TString gN = "topoETcone40_DataDriven_unconverted_photon_eta_";
291  gN += (*binLabel);
292  m_graph_dd_cone40_unconv_photon_shift->push_back( (TGraph*) file_ptleakagecorr->Get(baseN+gN));
293  gN = "topoETcone40_DataDriven_converted_photon_eta_";
294  gN += (*binLabel);
295  m_graph_dd_cone40_conv_photon_shift->push_back( (TGraph*) file_ptleakagecorr->Get(baseN+gN));
296  gN = "topoETcone20_DataDriven_unconverted_photon_eta_";
297  gN += (*binLabel);
298  m_graph_dd_cone20_unconv_photon_shift->push_back( (TGraph*) file_ptleakagecorr->Get(baseN+gN));
299  gN = "topoETcone20_DataDriven_converted_photon_eta_";
300  gN += (*binLabel);
301  m_graph_dd_cone20_conv_photon_shift->push_back( (TGraph*) file_ptleakagecorr->Get(baseN+gN));
302  ATH_MSG_VERBOSE("Got graphs \n"
303  << " dR = 0.4, unconv " << m_graph_dd_cone40_unconv_photon_shift->at(ieta)->GetName() << "\n"
304  << " dR = 0.4, conv " << m_graph_dd_cone40_conv_photon_shift->at(ieta)->GetName() << "\n"
305  << " dR = 0.2, unconv " << m_graph_dd_cone20_unconv_photon_shift->at(ieta)->GetName() << "\n"
306  << " dR = 0.2, conv " << m_graph_dd_cone20_conv_photon_shift->at(ieta)->GetName());
307 
308  }
309  m_corrInitialized[ii][jj] = true;
310  }
311 
312  return StatusCode::SUCCESS;
313 }
314 
316 
317  ATH_MSG_VERBOSE("Getting DD correction");
318  if (setupDD(year) == StatusCode::FAILURE) {
319  return 0;
320  }
321 
322  // corrections only for MC and photon
323  if(!m_is_mc || input.type() == xAOD::Type::Electron) return 0;
324 
325  const xAOD::Photon* ph_input = ((const xAOD::Photon_v1*) &input);
326  int convFlag_int = xAOD::EgammaHelpers::conversionType(ph_input);
327 
328  bool converted = false;
329  if(convFlag_int > 0) converted = true;
330 
331  float etaS2 = input.eta();
332  int eta_bin = 0;
333 
334  double feta = fabs(etaS2);
335  for (unsigned int i = 0; i < m_feta_bins_dd->size()-1; i++) {
336  if (feta >= m_feta_bins_dd->at(i) && feta < m_feta_bins_dd->at(i+1))
337  eta_bin = i;
338  }
339  if (eta_bin == m_crackBin)
340  return 0;
341  else if (eta_bin > m_crackBin)
342  eta_bin -= 1;
343 
344  if (eta_bin < 0) {
345  ATH_MSG_WARNING("Strange cluster S2 eta for photon isolation DD correction ! eta = " << etaS2 << ". No correction");
346  return 0;
347  }
348 
349  if (input.pt() > 25e3)
350  ATH_MSG_VERBOSE("Getting correction for photon pt: " <<input.pt()
351  << " eta: " << etaS2 << " etabin: " << eta_bin);
352 
353  float pt_gev = input.pt()*0.001;
354  if (pt_gev > 999.) pt_gev = 999. ;
355 
356  float isolation_ddcorrection = 0;
357  if (isol==xAOD::Iso::topoetcone40) {
358  if (!converted)
359  isolation_ddcorrection = 1e3*(*m_graph_dd_cone40_unconv_photon_shift)[eta_bin]->Eval(pt_gev);
360  else
361  isolation_ddcorrection = 1e3*(*m_graph_dd_cone40_conv_photon_shift)[eta_bin]->Eval(pt_gev);
362  } else if (isol==xAOD::Iso::topoetcone20) {
363  if (!converted)
364  isolation_ddcorrection = 1e3*(*m_graph_dd_cone20_unconv_photon_shift)[eta_bin]->Eval(pt_gev);
365  else
366  isolation_ddcorrection = 1e3*(*m_graph_dd_cone20_conv_photon_shift)[eta_bin]->Eval(pt_gev);
367  }
368 
369  return isolation_ddcorrection;
370  }
371 
373  if (input->caloCluster() == nullptr) {
374  ATH_MSG_WARNING("The associated cluster of the object does not exist ! Maybe the thinning was too agressive... use object eta for eta (instead of etaS2 or pointing).");
375  return input->eta();
376  }
377  float etaS1 = input->caloCluster()->etaBE(1);
378  float etaS2 = input->caloCluster()->etaBE(2);
379  float phiCluster = input->caloCluster()->phi();
381 
382  if(part_type == IsolationCorrection::PHOTON && fabs(etaS2) > 2.37) return 0.;
383  if(part_type == IsolationCorrection::ELECTRON && fabs(etaS2) > 2.47) return 0.;
384  if(fabs(etaS1) > 2.5) return 0.;
385  if(fabs(phiCluster) > 3.2) return 0.;
386 
387  auto etaPointing = m_shower->getCaloPointingEta(etaS1, etaS2, phiCluster);
388  //using std::optional here
389  return etaPointing.value_or(0.);
390  }
391 
393  m_is_mc = is_mc;
394  m_set_mc = true;
395  }
396 
397  void IsolationCorrection::SetAFII(bool AFII_corr){
398  m_AFII_corr = AFII_corr;
399  }
400 
401  // obsolete
402  /*
403  void IsolationCorrection::SetDD(bool apply_dd){
404  ATH_MSG_WARNING("The method SetDD is obsolete and not doing anything");
405  }
406  */
407 
408  void IsolationCorrection::SetCorrectEtcone(bool correct_etcone){
409  m_correct_etcone = correct_etcone;
410  }
411 
412  void IsolationCorrection::SetTroubleCategories(bool trouble_categories){
413  m_trouble_categories = trouble_categories;
414  }
415 
418  }
419 
423  m_eta_bins_fine = {0.0, 0.10, 0.60, 0.80, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37, 2.47};
424  m_eta_bins_coarse = {0.0, 0.60, 1.37, 1.52, 1.81, 2.47};
425  }
426 
427  // initialize the leakage corrections and DD only for rel17.2.
428  // Other DD are initialized once used for the first time
430  if (m_tool_ver == REL17_2) {
431  set2011Corr(); // in fact, this is for etcone
432  set2012Corr();
433  setDDCorr();
434  } else if (m_tool_ver == REL20_2 || m_tool_ver == REL21 || m_tool_ver == REL22)
435  set2015Corr();
436  }
437 
438  // This for etcone !!! From 2011 !
440 
441  // -------------------------------------------------------------------------------------------
442  // ------------- full 2011 (rel 17) leakage corrections --------------------------------------
443  // CURRENT isolation corrections: fine grained in eta, derived from MC11
444  m_mc_rel17_leakage_correction_slopes_electron_15 = { 0.01466, 0.01421, 0.01427, 0.01872, 0.02008, 0.02181, 0.02141, 0.02636, 0.03285, 0.03564 };
445  m_mc_rel17_leakage_correction_slopes_electron_20 = { 0.01616, 0.01572, 0.01596, 0.02139, 0.02339, 0.03350, 0.02499, 0.03038, 0.03870, 0.04337 };
446  m_mc_rel17_leakage_correction_slopes_electron_25 = { 0.01663, 0.01616, 0.01667, 0.02223, 0.02445, 0.03852, 0.02611, 0.03174, 0.04093, 0.04692 };
447  m_mc_rel17_leakage_correction_slopes_electron_30 = { 0.01689, 0.01635, 0.01684, 0.02256, 0.02485, 0.04223, 0.02660, 0.03232, 0.04182, 0.04846 };
448  m_mc_rel17_leakage_correction_slopes_electron_35 = { 0.01695, 0.01642, 0.01693, 0.02268, 0.02501, 0.04403, 0.02685, 0.03254, 0.04223, 0.04928 };
449  m_mc_rel17_leakage_correction_slopes_electron_40 = { 0.01701, 0.01646, 0.01702, 0.02272, 0.02517, 0.04550, 0.02698, 0.03267, 0.04242, 0.04964 };
450 
451  m_mc_rel17_leakage_correction_offsets_electron_15 = { 21.71, 36.00, 132.56, 191.64, 263.46, 619.58, 288.75, 121.92, 102.35, 175.02 };
452  m_mc_rel17_leakage_correction_offsets_electron_20 = { 76.67, 85.35, 184.90, 276.72, 384.97, 595.60, 657.99, 231.88, 170.48, 312.30 };
453  m_mc_rel17_leakage_correction_offsets_electron_25 = { 90.44, 105.02, 267.95, 420.38, 555.09, 1014.50, 765.83, 283.50, 224.18, 357.30 };
454  m_mc_rel17_leakage_correction_offsets_electron_30 = { 119.55, 127.09, 279.48, 430.96, 571.81, 846.86, 968.01, 354.46, 263.11, 455.21 };
455  m_mc_rel17_leakage_correction_offsets_electron_35 = { 138.79, 161.87, 371.47, 572.08, 754.17, 1249.38, 1000.44, 389.22, 295.72, 464.28 };
456  m_mc_rel17_leakage_correction_offsets_electron_40 = { 180.08, 187.89, 363.31, 553.46, 707.60, 1006.20, 1105.73, 434.21, 312.78, 535.90 };
457 
458  // photons: last eta bin isn't used
459  m_mc_rel17_leakage_correction_slopes_photon_converted_15 = { 0.01450, 0.01410, 0.01410, 0.01860, 0.01990, 0.0, 0.02120, 0.02610, 0.03260, 0.0 };
460  m_mc_rel17_leakage_correction_slopes_photon_converted_20 = { 0.01600, 0.01560, 0.01580, 0.02130, 0.02320, 0.0, 0.02450, 0.03000, 0.03840, 0.0 };
461  m_mc_rel17_leakage_correction_slopes_photon_converted_25 = { 0.01630, 0.01600, 0.01620, 0.02210, 0.02420, 0.0, 0.02560, 0.03140, 0.04060, 0.0 };
462  m_mc_rel17_leakage_correction_slopes_photon_converted_30 = { 0.01630, 0.01600, 0.01630, 0.02240, 0.02460, 0.0, 0.02610, 0.03190, 0.04150, 0.0 };
463  m_mc_rel17_leakage_correction_slopes_photon_converted_35 = { 0.01660, 0.01600, 0.01630, 0.02240, 0.02470, 0.0, 0.02640, 0.03210, 0.04190, 0.0 };
464  m_mc_rel17_leakage_correction_slopes_photon_converted_40 = { 0.01610, 0.01590, 0.01620, 0.02250, 0.02480, 0.0, 0.02650, 0.03220, 0.04210, 0.0 };
465 
466  m_mc_rel17_leakage_correction_offsets_photon_converted_15 = { 36.50, 61.80, 176.90, 206.40, 300.70, 0.0, 277.40, 91.70, 126.60, 0.0 };
467  m_mc_rel17_leakage_correction_offsets_photon_converted_20 = { 93.30, 101.40, 270.60, 369.10, 514.70, 0.0, 586.10, 160.80, 193.80, 0.0 };
468  m_mc_rel17_leakage_correction_offsets_photon_converted_25 = { 195.80, 166.20, 386.50, 472.30, 637.30, 0.0, 739.40, 207.60, 240.60, 0.0 };
469  m_mc_rel17_leakage_correction_offsets_photon_converted_30 = { 286.60, 241.60, 501.60, 570.70, 739.50, 0.0, 860.00, 264.50, 270.40, 0.0 };
470  m_mc_rel17_leakage_correction_offsets_photon_converted_35 = { 329.90, 314.70, 585.60, 655.60, 835.70, 0.0, 934.30, 291.50, 291.90, 0.0 };
471  m_mc_rel17_leakage_correction_offsets_photon_converted_40 = { 478.70, 383.80, 679.20, 725.70, 938.70, 0.0, 999.30, 322.80, 316.20, 0.0 };
472 
473  m_mc_rel17_leakage_correction_slopes_photon_unconverted_15 = { 0.01480, 0.01410, 0.01400, 0.01820, 0.01950, 0.0, 0.02140, 0.02660, 0.03250, 0.0 };
474  m_mc_rel17_leakage_correction_slopes_photon_unconverted_20 = { 0.01630, 0.01560, 0.01560, 0.02060, 0.02240, 0.0, 0.02480, 0.03060, 0.03830, 0.0 };
475  m_mc_rel17_leakage_correction_slopes_photon_unconverted_25 = { 0.01670, 0.01610, 0.01620, 0.02140, 0.02330, 0.0, 0.02590, 0.03200, 0.04050, 0.0 };
476  m_mc_rel17_leakage_correction_slopes_photon_unconverted_30 = { 0.01690, 0.01630, 0.01640, 0.02170, 0.02360, 0.0, 0.02630, 0.03260, 0.04140, 0.0 };
477  m_mc_rel17_leakage_correction_slopes_photon_unconverted_35 = { 0.01700, 0.01640, 0.01650, 0.02180, 0.02380, 0.0, 0.02650, 0.03280, 0.04180, 0.0 };
478  m_mc_rel17_leakage_correction_slopes_photon_unconverted_40 = { 0.01710, 0.01640, 0.01650, 0.02190, 0.02390, 0.0, 0.02660, 0.03290, 0.04200, 0.0 };
479 
480  m_mc_rel17_leakage_correction_offsets_photon_unconverted_15 = { -27.80, 3.80, 67.50, 80.90, 114.90, 0.0, 82.60, 2.10, 39.80, 0.0 };
481  m_mc_rel17_leakage_correction_offsets_photon_unconverted_20 = { -17.70, 12.60, 97.80, 126.50, 186.20, 0.0, 200.80, 24.00, 62.30, 0.0 };
482  m_mc_rel17_leakage_correction_offsets_photon_unconverted_25 = { -8.60, 20.30, 118.20, 161.80, 244.30, 0.0, 271.80, 39.80, 79.10, 0.0 };
483  m_mc_rel17_leakage_correction_offsets_photon_unconverted_30 = { 5.40, 33.80, 141.60, 199.50, 295.40, 0.0, 336.50, 64.80, 90.40, 0.0 };
484  m_mc_rel17_leakage_correction_offsets_photon_unconverted_35 = { 9.60, 47.80, 154.10, 231.10, 346.10, 0.0, 384.60, 77.80, 96.90, 0.0 };
485  m_mc_rel17_leakage_correction_offsets_photon_unconverted_40 = { 13.30, 62.00, 177.00, 267.10, 406.20, 0.0, 419.80, 89.40, 105.90, 0.0 };
486  }
487 
489  if( !m_corr_file.empty()){
490  load2012Corr();
491  }else{
492  ATH_MSG_WARNING("Correction file for 2017 data/mc not specified, tool not initialized for 2017 corrections\n");
493  }
494  }
495 
497  std::unique_ptr<TFile> file_ptleakagecorr(TFile::Open(m_corr_file.c_str(), "READ"));
498  if(!file_ptleakagecorr){
499  ATH_MSG_WARNING("Correction file for 2012 data/mc not found, tool not initialized for 2012 corrections\n");
500  m_corr_file = "";
501  return;
502  }else{
503  m_graph_cone40_photon_unconverted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_photon_unconverted_etabin0_extrap") );
504  m_graph_cone40_photon_unconverted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_photon_unconverted_etabin1_extrap") );
505  m_graph_cone40_photon_unconverted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_photon_unconverted_etabin2_extrap") );
506  m_graph_cone40_photon_unconverted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_photon_unconverted_etabin3_extrap") );
507  m_graph_cone40_photon_unconverted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_photon_unconverted_etabin4_extrap") );
508  m_graph_cone40_photon_unconverted.push_back( new TGraph() );//No corrections for photons in the crack region
509  m_graph_cone40_photon_unconverted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_photon_unconverted_etabin6_extrap") );
510  m_graph_cone40_photon_unconverted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_photon_unconverted_etabin7_extrap") );
511  m_graph_cone40_photon_unconverted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_photon_unconverted_etabin8_extrap") );
512  m_graph_cone40_photon_unconverted.push_back( new TGraph() );//No corrections for photons with |eta|>2.37
513 
514  m_graph_cone40_photon_converted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_photon_converted_etabin0_extrap") );
515  m_graph_cone40_photon_converted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_photon_converted_etabin1_extrap") );
516  m_graph_cone40_photon_converted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_photon_converted_etabin2_extrap") );
517  m_graph_cone40_photon_converted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_photon_converted_etabin3_extrap") );
518  m_graph_cone40_photon_converted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_photon_converted_etabin4_extrap") );
519  m_graph_cone40_photon_converted.push_back( new TGraph() );//No corrections for photons in the crack region
520  m_graph_cone40_photon_converted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_photon_converted_etabin6_extrap") );
521  m_graph_cone40_photon_converted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_photon_converted_etabin7_extrap") );
522  m_graph_cone40_photon_converted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_photon_converted_etabin8_extrap") );
523  m_graph_cone40_photon_converted.push_back( new TGraph() );//No corrections for photons with |eta|>2.37
524 
525  m_graph_cone40_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_electron_etabin0_extrap") );
526  m_graph_cone40_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_electron_etabin1_extrap") );
527  m_graph_cone40_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_electron_etabin2_extrap") );
528  m_graph_cone40_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_electron_etabin3_extrap") );
529  m_graph_cone40_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_electron_etabin4_extrap") );
530  m_graph_cone40_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_electron_etabin5_extrap") );
531  m_graph_cone40_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_electron_etabin6_extrap") );
532  m_graph_cone40_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_electron_etabin7_extrap") );
533  m_graph_cone40_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_electron_etabin8_extrap") );
534  m_graph_cone40_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone40_electron_etabin9_extrap") );
535 
536  m_graph_cone30_photon_unconverted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_photon_unconverted_etabin0_extrap") );
537  m_graph_cone30_photon_unconverted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_photon_unconverted_etabin1_extrap") );
538  m_graph_cone30_photon_unconverted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_photon_unconverted_etabin2_extrap") );
539  m_graph_cone30_photon_unconverted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_photon_unconverted_etabin3_extrap") );
540  m_graph_cone30_photon_unconverted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_photon_unconverted_etabin4_extrap") );
541  m_graph_cone30_photon_unconverted.push_back( new TGraph() );//No corrections for photons in the crack region
542  m_graph_cone30_photon_unconverted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_photon_unconverted_etabin6_extrap") );
543  m_graph_cone30_photon_unconverted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_photon_unconverted_etabin7_extrap") );
544  m_graph_cone30_photon_unconverted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_photon_unconverted_etabin8_extrap") );
545  m_graph_cone30_photon_unconverted.push_back( new TGraph() );//No corrections for photons with |eta|>2.37
546 
547  m_graph_cone30_photon_converted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_photon_converted_etabin0_extrap") );
548  m_graph_cone30_photon_converted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_photon_converted_etabin1_extrap") );
549  m_graph_cone30_photon_converted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_photon_converted_etabin2_extrap") );
550  m_graph_cone30_photon_converted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_photon_converted_etabin3_extrap") );
551  m_graph_cone30_photon_converted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_photon_converted_etabin4_extrap") );
552  m_graph_cone30_photon_converted.push_back( new TGraph() );//No corrections for photons in the crack region
553  m_graph_cone30_photon_converted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_photon_converted_etabin6_extrap") );
554  m_graph_cone30_photon_converted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_photon_converted_etabin7_extrap") );
555  m_graph_cone30_photon_converted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_photon_converted_etabin8_extrap") );
556  m_graph_cone30_photon_converted.push_back( new TGraph() );//No corrections for photons with |eta|>2.37
557 
558  m_graph_cone30_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_electron_etabin0_extrap") );
559  m_graph_cone30_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_electron_etabin1_extrap") );
560  m_graph_cone30_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_electron_etabin2_extrap") );
561  m_graph_cone30_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_electron_etabin3_extrap") );
562  m_graph_cone30_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_electron_etabin4_extrap") );
563  m_graph_cone30_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_electron_etabin5_extrap") );
564  m_graph_cone30_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_electron_etabin6_extrap") );
565  m_graph_cone30_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_electron_etabin7_extrap") );
566  m_graph_cone30_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_electron_etabin8_extrap") );
567  m_graph_cone30_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone30_electron_etabin9_extrap") );
568 
569  m_graph_cone20_photon_unconverted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_photon_unconverted_etabin0_extrap") );
570  m_graph_cone20_photon_unconverted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_photon_unconverted_etabin1_extrap") );
571  m_graph_cone20_photon_unconverted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_photon_unconverted_etabin2_extrap") );
572  m_graph_cone20_photon_unconverted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_photon_unconverted_etabin3_extrap") );
573  m_graph_cone20_photon_unconverted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_photon_unconverted_etabin4_extrap") );
574  m_graph_cone20_photon_unconverted.push_back( new TGraph() );//No corrections for photons in the crack region
575  m_graph_cone20_photon_unconverted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_photon_unconverted_etabin6_extrap") );
576  m_graph_cone20_photon_unconverted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_photon_unconverted_etabin7_extrap") );
577  m_graph_cone20_photon_unconverted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_photon_unconverted_etabin8_extrap") );
578  m_graph_cone20_photon_unconverted.push_back( new TGraph() );//No corrections for photons with |eta|>2.37
579 
580  m_graph_cone20_photon_converted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_photon_converted_etabin0_extrap") );
581  m_graph_cone20_photon_converted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_photon_converted_etabin1_extrap") );
582  m_graph_cone20_photon_converted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_photon_converted_etabin2_extrap") );
583  m_graph_cone20_photon_converted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_photon_converted_etabin3_extrap") );
584  m_graph_cone20_photon_converted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_photon_converted_etabin4_extrap") );
585  m_graph_cone20_photon_converted.push_back( new TGraph() );//No corrections for photons in the crack region
586  m_graph_cone20_photon_converted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_photon_converted_etabin6_extrap") );
587  m_graph_cone20_photon_converted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_photon_converted_etabin7_extrap") );
588  m_graph_cone20_photon_converted.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_photon_converted_etabin8_extrap") );
589  m_graph_cone20_photon_converted.push_back( new TGraph() );//No corrections for photons with |eta|>2.37
590 
591  m_graph_cone20_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_electron_etabin0_extrap") );
592  m_graph_cone20_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_electron_etabin1_extrap") );
593  m_graph_cone20_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_electron_etabin2_extrap") );
594  m_graph_cone20_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_electron_etabin3_extrap") );
595  m_graph_cone20_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_electron_etabin4_extrap") );
596  m_graph_cone20_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_electron_etabin5_extrap") );
597  m_graph_cone20_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_electron_etabin6_extrap") );
598  m_graph_cone20_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_electron_etabin7_extrap") );
599  m_graph_cone20_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_electron_etabin8_extrap") );
600  m_graph_cone20_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_electron_etabin9_extrap") );
601  }
602  }
603 
605  if( !m_corr_file.empty()){
606  load2015Corr();
607  }else{
608  ATH_MSG_WARNING("Correction file for 2015 data/mc not specified, tool not initialized for 2015 corrections\n");
609  }
610  }
611 
613  std::unique_ptr<TFile> file_ptleakagecorr(TFile::Open(m_corr_file.c_str(), "READ"));
614  if(!file_ptleakagecorr){
615  ATH_MSG_WARNING("Correction file for 2015 data/mc not found, "<<m_corr_file<<". tool not initialized for 2015 corrections\n");
616  m_corr_file = "";
617  }else{
618  if(!file_ptleakagecorr->GetListOfKeys()->Contains("mean_f_topoetcone40_eta_1.15_1.37_converted_ok")){
619  ATH_MSG_ERROR("Correction file for 2015 data/mc is not right, "<<m_corr_file<<". Tool not initialized for 2015 corrections\n");
620  m_corr_file = "";
621  } else {
622 
623  // ******************************
624  // Global fit corrections *******
625  // ******************************
626 
627  static const int nEta = 10;
628  static const TString etaLab[nEta] = { "0.0_0.1", "0.1_0.6", "0.6_0.8", "0.8_1.15", "1.15_1.37", "1.37_1.52", "1.52_1.81", "1.81_2.01", "2.01_2.37", "2.37_2.47" };
629  static const TString pLab[5] = { "_unconverted", "_converted_ok", "_converted_trouble", "_author_1_electron", "_author_16_electron" };
630  static const TString dRLab[3] = { "20", "30", "40" };
631 
641 
648 
649  if (m_trouble_categories) {
653 
657  }
658 
659  for (int iPart = 0; iPart < 5; iPart++) {
660 
661  for (int iEta = 0; iEta < 10; iEta++) {
662 
663  // No parametrisation in the crack or above |eta| = 2.37 for photons
664  if (iPart < 3 && (iEta == 5 || iEta == 9))
665  continue;
666 
667  for (int idR = 0; idR < 3; idR++) {
668  // The LogLog fit is a quick-and-dirty solution to get rid of negative leakage at low ET for unconverted and converted_ok photons
669  TString fN = (m_useLogLogFit && iPart < 2) ? "mean_flog_histo_topoetcone" : "mean_f_topoetcone";
670  fN += dRLab[idR]; fN += "_eta_"; fN += etaLab[iEta]; fN += pLab[iPart];
671  TString gN;
672  // Trouble categories are converted_trouble photons and author 16 electrons. Below 250 GeV, one uses the mean of the leakage histo
673  // instead of a fit to the mean of the CB vs ET
674  if (m_trouble_categories && (iPart == 2 || iPart == 4)) {
675  gN = "mean_g_histo_topoetcone"; gN += dRLab[idR]; gN += "_eta_"; gN += etaLab[iEta]; gN += pLab[iPart];
676  }
677  if (idR == 2) {
678  if (iPart == 0) {
679  m_function_2015_cone40_photon_unconverted.at(iEta) = ((TF1*)file_ptleakagecorr->Get(fN));
680  ATH_MSG_DEBUG("TF1 name : " << fN << " ptr = " << m_function_2015_cone40_photon_unconverted.at(iEta));
681  } else if (iPart == 1) {
682  m_function_2015_cone40_photon_converted_ok.at(iEta) = ((TF1*)file_ptleakagecorr->Get(fN));
683  ATH_MSG_DEBUG("TF1 name : " << fN << " ptr = " << m_function_2015_cone40_photon_converted_ok.at(iEta));
684  } else if (iPart == 2) {
685  m_function_2015_cone40_photon_converted_trouble.at(iEta) = ((TF1*)file_ptleakagecorr->Get(fN));
686  ATH_MSG_DEBUG("TF1 name : " << fN << " ptr = " << m_function_2015_cone40_photon_converted_trouble.at(iEta));
687  if (m_trouble_categories) {
688  m_graph_histoMean_2015_cone40_photon_converted_trouble.at(iEta) = ((TGraph*)file_ptleakagecorr->Get(gN));
689  ATH_MSG_DEBUG("TGraph name (trouble categories at low ET) : " << gN << " ptr = " << m_graph_histoMean_2015_cone40_photon_converted_trouble.at(iEta));
690  }
691  } else if (iPart == 3) {
692  m_function_2015_cone40_author_1_electron.at(iEta) = ((TF1*)file_ptleakagecorr->Get(fN));
693  ATH_MSG_DEBUG("TF1 name : " << fN << " ptr = " << m_function_2015_cone40_author_1_electron.at(iEta));
694  } else if (iPart == 4) {
695  m_function_2015_cone40_author_16_electron.at(iEta) = ((TF1*)file_ptleakagecorr->Get(fN));
696  ATH_MSG_DEBUG("TF1 name : " << fN << " ptr = " << m_function_2015_cone40_author_16_electron.at(iEta));
697  if (m_trouble_categories) {
698  m_graph_histoMean_2015_cone40_author_16_electron.at(iEta) = ((TGraph*)file_ptleakagecorr->Get(gN));
699  ATH_MSG_DEBUG("TGraph name (trouble categories at low ET) : " << gN << " ptr = " << m_graph_histoMean_2015_cone40_author_16_electron.at(iEta));
700  }
701  }
702 
703  } else if (idR == 1) {
704  if (iPart == 0) {
705  m_function_2015_cone30_photon_unconverted.at(iEta) = ((TF1*)file_ptleakagecorr->Get(fN));
706  ATH_MSG_DEBUG("TF1 name : " << fN << " ptr = " << m_function_2015_cone30_photon_unconverted.at(iEta));
707  } else if (iPart == 1) {
708  m_function_2015_cone30_photon_converted_ok.at(iEta) = ((TF1*)file_ptleakagecorr->Get(fN));
709  ATH_MSG_DEBUG("TF1 name : " << fN << " ptr = " << m_function_2015_cone30_photon_converted_ok.at(iEta));
710  } else if (iPart == 2) {
711  m_function_2015_cone30_photon_converted_trouble.at(iEta) = ((TF1*)file_ptleakagecorr->Get(fN));
712  ATH_MSG_DEBUG("TF1 name : " << fN << " ptr = " << m_function_2015_cone30_photon_converted_trouble.at(iEta));
713  if (m_trouble_categories) {
714  m_graph_histoMean_2015_cone30_photon_converted_trouble.at(iEta) = ((TGraph*)file_ptleakagecorr->Get(gN));
715  ATH_MSG_DEBUG("TGraph name (trouble categories at low ET) : " << gN << " ptr = " << m_graph_histoMean_2015_cone30_photon_converted_trouble.at(iEta));
716  }
717  } else if (iPart == 3) {
718  m_function_2015_cone30_author_1_electron.at(iEta) = ((TF1*)file_ptleakagecorr->Get(fN));
719  ATH_MSG_DEBUG("TF1 name : " << fN << " ptr = " << m_function_2015_cone30_author_1_electron.at(iEta));
720  } else if (iPart == 4) {
721  m_function_2015_cone30_author_16_electron.at(iEta) = ((TF1*)file_ptleakagecorr->Get(fN));
722  ATH_MSG_DEBUG("TF1 name : " << fN << " ptr = " << m_function_2015_cone30_author_16_electron.at(iEta));
723  if (m_trouble_categories) {
724  m_graph_histoMean_2015_cone30_author_16_electron.at(iEta) = ((TGraph*)file_ptleakagecorr->Get(gN));
725  ATH_MSG_DEBUG("TGraph name (trouble categories at low ET) : " << gN << " ptr = " << m_graph_histoMean_2015_cone30_author_16_electron.at(iEta));
726  }
727  }
728 
729  } else {
730  if (iPart == 0) {
731  m_function_2015_cone20_photon_unconverted.at(iEta) = ((TF1*)file_ptleakagecorr->Get(fN));
732  ATH_MSG_DEBUG("TF1 name : " << fN << " ptr = " << m_function_2015_cone20_photon_unconverted.at(iEta));
733  } else if (iPart == 1) {
734  m_function_2015_cone20_photon_converted_ok.at(iEta) = ((TF1*)file_ptleakagecorr->Get(fN));
735  ATH_MSG_DEBUG("TF1 name : " << fN << " ptr = " << m_function_2015_cone20_photon_converted_ok.at(iEta));
736  } else if (iPart == 2) {
737  m_function_2015_cone20_photon_converted_trouble.at(iEta) = ((TF1*)file_ptleakagecorr->Get(fN));
738  ATH_MSG_DEBUG("TF1 name : " << fN << " ptr = " << m_function_2015_cone20_photon_converted_trouble.at(iEta));
739  if (m_trouble_categories) {
740  m_graph_histoMean_2015_cone20_photon_converted_trouble.at(iEta) = ((TGraph*)file_ptleakagecorr->Get(gN));
741  ATH_MSG_DEBUG("TGraph name (trouble categories at low ET) : " << gN << " ptr = " << m_graph_histoMean_2015_cone20_photon_converted_trouble.at(iEta));
742  }
743  } else if (iPart == 3) {
744  m_function_2015_cone20_author_1_electron.at(iEta) = ((TF1*)file_ptleakagecorr->Get(fN));
745  ATH_MSG_DEBUG("TF1 name : " << fN << " ptr = " << m_function_2015_cone20_author_1_electron.at(iEta));
746  } else if (iPart == 4) {
747  m_function_2015_cone20_author_16_electron.at(iEta) = ((TF1*)file_ptleakagecorr->Get(fN));
748  ATH_MSG_DEBUG("TF1 name : " << fN << " ptr = " << m_function_2015_cone20_author_16_electron.at(iEta));
749  if (m_trouble_categories) {
750  m_graph_histoMean_2015_cone20_author_16_electron.at(iEta) = ((TGraph*)file_ptleakagecorr->Get(gN));
751  ATH_MSG_DEBUG("TGraph name (trouble categories at low ET) : " << gN << " ptr = " << m_graph_histoMean_2015_cone20_author_16_electron.at(iEta));
752  }
753  }
754  }
755 
756  } // dR bin
757 
758  } // eta bin
759 
760  } // particle type
761 
762  } // root file : no good format
763  } // root file not found
764  }
765 
767  if( !m_corr_ddshift_file.empty() && !m_corr_ddsmearing_file.empty()){
768  loadDDCorr();
769  }else{
770  ATH_MSG_WARNING("Data-driven correction files not specified, tool not initialized for data-driven corrections\n");
771  }
772  }
773 
775  std::unique_ptr< TFile > file_ddshift_corr( TFile::Open( m_corr_ddshift_file.c_str(), "READ" ) );
776  std::unique_ptr< TFile > file_ddsmearingcorr( TFile::Open( m_corr_ddsmearing_file.c_str(), "READ" ) );
777 
778  if(!file_ddshift_corr || !file_ddsmearingcorr){
779  ATH_MSG_WARNING("Correction file for data-driven corrections not found, tool not initialized for data-driven corrections\n");
780  m_corr_ddshift_file = "";
782  }else{
783 
784  // **********************************
785  // Data driven corrections **********
786  // https://cds.cern.ch/record/2008664
787  // **********************************
788 
789  // Photon shift corrections
790  std::vector< std::shared_ptr<TGraphAsymmErrors> > graph_shift;
791  // Photon smearing corrections (to be applied in end caps only)
792  std::vector< std::shared_ptr<TGraphAsymmErrors> > graph_smearing;
793  for (int ig = 0; ig <= 13; ig++) {
794  graph_shift.emplace_back( dynamic_cast<TGraphAsymmErrors*>(file_ddshift_corr->Get(Form("graph_%i",ig))) );
795  graph_smearing.emplace_back( dynamic_cast<TGraphAsymmErrors*>(file_ddsmearingcorr->Get(Form("graph_%i",ig))) );
796  }
797  for (int ig = 0; ig <= 13; ig++) {
798  if (ig <= 7)
799  m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(ig)->GetFunction("f") );
800  else
801  m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(ig)->GetFunction("f_2") );
802  m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(ig)->GetFunction("f_3") );
803  }
804 
805  for (const auto& gr : graph_shift) {
806  if (gr == nullptr)
807  ATH_MSG_ERROR("Null pointer for one of the DD correction graphs");
808  }
809  for (const auto& gr : graph_smearing) {
810  if (gr == nullptr)
811  ATH_MSG_ERROR("Null pointer for one of the smearing graphs");
812  }
813  }
814  }
815 
816  template <class T> void IsolationCorrection::FreeClear( T & cntr ) {
817  ATH_MSG_DEBUG("FreeClearing the container " << cntr.size());
818  for ( typename T::iterator it = cntr.begin();
819  it != cntr.end(); ++it ) {
820  if (*it) {
821  if (msgLvl(MSG::DEBUG)) {
822  ATH_MSG_DEBUG("Deleting " << *it << " " << typeid(*it).name());
823  ATH_MSG_DEBUG((*it)->GetName());
824  (*it)->Print();
825  }
826  delete * it;
827  }
828  }
829  cntr.clear();
830  }
831 
833  m_eta_bins_fine.clear();
834  m_eta_bins_coarse.clear();
835 
836  if (m_tool_ver == REL17_2) {
840 
844 
848 
851 
852  } else if (m_tool_ver == REL20_2 || m_tool_ver == REL21 || m_tool_ver == REL22) {
853 
854  //---- Rel 20_2 pT leakage correction file
855 
859 
863 
867 
871 
875 
876 
877  //---- Rel 20_2 pT leakage correction with histogram mean file
878 
882 
886 
887  }
888 
894  }
900  }
901 
902  // For etcone, we only have very old corrections...
909 
916 
917  // photons: last eta bin isn't used
924 
931 
938 
945 
946  // -------------------------------------------------------------------------------------------
947  //Delete m_shower instance
948  delete m_shower;
949 
950  }
951 
952  //-----------------------------------------------------------------------
953  // User function
954  // Returns the pt leakage corrected isolation
955  //
957  float etaS2,
958  float etaPointing,
959  float etaCluster,
960  float radius,
961  bool is_mc,
962  float Etcone_value,
963  bool isConversion,
964  ParticleType parttype){
965 
966  float pt_correction = GetPtCorrection(energy, etaS2, etaPointing, etaCluster, radius, is_mc, isConversion, parttype);
967  return Etcone_value - pt_correction;
968  }
969  //-----------------------------------------------------------------------
970 
971  //-----------------------------------------------------------------------
972  // User function
973  // Returns the pt leakage corrected topo isolation
974  //
976  float etaS2,
977  float etaPointing,
978  float etaCluster,
979  float radius,
980  bool is_mc,
981  float Etcone_value,
982  bool isConversion,
983  ParticleType parttype,
984  Version ver){
985 
986  float pt_correction = GetPtCorrectionTopo(energy, etaS2, etaPointing, etaCluster, radius, is_mc, isConversion, parttype, ver);
987  return Etcone_value - pt_correction;
988  }
989  //-----------------------------------------------------------------------
990 
991 
992  // ***************************************************************************************************************************
993  // ***************************************************************************************************************************
994  // Internal Functions Below.
995  // ***************************************************************************************************************************
996  // ***************************************************************************************************************************
997 
998  //-----------------------------------------------------------------------
999  // Internal function
1000  // Gets the pt correction factor
1001  //
1003  float etaS2, float etaPointing, float etaCluster,
1004  float radius,
1005  bool is_mc,
1006  bool isConversion, ParticleType parttype) const {
1007 
1008  int newrad = GetRadius(radius);
1009  std::vector<float> mc_correction_slopes_ptr;
1010  std::vector<float> mc_correction_offsets_ptr;
1011  std::vector<float> data_correction_slopes_ptr;
1012 
1013  //TODO: when implementing ptcorr for etconeXX change this
1014 
1015  switch(newrad){
1016  case 20:
1017  if (parttype == PHOTON) {
1018  // photons
1019  if(isConversion) {
1020  // converted
1023  } else {
1024  // unconverted
1027  }
1028  } else {
1029  // electrons
1030  mc_correction_slopes_ptr = m_mc_rel17_leakage_correction_slopes_electron_20;
1031  mc_correction_offsets_ptr = m_mc_rel17_leakage_correction_offsets_electron_20;
1032  }
1033  break;
1034  case 30:
1035  if (parttype == PHOTON) {
1036  // photons
1037  if(isConversion) {
1038  // converted
1041  } else {
1042  // unconverted
1045  }
1046  } else {
1047  // electrons
1048  mc_correction_slopes_ptr = m_mc_rel17_leakage_correction_slopes_electron_30;
1049  mc_correction_offsets_ptr = m_mc_rel17_leakage_correction_offsets_electron_30;
1050  }
1051  break;
1052  case 40:
1053  if (parttype == PHOTON) {
1054  // photons
1055  if(isConversion) {
1056  // converted
1059  } else {
1060  // unconverted
1063  }
1064  } else {
1065  // electrons
1066  mc_correction_slopes_ptr = m_mc_rel17_leakage_correction_slopes_electron_40;
1067  mc_correction_offsets_ptr = m_mc_rel17_leakage_correction_offsets_electron_40;
1068  }
1069  break;
1070  default:
1071  ATH_MSG_WARNING("Unable to retrieve leakage correction for topoIso cone with radius = " << radius << ".\n--- Radii must be one of {.20, .30, .40} OR {20, 30, 40}.\n");
1072  return 0.;
1073  }
1074 
1075  float scale_factor = GetPtCorrectionFactor(etaS2, mc_correction_slopes_ptr, data_correction_slopes_ptr);
1076  float offset = 0.;
1077  if (!mc_correction_offsets_ptr.empty()) offset = GetPtCorrectionFactor(etaS2, mc_correction_offsets_ptr);
1078 
1079  //avoid warnings
1080  if(is_mc) is_mc = true;
1081  return offset + GetPtCorrectionValue(energy, etaPointing, etaCluster, scale_factor);
1082 
1083  }
1084  //-----------------------------------------------------------------------
1085 
1086  //-----------------------------------------------------------------------
1087  // Internal function
1088  // Gets the pt correction factor for topoIso
1089  //
1091  float etaS2, float etaPointing, float etaCluster,
1092  float radius,
1093  bool /*is_mc*/,
1094  bool isConversion, ParticleType parttype, Version ver,
1095  int convFlag_int, int author, float conv_radius, float conv_ratio) const {
1096  double correction_value = 0.;
1097  if (ver== REL17_2) {
1098  correction_value = GetPtCorrection_FromGraph(energy,etaS2,etaPointing,etaCluster,radius,isConversion,parttype);
1099  } else if (m_tool_ver == REL20_2 || m_tool_ver == REL21 || m_tool_ver == REL22){
1100  correction_value = GetPtCorrection_FromGraph_2015(energy, etaS2, radius, convFlag_int, author, conv_radius, conv_ratio, parttype);
1101  }
1102 
1103  return correction_value;
1104  }
1105  //-----------------------------------------------------------------------
1106 
1107 
1108  //-----------------------------------------------------------------------
1109  // Internal function
1110  // Used to retrieve the correct radius
1112  int newrad = 0;
1113  // avoid roundoff errors by adding 0.1
1114  if(radius < 1) newrad = (int)(radius * 100 + 0.1);
1115  else newrad = (int)radius;
1116  return newrad;
1117  }
1118  //-----------------------------------------------------------------------
1119 
1120 
1121  //-----------------------------------------------------------------------
1122  // Internal function
1123  // Used to retrieve the correct (fine) eta bin number
1124  //
1126  int eta_bin=-1;
1127  float fabs_eta = fabs(eta);
1128  for (unsigned int i=0; i < m_nBinsEtaFine; ++i) {
1129  if ((fabs_eta >= m_eta_bins_fine[i]) && (fabs_eta < m_eta_bins_fine[i+1])) {
1130  eta_bin = i;
1131  break;
1132  }
1133  }
1134  return eta_bin;
1135  }
1136  //-----------------------------------------------------------------------
1137 
1138 
1139  //-----------------------------------------------------------------------
1140  // Internal function
1141  // Used to retrieve the correct (coarse) eta bin number
1142  //
1144  int eta_bin=-1;
1145  float fabs_eta = fabs(eta);
1146  for (unsigned int i=0; i < m_nBinsEtaCoarse; ++i) {
1147  if ((fabs_eta >= m_eta_bins_coarse[i]) && (fabs_eta < m_eta_bins_coarse[i+1])) {
1148  eta_bin = i;
1149  break;
1150  }
1151  }
1152  return eta_bin;
1153  }
1154  //-----------------------------------------------------------------------
1155 
1156  //-----------------------------------------------------------------------
1157  // Internal function
1158  // Returns the appropriate corrections value
1159  //
1161  const std::vector<float>& mc_leakage_corrections_ptr,
1162  const std::vector<float>& data_leakage_corrections_ptr) const {
1163  if(mc_leakage_corrections_ptr.empty() && data_leakage_corrections_ptr.empty())
1164  return 0.;
1165 
1166  int eta_bin_fine = GetEtaBinFine(eta);
1167  int eta_bin_coarse = GetEtaBinCoarse(eta);
1168 
1169  float correction = 0.;
1170  if (!mc_leakage_corrections_ptr.empty() && (eta_bin_fine >= 0)) correction += mc_leakage_corrections_ptr[eta_bin_fine];
1171  if (!data_leakage_corrections_ptr.empty() && (eta_bin_coarse >= 0)) correction += data_leakage_corrections_ptr[eta_bin_coarse];
1172 
1173  return correction;
1174  }
1175  //-----------------------------------------------------------------------
1176 
1177  //-----------------------------------------------------------------------
1178  // Internal function
1179  // Does the final pt scaling
1180  float IsolationCorrection::GetPtCorrectionValue(float energy, float etaPointing, float etaCluster, float scale_factor) {
1181  // apply the correction to et
1182  double etaForPt = ((fabs(etaPointing - etaCluster) < 0.15) ? etaPointing : etaCluster);
1183  double et = (fabs(etaForPt)<99.) ? energy/cosh(etaForPt) : 0.;
1184 
1185  return scale_factor * et;
1186  }
1187  //-----------------------------------------------------------------------
1188 
1189 
1190  //-----------------------------------------------------------------------
1191  // Internal function
1192  // Does the correction for REL17_2 from TGraph stored into isolation_leakage_corrections.root file
1193  // Returns the correction value in MeV
1194  float IsolationCorrection::GetPtCorrection_FromGraph(float energy,float etaS2,float etaPointing,float etaCluster,float radius,bool isConversion,ParticleType parttype) const
1195  {
1196  int newrad = GetRadius(radius);
1197  double etaForPt = ((fabs(etaPointing - etaCluster) < 0.15) ? etaPointing : etaCluster);
1198  double et = (fabs(etaForPt)<99.) ? energy/cosh(etaForPt) : 0.;
1199  int etabin = GetEtaBinFine(etaS2);
1200  if( m_corr_file.empty() ){
1201  ATH_MSG_WARNING("IsolationCorrection::GetPtCorrection_FromGraph: the file containing the isolation leakage corrections is not initialized.\nNo correction is applied.\n");
1202  return 0;
1203  }
1204  if (etabin < 0) return 0; // must have eta in fiducial region
1205 
1206  if( (etabin == 9 || etabin == 5) && parttype == PHOTON ){
1207  //No correction for photons with |etaS2|>2.37 or 1.37<|etaS2|<1.52
1208  return 0.;
1209  }
1210  double correction_value_mev = -1e6;
1211  switch(newrad){
1212  case 20:
1213  if(parttype == ELECTRON)
1214  correction_value_mev = GeV*m_graph_cone20_electron[etabin]->Eval(et/GeV);
1215  else
1216  if(isConversion) correction_value_mev = GeV*m_graph_cone20_photon_converted[etabin]->Eval(et/GeV);
1217  else correction_value_mev = GeV*m_graph_cone20_photon_unconverted[etabin]->Eval(et/GeV);
1218  break;
1219  case 30:
1220  if(parttype == ELECTRON)
1221  correction_value_mev = GeV*m_graph_cone30_electron[etabin]->Eval(et/GeV);
1222  else
1223  if(isConversion) correction_value_mev = GeV*m_graph_cone30_photon_converted[etabin]->Eval(et/GeV);
1224  else correction_value_mev = GeV*m_graph_cone30_photon_unconverted[etabin]->Eval(et/GeV);
1225  break;
1226  case 40:
1227  if(parttype == ELECTRON)
1228  correction_value_mev = GeV*m_graph_cone40_electron[etabin]->Eval(et/GeV);
1229  else
1230  if(isConversion) correction_value_mev = GeV*m_graph_cone40_photon_converted[etabin]->Eval(et/GeV);
1231  else correction_value_mev = GeV*m_graph_cone40_photon_unconverted[etabin]->Eval(et/GeV);
1232  break;
1233  default:
1234  ATH_MSG_WARNING("Unable to retrieve leakage correction for topoIso cone with radius = " << radius << ".\n--- Radii must be one of {.20, .30, .40} OR {20, 30, 40}.\n");
1235  return 0.;
1236  }
1237  return correction_value_mev;
1238 
1239  }
1240 
1241  //-----------------------------------------------------------------------
1242  // Internal function
1243  // Does the correction for REL18 from TGraph stored into isolation_ptcorrections.root file
1244  // Returns the correction value in MeV
1245 
1246  int IsolationCorrection::GetConversionType(int conversion_flag, float conv_radius, float conv_ratio) {
1247  // ph_convFlag==0
1248  if(conversion_flag == 0) return 0;
1249  // ((ph_convFlag==1)||(ph_convFlag==2&&ph_ptconv_ratio>0.3)||(ph_convFlag==2&&ph_ptconv_ratio<0.3&&ph_truth_Rconv>140.))
1250  if( (conversion_flag == 1) || ((conversion_flag == 2 && conv_ratio > 0.3) || (conversion_flag == 2 && conv_ratio < 0.3 && conv_radius > 140.)) ) return 1;
1251  // (ph_convFlag==2&&ph_ptconv_ratio<0.3&&ph_truth_Rconv<140.)
1252  if(conversion_flag == 2 && conv_radius < 140.) return 2;
1253  return 0;
1254  }
1255 
1256  float IsolationCorrection::GetPtCorrection_FromGraph_2015(float energy, float etaS2, float radius, int conversion_flag, int author, float conv_radius, float conv_ratio, ParticleType parttype) const {
1257  int newrad = GetRadius(radius);
1258  double etaForPt = etaS2; //((fabs(etaPointing - etaCluster) < 0.15) ? etaPointing : etaCluster);
1259  double et = energy/cosh(etaForPt); //(fabs(etaForPt)<99.) ? energy/cosh(etaForPt) : 0.;
1260  int etabin = GetEtaBinFine(etaS2);
1261 
1262  int conversion_type = 0;
1263  if(parttype == PHOTON) conversion_type = GetConversionType(conversion_flag, conv_radius, conv_ratio);
1264 
1265  // for test
1266  if (m_forcePartType && parttype == PHOTON) conversion_type = conv_radius > 800 ? 0 : (conv_radius > 140 ? 1 : 2);
1267 
1268  if( m_corr_file.empty() ){
1269  ATH_MSG_WARNING("In IsolationCorrection::GetPtCorrection_FromGraph_2015: the file containing the isolation leakage corrections is not initialized.\nNo correction is applied.\n");
1270  return 0;
1271  }
1272 
1273  if (etabin < 0) return 0; // must have eta in fiducial region
1274  if(parttype == PHOTON) if( (etabin == 9 || etabin == 5) ) return 0; // No correction for photons with |etaS2|>2.37 or 1.37<|etaS2|<1.52
1275 
1276  double correction_value_mev = 0;
1277 
1278  float pt_threshold = 250000.;
1279 
1280  //if(parttype == PHOTON) ATH_MSG_INFO("Applying 2015 corrections photon etaBin "<<etabin<<" Pt: "<<et<<" || "<< conversion_type <<" "<< author <<" "<< conv_radius <<" "<< conv_ratio <<"\n");
1281  //else ATH_MSG_INFO("Applying 2015 corrections electron etaBin "<<etabin<<" Pt: "<<et<<" || "<< conversion_type <<" "<< author <<" "<< conv_radius <<" "<< conv_ratio <<"\n");
1282  //TODO: switch author_1 with author_16 in the right places, invert function and histomean
1283  switch(newrad){
1284  case 20:
1285  if(parttype == ELECTRON){
1286  if(author == 1) correction_value_mev = m_function_2015_cone20_author_1_electron[etabin]->Eval(et);
1287  if(author == 16){
1288  if(m_trouble_categories && et < pt_threshold) correction_value_mev = m_graph_histoMean_2015_cone20_author_16_electron[etabin]->Eval(et);
1289  else correction_value_mev = m_function_2015_cone20_author_16_electron[etabin]->Eval(et);
1290  }
1291  }else{
1292  if(conversion_type == 0) correction_value_mev = m_function_2015_cone20_photon_unconverted[etabin]->Eval(et);
1293  if(conversion_type == 1) correction_value_mev = m_function_2015_cone20_photon_converted_ok[etabin]->Eval(et);
1294  if(conversion_type == 2){
1295  if(m_trouble_categories && et < pt_threshold) correction_value_mev = m_graph_histoMean_2015_cone20_photon_converted_trouble[etabin]->Eval(et);
1296  else correction_value_mev = m_function_2015_cone20_photon_converted_trouble[etabin]->Eval(et);
1297  }
1298  }
1299  break;
1300  case 30:
1301  if(parttype == ELECTRON){
1302  if(author == 1) correction_value_mev = m_function_2015_cone30_author_1_electron[etabin]->Eval(et);
1303  if(author == 16) {
1304  if(m_trouble_categories && et < pt_threshold) correction_value_mev = m_graph_histoMean_2015_cone30_author_16_electron[etabin]->Eval(et);
1305  else correction_value_mev = m_function_2015_cone30_author_16_electron[etabin]->Eval(et);
1306  }
1307  }else{
1308  if(conversion_type == 0) correction_value_mev = m_function_2015_cone30_photon_unconverted[etabin]->Eval(et);
1309  if(conversion_type == 1) correction_value_mev = m_function_2015_cone30_photon_converted_ok[etabin]->Eval(et);
1310  if(conversion_type == 2){
1311  if(m_trouble_categories && et < pt_threshold) correction_value_mev = m_graph_histoMean_2015_cone30_photon_converted_trouble[etabin]->Eval(et);
1312  else correction_value_mev = m_function_2015_cone30_photon_converted_trouble[etabin]->Eval(et);
1313  }
1314  }
1315  break;
1316  case 40:
1317  if(parttype == ELECTRON){
1318  if(author == 1) correction_value_mev = m_function_2015_cone40_author_1_electron[etabin]->Eval(et);
1319  if(author == 16){
1320  if(m_trouble_categories && et < pt_threshold) correction_value_mev = m_graph_histoMean_2015_cone40_author_16_electron[etabin]->Eval(et);
1321  else correction_value_mev = m_function_2015_cone40_author_16_electron[etabin]->Eval(et);
1322  }
1323  }else{
1324  if(conversion_type == 0) correction_value_mev = m_function_2015_cone40_photon_unconverted[etabin]->Eval(et);
1325  if(conversion_type == 1) correction_value_mev = m_function_2015_cone40_photon_converted_ok[etabin]->Eval(et);
1326  if(conversion_type == 2){
1327  if(m_trouble_categories && et < pt_threshold) correction_value_mev = m_graph_histoMean_2015_cone40_photon_converted_trouble[etabin]->Eval(et);
1328  else correction_value_mev = m_function_2015_cone40_photon_converted_trouble[etabin]->Eval(et);
1329  }
1330  }
1331  break;
1332  default:
1333  ATH_MSG_WARNING("Unable to retrieve leakage correction for topoIso cone with radius = " << radius << ".\n--- Radii must be one of {.20, .30, .40} OR {20, 30, 40}.\n");
1334  return 0.;
1335  }
1336  //ATH_MSG_INFO(" Correction: "<< correction_value_mev <<"\n");
1337  if (et > 20e3)
1338  ATH_MSG_VERBOSE("Electron ? " << (parttype == ELECTRON) << " author / conversion type = " << (parttype == ELECTRON ? author : conversion_type) << " et = " << et << " eta = " << etaS2 << " etabin = " << etabin << " correction: "<< correction_value_mev);
1339  return correction_value_mev;
1340  }
1341 
1343  ATH_MSG_INFO("Print properties of the parametrisation");
1345  ATH_MSG_INFO("ptr = " << i);
1346  if (i) {
1347  ATH_MSG_INFO(typeid(i).name());
1348  i->Print();
1349  }
1350  }
1351  }
1352 
1353 
1354 }
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
CP::IsolationCorrection::SetToolVer
void SetToolVer(CP::IsolationCorrection::Version)
Definition: IsolationCorrection.cxx:78
CP::IsolationCorrection::getPtAtFirstMeasurement
static float getPtAtFirstMeasurement(const xAOD::TrackParticle *tp)
Definition: IsolationCorrection.cxx:220
CP::IsolationCorrection::m_mc_rel17_leakage_correction_slopes_photon_unconverted_35
std::vector< float > m_mc_rel17_leakage_correction_slopes_photon_unconverted_35
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:316
xAOD::Iso::topoetcone
@ topoetcone
Topo-cluster ET-sum.
Definition: IsolationFlavour.h:25
CP::IsolationCorrection::m_mc_rel17_leakage_correction_offsets_photon_converted_25
std::vector< float > m_mc_rel17_leakage_correction_offsets_photon_converted_25
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:307
CP::IsolationCorrection::m_function_2015_cone20_photon_converted_trouble
std::vector< TF1 * > m_function_2015_cone20_photon_converted_trouble
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:242
CP::IsolationCorrection::m_feta_bins_dd_2015
std::vector< float > m_feta_bins_dd_2015
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:67
CP::IsolationCorrection::m_graph_histoMean_2015_cone30_photon_converted_trouble
std::vector< TGraph * > m_graph_histoMean_2015_cone30_photon_converted_trouble
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:254
CP::IsolationCorrection::m_mc_rel17_leakage_correction_offsets_photon_converted_40
std::vector< float > m_mc_rel17_leakage_correction_offsets_photon_converted_40
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:310
et
Extra patterns decribing particle interation process.
CP::IsolationCorrection::m_function_2015_cone40_photon_converted_ok
std::vector< TF1 * > m_function_2015_cone40_photon_converted_ok
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:236
ConvertOldHistosToNewHistos.converted
converted
Definition: ConvertOldHistosToNewHistos.py:40
CP::IsolationCorrection::m_graph_cone20_electron
std::vector< TGraph * > m_graph_cone20_electron
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:276
CP::IsolationCorrection::m_graph_cone30_photon_converted
std::vector< TGraph * > m_graph_cone30_photon_converted
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:271
CP::IsolationCorrection::m_mc_rel17_leakage_correction_slopes_photon_unconverted_40
std::vector< float > m_mc_rel17_leakage_correction_slopes_photon_unconverted_40
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:317
CP::IsolationCorrection::REL20_2
@ REL20_2
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:33
xAOD::Iso::topoetcone20
@ topoetcone20
Topo-cluster ET-sum.
Definition: IsolationType.h:48
xAOD::Electron
Electron_v1 Electron
Definition of the current "egamma version".
Definition: Event/xAOD/xAODEgamma/xAODEgamma/Electron.h:17
CP::IsolationCorrection::m_mc_rel17_leakage_correction_slopes_electron_15
std::vector< float > m_mc_rel17_leakage_correction_slopes_electron_15
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:283
CP::IsolationCorrection::SetTroubleCategories
void SetTroubleCategories(bool trouble_categories)
Definition: IsolationCorrection.cxx:412
asg::AsgMessaging::msgLvl
bool msgLvl(const MSG::Level lvl) const
Test the output level of the object.
Definition: AsgMessaging.cxx:41
CP::ShowerDepthTool::getCaloPointingEta
std::optional< float > getCaloPointingEta(float etas1, float etas2, float phi, bool isData=true) const
Eta direction from samplings 1 and 2 (pointing)
Definition: ShowerDepthTool.cxx:120
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CP::IsolationCorrection::m_mc_rel17_leakage_correction_offsets_electron_30
std::vector< float > m_mc_rel17_leakage_correction_offsets_electron_30
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:293
CP::IsolationCorrection::m_graph_histoMean_2015_cone20_photon_converted_trouble
std::vector< TGraph * > m_graph_histoMean_2015_cone20_photon_converted_trouble
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:255
CP::IsolationCorrection::m_previousYear
std::string m_previousYear
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:82
CP::IsolationCorrection::GetPtCorrection_FromGraph
float GetPtCorrection_FromGraph(float energy, float etaS2, float etaPointing, float etaCluster, float radius, bool isConversion, ParticleType parttype) const
Definition: IsolationCorrection.cxx:1194
CP::IsolationCorrection::m_graph_dd_cone40_photon_shift
std::vector< TF1 * > m_graph_dd_cone40_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:224
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
CP::IsolationCorrection::m_graph_afIIdd_2017_cone40_unconv_photon_shift
std::vector< TGraph * > m_graph_afIIdd_2017_cone40_unconv_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:189
xAOD::et
et
Definition: TrigEMCluster_v1.cxx:25
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:66
CP::IsolationCorrection::m_mc_rel17_leakage_correction_offsets_electron_40
std::vector< float > m_mc_rel17_leakage_correction_offsets_electron_40
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:295
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
CP::IsolationCorrection::m_mc_rel17_leakage_correction_slopes_photon_unconverted_15
std::vector< float > m_mc_rel17_leakage_correction_slopes_photon_unconverted_15
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:312
CP::IsolationCorrection::m_function_2015_cone30_photon_converted_ok
std::vector< TF1 * > m_function_2015_cone30_photon_converted_ok
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:237
CP::IsolationCorrection::m_graph_dd_2015_cone40_conv_photon_shift
std::vector< TGraph * > m_graph_dd_2015_cone40_conv_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:215
CP::IsolationCorrection::GetConversionType
static int GetConversionType(int conversion_flag, float conv_radius, float conv_ratio)
Definition: IsolationCorrection.cxx:1246
CP::IsolationCorrection::m_feta_bins_dd_2017
std::vector< float > m_feta_bins_dd_2017
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:68
CP::IsolationCorrection::m_graph_afIIdd_2015_2016_cone40_conv_photon_shift
std::vector< TGraph * > m_graph_afIIdd_2015_2016_cone40_conv_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:205
CP::IsolationCorrection::FreeClear
void FreeClear(T &cntr)
Definition: IsolationCorrection.cxx:816
CP::IsolationCorrection::m_shower
CP::ShowerDepthTool * m_shower
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:80
CP::IsolationCorrection::Print
void Print()
Definition: IsolationCorrection.cxx:1342
CP::IsolationCorrection::GetPtCorrectionFactor
float GetPtCorrectionFactor(float eta, const std::vector< float > &mc_leakage_corrections_ptr=std::vector< float >(), const std::vector< float > &data_leakage_corrections_ptr=std::vector< float >()) const
Definition: IsolationCorrection.cxx:1160
CP::IsolationCorrection::m_mc_rel17_leakage_correction_slopes_electron_25
std::vector< float > m_mc_rel17_leakage_correction_slopes_electron_25
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:285
skel.it
it
Definition: skel.GENtoEVGEN.py:423
asg
Definition: DataHandleTestTool.h:28
M_PI
#define M_PI
Definition: ActiveFraction.h:11
CP::IsolationCorrection::load2015Corr
void load2015Corr()
Definition: IsolationCorrection.cxx:612
CP::IsolationCorrection::set2012Corr
void set2012Corr()
Definition: IsolationCorrection.cxx:488
CP::IsolationCorrection::m_useLogLogFit
bool m_useLogLogFit
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:77
CP::IsolationCorrection::m_function_2015_cone20_photon_converted_ok
std::vector< TF1 * > m_function_2015_cone20_photon_converted_ok
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:238
ParticleTest.tp
tp
Definition: ParticleTest.py:25
IsolationCorrection.h
CP::IsolationCorrection::m_mc_rel17_leakage_correction_slopes_photon_converted_35
std::vector< float > m_mc_rel17_leakage_correction_slopes_photon_converted_35
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:302
CP::IsolationCorrection::m_graph_cone30_electron
std::vector< TGraph * > m_graph_cone30_electron
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:275
CP::IsolationCorrection::GetPtCorrection
float GetPtCorrection(const xAOD::Egamma &, const xAOD::Iso::IsolationType) const
Definition: IsolationCorrection.cxx:90
CP::IsolationCorrection::m_mc_rel17_leakage_correction_slopes_electron_40
std::vector< float > m_mc_rel17_leakage_correction_slopes_electron_40
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:288
gr
#define gr
CP::IsolationCorrection::m_graph_dd_cone20_conv_photon_shift
std::vector< TGraph * > * m_graph_dd_cone20_conv_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:90
CP::IsolationCorrection::m_mc_rel17_leakage_correction_offsets_photon_unconverted_30
std::vector< float > m_mc_rel17_leakage_correction_offsets_photon_unconverted_30
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:322
xAOD::Egamma_v1
Definition: Egamma_v1.h:56
CP::IsolationCorrection::m_eta_bins_coarse
std::vector< float > m_eta_bins_coarse
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:58
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
CP::IsolationCorrection::m_graph_dd_cone40_photon_smearing
std::vector< TF1 * > m_graph_dd_cone40_photon_smearing
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:225
python.AtlRunQueryAMI.year
year
Definition: AtlRunQueryAMI.py:226
CP::IsolationCorrection::m_mc_rel17_leakage_correction_offsets_photon_converted_30
std::vector< float > m_mc_rel17_leakage_correction_offsets_photon_converted_30
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:308
CP::IsolationCorrection::m_graph_afIIdd_2015_2016_cone40_unconv_photon_shift
std::vector< TGraph * > m_graph_afIIdd_2015_2016_cone40_unconv_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:204
xAOD::EventInfo_v1::IS_SIMULATION
@ IS_SIMULATION
true: simulation, false: data
Definition: EventInfo_v1.h:151
CP::IsolationCorrection::m_mc_rel17_leakage_correction_offsets_electron_25
std::vector< float > m_mc_rel17_leakage_correction_offsets_electron_25
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:292
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
CP::ShowerDepthTool
Definition: ShowerDepthTool.h:18
CP::IsolationCorrection::initialize
StatusCode initialize()
Definition: IsolationCorrection.cxx:68
CP::IsolationCorrection::GetEtaBinFine
int GetEtaBinFine(float eta) const
Definition: IsolationCorrection.cxx:1125
CP::IsolationCorrection::m_mc_rel17_leakage_correction_slopes_photon_unconverted_20
std::vector< float > m_mc_rel17_leakage_correction_slopes_photon_unconverted_20
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:313
CP::IsolationCorrection::m_graph_dd_2015_2016_cone20_unconv_photon_shift
std::vector< TGraph * > m_graph_dd_2015_2016_cone20_unconv_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:201
CP::IsolationCorrection::SetCorrectionFile
void SetCorrectionFile(const std::string &corr_file, const std::string &corr_ddshift_file, const std::string &corr_ddsmearing_file)
Definition: IsolationCorrection.cxx:59
CP::IsolationCorrection::m_mc_rel17_leakage_correction_offsets_photon_converted_15
std::vector< float > m_mc_rel17_leakage_correction_offsets_photon_converted_15
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:305
CP::IsolationCorrection::m_function_2015_cone40_photon_unconverted
std::vector< TF1 * > m_function_2015_cone40_photon_unconverted
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:232
CP::IsolationCorrection::m_mc_rel17_leakage_correction_offsets_photon_unconverted_15
std::vector< float > m_mc_rel17_leakage_correction_offsets_photon_unconverted_15
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:319
CP::IsolationCorrection::m_graph_cone40_electron
std::vector< TGraph * > m_graph_cone40_electron
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:274
CP::IsolationCorrection::m_graph_cone20_photon_unconverted
std::vector< TGraph * > m_graph_cone20_photon_unconverted
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:268
CP::IsolationCorrection::GetDDCorrection
float GetDDCorrection(const xAOD::Egamma &, const xAOD::Iso::IsolationType, const std::string &year)
Definition: IsolationCorrection.cxx:315
CP::IsolationCorrection::m_set_mc
bool m_set_mc
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:74
tools.zlumi_mc_cf.correction
def correction(mu, runmode, campaign, run=None)
Definition: zlumi_mc_cf.py:4
CP::IsolationCorrection::m_graph_afIIdd_2015_2016_cone20_unconv_photon_shift
std::vector< TGraph * > m_graph_afIIdd_2015_2016_cone20_unconv_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:206
CP::IsolationCorrection::GetRadius
static int GetRadius(float radius)
Definition: IsolationCorrection.cxx:1111
CP::IsolationCorrection::m_mc_rel17_leakage_correction_offsets_electron_35
std::vector< float > m_mc_rel17_leakage_correction_offsets_electron_35
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:294
CP::IsolationCorrection::set2011Corr
void set2011Corr()
Definition: IsolationCorrection.cxx:439
Pythia8_A14_NNPDF23LO_Var1Down_Common.ver
ver
Definition: Pythia8_A14_NNPDF23LO_Var1Down_Common.py:26
CP::IsolationCorrection::ELECTRON
@ ELECTRON
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:32
CP::IsolationCorrection::m_eta_bins_fine
std::vector< float > m_eta_bins_fine
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:57
CP::IsolationCorrection::m_AFII_corr
bool m_AFII_corr
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:73
CP::IsolationCorrection::Version
Version
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:33
CP::IsolationCorrection::GetPtCorrectedTopoIsolation
float GetPtCorrectedTopoIsolation(float energy, float etaS2, float etaPointing, float etaCluster, float radius, bool is_mc, float Etcone_value, bool isConversion=false, ParticleType parttype=ELECTRON, Version ver=REL17_2)
Definition: IsolationCorrection.cxx:975
EgammaxAODHelpers.h
CP::IsolationCorrection::setDDCorr
void setDDCorr()
Definition: IsolationCorrection.cxx:766
CP::IsolationCorrection::m_graph_histoMean_2015_cone40_author_16_electron
std::vector< TGraph * > m_graph_histoMean_2015_cone40_author_16_electron
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:257
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CP::IsolationCorrection::m_graph_dd_2015_cone40_unconv_photon_shift
std::vector< TGraph * > m_graph_dd_2015_cone40_unconv_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:214
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
CP::IsolationCorrection::SetCorrectEtcone
void SetCorrectEtcone(bool correct_etcone)
Definition: IsolationCorrection.cxx:408
CP::IsolationCorrection::m_graph_cone40_photon_unconverted
std::vector< TGraph * > m_graph_cone40_photon_unconverted
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:266
lumiFormat.i
int i
Definition: lumiFormat.py:92
CP::IsolationCorrection::m_mc_rel17_leakage_correction_offsets_photon_unconverted_20
std::vector< float > m_mc_rel17_leakage_correction_offsets_photon_unconverted_20
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:320
CP::IsolationCorrection::loadDDCorr
void loadDDCorr()
Definition: IsolationCorrection.cxx:774
xAOD::FirstMeasurement
@ FirstMeasurement
Parameter defined at the position of the 1st measurement.
Definition: TrackingPrimitives.h:213
Photon.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CP::IsolationCorrection::m_graph_cone40_photon_converted
std::vector< TGraph * > m_graph_cone40_photon_converted
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:270
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
xAOD::Iso::IsolationType
IsolationType
Overall enumeration for isolation types in xAOD files.
Definition: IsolationType.h:26
CP::IsolationCorrection::GetPtCorrectedIsolation
float GetPtCorrectedIsolation(const xAOD::Egamma &, const xAOD::Iso::IsolationType) const
Definition: IsolationCorrection.cxx:83
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
CP::IsolationCorrection::m_graph_dd_2015_2016_cone40_conv_photon_shift
std::vector< TGraph * > m_graph_dd_2015_2016_cone40_conv_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:200
CP::IsolationCorrection::m_nBinsEtaCoarse
const unsigned int m_nBinsEtaCoarse
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:61
CP::IsolationCorrection::m_graph_afIIdd_2015_2016_cone20_conv_photon_shift
std::vector< TGraph * > m_graph_afIIdd_2015_2016_cone20_conv_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:207
CP::IsolationCorrection::m_mc_rel17_leakage_correction_offsets_electron_15
std::vector< float > m_mc_rel17_leakage_correction_offsets_electron_15
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:290
CP::IsolationCorrection::m_function_2015_cone30_photon_unconverted
std::vector< TF1 * > m_function_2015_cone30_photon_unconverted
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:233
CP::IsolationCorrection::m_mc_rel17_leakage_correction_offsets_electron_20
std::vector< float > m_mc_rel17_leakage_correction_offsets_electron_20
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:291
CP::IsolationCorrection::REL22
@ REL22
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:33
CP::IsolationCorrection::~IsolationCorrection
~IsolationCorrection()
Definition: IsolationCorrection.cxx:832
CP::IsolationCorrection::m_graph_dd_2017_cone20_unconv_photon_shift
std::vector< TGraph * > m_graph_dd_2017_cone20_unconv_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:186
CP::IsolationCorrection::m_graph_dd_cone40_unconv_photon_shift
std::vector< TGraph * > * m_graph_dd_cone40_unconv_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:87
xAOD::Vertex_v1::trackParticle
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
Definition: Vertex_v1.cxx:249
CP::IsolationCorrection::PHOTON
@ PHOTON
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:32
CP::IsolationCorrection::m_graph_cone30_photon_unconverted
std::vector< TGraph * > m_graph_cone30_photon_unconverted
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:267
CP::IsolationCorrection::m_mc_rel17_leakage_correction_slopes_photon_converted_40
std::vector< float > m_mc_rel17_leakage_correction_slopes_photon_converted_40
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:303
CP::IsolationCorrection::m_function_2015_cone40_author_1_electron
std::vector< TF1 * > m_function_2015_cone40_author_1_electron
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:244
CP::IsolationCorrection::m_mc_rel17_leakage_correction_offsets_photon_unconverted_40
std::vector< float > m_mc_rel17_leakage_correction_offsets_photon_unconverted_40
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:324
CP::IsolationCorrection::REL21
@ REL21
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:33
CP::IsolationCorrection::m_graph_dd_2015_cone20_conv_photon_shift
std::vector< TGraph * > m_graph_dd_2015_cone20_conv_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:217
CP::IsolationCorrection::m_function_2015_cone20_author_16_electron
std::vector< TF1 * > m_function_2015_cone20_author_16_electron
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:250
CP::IsolationCorrection::m_function_2015_cone30_author_1_electron
std::vector< TF1 * > m_function_2015_cone30_author_1_electron
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:245
CP::IsolationCorrection::m_graph_dd_2017_cone20_conv_photon_shift
std::vector< TGraph * > m_graph_dd_2017_cone20_conv_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:187
CP::GeV
const double GeV
Definition: EgammaCalibrationAndSmearingTool.cxx:43
CP::IsolationCorrection::m_graph_dd_2015_2016_cone40_unconv_photon_shift
std::vector< TGraph * > m_graph_dd_2015_2016_cone40_unconv_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:199
CP::IsolationCorrection::m_tool_ver
CP::IsolationCorrection::Version m_tool_ver
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:55
CP::IsolationCorrection::GetEtaBinCoarse
int GetEtaBinCoarse(float eta) const
Definition: IsolationCorrection.cxx:1143
xAOD::Iso::isolationFlavour
IsolationFlavour isolationFlavour(IsolationType type)
convert Isolation Type into Isolation Flavour
Definition: IsolationHelpers.h:47
CP::IsolationCorrection::m_mc_rel17_leakage_correction_slopes_electron_20
std::vector< float > m_mc_rel17_leakage_correction_slopes_electron_20
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:284
CP::IsolationCorrection::m_trouble_categories
bool m_trouble_categories
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:76
CP::IsolationCorrection::m_mc_rel17_leakage_correction_slopes_photon_converted_15
std::vector< float > m_mc_rel17_leakage_correction_slopes_photon_converted_15
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:298
CP::IsolationCorrection::m_graph_histoMean_2015_cone30_author_16_electron
std::vector< TGraph * > m_graph_histoMean_2015_cone30_author_16_electron
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:258
doL1CaloHVCorrections.eta_bin
eta_bin
Definition: doL1CaloHVCorrections.py:368
CP::IsolationCorrection::m_mc_rel17_leakage_correction_slopes_electron_35
std::vector< float > m_mc_rel17_leakage_correction_slopes_electron_35
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:287
CP::IsolationCorrection::m_is_mc
bool m_is_mc
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:72
CP::IsolationCorrection::m_mc_rel17_leakage_correction_slopes_electron_30
std::vector< float > m_mc_rel17_leakage_correction_slopes_electron_30
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:286
PathResolver.h
CP::IsolationCorrection::m_graph_histoMean_2015_cone20_author_16_electron
std::vector< TGraph * > m_graph_histoMean_2015_cone20_author_16_electron
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:259
CP::IsolationCorrection::m_graph_dd_2015_cone20_unconv_photon_shift
std::vector< TGraph * > m_graph_dd_2015_cone20_unconv_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:216
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
CP::IsolationCorrection::m_graph_dd_cone40_conv_photon_shift
std::vector< TGraph * > * m_graph_dd_cone40_conv_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:88
xAOD::EgammaHelpers::conversionRadius
float conversionRadius(const xAOD::Vertex *vx)
return the conversion radius or 9999.
Definition: PhotonxAODHelpers.cxx:76
CP::IsolationCorrection::m_graph_dd_cone20_unconv_photon_shift
std::vector< TGraph * > * m_graph_dd_cone20_unconv_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:89
CP::IsolationCorrection::load2012Corr
void load2012Corr()
Definition: IsolationCorrection.cxx:496
CP::IsolationCorrection::m_corrInitialized
bool m_corrInitialized[3][2]
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:83
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:431
CP::IsolationCorrection::m_correct_etcone
bool m_correct_etcone
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:75
CP::IsolationCorrection::m_graph_dd_2015_2016_cone20_conv_photon_shift
std::vector< TGraph * > m_graph_dd_2015_2016_cone20_conv_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:202
TrackParticle.h
CP::IsolationCorrection::m_graph_histoMean_2015_cone40_photon_converted_trouble
std::vector< TGraph * > m_graph_histoMean_2015_cone40_photon_converted_trouble
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:253
CP::IsolationCorrection::m_mc_rel17_leakage_correction_offsets_photon_unconverted_25
std::vector< float > m_mc_rel17_leakage_correction_offsets_photon_unconverted_25
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:321
CP::IsolationCorrection::m_feta_bins_dd
std::vector< float > * m_feta_bins_dd
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:86
CP::IsolationCorrection::m_mc_rel17_leakage_correction_slopes_photon_converted_30
std::vector< float > m_mc_rel17_leakage_correction_slopes_photon_converted_30
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:301
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
xAOD::Photon_v1
Definition: Photon_v1.h:37
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CP::IsolationCorrection::setIsolCorr
void setIsolCorr()
Definition: IsolationCorrection.cxx:429
CP::IsolationCorrection::GetPtCorrectionValue
static float GetPtCorrectionValue(float energy, float etaPointing, float etaCluster, float scale_factor)
Definition: IsolationCorrection.cxx:1180
CP::IsolationCorrection::set2015Corr
void set2015Corr()
Definition: IsolationCorrection.cxx:604
CP::IsolationCorrection::m_corr_ddshift_file
std::string m_corr_ddshift_file
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:63
CP::IsolationCorrection::m_mc_rel17_leakage_correction_offsets_photon_unconverted_35
std::vector< float > m_mc_rel17_leakage_correction_offsets_photon_unconverted_35
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:323
CP::IsolationCorrection::m_function_2015_cone30_photon_converted_trouble
std::vector< TF1 * > m_function_2015_cone30_photon_converted_trouble
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:241
CP::IsolationCorrection::m_mc_rel17_leakage_correction_offsets_photon_converted_35
std::vector< float > m_mc_rel17_leakage_correction_offsets_photon_converted_35
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:309
IsolationHelpers.h
DEBUG
#define DEBUG
Definition: page_access.h:11
CaloCondBlobAlgs_fillNoiseFromASCII.author
string author
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:26
CP::IsolationCorrection::GetEtaPointing
float GetEtaPointing(const xAOD::Egamma *)
Definition: IsolationCorrection.cxx:372
EgammaDefs.h
CP::IsolationCorrection::m_graph_afIIdd_2017_cone40_conv_photon_shift
std::vector< TGraph * > m_graph_afIIdd_2017_cone40_conv_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:190
CP::IsolationCorrection::m_mc_rel17_leakage_correction_slopes_photon_unconverted_25
std::vector< float > m_mc_rel17_leakage_correction_slopes_photon_unconverted_25
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:314
xAOD::EgammaHelpers::conversionType
xAOD::EgammaParameters::ConversionType conversionType(const xAOD::Photon *ph)
return the photon conversion type (see EgammaEnums)
Definition: PhotonxAODHelpers.cxx:26
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
CP::IsolationCorrection::m_graph_dd_2017_cone40_conv_photon_shift
std::vector< TGraph * > m_graph_dd_2017_cone40_conv_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:185
CP::IsolationCorrection::m_corr_ddsmearing_file
std::string m_corr_ddsmearing_file
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:64
CP::IsolationCorrection::m_mc_rel17_leakage_correction_slopes_photon_converted_25
std::vector< float > m_mc_rel17_leakage_correction_slopes_photon_converted_25
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:300
CP::IsolationCorrection::m_mc_rel17_leakage_correction_slopes_photon_unconverted_30
std::vector< float > m_mc_rel17_leakage_correction_slopes_photon_unconverted_30
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:315
SG::ConstAccessor< T, AuxAllocator_t< T > >::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
CP::IsolationCorrection::m_corr_file
std::string m_corr_file
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:62
CP::IsolationCorrection::REL17_2
@ REL17_2
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:33
Electron.h
CP::IsolationCorrection::m_graph_afIIdd_2017_cone20_unconv_photon_shift
std::vector< TGraph * > m_graph_afIIdd_2017_cone20_unconv_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:191
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
CP::IsolationCorrection::m_function_2015_cone20_author_1_electron
std::vector< TF1 * > m_function_2015_cone20_author_1_electron
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:246
xAOD::Iso::topoetcone40
@ topoetcone40
Definition: IsolationType.h:50
TrigVSI::AlgConsts::nEta
constexpr int nEta
Default bin number of eta for vertex map.
Definition: Trigger/TrigTools/TrigVrtSecInclusive/TrigVrtSecInclusive/Constants.h:26
CP::IsolationCorrection::m_mc_rel17_leakage_correction_offsets_photon_converted_20
std::vector< float > m_mc_rel17_leakage_correction_offsets_photon_converted_20
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:306
CP::IsolationCorrection::m_graph_cone20_photon_converted
std::vector< TGraph * > m_graph_cone20_photon_converted
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:272
CP::IsolationCorrection::IsolationCorrection
IsolationCorrection(const std::string &name)
Definition: IsolationCorrection.cxx:33
xAOD::iEta
setScale setgFexType iEta
Definition: gFexJetRoI_v1.cxx:74
CP::IsolationCorrection::SetAFII
void SetAFII(bool AFII_corr)
Definition: IsolationCorrection.cxx:397
CP::IsolationCorrection::m_function_2015_cone40_author_16_electron
std::vector< TF1 * > m_function_2015_cone40_author_16_electron
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:248
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
xAOD::Iso::coneSize
float coneSize(IsolationConeSize type)
convert Isolation Size into cone size
Definition: IsolationHelpers.h:27
CP::IsolationCorrection::GetPtCorrectionTopo
float GetPtCorrectionTopo(float energy, float etaS2, float etaPointing, float etaCluster, float radius, bool is_mc=true, bool isConversion=false, ParticleType parttype=ELECTRON, Version ver=REL17_2, int convFlag_int=0, int author=0, float conv_radius=0., float conv_ratio=0.) const
Definition: IsolationCorrection.cxx:1090
CP::IsolationCorrection::m_function_2015_cone30_author_16_electron
std::vector< TF1 * > m_function_2015_cone30_author_16_electron
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:249
xAOD::Photon_v1::vertex
const xAOD::Vertex * vertex(size_t index=0) const
Pointer to the xAOD::Vertex/es that match the photon candidate.
Definition: Photon_v1.cxx:46
CP::IsolationCorrection::m_function_2015_cone40_photon_converted_trouble
std::vector< TF1 * > m_function_2015_cone40_photon_converted_trouble
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:240
CP::ShowerDepthTool::initialize
bool initialize()
Function initialising the tool.
Definition: ShowerDepthTool.cxx:35
CP::IsolationCorrection::ParticleType
ParticleType
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:32
readCCLHist.float
float
Definition: readCCLHist.py:83
CP::IsolationCorrection::m_crackBin
int m_crackBin
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:84
CP::IsolationCorrection::GetPtCorrection_FromGraph_2015
float GetPtCorrection_FromGraph_2015(float energy, float etaS2, float radius, int conversion_flag, int author, float conv_radius, float conv_ratio, ParticleType parttype) const
Definition: IsolationCorrection.cxx:1256
CP::IsolationCorrection::m_forcePartType
bool m_forcePartType
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:78
CP::IsolationCorrection::m_nBinsEtaFine
const unsigned int m_nBinsEtaFine
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:60
CP::IsolationCorrection::m_graph_afIIdd_2017_cone20_conv_photon_shift
std::vector< TGraph * > m_graph_afIIdd_2017_cone20_conv_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:192
CP::IsolationCorrection::m_function_2015_cone20_photon_unconverted
std::vector< TF1 * > m_function_2015_cone20_photon_unconverted
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:234
xAOD::EventInfo_v1::eventType
bool eventType(EventType type) const
Check for one particular bitmask value.
CP::IsolationCorrection::SetDataMC
void SetDataMC(bool is_mc)
Definition: IsolationCorrection.cxx:392
CP::IsolationCorrection::setEtaBins
void setEtaBins()
Definition: IsolationCorrection.cxx:420
CP::IsolationCorrection::m_mc_rel17_leakage_correction_slopes_photon_converted_20
std::vector< float > m_mc_rel17_leakage_correction_slopes_photon_converted_20
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:299
CP::IsolationCorrection::setupDD
StatusCode setupDD(const std::string &year)
Definition: IsolationCorrection.cxx:230
CP::IsolationCorrection::m_graph_dd_2017_cone40_unconv_photon_shift
std::vector< TGraph * > m_graph_dd_2017_cone40_unconv_photon_shift
Definition: PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/IsolationCorrection.h:184