ATLAS Offline Software
EgammaMonitoring.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "EgammaMonitoring.h"
6 
7 #include "GaudiKernel/ITHistSvc.h"
8 #include "GaudiKernel/SystemOfUnits.h"
9 
10 #include "TH1D.h"
11 #include "TH2D.h"
12 #include "TH3D.h"
13 #include "TProfile.h"
14 
16 #include "xAODEgamma/Egamma.h"
18 #include "xAODEgamma/Electron.h"
19 #include "xAODEgamma/Photon.h"
21 #include "xAODTruth/TruthVertex.h"
23 
25  ISvcLocator *pSvcLocator)
26  : AthAlgorithm(name, pSvcLocator) {}
27 
28 // ******
29 
31  ATH_MSG_INFO("******************** Running over " << m_sampleType
32  << " ******************");
33  ATH_CHECK(service("THistSvc", rootHistSvc));
34 
35  showerShapesAll = std::make_unique<egammaMonitoring::ShowerShapesHistograms>(
36  "showerShapesAll", "Shower Shapes ", "/MONITORING/showerShapesAll/",
37  rootHistSvc);
38 
40  std::make_unique<egammaMonitoring::ShowerShapesHistograms>(
41  "showerShapes10GeV", "Shower Shapes - 10 GeV",
42  "/MONITORING/showerShapes10GeV/", rootHistSvc);
43 
44  isolationAll = std::make_unique<egammaMonitoring::IsolationHistograms>(
45  "isolationAll", "Isolation ", "/MONITORING/isolationAll/", rootHistSvc);
46 
47  ATH_CHECK(showerShapesAll->initializePlots());
48  ATH_CHECK(showerShapes10GeV->initializePlots());
49  ATH_CHECK(isolationAll->initializePlots(m_sampleType == "electron"));
50 
51  if ("dataZ" != m_sampleType) {
52  clusterAll = std::make_unique<egammaMonitoring::ClusterHistograms>(
53  "clustersAll", "Clusters", "/MONITORING/clusterAll/", rootHistSvc);
54 
55  cluster10GeV = std::make_unique<egammaMonitoring::ClusterHistograms>(
56  "clusters10GeV", "Clusters - 10 GeV", "/MONITORING/cluster10GeV/",
57  rootHistSvc);
58 
59  clusterPromptAll = std::make_unique<egammaMonitoring::ClusterHistograms>(
60  "clustersPromptAll", "Clusters from Prompt",
61  "/MONITORING/clusterPromptAll/", rootHistSvc);
62 
63  clusterPrompt10GeV = std::make_unique<egammaMonitoring::ClusterHistograms>(
64  "clustersPrompt10GeV", "Clusters from Prompt - 10 GeV",
65  "/MONITORING/clusterPrompt10GeV/", rootHistSvc);
66 
67  ATH_CHECK(clusterAll->initializePlots());
68  ATH_CHECK(cluster10GeV->initializePlots());
69  ATH_CHECK(clusterPromptAll->initializePlots());
70  ATH_CHECK(clusterPrompt10GeV->initializePlots());
71  } else {
72  m_clusterReco = std::make_unique<egammaMonitoring::RecoClusterHistograms>(
73  "clustersReco", "Clusters from Z->ee candidates in data",
74  "/MONITORING/recoCluster/", rootHistSvc);
76  std::make_unique<egammaMonitoring::RecoElectronHistograms>(
77  "recoElectronAll", "Reco electrons from Z->ee candidates in data",
78  "/MONITORING/recoZElectron/", rootHistSvc);
79  m_diElectron = std::make_unique<egammaMonitoring::DiObjectHistograms>(
80  "diElectrons", "Z->ee candidates in data", "/MONITORING/diElectrons/",
81  rootHistSvc);
82  ATH_CHECK(m_clusterReco->initializePlots());
83  recoElectronAll->isData();
84  ATH_CHECK(recoElectronAll->initializePlots());
85  ATH_CHECK(m_diElectron->initializePlots());
86  }
87 
88  if ("electron" == m_sampleType) {
89 
91  std::make_unique<egammaMonitoring::RecoElectronHistograms>(
92  "recoElectronAll", "Electrons Reco Electron",
93  "/MONITORING/recoElectronAll/", rootHistSvc);
94 
96  std::make_unique<egammaMonitoring::TruthElectronHistograms>(
97  "truthElectronAll", "All Truth Electrons",
98  "/MONITORING/truthElectronAll/", rootHistSvc);
99 
101  std::make_unique<egammaMonitoring::TruthElectronHistograms>(
102  "truthPromptElectronAll", "All Truth Prompt Electrons",
103  "/MONITORING/truthPromptElectronAll/", rootHistSvc);
104 
106  std::make_unique<egammaMonitoring::TruthElectronHistograms>(
107  "truthElectronRecoElectronAll", "Truth Electrons Reco Electron",
108  "/MONITORING/truthElectronRecoElectronAll/", rootHistSvc);
109 
111  std::make_unique<egammaMonitoring::TruthElectronHistograms>(
112  "truthPromptElectronWithTrack", "Truth Prompt Electrons With Track",
113  "/MONITORING/truthPromptElectronWithTrack/", rootHistSvc);
114 
116  std::make_unique<egammaMonitoring::TruthElectronHistograms>(
117  "truthPromptElectronWithGSFTrack",
118  "Truth Prompt Electrons With GSFTrack",
119  "/MONITORING/truthPromptElectronWithGSFTrack/", rootHistSvc);
120 
122  std::make_unique<egammaMonitoring::TruthElectronHistograms>(
123  "truthPromptElectronWithReco",
124  "Truth Prompt Electrons With GSFTrack or just with a fwd cluster",
125  "/MONITORING/truthPromptElectronWithReco/", rootHistSvc);
126 
128  std::make_unique<egammaMonitoring::TruthElectronHistograms>(
129  "truthPromptElectronWithRecoTrack",
130  "Truth Prompt Electrons With GSFTrack",
131  "/MONITORING/truthPromptElectronWithRecoTrack/", rootHistSvc);
132 
134  std::make_unique<egammaMonitoring::TruthElectronHistograms>(
135  "truthRecoElectronLooseLH", "LLH Electrons Reco Electron",
136  "/MONITORING/truthRecoElectronLooseLH/", rootHistSvc);
137 
139  std::make_unique<egammaMonitoring::TruthElectronHistograms>(
140  "truthRecoElectronMediumLH", "MLH Electrons Reco Electron",
141  "/MONITORING/truthRecoElectronMediumLH/", rootHistSvc);
142 
144  std::make_unique<egammaMonitoring::TruthElectronHistograms>(
145  "truthRecoElectronTightLH", "TLH Electrons Reco Electron",
146  "/MONITORING/truthRecoElectronTightLH/", rootHistSvc);
147 
148  if (!m_FwdElectronsKey.empty()) {
149  recoElectronAll->hasFwd();
150  truthElectronAll->hasFwd();
151  truthPromptElectronAll->hasFwd();
155  truthPromptElectronWithReco->hasFwd();
157  truthRecoElectronLoose->hasFwd();
158  truthRecoElectronMedium->hasFwd();
159  truthRecoElectronTight->hasFwd();
160  }
161 
162  ATH_CHECK(recoElectronAll->initializePlots());
163  ATH_CHECK(truthRecoElectronLoose->initializePlots());
164  ATH_CHECK(truthRecoElectronMedium->initializePlots());
165  ATH_CHECK(truthRecoElectronTight->initializePlots());
166  ATH_CHECK(truthElectronAll->initializePlots(true));
167  ATH_CHECK(truthPromptElectronAll->initializePlots(true));
168  ATH_CHECK(truthElectronRecoElectronAll->initializePlots());
169  ATH_CHECK(truthPromptElectronWithTrack->initializePlots(true));
170  ATH_CHECK(truthPromptElectronWithGSFTrack->initializePlots(true));
171  ATH_CHECK(truthPromptElectronWithReco->initializePlots());
172  ATH_CHECK(truthPromptElectronWithRecoTrack->initializePlots());
173  } // electron Hists
174 
175  if ("gamma" == m_sampleType) {
176 
177  // all reco photons
178  recoPhotonAll = std::make_unique<egammaMonitoring::RecoPhotonHistograms>(
179  "recoPhotonAll", "Reco Photon", "/MONITORING/recoPhotonAll/",
180  rootHistSvc);
181  ATH_CHECK(recoPhotonAll->initializePlots());
182 
183  clusterConvPhoton = std::make_unique<egammaMonitoring::ClusterHistograms>(
184  "clusterConvPhoton", "Clusters from Converted Photons",
185  "/MONITORING/clusterConvPhoton/", rootHistSvc);
186 
187  clusterConvPhotonSi = std::make_unique<egammaMonitoring::ClusterHistograms>(
188  "clusterConvPhotonSi", "Clusters from Converted Photons - Si",
189  "/MONITORING/clusterConvPhotonSi/", rootHistSvc);
190 
192  std::make_unique<egammaMonitoring::ClusterHistograms>(
193  "clusterConvPhotonSiSi", "Clusters from Converted Photons - SiSi",
194  "/MONITORING/clusterConvPhotonSiSi/", rootHistSvc);
195 
196  clusterUnconvPhoton = std::make_unique<egammaMonitoring::ClusterHistograms>(
197  "clusterUnconvPhoton", "Clusters from Converted Photons",
198  "/MONITORING/clusterUnconvPhoton/", rootHistSvc);
199 
200  // Cluster information
201  ATH_CHECK(clusterConvPhoton->initializePlots());
202  ATH_CHECK(clusterConvPhotonSi->initializePlots());
203  ATH_CHECK(clusterConvPhotonSiSi->initializePlots());
204  ATH_CHECK(clusterUnconvPhoton->initializePlots());
205 
206  if (m_hasTRT) {
208  std::make_unique<egammaMonitoring::ClusterHistograms>(
209  "clusterConvPhotonTRT", "Clusters from Converted Photons - TRT",
210  "/MONITORING/clusterConvPhotonTRT/", rootHistSvc);
211 
213  std::make_unique<egammaMonitoring::ClusterHistograms>(
214  "clusterConvPhotonTRTTRT",
215  "Clusters from Converted Photons - TRTTRT",
216  "/MONITORING/clusterConvPhotonTRTTRT/", rootHistSvc);
217 
219  std::make_unique<egammaMonitoring::ClusterHistograms>(
220  "clusterConvPhotonSiTRT",
221  "Clusters from Converted Photons - SiTRT",
222  "/MONITORING/clusterConvPhotonSiTRT/", rootHistSvc);
223 
225  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
226  "truthConvRecoConv1TRT", "truthConvRecoConv1TRT",
227  "/MONITORING/truthConvRecoConv1TRT/", rootHistSvc);
228 
230  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
231  "truthConvRecoConv2TRT", "truthConvRecoConv2TRT",
232  "/MONITORING/truthConvRecoConv2TRT/", rootHistSvc);
233 
235  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
236  "truthConvRecoConv2SiTRT", "truthConvRecoConv2SiTRT",
237  "/MONITORING/truthConvRecoConv2SiTRT/", rootHistSvc);
238 
240  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
241  "truthUnconvRecoConv1TRT", "truthUnconvRecoConv1TRT",
242  "/MONITORING/truthUnconvRecoConv1TRT/", rootHistSvc);
243 
245  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
246  "truthUnconvRecoConv2TRT", "truthUnconvRecoConv2TRT",
247  "/MONITORING/truthUnconvRecoConv2TRT/", rootHistSvc);
248 
250  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
251  "truthUnconvRecoConv2SiTRT", "truthUnconvRecoConv2SiTRT",
252  "/MONITORING/truthUnconvRecoConv2SiTRT/", rootHistSvc);
253 
254  ATH_CHECK(truthPhotonConvRecoConv1TRT->initializePlots());
255  ATH_CHECK(truthPhotonConvRecoConv2TRT->initializePlots());
256  ATH_CHECK(truthPhotonConvRecoConv2SiTRT->initializePlots());
257  ATH_CHECK(truthPhotonUnconvRecoConv1TRT->initializePlots());
258  ATH_CHECK(truthPhotonUnconvRecoConv2TRT->initializePlots());
259  ATH_CHECK(truthPhotonUnconvRecoConv2SiTRT->initializePlots());
260  ATH_CHECK(clusterConvPhotonTRT->initializePlots());
261  ATH_CHECK(clusterConvPhotonTRTTRT->initializePlots());
262  ATH_CHECK(clusterConvPhotonSiTRT->initializePlots());
263  }
264 
265  // All truth
266  truthPhotonAll = std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
267  "truthPhotonAll", "truthPhotonAll", "/MONITORING/truthPhotonAll/",
268  rootHistSvc);
269 
271  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
272  "truthPhotonAllUnconv", "truthPhotonAllUnconv",
273  "/MONITORING/truthPhotonAllUnconv/", rootHistSvc);
274 
276  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
277  "truthPhotonAllConv", "truthPhotonAllConv",
278  "/MONITORING/truthPhotonAllConv/", rootHistSvc);
279 
281  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
282  "truthPhotonAllLateConv", "truthPhotonAllLateConv",
283  "/MONITORING/truthPhotonAllLateConv/", rootHistSvc);
284 
285  // Reco and truth-matched
287  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
288  "truthPhotonRecoPhoton", "truthPhotonRecoPhoton",
289  "/MONITORING/truthPhotonRecoPhoton/", rootHistSvc);
290 
292  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
293  "truthPhotonRecoPhotonOrElectron",
294  "truthPhotonRecoPhotonOrElectron",
295  "/MONITORING/truthPhotonRecoPhotonOrElectron/", rootHistSvc);
296 
298  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
299  "truthConvPhoton", "truthConvPhoton",
300  "/MONITORING/truthConvPhoton/", rootHistSvc);
301 
303  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
304  "truthConvRecoConv", "truthConvRecoConv",
305  "/MONITORING/truthConvRecoConv/", rootHistSvc);
306 
308  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
309  "truthConvRecoConv1Si", "truthConvRecoConv1Si",
310  "/MONITORING/truthConvRecoConv1Si/", rootHistSvc);
311 
313  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
314  "truthConvRecoConv2Si", "truthConvRecoConv2Si",
315  "/MONITORING/truthConvRecoConv2Si/", rootHistSvc);
316 
318  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
319  "truthConvRecoUnconv", "truthConvRecoUnconv",
320  "/MONITORING/truthConvRecoUnconv/", rootHistSvc);
321 
323  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
324  "truthUnconvPhoton", "truthUnconvPhoton",
325  "/MONITORING/truthUnconvPhoton/", rootHistSvc);
326 
328  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
329  "truthUnconvRecoConv", "truthUnconvRecoConv",
330  "/MONITORING/truthUnconvRecoConv/", rootHistSvc);
331 
333  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
334  "truthUnconvRecoConv1Si", "truthUnconvRecoConv1Si",
335  "/MONITORING/truthUnconvRecoConv1Si/", rootHistSvc);
336 
338  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
339  "truthUnconvRecoConv2Si", "truthUnconvRecoConv2Si",
340  "/MONITORING/truthUnconvRecoConv2Si/", rootHistSvc);
341 
343  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
344  "truthUnconvRecoUnconv", "truthUnconvRecoUnconv",
345  "/MONITORING/truthUnconvRecoUnconv/", rootHistSvc);
346 
348  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
349  "recoPhotonUnconvLoose", "Loose Photons Reco Photon",
350  "/MONITORING/recoPhotonUnconvLoose/", rootHistSvc);
351 
353  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
354  "recoPhotonUnconvTight", "Tight Photons Reco Photon",
355  "/MONITORING/recoPhotonUnconvTight/", rootHistSvc);
356 
358  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
359  "recoPhotonConvLoose", "Loose Photons Reco Photon",
360  "/MONITORING/recoPhotonConvLoose/", rootHistSvc);
361 
363  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
364  "recoPhotonConvTight", "Tight Photons Reco Photon",
365  "/MONITORING/recoPhotonConvTight/", rootHistSvc);
366 
368  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
369  "recoPhotonUnconvIsoFixedCutTight",
370  "Isolation Fixed Cut Tight Photons Reco Photon",
371  "/MONITORING/recoPhotonUnconvIsoFixedCutTight/", rootHistSvc);
372 
374  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
375  "recoPhotonUnconvIsoFixedCutTightCaloOnly",
376  "Isolation Fixed Cut Tight Calo Only Photons Reco Photon",
377  "/MONITORING/recoPhotonUnconvIsoFixedCutTightCaloOnly/",
378  rootHistSvc);
379 
381  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
382  "recoPhotonUnconvIsoFixedCutLoose",
383  "Isolation Fixed Cut Loose Photons Reco Photon",
384  "/MONITORING/recoPhotonUnconvIsoFixedCutLoose/", rootHistSvc);
385 
387  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
388  "recoPhotonConvIsoFixedCutTight",
389  "Isolation Fixed Cut Tight Photons Reco Photon",
390  "/MONITORING/recoPhotonConvIsoFixedCutTight/", rootHistSvc);
391 
393  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
394  "recoPhotonConvIsoFixedCutTightCaloOnly",
395  "Isolation Fixed Cut Tight Calo Only Photons Reco Photon",
396  "/MONITORING/recoPhotonConvIsoFixedCutTightCaloOnly/", rootHistSvc);
397 
399  std::make_unique<egammaMonitoring::TruthPhotonHistograms>(
400  "recoPhotonConvIsoFixedCutLoose",
401  "Isolation Fixed Cut Loose Photons Reco Photon",
402  "/MONITORING/recoPhotonConvIsoFixedCutLoose/", rootHistSvc);
403 
404  // for the track monitoring, consider
405  // 4 track types (TRTSA or not, highpt or not) and
406  // 4 truth matching types (all / e / not e / pion / no truth match)
407  static const std::string typeMatch[5] = {"", "MatchElectron", "NotElectron",
408  "MatchPion", "NotMatched"};
409  static const std::string typeTrk[2] = {"", "TRT"};
410  static const std::string ptTrk[2] = {"", "highpT"};
411  static const std::string ctypeMatch[5] = {
412  "", " match to electrons", " not matched to electrons",
413  " match to pions", " not matched"};
414  static const std::string ctypeTrk[2] = {"", " TRTSA"};
415  static const std::string cptTrk[2] = {"", " pT > 3 GeV"};
416 
417  for (int im = 0; im < 5; im++) {
418  std::string mN = typeMatch[im];
419  for (int it = 0; it < (m_hasTRT ? 2 : 1); it++) {
420  std::string tN = typeTrk[it];
421  for (int ip = 0; ip < 2; ip++) {
422  std::string pN = ptTrk[ip];
423 
424  std::string nN =
425  "InDetTracks" + typeTrk[it] + typeMatch[im] + ptTrk[ip];
426  std::string fN = "/MONITORING/" + nN + "/";
427  std::string cN =
428  "InDet Tracks" + ctypeTrk[it] + ctypeMatch[im] + cptTrk[ip];
429 
430  ATH_MSG_INFO("Creating histograms for " << nN);
431  mapTrkHistograms[nN] =
432  std::make_unique<egammaMonitoring::TrackHistograms>(
433  nN.c_str(), cN.c_str(), fN.c_str(), rootHistSvc);
434  ATH_CHECK(mapTrkHistograms[nN]->initializePlots());
435  }
436  }
437  }
438 
439  ATH_CHECK(truthPhotonAll->initializePlots());
440  ATH_CHECK(truthPhotonAllUnconv->initializePlots());
441  ATH_CHECK(truthPhotonAllConv->initializePlots());
442  ATH_CHECK(truthPhotonAllLateConv->initializePlots());
443  ATH_CHECK(truthPhotonRecoPhoton->initializePlots());
444  ATH_CHECK(truthPhotonRecoPhotonOrElectron->initializePlots());
445 
446  ATH_CHECK(truthPhotonConvPhoton->initializePlots());
447  ATH_CHECK(truthPhotonConvRecoConv->initializePlots());
448  ATH_CHECK(truthPhotonConvRecoConv1Si->initializePlots());
449  ATH_CHECK(truthPhotonConvRecoConv2Si->initializePlots());
450  ATH_CHECK(truthPhotonConvRecoUnconv->initializePlots());
451 
452  ATH_CHECK(truthPhotonUnconvPhoton->initializePlots());
453  ATH_CHECK(truthPhotonUnconvRecoConv->initializePlots());
454  ATH_CHECK(truthPhotonUnconvRecoConv1Si->initializePlots());
455  ATH_CHECK(truthPhotonUnconvRecoConv2Si->initializePlots());
456  ATH_CHECK(truthPhotonUnconvRecoUnconv->initializePlots());
457 
458  ATH_CHECK(recoPhotonUnconvLoose->initializePlots());
459  ATH_CHECK(recoPhotonUnconvTight->initializePlots());
460  ATH_CHECK(recoPhotonConvLoose->initializePlots());
461  ATH_CHECK(recoPhotonConvTight->initializePlots());
462  ATH_CHECK(recoPhotonUnconvIsoFixedCutTight->initializePlots());
464  ATH_CHECK(recoPhotonUnconvIsoFixedCutLoose->initializePlots());
465  ATH_CHECK(recoPhotonConvIsoFixedCutTight->initializePlots());
467  ATH_CHECK(recoPhotonConvIsoFixedCutLoose->initializePlots());
468 
469  } // gamma Hists
470 
471  if (m_sampleType != "gamma") {
474  }
475 
476  if ("electron" == m_sampleType) {
477  //*****************ID selectors (3 levels)********************
478  ATH_CHECK(m_Loose_Ele.retrieve());
479  ATH_CHECK(m_Medium_Ele.retrieve());
480  ATH_CHECK(m_Tight_Ele.retrieve());
481 
483 
484  if (!m_FwdElectronsKey.empty()) {
485  m_dR1 = new TH1D("dR1", ";#Delta R;Events", 1000, 0, 0.1);
486  ATH_CHECK(rootHistSvc->regHist("/MONITORING/Check/dR1", m_dR1));
487  m_dR2 = new TH1D("dR2", ";#Delta R;Events", 1000, 0, 0.1);
488  ATH_CHECK(rootHistSvc->regHist("/MONITORING/Check/dR2", m_dR2));
489 
490  ATH_CHECK(m_Loose_FwdEle.retrieve());
491  ATH_CHECK(m_Medium_FwdEle.retrieve());
492  ATH_CHECK(m_Tight_FwdEle.retrieve());
493  }
494  }
495 
496  if ("gamma" == m_sampleType) {
497  //*****************ID selectors (2 levels)********************
498  ATH_CHECK(m_Loose_Photon.retrieve());
499  ATH_CHECK(m_Tight_Photon.retrieve());
500 
501  //*****************Iso Requirements********************
502  ATH_CHECK(m_IsoFixedCutTight.retrieve());
504  ATH_CHECK(m_IsoFixedCutLoose.retrieve());
505 
506  ATH_CHECK(m_PhotonsKey.initialize());
507  }
508 
509  //***************** The handles used whatever the sample********************
512 
513  if (m_sampleType != "dataZ") {
516 
517  //*****************MC Truth Classifier Requirement********************
518  ATH_CHECK(m_mcTruthClassifier.retrieve());
519  }
520 
521  return StatusCode::SUCCESS;
522 }
523 
525 
526  const EventContext &ctx = Gaudi::Hive::currentContext();
527 
528  // Retrieve things from the event store
530  const float mu = eventInfo->averageInteractionsPerCrossing();
531 
532  // Retrieve indet track particles
535 
536  if ("dataZ" == m_sampleType) {
537  return this->ZeeSelection(mu, ctx);
538  }
539 
540  // Retrieve egamma truth particles
542  m_egTruthParticlesKey, ctx);
543 
544  // Retrieve truth particles
546  m_truthParticlesKey, ctx);
547 
548  if ("electron" == m_sampleType) {
549 
553 
554  ATH_MSG_DEBUG("------------ Truth Egamma Container ---------------");
555  for (const auto *egtruth : *egTruthParticles) {
556 
557  if (!egtruth)
558  continue;
559 
560  const xAOD::Electron *electron =
562 
563  if (!electron)
564  continue;
565 
566  clusterPromptAll->fill(*electron, mu);
567  if (egtruth->pt() > 10 * Gaudi::Units::GeV) {
568  clusterPrompt10GeV->fill(*electron, mu);
569  }
570  }
571 
572  ATH_MSG_DEBUG("------------ Truth Particles Container ---------------");
573  unsigned int promptElectronTruthIndex =
575  for (const auto *truth : *truthParticles) {
576 
577  if (!truth)
578  continue;
579  if (std::abs(truth->pdgId()) != 11)
580  continue;
581 
582  auto res = m_mcTruthClassifier->particleTruthClassifier(truth);
585 
586  if (msgLvl(MSG::DEBUG)) {
587 
588  bool haspVtx = truth->hasProdVtx();
589  double rProd = -1;
590  if (haspVtx) {
591  const xAOD::TruthVertex *pvtx = truth->prodVtx();
592  rProd = pvtx->perp();
593  }
594  bool hasdVtx = truth->hasDecayVtx();
595  double rDec = -1;
596  if (hasdVtx) {
597  const xAOD::TruthVertex *dvtx = truth->decayVtx();
598  rDec = dvtx->perp();
599  }
600 
601  ATH_MSG_DEBUG(" ******** Truth electron found: "
602  << truth << " TO " << TO << " TT " << TT
603  << " Rprod = " << rProd << " Rdec = " << rDec
604  << " eventNumber " << eventInfo->eventNumber());
605  }
606 
607  // Check if it is the prompt electron
609  TT == MCTruthPartClassifier::IsoElectron &&
610  MC::isSingleParticle(truth)) {
611  truthPromptElectronAll->fill(truth);
612  promptElectronTruthIndex = truth->index();
613  }
614 
615  // Check that it is not from geant4 (but electron from photon conversion
616  // are kept)
618  truthElectronAll->fill(truth);
619  }
620 
621  ATH_MSG_DEBUG("------------ InDetTracks ---------------");
622 
623  for (const auto *tp : *InDetTPs) {
624 
625  if (!tp)
626  continue;
627 
628  uint8_t nPi = 0;
629  uint8_t nSCT = 0;
630 
631  tp->summaryValue(nPi, xAOD::numberOfPixelHits);
632  tp->summaryValue(nSCT, xAOD::numberOfSCTHits);
633 
634  if ((nPi + nSCT) < 7)
635  continue;
636 
637  const xAOD::TruthParticle *truth =
639 
640  if (!truth || std::abs(truth->pdgId()) != 11)
641  continue;
642 
643  auto res = m_mcTruthClassifier->particleTruthClassifier(truth);
647  TT == MCTruthPartClassifier::IsoElectron &&
648  truth->index() == promptElectronTruthIndex) {
649 
650  // we found the track from the prompt electron
651  // let's count it
652  truthPromptElectronWithTrack->fill(truth);
653  break;
654 
655  } else {
656  const xAOD::TruthParticle *firstElTruth =
658  if (!firstElTruth)
659  continue;
660  // this is not a prompt electron, we need to check the parents
661  // but we need to make sure that we double count if already found the
662  // track foundPromptElectron will check that
663 
664  if (firstElTruth->index() == promptElectronTruthIndex) {
665  truthPromptElectronWithTrack->fill(firstElTruth);
666  break;
667  }
668  }
669  }
670 
671  ATH_MSG_DEBUG("------------ GSFTracks ---------------");
672  for (const auto *gsf : *GSFTracks) {
673 
674  if (!gsf)
675  continue;
676 
677  const xAOD::TruthParticle *truth =
679 
680  if (!truth)
681  continue;
682 
683  uint8_t nPi = 0;
684  uint8_t nSCT = 0;
685 
686  gsf->summaryValue(nPi, xAOD::numberOfPixelHits);
687  gsf->summaryValue(nSCT, xAOD::numberOfSCTHits);
688 
689  if ((nPi + nSCT) < 7)
690  continue;
691 
692  auto res = m_mcTruthClassifier->particleTruthClassifier(truth);
695  if (msgLvl(MSG::DEBUG)) {
696  auto res2 = m_mcTruthClassifier->checkOrigOfBkgElec(truth);
697  MCTruthPartClassifier::ParticleOrigin bkgTO = res2.second;
698  MCTruthPartClassifier::ParticleType bkgTT = res2.first;
699  ATH_MSG_DEBUG(" ** Truth particle associated to track Found: "
700  << truth << " index " << truth->index() << " bkg T0 "
701  << bkgTO << " bkg TT " << bkgTT << " T0 " << TO
702  << " TT " << TT << " eventNumber "
703  << eventInfo->eventNumber());
704  }
706  TT == MCTruthPartClassifier::IsoElectron &&
707  truth->index() == promptElectronTruthIndex) {
708 
709  // we found the track from the prompt electron
710  // let's count it
711  truthPromptElectronWithGSFTrack->fill(truth);
712  break;
713  } else {
714  const xAOD::TruthParticle *firstElTruth =
716  if (!firstElTruth)
717  continue;
718  ATH_MSG_DEBUG("********----- Getting Mother-----********");
719  ATH_MSG_DEBUG(" STATUS " << firstElTruth << " index "
720  << firstElTruth->index());
721  // this is not a prompt electron, we need to check the parents
722  // but we need to make sure that we double count if already found the
723  // track foundPromptElectron will check that
724  if (firstElTruth->index() == promptElectronTruthIndex) {
725  truthPromptElectronWithGSFTrack->fill(firstElTruth);
726  break;
727  }
728  }
729  }
730 
731  ATH_MSG_DEBUG("------------ Reco central electrons ---------------");
732  bool foundPromptElectron = false;
733 
734  for (const auto *elrec : *RecoEl) {
735 
736  if (!elrec)
737  continue;
738 
739  bool toFill = false;
740 
741  clusterAll->fill(*elrec, mu);
742  recoElectronAll->fill(*elrec);
743  showerShapesAll->fill(*elrec);
744  isolationAll->fill(*elrec);
745  if (elrec->pt() > 10 * Gaudi::Units::GeV) {
746  cluster10GeV->fill(*elrec, mu);
747  showerShapes10GeV->fill(*elrec);
748  }
749 
750  const xAOD::TruthParticle *truth =
752  if (!truth)
753  continue;
754  truthElectronRecoElectronAll->fill(truth, elrec);
755  if (std::abs(truth->pdgId()) != 11 || foundPromptElectron)
756  continue;
757  const xAOD::TruthParticle *elTruth(nullptr);
758  auto res = m_mcTruthClassifier->particleTruthClassifier(truth);
762  TT == MCTruthPartClassifier::IsoElectron &&
763  truth->index() == promptElectronTruthIndex) {
764  toFill = true;
765  elTruth = truth;
766  } else {
767  const xAOD::TruthParticle *firstElTruth =
769  if (!firstElTruth)
770  continue;
771  // this is not a prompt electron, we need to check the parents
772  // but we need to make sure that we double count if already found the
773  // track foundPromptElectron will check that
774  if (firstElTruth->index() == promptElectronTruthIndex) {
775  toFill = true;
776  elTruth = firstElTruth;
777  }
778  }
779  if (toFill) {
780  foundPromptElectron = true;
781  truthPromptElectronWithReco->fill(elTruth, elrec);
783  elTruth, elrec); // yes the same. This is different for fwd
784  if (m_Loose_Ele->accept(elrec))
785  truthRecoElectronLoose->fill(elTruth, elrec);
786  if (m_Medium_Ele->accept(elrec))
787  truthRecoElectronMedium->fill(elTruth, elrec);
788  if (m_Tight_Ele->accept(elrec))
789  truthRecoElectronTight->fill(elTruth, elrec);
790  }
791  } // RecoEl Loop
792 
793  if (!m_FwdElectronsKey.empty()) {
795  for (const auto *el : *RecoFwdEl) {
796  // This would be very weird ??
797  if (!el)
798  continue;
799 
800  clusterAll->fill(*el, mu);
801  recoElectronAll->fill(*el);
802  showerShapesAll->fill(*el);
803  if (el->pt() > 10 * Gaudi::Units::GeV) {
804  cluster10GeV->fill(*el, mu);
805  showerShapes10GeV->fill(*el);
806  }
807  bool toFill = false;
808 
809  const xAOD::TruthParticle *truth =
811 
812  if (!truth)
813  continue;
814  // truthElectronRecoFwdElectronAll->fill(truth, elrec); // to be done
815 
816  // if the prompt electron is not too far from the reco candidate, which
817  // might be matched to a photon use this prompt as the matched particle
818  // instead
819  if (std::abs(truth->pdgId()) != 11 &&
820  promptElectronTruthIndex < truthParticles->size()) {
821  const xAOD::TruthParticle *vtruth =
822  truthParticles->at(promptElectronTruthIndex);
823  double dR1 = vtruth->p4().DeltaR(el->caloCluster()->p4());
824  double dR2 = truth->p4().DeltaR(el->caloCluster()->p4());
825  m_dR1->Fill(dR1);
826  m_dR2->Fill(dR2);
827  if (dR1 < 0.05) // threshold to optimize
828  truth = vtruth;
829  }
830 
831  if (std::abs(truth->pdgId()) != 11)
832  continue;
833  const xAOD::TruthParticle *elTruth(nullptr);
834  auto res = m_mcTruthClassifier->particleTruthClassifier(truth);
835  if (res.second == MCTruthPartClassifier::SingleElec &&
836  res.first == MCTruthPartClassifier::IsoElectron &&
837  truth->index() == promptElectronTruthIndex) {
838  toFill = true;
839  elTruth = truth;
840  } else {
841  const xAOD::TruthParticle *firstElTruth =
843  if (!firstElTruth)
844  continue;
845  if (firstElTruth->index() == promptElectronTruthIndex) {
846  toFill = true;
847  elTruth = firstElTruth;
848  }
849  }
850  if (toFill) {
851  if (foundPromptElectron) {
852  ATH_MSG_DEBUG("A fwd electron also reconstructed as central "
853  "true eta = "
854  << elTruth->eta()
855  << " event = " << eventInfo->eventNumber());
856  m_CenFwdOverlap[0]++;
857  if (el->nTrackParticles() > 0)
858  m_CenFwdOverlap[1]++;
859  } else {
860  foundPromptElectron = true;
861  truthPromptElectronWithReco->fill(elTruth, el);
862  if (el->nTrackParticles() > 0)
863  truthPromptElectronWithRecoTrack->fill(elTruth, el);
864  if (m_Loose_FwdEle->accept(el))
865  truthRecoElectronLoose->fill(elTruth, el);
866  if (m_Medium_FwdEle->accept(el))
867  truthRecoElectronMedium->fill(elTruth, el);
868  if (m_Tight_FwdEle->accept(el))
869  truthRecoElectronTight->fill(elTruth, el);
870  }
871  }
872  } // loop on fwdEl
873  }
874 
875  } // if electron
876 
877  if ("gamma" == m_sampleType) {
878 
879  ATH_MSG_DEBUG("------------ Photons ---------------");
881 
882  for (const auto *phrec : *RecoPh) {
883 
884  if (!phrec)
885  continue;
886 
887  recoPhotonAll->fill(*phrec);
888  isolationAll->fill(*phrec);
889  showerShapesAll->fill(*phrec);
890  clusterAll->fill(*phrec, mu);
891  if (phrec->pt() > 10 * Gaudi::Units::GeV) {
892  cluster10GeV->fill(*phrec, mu);
893  showerShapes10GeV->fill(*phrec);
894  }
895 
896  } // RecoPh Loop
897 
898  for (const auto *egtruth : *egTruthParticles) {
899 
900  if (!egtruth)
901  continue;
902 
903  truthPhotonAll->fill(*egtruth, mu);
904 
905  bool isTrueConv = xAOD::EgammaHelpers::isTrueConvertedPhoton(egtruth);
906  bool isTrueLateConv =
908  !isTrueConv;
910  const xAOD::Electron *electron =
912 
913  if (isTrueConv)
914  truthPhotonAllConv->fill(*egtruth, mu);
915  if (isTrueLateConv)
916  truthPhotonAllLateConv->fill(*egtruth, mu);
917  if (!isTrueConv && !isTrueLateConv)
918  truthPhotonAllUnconv->fill(*egtruth, mu);
919 
920  if (photon || electron)
921  truthPhotonRecoPhotonOrElectron->fill(*egtruth, mu);
922 
923  if (!photon)
924  continue;
925 
926  truthPhotonRecoPhoton->fill(*egtruth, mu);
927  clusterPromptAll->fill(*photon, mu);
928  if (egtruth->pt() > 10 * Gaudi::Units::GeV) {
929  clusterPrompt10GeV->fill(*photon, mu);
930  }
931 
935 
936  if (isTrueConv) {
937 
938  truthPhotonConvPhoton->fill(*egtruth, mu);
939 
940  if (isRecoConv) {
941 
942  truthPhotonConvRecoConv->fill(*egtruth, mu);
943 
944  clusterConvPhoton->fill(*photon, mu);
945 
946  if (convType == xAOD::EgammaParameters::singleSi) {
947  truthPhotonConvRecoConv1Si->fill(*egtruth, mu);
948  clusterConvPhotonSi->fill(*photon, mu);
949  } else if (convType == xAOD::EgammaParameters::singleTRT) {
950  truthPhotonConvRecoConv1TRT->fill(*egtruth, mu);
951  clusterConvPhotonTRT->fill(*photon, mu);
952  } else if (convType == xAOD::EgammaParameters::doubleSi) {
953  truthPhotonConvRecoConv2Si->fill(*egtruth, mu);
955  } else if (convType == xAOD::EgammaParameters::doubleTRT) {
956  truthPhotonConvRecoConv2TRT->fill(*egtruth, mu);
958  } else if (convType == xAOD::EgammaParameters::doubleSiTRT) {
959  truthPhotonConvRecoConv2SiTRT->fill(*egtruth, mu);
961  }
962 
963  if (m_IsoFixedCutTight->accept(*photon))
964  recoPhotonConvIsoFixedCutTight->fill(*egtruth, mu);
965  if (m_IsoFixedCutTightCaloOnly->accept(*photon))
967  if (m_IsoFixedCutLoose->accept(*photon))
968  recoPhotonConvIsoFixedCutLoose->fill(*egtruth, mu);
969  if (m_Loose_Photon->accept(photon))
970  recoPhotonConvLoose->fill(*egtruth, mu);
971  if (m_Tight_Photon->accept(photon))
972  recoPhotonConvTight->fill(*egtruth, mu);
973  } // isRecoConv
974  else {
975  truthPhotonConvRecoUnconv->fill(*egtruth, mu);
976  clusterUnconvPhoton->fill(*photon, mu);
977  }
978 
979  } // isTrueConv
980  // else if (!isTrueLateConv) {
981  else {
982 
983  truthPhotonUnconvPhoton->fill(*egtruth, mu);
984 
985  if (isRecoConv) {
986  truthPhotonUnconvRecoConv->fill(*egtruth, mu);
987 
988  if (convType == xAOD::EgammaParameters::singleSi) {
989  truthPhotonUnconvRecoConv1Si->fill(*egtruth, mu);
990  clusterConvPhotonSi->fill(*photon, mu);
991  } else if (convType == xAOD::EgammaParameters::singleTRT) {
992  truthPhotonUnconvRecoConv1TRT->fill(*egtruth, mu);
993  clusterConvPhotonTRT->fill(*photon, mu);
994  } else if (convType == xAOD::EgammaParameters::doubleSi) {
995  truthPhotonUnconvRecoConv2Si->fill(*egtruth, mu);
997  } else if (convType == xAOD::EgammaParameters::doubleTRT) {
998  truthPhotonUnconvRecoConv2TRT->fill(*egtruth, mu);
1000  } else if (convType == xAOD::EgammaParameters::doubleSiTRT) {
1001  truthPhotonUnconvRecoConv2SiTRT->fill(*egtruth, mu);
1002  clusterConvPhotonSiTRT->fill(*photon, mu);
1003  }
1004  } else
1005  truthPhotonUnconvRecoUnconv->fill(*egtruth, mu);
1007 
1008  if (m_IsoFixedCutTight->accept(*photon))
1009  recoPhotonUnconvIsoFixedCutTight->fill(*egtruth, mu);
1010  if (m_IsoFixedCutTightCaloOnly->accept(*photon))
1012  if (m_IsoFixedCutLoose->accept(*photon))
1013  recoPhotonUnconvIsoFixedCutLoose->fill(*egtruth, mu);
1014  if (m_Loose_Photon->accept(photon))
1015  recoPhotonUnconvLoose->fill(*egtruth, mu);
1016  if (m_Tight_Photon->accept(photon))
1017  recoPhotonUnconvTight->fill(*egtruth, mu);
1018  } // !isTrueLateConv
1019  } // egtruth Loop
1020 
1021  // loop over InDetTrackParticles
1022  for (const auto *tp : *InDetTPs) {
1023 
1024  mapTrkHistograms["InDetTracks"]->fill(*tp, mu);
1025  if (matchedToElectron(*tp))
1026  mapTrkHistograms["InDetTracksMatchElectron"]->fill(*tp, mu);
1027  else {
1028  mapTrkHistograms["InDetTracksNotElectron"]->fill(*tp, mu);
1029  if (matchedToPion(*tp))
1030  mapTrkHistograms["InDetTracksMatchPion"]->fill(*tp, mu);
1031  else if (notMatchedToTruth(*tp))
1032  mapTrkHistograms["InDetTracksNotMatched"]->fill(*tp, mu);
1033  }
1034  if (tp->pt() > 3000.) {
1035  mapTrkHistograms["InDetTrackshighpT"]->fill(*tp, mu);
1036  if (matchedToElectron(*tp)) {
1037  mapTrkHistograms["InDetTracksMatchElectronhighpT"]->fill(*tp, mu);
1038  } else {
1039  mapTrkHistograms["InDetTracksNotElectronhighpT"]->fill(*tp, mu);
1040  if (matchedToPion(*tp)) {
1041  mapTrkHistograms["InDetTracksMatchPionhighpT"]->fill(*tp, mu);
1042  } else if (notMatchedToTruth(*tp)) {
1043  mapTrkHistograms["InDetTracksNotMatchedhighpT"]->fill(*tp, mu);
1044  }
1045  }
1046  }
1047 
1048  if (m_hasTRT &&
1049  xAOD::EgammaHelpers::numberOfSiHits(tp) == 0) { // TRTSA tracks
1050  mapTrkHistograms["InDetTracksTRT"]->fill(*tp, mu);
1051  if (matchedToElectron(*tp))
1052  mapTrkHistograms["InDetTracksTRTMatchElectron"]->fill(*tp, mu);
1053  else {
1054  mapTrkHistograms["InDetTracksTRTNotElectron"]->fill(*tp, mu);
1055  if (matchedToPion(*tp))
1056  mapTrkHistograms["InDetTracksTRTMatchPion"]->fill(*tp, mu);
1057  else if (notMatchedToTruth(*tp))
1058  mapTrkHistograms["InDetTracksTRTNotMatched"]->fill(*tp, mu);
1059  }
1060  if (tp->pt() > 3000.) {
1061  mapTrkHistograms["InDetTracksTRThighpT"]->fill(*tp, mu);
1062  if (matchedToElectron(*tp))
1063  mapTrkHistograms["InDetTracksTRTMatchElectronhighpT"]->fill(*tp,
1064  mu);
1065  else {
1066  mapTrkHistograms["InDetTracksTRTNotElectronhighpT"]->fill(*tp, mu);
1067  if (matchedToPion(*tp))
1068  mapTrkHistograms["InDetTracksTRTMatchPionhighpT"]->fill(*tp, mu);
1069  else if (notMatchedToTruth(*tp))
1070  mapTrkHistograms["InDetTracksTRTNotMatchedhighpT"]->fill(*tp, mu);
1071  }
1072  }
1073  }
1074 
1075  } // loop over InDetTPs
1076 
1077  } // if gamma
1078 
1079  return StatusCode::SUCCESS;
1080 }
1081 
1082 // ******
1083 
1085 
1086  if ("electron" == m_sampleType) {
1087 
1088  ATH_MSG_INFO("Number of events with electron reconstructed "
1089  "as both Central and Forward "
1090  << m_CenFwdOverlap[0] << " and with a track for the Forward "
1091  << m_CenFwdOverlap[1]);
1092 
1094  "trackingEfficiency", "/MONITORING/trackingEfficiency/", rootHistSvc);
1096  truthPromptElectronAll.get()));
1097  egammaMonitoring::EfficiencyPlot GSFEfficiency(
1098  "GSFEfficiency", "/MONITORING/GSFEfficiency/", rootHistSvc);
1099  ATH_CHECK(GSFEfficiency.divide(truthPromptElectronWithGSFTrack.get(),
1101  egammaMonitoring::EfficiencyPlot matchingEfficiency(
1102  "matchingEfficiency", "/MONITORING/matchingEfficiency/", rootHistSvc);
1103  ATH_CHECK(matchingEfficiency.divide(truthPromptElectronWithRecoTrack.get(),
1105  egammaMonitoring::EfficiencyPlot reconstructionEfficiency(
1106  "reconstructionEfficiency", "/MONITORING/reconstructionEfficiency/",
1107  rootHistSvc);
1108  ATH_CHECK(reconstructionEfficiency.divide(truthPromptElectronWithReco.get(),
1109  truthPromptElectronAll.get()));
1110  egammaMonitoring::EfficiencyPlot recoElectronLooseEfficiency(
1111  "recoElectronLooseLHEfficiency",
1112  "/MONITORING/recoElectronLooseLHEfficiency/", rootHistSvc);
1113  ATH_CHECK(recoElectronLooseEfficiency.divide(truthRecoElectronLoose.get(),
1114  truthPromptElectronAll.get()));
1115  egammaMonitoring::EfficiencyPlot recoElectronMediumEfficiency(
1116  "recoElectronMediumLHEfficiency",
1117  "/MONITORING/recoElectronMediumLHEfficiency/", rootHistSvc);
1118  ATH_CHECK(recoElectronMediumEfficiency.divide(
1120  egammaMonitoring::EfficiencyPlot recoElectronTightEfficiency(
1121  "recoElectronTightLHEfficiency",
1122  "/MONITORING/recoElectronTightLHEfficiency/", rootHistSvc);
1123  ATH_CHECK(recoElectronTightEfficiency.divide(truthRecoElectronTight.get(),
1124  truthPromptElectronAll.get()));
1125 
1126  }
1127 
1128  else if ("gamma" == m_sampleType) {
1129 
1130  egammaMonitoring::EfficiencyPlot truthPhotonRecoPhotonEfficiency(
1131  "truthPhotonRecoPhotonEfficiency",
1132  "/MONITORING/truthPhotonRecoPhotonEfficiency/", rootHistSvc);
1133  ATH_CHECK(truthPhotonRecoPhotonEfficiency.divide(
1134  truthPhotonRecoPhoton.get(), truthPhotonAll.get()));
1135  egammaMonitoring::EfficiencyPlot truthPhotonRecoPhotonOrElectronEfficiency(
1136  "truthPhotonRecoPhotonOrElectronEfficiency",
1137  "/MONITORING/truthPhotonRecoPhotonOrElectronEfficiency/", rootHistSvc);
1138  ATH_CHECK(truthPhotonRecoPhotonOrElectronEfficiency.divide(
1140  egammaMonitoring::EfficiencyPlot truthPhotonConvRecoEfficiency(
1141  "truthPhotonConvRecoEfficiency",
1142  "/MONITORING/truthPhotonConvRecoEfficiency/", rootHistSvc);
1143  ATH_CHECK(truthPhotonConvRecoEfficiency.divide(truthPhotonConvPhoton.get(),
1144  truthPhotonAllConv.get()));
1145  egammaMonitoring::EfficiencyPlot truthPhotonUnconvRecoEfficiency(
1146  "truthPhotonUnconvRecoEfficiency",
1147  "/MONITORING/truthPhotonUnconvRecoEfficiency/", rootHistSvc);
1148  ATH_CHECK(truthPhotonUnconvRecoEfficiency.divide(
1150  egammaMonitoring::EfficiencyPlot truthPhotonConvRecoConvEfficiency(
1151  "truthPhotonConvRecoConvEfficiency",
1152  "/MONITORING/truthPhotonConvRecoConvEfficiency/", rootHistSvc);
1153  ATH_CHECK(truthPhotonConvRecoConvEfficiency.divide(
1155  egammaMonitoring::EfficiencyPlot truthPhotonConvRecoConv1SiEfficiency(
1156  "truthPhotonConvRecoConv1SiEfficiency",
1157  "/MONITORING/truthPhotonConvRecoConv1SiEfficiency/", rootHistSvc);
1158  ATH_CHECK(truthPhotonConvRecoConv1SiEfficiency.divide(
1160  egammaMonitoring::EfficiencyPlot truthPhotonConvRecoConv2SiEfficiency(
1161  "truthPhotonConvRecoConv2SiEfficiency",
1162  "/MONITORING/truthPhotonConvRecoConv2SiEfficiency/", rootHistSvc);
1163  ATH_CHECK(truthPhotonConvRecoConv2SiEfficiency.divide(
1165  egammaMonitoring::EfficiencyPlot truthPhotonConvRecoUnconvEfficiency(
1166  "truthPhotonConvRecoUnconvEfficiency",
1167  "/MONITORING/truthPhotonConvRecoUnconvEfficiency/", rootHistSvc);
1168  ATH_CHECK(truthPhotonConvRecoUnconvEfficiency.divide(
1170  egammaMonitoring::EfficiencyPlot truthPhotonUnconvRecoConvEfficiency(
1171  "truthPhotonUnconvRecoConvEfficiency",
1172  "/MONITORING/truthPhotonUnconvRecoConvEfficiency/", rootHistSvc);
1173  ATH_CHECK(truthPhotonUnconvRecoConvEfficiency.divide(
1175  egammaMonitoring::EfficiencyPlot truthPhotonUnconvRecoConv1SiEfficiency(
1176  "truthPhotonUnconvRecoConv1SiEfficiency",
1177  "/MONITORING/truthPhotonUnconvRecoConv1SiEfficiency/", rootHistSvc);
1178  ATH_CHECK(truthPhotonUnconvRecoConv1SiEfficiency.divide(
1180  egammaMonitoring::EfficiencyPlot truthPhotonUnconvRecoConv2SiEfficiency(
1181  "truthPhotonUnconvRecoConv2SiEfficiency",
1182  "/MONITORING/truthPhotonUnconvRecoConv2SiEfficiency/", rootHistSvc);
1183  ATH_CHECK(truthPhotonUnconvRecoConv2SiEfficiency.divide(
1185  egammaMonitoring::EfficiencyPlot truthPhotonUnconvRecoUnconvEfficiency(
1186  "truthPhotonUnconvRecoUnconvEfficiency",
1187  "/MONITORING/truthPhotonUnconvRecoUnconvEfficiency/", rootHistSvc);
1188  ATH_CHECK(truthPhotonUnconvRecoUnconvEfficiency.divide(
1190  egammaMonitoring::EfficiencyPlot truthPhotonRecoConvEfficiency(
1191  "truthPhotonRecoConvEfficiency",
1192  "/MONITORING/truthPhotonRecoConvEfficiency/", rootHistSvc);
1193  ATH_CHECK(truthPhotonRecoConvEfficiency.divide(
1195  egammaMonitoring::EfficiencyPlot truthPhotonRecoUnconvEfficiency(
1196  "truthPhotonRecoUnconvEfficiency",
1197  "/MONITORING/truthPhotonRecoUnconvEfficiency/", rootHistSvc);
1198  ATH_CHECK(truthPhotonRecoUnconvEfficiency.divide(
1200  egammaMonitoring::EfficiencyPlot recoPhotonUnconvIsoFixedCutTightEfficiency(
1201  "recoPhotonUnconvIsoFixedCutTightEfficiency",
1202  "/MONITORING/recoPhotonUnconvIsoFixedCutTightEfficiency/", rootHistSvc);
1203  ATH_CHECK(recoPhotonUnconvIsoFixedCutTightEfficiency.divide(
1207  recoPhotonUnconvIsoFixedCutTightCaloOnlyEfficiency(
1208  "recoPhotonUnconvIsoFixedCutTightCaloOnlyEfficiency",
1209  "/MONITORING/recoPhotonUnconvIsoFixedCutTightCaloOnlyEfficiency/",
1210  rootHistSvc);
1211  ATH_CHECK(recoPhotonUnconvIsoFixedCutTightCaloOnlyEfficiency.divide(
1214  egammaMonitoring::EfficiencyPlot recoPhotonUnconvIsoFixedCutLooseEfficiency(
1215  "recoPhotonUnconvIsoFixedCutLooseEfficiency",
1216  "/MONITORING/recoPhotonUnconvIsoFixedCutLooseEfficiency/", rootHistSvc);
1217  ATH_CHECK(recoPhotonUnconvIsoFixedCutLooseEfficiency.divide(
1220  egammaMonitoring::EfficiencyPlot recoPhotonConvIsoFixedCutTightEfficiency(
1221  "recoPhotonConvIsoFixedCutTightEfficiency",
1222  "/MONITORING/recoPhotonConvIsoFixedCutTightEfficiency/", rootHistSvc);
1223  ATH_CHECK(recoPhotonConvIsoFixedCutTightEfficiency.divide(
1226  recoPhotonConvIsoFixedCutTightCaloOnlyEfficiency(
1227  "recoPhotonConvIsoFixedCutTightCaloOnlyEfficiency",
1228  "/MONITORING/recoPhotonConvIsoFixedCutTightCaloOnlyEfficiency/",
1229  rootHistSvc);
1230  ATH_CHECK(recoPhotonConvIsoFixedCutTightCaloOnlyEfficiency.divide(
1232  truthPhotonConvRecoConv.get()));
1233  egammaMonitoring::EfficiencyPlot recoPhotonConvIsoFixedCutLooseEfficiency(
1234  "recoPhotonConvIsoFixedCutLooseEfficiency",
1235  "/MONITORING/recoPhotonConvIsoFixedCutLooseEfficiency/", rootHistSvc);
1236  ATH_CHECK(recoPhotonConvIsoFixedCutLooseEfficiency.divide(
1238  egammaMonitoring::EfficiencyPlot recoPhotonConvLooseEfficiency(
1239  "recoPhotonConvLooseEfficiency",
1240  "/MONITORING/recoPhotonConvLooseEfficiency/", rootHistSvc);
1241  ATH_CHECK(recoPhotonConvLooseEfficiency.divide(
1243  egammaMonitoring::EfficiencyPlot recoPhotonConvTightEfficiency(
1244  "recoPhotonConvTightEfficiency",
1245  "/MONITORING/recoPhotonConvTightEfficiency/", rootHistSvc);
1246  ATH_CHECK(recoPhotonConvTightEfficiency.divide(
1248  egammaMonitoring::EfficiencyPlot recoPhotonUnconvLooseEfficiency(
1249  "recoPhotonUnconvLooseEfficiency",
1250  "/MONITORING/recoPhotonUnconvLooseEfficiency/", rootHistSvc);
1251  ATH_CHECK(recoPhotonUnconvLooseEfficiency.divide(
1253  egammaMonitoring::EfficiencyPlot recoPhotonUnconvTightEfficiency(
1254  "recoPhotonUnconvTightEfficiency",
1255  "/MONITORING/recoPhotonUnconvTightEfficiency/", rootHistSvc);
1256  ATH_CHECK(recoPhotonUnconvTightEfficiency.divide(
1258 
1259  egammaMonitoring::WidthPlot truthPhotonRecoPhotonWidth(
1260  "truthPhotonRecoPhotonWidth", "/MONITORING/truthPhotonRecoPhotonWidth/",
1261  rootHistSvc);
1262  ATH_CHECK(truthPhotonRecoPhotonWidth.fill(truthPhotonRecoPhoton.get()));
1263  egammaMonitoring::WidthPlot truthPhotonConvPhotonWidth(
1264  "truthPhotonConvPhotonWidth", "/MONITORING/truthPhotonConvPhotonWidth/",
1265  rootHistSvc);
1266  ATH_CHECK(truthPhotonConvPhotonWidth.fill(truthPhotonConvPhoton.get()));
1267  egammaMonitoring::WidthPlot truthPhotonConvRecoConvWidth(
1268  "truthPhotonConvRecoConvWidth",
1269  "/MONITORING/truthPhotonConvRecoConvWidth/", rootHistSvc);
1270  ATH_CHECK(truthPhotonConvRecoConvWidth.fill(truthPhotonConvRecoConv.get()));
1271  egammaMonitoring::WidthPlot truthPhotonConvRecoConv1SiWidth(
1272  "truthPhotonConvRecoConv1SiWidth",
1273  "/MONITORING/truthPhotonConvRecoConv1SiWidth/", rootHistSvc);
1274  ATH_CHECK(
1275  truthPhotonConvRecoConv1SiWidth.fill(truthPhotonConvRecoConv1Si.get()));
1276  egammaMonitoring::WidthPlot truthPhotonConvRecoConv2SiWidth(
1277  "truthPhotonConvRecoConv2SiWidth",
1278  "/MONITORING/truthPhotonConvRecoConv2SiWidth/", rootHistSvc);
1279  ATH_CHECK(
1280  truthPhotonConvRecoConv2SiWidth.fill(truthPhotonConvRecoConv2Si.get()));
1281  if (m_hasTRT) {
1282  egammaMonitoring::EfficiencyPlot truthPhotonConvRecoConv1TRTEfficiency(
1283  "truthPhotonConvRecoConv1TRTEfficiency",
1284  "/MONITORING/truthPhotonConvRecoConv1TRTEfficiency/", rootHistSvc);
1285  ATH_CHECK(truthPhotonConvRecoConv1TRTEfficiency.divide(
1287  egammaMonitoring::EfficiencyPlot truthPhotonConvRecoConv2TRTEfficiency(
1288  "truthPhotonConvRecoConv2TRTEfficiency",
1289  "/MONITORING/truthPhotonConvRecoConv2TRTEfficiency/", rootHistSvc);
1290  ATH_CHECK(truthPhotonConvRecoConv2TRTEfficiency.divide(
1292  egammaMonitoring::EfficiencyPlot truthPhotonConvRecoConv2SiTRTEfficiency(
1293  "truthPhotonConvRecoConv2SiTRTEfficiency",
1294  "/MONITORING/truthPhotonConvRecoConv2SiTRTEfficiency/", rootHistSvc);
1295  ATH_CHECK(truthPhotonConvRecoConv2SiTRTEfficiency.divide(
1297  egammaMonitoring::EfficiencyPlot truthPhotonUnconvRecoConv1TRTEfficiency(
1298  "truthPhotonUnconvRecoConv1TRTEfficiency",
1299  "/MONITORING/truthPhotonUnconvRecoConv1TRTEfficiency/", rootHistSvc);
1300  ATH_CHECK(truthPhotonUnconvRecoConv1TRTEfficiency.divide(
1302  egammaMonitoring::EfficiencyPlot truthPhotonUnconvRecoConv2TRTEfficiency(
1303  "truthPhotonUnconvRecoConv2TRTEfficiency",
1304  "/MONITORING/truthPhotonUnconvRecoConv2TRTEfficiency/", rootHistSvc);
1305  ATH_CHECK(truthPhotonUnconvRecoConv2TRTEfficiency.divide(
1308  truthPhotonUnconvRecoConv2SiTRTEfficiency(
1309  "truthPhotonUnconvRecoConv2SiTRTEfficiency",
1310  "/MONITORING/truthPhotonUnconvRecoConv2SiTRTEfficiency/",
1311  rootHistSvc);
1312  ATH_CHECK(truthPhotonUnconvRecoConv2SiTRTEfficiency.divide(
1314  truthPhotonUnconvPhoton.get()));
1315  egammaMonitoring::WidthPlot truthPhotonConvRecoConv1TRTWidth(
1316  "truthPhotonConvRecoConv1TRTWidth",
1317  "/MONITORING/truthPhotonConvRecoConv1TRTWidth/", rootHistSvc);
1318  ATH_CHECK(truthPhotonConvRecoConv1TRTWidth.fill(
1320  egammaMonitoring::WidthPlot truthPhotonConvRecoConv2TRTWidth(
1321  "truthPhotonConvRecoConv2TRTWidth",
1322  "/MONITORING/truthPhotonConvRecoConv2TRTWidth/", rootHistSvc);
1323  ATH_CHECK(truthPhotonConvRecoConv2TRTWidth.fill(
1325  egammaMonitoring::WidthPlot truthPhotonConvRecoConv2SiTRTWidth(
1326  "truthPhotonConvRecoConv2SiTRTWidth",
1327  "/MONITORING/truthPhotonConvRecoConv2SiTRTWidth/", rootHistSvc);
1328  ATH_CHECK(truthPhotonConvRecoConv2SiTRTWidth.fill(
1330  }
1331  egammaMonitoring::WidthPlot truthPhotonConvRecoUnconvWidth(
1332  "truthPhotonConvRecoUnconvWidth",
1333  "/MONITORING/truthPhotonConvRecoUnconvWidth/", rootHistSvc);
1334  ATH_CHECK(
1335  truthPhotonConvRecoUnconvWidth.fill(truthPhotonConvRecoUnconv.get()));
1336  egammaMonitoring::WidthPlot truthPhotonUnconvPhotonWidth(
1337  "truthPhotonUnconvPhotonWidth",
1338  "/MONITORING/truthPhotonUnconvPhotonWidth/", rootHistSvc);
1339  ATH_CHECK(truthPhotonUnconvPhotonWidth.fill(truthPhotonUnconvPhoton.get()));
1340  egammaMonitoring::WidthPlot truthPhotonUnconvRecoConvWidth(
1341  "truthPhotonUnconvRecoConvWidth",
1342  "/MONITORING/truthPhotonUnconvRecoConvWidth/", rootHistSvc);
1343  ATH_CHECK(
1344  truthPhotonUnconvRecoConvWidth.fill(truthPhotonUnconvRecoConv.get()));
1345  egammaMonitoring::WidthPlot truthPhotonUnconvRecoUnconvWidth(
1346  "truthPhotonUnconvRecoUnconvWidth",
1347  "/MONITORING/truthPhotonUnconvRecoUnconvWidth/", rootHistSvc);
1348  ATH_CHECK(truthPhotonUnconvRecoUnconvWidth.fill(
1350  } else if ("dataZ" == m_sampleType) {
1352  }
1353 
1354  return StatusCode::SUCCESS;
1355 }
1356 
1359  return truth && abs(truth->pdgId()) == 11;
1360 }
1361 
1364  return truth && abs(truth->pdgId()) == 211;
1365 }
1366 
1369  return !truth;
1370 }
1371 
1372 StatusCode EgammaMonitoring::ZeeSelection(float mu, const EventContext &ctx) {
1375  ctx);
1376 
1377  const xAOD::Electron *e1 = nullptr, *e2 = nullptr;
1378  double pTL = -9e9, pTSL = -9e9;
1379  for (const auto *el : *RecoEl) {
1380  double pt = el->pt();
1381  if (pt < 15e3)
1382  continue;
1383  if (pt > pTL) {
1384  e2 = e1;
1385  pTSL = pTL;
1386  e1 = el;
1387  pTL = pt;
1388  } else if (pt > pTSL) {
1389  e2 = el;
1390  pTSL = pt;
1391  }
1392  }
1393 
1394  if (!e2)
1395  return StatusCode::SUCCESS;
1396 
1397  m_diElectron->fill(*e1, *e2, mu);
1398 
1399  m_clusterReco->fill(*e1);
1400  m_clusterReco->fill(*e2);
1401  recoElectronAll->fill(*e1);
1402  recoElectronAll->fill(*e2);
1403 
1404  showerShapesAll->fill(*e1);
1405  showerShapesAll->fill(*e2);
1406  if (e1->pt() > 10 * Gaudi::Units::GeV)
1407  showerShapes10GeV->fill(*e1);
1408  if (e2->pt() > 10 * Gaudi::Units::GeV)
1409  showerShapes10GeV->fill(*e2);
1410  isolationAll->fill(*e1);
1411  isolationAll->fill(*e2);
1412 
1413  return StatusCode::SUCCESS;
1414 }
1415 
1417 
1418  TH1D *hRef = (TH1D *)m_diElectron->histoMap["mass"];
1419  double xmi = 66, xma = 116, eps = 0.01;
1420  int ib1 = hRef->FindBin(xmi + eps);
1421  int ib2 = hRef->FindBin(xma - eps);
1422  TH1D *hmee = new TH1D("mee", ";m_{ee} [GeV];Events / 0.5 GeV", ib2 - ib1 + 1,
1423  xmi, xma);
1424  for (int ib = ib1; ib <= ib2; ib++) {
1425  double c = hRef->GetBinContent(ib);
1426  double ec = hRef->GetBinError(ib);
1427  hmee->SetBinContent(ib - ib1 + 1, c);
1428  hmee->SetBinError(ib - ib1 + 1, ec);
1429  }
1430  ATH_CHECK(rootHistSvc->regHist("/MONITORING/Data/mee", hmee));
1431 
1432  TString vsX[3] = {"Et", "Etetale0p8", "Eta"};
1433  TString coo[3] = {"x", "x", "y"};
1434  for (int iL = 0; iL < 5; iL++) {
1435  TH3D *nRef;
1436  if (iL < 4)
1437  nRef = m_clusterReco->m_histo3DMap[Form("hNcellsvseteta_Lr%i", iL)];
1438  else
1439  nRef = recoElectronAll->histo3DMap["eteta_eop"];
1440  for (int iX = 0; iX < 3; iX++) {
1441  if (iL == 4 && iX == 2)
1442  continue;
1443  // nCells vs eta
1444  if (iX == 1) {
1445  int ieta08 = nRef->GetYaxis()->FindBin(0.79);
1446  nRef->GetYaxis()->SetRange(1, ieta08);
1447  } else if (iX == 2) {
1448  nRef->GetYaxis()->SetRange(1, 25);
1449  }
1450  TH2D *nRefvsX = (TH2D *)nRef->Project3D(Form("z%s", coo[iX].Data()));
1451  TString pN;
1452  if (iL < 4)
1453  pN = Form("pn%ivs%s", iL, vsX[iX].Data());
1454  else
1455  pN = Form("pEopvs%s", vsX[iX].Data());
1456  TProfile *pRefvsX = nRefvsX->ProfileX(pN.Data());
1457  pRefvsX->SetTitle(pN.Data());
1458  pRefvsX->GetXaxis()->SetTitle(iX < 2 ? "E_{T} [GeV]" : "|#eta|");
1459  pRefvsX->GetYaxis()->SetTitle(iL < 4 ? Form("nCells_Lr%i", iL) : "E/p");
1460  ATH_CHECK(rootHistSvc->regHist(
1461  Form("/MONITORING/Data/%s", pRefvsX->GetName()), pRefvsX));
1462  delete nRefvsX;
1463  }
1464  }
1465  return StatusCode::SUCCESS;
1466 }
EgammaMonitoring::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: EgammaMonitoring.h:196
EgammaMonitoring::recoPhotonConvTight
std::unique_ptr< egammaMonitoring::IHistograms > recoPhotonConvTight
Definition: EgammaMonitoring.h:128
EgammaMonitoring::truthPhotonUnconvRecoConv
std::unique_ptr< egammaMonitoring::IHistograms > truthPhotonUnconvRecoConv
Definition: EgammaMonitoring.h:117
EgammaMonitoring::m_IsoFixedCutTight
ToolHandle< CP::IIsolationSelectionTool > m_IsoFixedCutTight
Definition: EgammaMonitoring.h:184
EgammaMonitoring::mapTrkHistograms
std::map< std::string, std::unique_ptr< egammaMonitoring::TrackHistograms > > mapTrkHistograms
Definition: EgammaMonitoring.h:140
xAOD::EgammaHelpers::getRecoPhoton
const xAOD::Photon * getRecoPhoton(const xAOD::TruthParticle *particle)
return the reco photon associated to the given TruthParticle (if any)
Definition: EgammaTruthxAODHelpers.cxx:54
EgammaMonitoring::truthPhotonConvRecoUnconv
std::unique_ptr< egammaMonitoring::IHistograms > truthPhotonConvRecoUnconv
Definition: EgammaMonitoring.h:115
max
#define max(a, b)
Definition: cfImp.cxx:41
EgammaMonitoring::truthPhotonUnconvRecoUnconv
std::unique_ptr< egammaMonitoring::IHistograms > truthPhotonUnconvRecoUnconv
Definition: EgammaMonitoring.h:124
EgammaMonitoring::m_IsoFixedCutLoose
ToolHandle< CP::IIsolationSelectionTool > m_IsoFixedCutLoose
Definition: EgammaMonitoring.h:188
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
EgammaMonitoring::clusterPrompt10GeV
std::unique_ptr< egammaMonitoring::ClusterHistograms > clusterPrompt10GeV
Definition: EgammaMonitoring.h:58
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:575
xAOD::EventInfo_v1::eventNumber
uint64_t eventNumber() const
The current event's event number.
TH3D
Definition: rootspy.cxx:505
EgammaMonitoring::matchedToPion
static bool matchedToPion(const xAOD::TrackParticle &tp)
Definition: EgammaMonitoring.cxx:1362
EgammaMonitoring::recoPhotonUnconvLoose
std::unique_ptr< egammaMonitoring::IHistograms > recoPhotonUnconvLoose
Definition: EgammaMonitoring.h:125
egammaEnergyPositionAllSamples::e1
double e1(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 1st sampling
EgammaMonitoring::notMatchedToTruth
static bool notMatchedToTruth(const xAOD::TrackParticle &tp)
Definition: EgammaMonitoring.cxx:1367
EgammaMonitoring::recoPhotonConvIsoFixedCutTight
std::unique_ptr< egammaMonitoring::IHistograms > recoPhotonConvIsoFixedCutTight
Definition: EgammaMonitoring.h:135
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
EgammaMonitoring::truthPhotonAllConv
std::unique_ptr< egammaMonitoring::IHistograms > truthPhotonAllConv
Definition: EgammaMonitoring.h:103
Data
@ Data
Definition: BaseObject.h:11
EgammaMonitoring::m_egTruthParticlesKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_egTruthParticlesKey
Definition: EgammaMonitoring.h:199
skel.it
it
Definition: skel.GENtoEVGEN.py:423
EgammaMonitoring::truthPhotonConvRecoConv
std::unique_ptr< egammaMonitoring::IHistograms > truthPhotonConvRecoConv
Definition: EgammaMonitoring.h:109
TH1D
Definition: rootspy.cxx:342
test_pyathena.pt
pt
Definition: test_pyathena.py:11
PlotCalibFromCool.ib
ib
Definition: PlotCalibFromCool.py:419
EgammaMonitoring::m_Medium_FwdEle
ToolHandle< IAsgElectronLikelihoodTool > m_Medium_FwdEle
Definition: EgammaMonitoring.h:172
python.atlas_oh.im
im
Definition: atlas_oh.py:167
ParticleTest.tp
tp
Definition: ParticleTest.py:25
SingleElec
@ SingleElec
Definition: TruthClasses.h:54
AthCommonMsg< Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
EgammaMonitoring::truthPhotonUnconvRecoConv2TRT
std::unique_ptr< egammaMonitoring::IHistograms > truthPhotonUnconvRecoConv2TRT
Definition: EgammaMonitoring.h:121
xAOD::numberOfPixelHits
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
Definition: TrackingPrimitives.h:259
xAOD::EgammaParameters::ConversionType
ConversionType
Definition: EgammaEnums.h:268
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
xAODTruthHelpers.h
python.compareTCTs.nRef
nRef
Definition: compareTCTs.py:115
EgammaMonitoring::m_truthParticlesKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticlesKey
Definition: EgammaMonitoring.h:202
EgammaMonitoring::m_mcTruthClassifier
ToolHandle< IMCTruthClassifier > m_mcTruthClassifier
Definition: EgammaMonitoring.h:192
EgammaMonitoring::ZeeSelection
StatusCode ZeeSelection(float mu, const EventContext &ctx)
Definition: EgammaMonitoring.cxx:1372
EgammaMonitoring::m_GSFTrackParticlesKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_GSFTrackParticlesKey
Definition: EgammaMonitoring.h:217
EgammaMonitoring::execute
virtual StatusCode execute()
Definition: EgammaMonitoring.cxx:524
xAOD::EgammaHelpers::getBkgElectronMother
const xAOD::TruthParticle * getBkgElectronMother(const xAOD::Electron *el, const bool allTheWayBack=true)
Helper wrapper function for calling the function below that accepts truth input.
Definition: EgammaTruthxAODHelpers.cxx:91
EFTrackingSmearingConfig.trackEfficiency
trackEfficiency
Definition: EFTrackingSmearingConfig.py:72
EgammaMonitoring::m_PhotonsKey
SG::ReadHandleKey< xAOD::PhotonContainer > m_PhotonsKey
Definition: EgammaMonitoring.h:211
EgammaMonitoring::recoPhotonUnconvIsoFixedCutLoose
std::unique_ptr< egammaMonitoring::IHistograms > recoPhotonUnconvIsoFixedCutLoose
Definition: EgammaMonitoring.h:134
EgammaMonitoring::truthPromptElectronWithGSFTrack
std::unique_ptr< egammaMonitoring::TruthElectronHistograms > truthPromptElectronWithGSFTrack
Definition: EgammaMonitoring.h:79
EgammaMonitoring::m_Tight_Photon
ToolHandle< IAsgPhotonIsEMSelector > m_Tight_Photon
Definition: EgammaMonitoring.h:180
TH1D::GetBinContent
double GetBinContent(int) const
Definition: rootspy.cxx:347
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Egamma.h
EgammaMonitoring::clusterAll
std::unique_ptr< egammaMonitoring::ClusterHistograms > clusterAll
Definition: EgammaMonitoring.h:54
EgammaMonitoring::truthPromptElectronWithRecoTrack
std::unique_ptr< egammaMonitoring::TruthElectronHistograms > truthPromptElectronWithRecoTrack
Definition: EgammaMonitoring.h:83
EgammaMonitoring::truthRecoElectronTight
std::unique_ptr< egammaMonitoring::TruthElectronHistograms > truthRecoElectronTight
Definition: EgammaMonitoring.h:89
EgammaxAODHelpers.h
xAOD::EgammaHelpers::isConvertedPhoton
bool isConvertedPhoton(const xAOD::Egamma *eg, bool excludeTRT=false)
is the object a converted photon
Definition: EgammaxAODHelpers.cxx:25
EgammaMonitoring::truthPhotonUnconvPhoton
std::unique_ptr< egammaMonitoring::IHistograms > truthPhotonUnconvPhoton
Definition: EgammaMonitoring.h:116
EgammaMonitoring::truthPhotonConvRecoConv2Si
std::unique_ptr< egammaMonitoring::IHistograms > truthPhotonConvRecoConv2Si
Definition: EgammaMonitoring.h:112
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
EgammaMonitoring::truthPhotonUnconvRecoConv1TRT
std::unique_ptr< egammaMonitoring::IHistograms > truthPhotonUnconvRecoConv1TRT
Definition: EgammaMonitoring.h:119
EgammaMonitoring::m_Tight_Ele
ToolHandle< IAsgElectronLikelihoodTool > m_Tight_Ele
Definition: EgammaMonitoring.h:168
EgammaMonitoring::m_diElectron
std::unique_ptr< egammaMonitoring::DiObjectHistograms > m_diElectron
Definition: EgammaMonitoring.h:67
EgammaMonitoring::m_dR1
TH1D * m_dR1
Definition: EgammaMonitoring.h:228
EgammaMonitoring::showerShapes10GeV
std::unique_ptr< egammaMonitoring::ShowerShapesHistograms > showerShapes10GeV
Definition: EgammaMonitoring.h:62
EgammaMonitoring::ZeePostProc
StatusCode ZeePostProc()
Definition: EgammaMonitoring.cxx:1416
EgammaMonitoring::recoElectronAll
std::unique_ptr< egammaMonitoring::RecoElectronHistograms > recoElectronAll
Definition: EgammaMonitoring.h:70
Photon.h
EgammaMonitoring::m_Tight_FwdEle
ToolHandle< IAsgElectronLikelihoodTool > m_Tight_FwdEle
Definition: EgammaMonitoring.h:174
EgammaMonitoring::recoPhotonUnconvIsoFixedCutTightCaloOnly
std::unique_ptr< egammaMonitoring::IHistograms > recoPhotonUnconvIsoFixedCutTightCaloOnly
Definition: EgammaMonitoring.h:132
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
EgammaMonitoring::m_CenFwdOverlap
int m_CenFwdOverlap[2]
Definition: EgammaMonitoring.h:226
ParticleOrigin
ParticleOrigin
Definition: TruthClasses.h:51
EgammaMonitoring::truthPhotonUnconvRecoConv1Si
std::unique_ptr< egammaMonitoring::IHistograms > truthPhotonUnconvRecoConv1Si
Definition: EgammaMonitoring.h:118
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
EgammaMonitoring::isolationAll
std::unique_ptr< egammaMonitoring::IsolationHistograms > isolationAll
Definition: EgammaMonitoring.h:63
EgammaMonitoring::clusterConvPhotonSi
std::unique_ptr< egammaMonitoring::ClusterHistograms > clusterConvPhotonSi
Definition: EgammaMonitoring.h:93
xAOD::TruthVertex_v1::perp
float perp() const
Vertex transverse distance from the beam line.
Definition: TruthVertex_v1.cxx:165
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
EgammaMonitoring::clusterPromptAll
std::unique_ptr< egammaMonitoring::ClusterHistograms > clusterPromptAll
Definition: EgammaMonitoring.h:57
xAOD::EgammaParameters::doubleSi
@ doubleSi
two tracks, both with Si hits
Definition: EgammaEnums.h:279
EgammaMonitoring::initialize
virtual StatusCode initialize()
Definition: EgammaMonitoring.cxx:30
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
EgammaMonitoring::m_dR2
TH1D * m_dR2
Definition: EgammaMonitoring.h:229
EgammaMonitoring::truthPromptElectronAll
std::unique_ptr< egammaMonitoring::TruthElectronHistograms > truthPromptElectronAll
Definition: EgammaMonitoring.h:73
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
EgammaMonitoring::showerShapesAll
std::unique_ptr< egammaMonitoring::ShowerShapesHistograms > showerShapesAll
Definition: EgammaMonitoring.h:61
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
EgammaMonitoring::m_IsoFixedCutTightCaloOnly
ToolHandle< CP::IIsolationSelectionTool > m_IsoFixedCutTightCaloOnly
Definition: EgammaMonitoring.h:186
EgammaMonitoring::clusterUnconvPhoton
std::unique_ptr< egammaMonitoring::ClusterHistograms > clusterUnconvPhoton
Definition: EgammaMonitoring.h:98
EgammaMonitoring::matchedToElectron
static bool matchedToElectron(const xAOD::TrackParticle &tp)
Definition: EgammaMonitoring.cxx:1357
TH2D
Definition: rootspy.cxx:430
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
MC::isSingleParticle
bool isSingleParticle(const T &p)
Definition: HepMCHelpers.h:55
EgammaMonitoring::truthPhotonAllUnconv
std::unique_ptr< egammaMonitoring::IHistograms > truthPhotonAllUnconv
Definition: EgammaMonitoring.h:102
EgammaMonitoring::clusterConvPhoton
std::unique_ptr< egammaMonitoring::ClusterHistograms > clusterConvPhoton
Definition: EgammaMonitoring.h:92
SG::AuxElement::index
size_t index() const
Return the index of this element within its container.
EgammaMonitoring::m_sampleType
Gaudi::Property< std::string > m_sampleType
Sample name ///.
Definition: EgammaMonitoring.h:155
EgammaMonitoring::truthPhotonConvRecoConv2SiTRT
std::unique_ptr< egammaMonitoring::IHistograms > truthPhotonConvRecoConv2SiTRT
Definition: EgammaMonitoring.h:114
EgammaMonitoring::truthPhotonAll
std::unique_ptr< egammaMonitoring::IHistograms > truthPhotonAll
Definition: EgammaMonitoring.h:101
EgammaMonitoring::truthPhotonAllLateConv
std::unique_ptr< egammaMonitoring::IHistograms > truthPhotonAllLateConv
Definition: EgammaMonitoring.h:104
EgammaMonitoring::clusterConvPhotonSiSi
std::unique_ptr< egammaMonitoring::ClusterHistograms > clusterConvPhotonSiSi
Definition: EgammaMonitoring.h:94
EgammaMonitoring::recoPhotonConvIsoFixedCutLoose
std::unique_ptr< egammaMonitoring::IHistograms > recoPhotonConvIsoFixedCutLoose
Definition: EgammaMonitoring.h:138
xAOD::EgammaParameters::doubleSiTRT
@ doubleSiTRT
two tracks, only one with Si hits
Definition: EgammaEnums.h:285
EgammaMonitoring::clusterConvPhotonTRTTRT
std::unique_ptr< egammaMonitoring::ClusterHistograms > clusterConvPhotonTRTTRT
Definition: EgammaMonitoring.h:96
AthAlgorithm
Definition: AthAlgorithm.h:47
xAOD::EgammaParameters::singleTRT
@ singleTRT
one track only, no Si hits (TRT only)
Definition: EgammaEnums.h:276
EgammaMonitoring::truthPhotonUnconvRecoConv2Si
std::unique_ptr< egammaMonitoring::IHistograms > truthPhotonUnconvRecoConv2Si
Definition: EgammaMonitoring.h:120
EgammaMonitoring::truthPhotonRecoPhoton
std::unique_ptr< egammaMonitoring::IHistograms > truthPhotonRecoPhoton
Definition: EgammaMonitoring.h:105
TruthVertex.h
egammaMonitoring::WidthPlot::fill
StatusCode fill(IHistograms *input)
Definition: WidthPlot.cxx:24
EgammaMonitoring::truthPhotonConvRecoConv2TRT
std::unique_ptr< egammaMonitoring::IHistograms > truthPhotonConvRecoConv2TRT
Definition: EgammaMonitoring.h:113
EgammaMonitoring::m_InDetTrackParticlesKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_InDetTrackParticlesKey
Definition: EgammaMonitoring.h:214
xAOD::EventInfo_v1::averageInteractionsPerCrossing
float averageInteractionsPerCrossing() const
Average interactions per crossing for all BCIDs - for out-of-time pile-up.
Definition: EventInfo_v1.cxx:397
xAOD::EgammaHelpers::isTrueConvertedPhoton
bool isTrueConvertedPhoton(const xAOD::Photon *ph, float maxRadius=800.)
is the object matched to a true converted photon with R < maxRadius
Definition: EgammaTruthxAODHelpers.cxx:69
xAOD::TruthVertex_v1
Class describing a truth vertex in the MC record.
Definition: TruthVertex_v1.h:41
EgammaMonitoring::m_Medium_Ele
ToolHandle< IAsgElectronLikelihoodTool > m_Medium_Ele
Definition: EgammaMonitoring.h:166
EgammaMonitoring::m_FwdElectronsKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_FwdElectronsKey
Definition: EgammaMonitoring.h:208
xAOD::EgammaParameters::singleSi
@ singleSi
one track only, with Si hits
Definition: EgammaEnums.h:273
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
EgammaMonitoring::m_hasTRT
Gaudi::Property< bool > m_hasTRT
is it run 3 or run 4 and later ?
Definition: EgammaMonitoring.h:159
xAOD::TruthHelpers::getTruthParticle
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle &p)
Return the truthParticle associated to the given IParticle (if any)
Definition: xAODTruthHelpers.cxx:25
TH1D::SetBinContent
void SetBinContent(int, double)
Definition: rootspy.cxx:348
TProfile
Definition: rootspy.cxx:515
EgammaMonitoring::EgammaMonitoring
EgammaMonitoring(const std::string &name, ISvcLocator *pSvcLocator)
Definition: EgammaMonitoring.cxx:24
xAOD::EgammaHelpers::getRecoElectron
const xAOD::Electron * getRecoElectron(const xAOD::TruthParticle *)
return the reco electron associated to the given TruthParticle (if any)
Definition: EgammaTruthxAODHelpers.cxx:31
EgammaMonitoring::truthElectronRecoElectronAll
std::unique_ptr< egammaMonitoring::TruthElectronHistograms > truthElectronRecoElectronAll
Definition: EgammaMonitoring.h:75
xAOD::TruthParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TruthParticle_v1.cxx:174
EgammaMonitoring.h
xAOD::EgammaHelpers::numberOfSiHits
std::size_t numberOfSiHits(const xAOD::TrackParticle *tp)
return the number of Si hits in the track particle
Definition: ElectronxAODHelpers.cxx:66
xAOD::Electron_v1
Definition: Electron_v1.h:34
EgammaMonitoring::m_Loose_Photon
ToolHandle< IAsgPhotonIsEMSelector > m_Loose_Photon
Definition: EgammaMonitoring.h:178
EgammaMonitoring::recoPhotonAll
std::unique_ptr< egammaMonitoring::RecoPhotonHistograms > recoPhotonAll
Definition: EgammaMonitoring.h:100
EgammaMonitoring::truthPromptElectronWithTrack
std::unique_ptr< egammaMonitoring::TruthElectronHistograms > truthPromptElectronWithTrack
Definition: EgammaMonitoring.h:77
EgammaMonitoring::clusterConvPhotonTRT
std::unique_ptr< egammaMonitoring::ClusterHistograms > clusterConvPhotonTRT
Definition: EgammaMonitoring.h:95
checkCorrelInHIST.iX
int iX
Definition: checkCorrelInHIST.py:491
EgammaMonitoring::truthElectronAll
std::unique_ptr< egammaMonitoring::TruthElectronHistograms > truthElectronAll
Definition: EgammaMonitoring.h:71
EgammaMonitoring::truthPhotonConvPhoton
std::unique_ptr< egammaMonitoring::IHistograms > truthPhotonConvPhoton
Definition: EgammaMonitoring.h:108
xAOD::photon
@ photon
Definition: TrackingPrimitives.h:199
egammaMonitoring::EfficiencyPlot
Definition: EfficiencyPlot.h:14
EgammaMonitoring::finalize
virtual StatusCode finalize()
Definition: EgammaMonitoring.cxx:1084
EgammaMonitoring::truthPhotonConvRecoConv1TRT
std::unique_ptr< egammaMonitoring::IHistograms > truthPhotonConvRecoConv1TRT
Definition: EgammaMonitoring.h:111
xAOD::Photon_v1
Definition: Photon_v1.h:37
EgammaMonitoring::recoPhotonUnconvIsoFixedCutTight
std::unique_ptr< egammaMonitoring::IHistograms > recoPhotonUnconvIsoFixedCutTight
Definition: EgammaMonitoring.h:130
egammaEnergyPositionAllSamples::e2
double e2(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 2nd sampling
EgammaMonitoring::truthPromptElectronWithReco
std::unique_ptr< egammaMonitoring::TruthElectronHistograms > truthPromptElectronWithReco
Definition: EgammaMonitoring.h:81
EgammaMonitoring::truthPhotonConvRecoConv1Si
std::unique_ptr< egammaMonitoring::IHistograms > truthPhotonConvRecoConv1Si
Definition: EgammaMonitoring.h:110
EgammaMonitoring::m_ElectronsKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_ElectronsKey
Definition: EgammaMonitoring.h:205
DEBUG
#define DEBUG
Definition: page_access.h:11
EgammaMonitoring::truthPhotonUnconvRecoConv2SiTRT
std::unique_ptr< egammaMonitoring::IHistograms > truthPhotonUnconvRecoConv2SiTRT
Definition: EgammaMonitoring.h:123
NonPrimary
@ NonPrimary
Definition: TruthClasses.h:29
EgammaMonitoring::clusterConvPhotonSiTRT
std::unique_ptr< egammaMonitoring::ClusterHistograms > clusterConvPhotonSiTRT
Definition: EgammaMonitoring.h:97
egammaMonitoring::WidthPlot
Definition: WidthPlot.h:14
xAOD::EgammaParameters::electron
@ electron
Definition: EgammaEnums.h:18
xAOD::EgammaHelpers::conversionType
xAOD::EgammaParameters::ConversionType conversionType(const xAOD::Photon *ph)
return the photon conversion type (see EgammaEnums)
Definition: PhotonxAODHelpers.cxx:26
EgammaMonitoring::m_clusterReco
std::unique_ptr< egammaMonitoring::RecoClusterHistograms > m_clusterReco
Definition: EgammaMonitoring.h:66
EgammaMonitoring::truthPhotonRecoPhotonOrElectron
std::unique_ptr< egammaMonitoring::IHistograms > truthPhotonRecoPhotonOrElectron
Definition: EgammaMonitoring.h:107
egammaMonitoring::EfficiencyPlot::divide
StatusCode divide(IHistograms *pass, IHistograms *total)
Definition: EfficiencyPlot.cxx:19
xAOD::numberOfSCTHits
@ numberOfSCTHits
number of hits in SCT [unit8_t].
Definition: TrackingPrimitives.h:268
EgammaMonitoring::truthRecoElectronLoose
std::unique_ptr< egammaMonitoring::TruthElectronHistograms > truthRecoElectronLoose
Definition: EgammaMonitoring.h:85
xAOD::EgammaParameters::doubleTRT
@ doubleTRT
two tracks, none with Si hits (TRT only)
Definition: EgammaEnums.h:282
Electron.h
EgammaMonitoring::truthRecoElectronMedium
std::unique_ptr< egammaMonitoring::TruthElectronHistograms > truthRecoElectronMedium
Definition: EgammaMonitoring.h:87
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
xAOD::TruthParticle_v1::p4
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
Definition: TruthParticle_v1.cxx:196
EgammaMonitoring::m_Loose_Ele
ToolHandle< IAsgElectronLikelihoodTool > m_Loose_Ele
Selector tools.
Definition: EgammaMonitoring.h:164
TruthParticle.h
Analysis::TT
@ TT
Definition: JpsiFinder.h:39
xAOD::TruthParticle_v1::pdgId
int pdgId() const
PDG ID code.
EgammaMonitoring::m_Loose_FwdEle
ToolHandle< IAsgElectronLikelihoodTool > m_Loose_FwdEle
Definition: EgammaMonitoring.h:170
ParticleType
ParticleType
Definition: TruthClasses.h:8
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
EgammaMonitoring::recoPhotonConvIsoFixedCutTightCaloOnly
std::unique_ptr< egammaMonitoring::IHistograms > recoPhotonConvIsoFixedCutTightCaloOnly
Definition: EgammaMonitoring.h:137
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
python.compressB64.c
def c
Definition: compressB64.py:93
EgammaMonitoring::rootHistSvc
ITHistSvc * rootHistSvc
Tools and services ///.
Definition: EgammaMonitoring.h:51
EgammaMonitoring::recoPhotonConvLoose
std::unique_ptr< egammaMonitoring::IHistograms > recoPhotonConvLoose
Definition: EgammaMonitoring.h:127
EgammaMonitoring::cluster10GeV
std::unique_ptr< egammaMonitoring::ClusterHistograms > cluster10GeV
Definition: EgammaMonitoring.h:55
HepMCHelpers.h
EgammaMonitoring::recoPhotonUnconvTight
std::unique_ptr< egammaMonitoring::IHistograms > recoPhotonUnconvTight
Definition: EgammaMonitoring.h:126