ATLAS Offline Software
EgammaPhysValMonitoringTool.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 // EgammaPhysValMonitoringTool.cxx
6 // Implementation file for class EgammaPhysValMonitoringTool
7 // Author:
9 
10 // PhysVal includes
12 
13 // STL includes
14 #include <vector>
15 
16 // FrameWork includes
17 #include "GaudiKernel/IToolSvc.h"
19 #include "xAODEgamma/EgammaEnums.h"
20 #include "xAODEgamma/EgammaDefs.h"
25 
29 
30 #include "StoreGate/ReadHandle.h"
32 
33 #include <iostream>
34 
36 
37 using CLHEP::GeV;
38 using namespace std;
39 using namespace MCTruthPartClassifier;
40 
42 
44 // Public methods:
46 
47 // Constructors
49 
50 EgammaPhysValMonitoringTool::EgammaPhysValMonitoringTool( const std::string& type,
51  const std::string& name,
52  const IInterface* parent ):
54  m_oElectronValidationPlots(nullptr, "Electron/"),
55  m_oPhotonValidationPlots(nullptr, "Photon/"),
56  m_oLRTElectronValidationPlots(nullptr, "LRTElectron/"),
57  m_acc_electronLLH_VeryLooseNoPix("DFCommonElectronsLHVeryLooseNoPix"),
58  m_acc_electronLLH_LooseNoPix("DFCommonElectronsLHLooseNoPix"),
59  m_acc_electronLLH_MediumNoPix("DFCommonElectronsLHMediumNoPix"),
60  m_acc_electronLLH_TightNoPix("DFCommonElectronsLHTightNoPix")
61 {
62 }
63 
64 // Athena algtool's Hooks
67 {
68  ATH_MSG_INFO("Initializing " << name() << "...");
69  ATH_MSG_INFO("using OQ quality cuts: " << m_useOQQuality);
71  ATH_CHECK(m_truthClassifier.retrieve());
77  ATH_CHECK(m_photonContainerKey.initialize());
83 
84  return StatusCode::SUCCESS;
85 }
86 
88 {
89  ATH_MSG_INFO ("Booking hists " << name() << "...");
90 
93  for (auto &hist : hists){
94  ATH_MSG_DEBUG ("Initializing " << hist.first << " " << hist.first->GetName() << " " << hist.second << "...");
95  ATH_CHECK(regHist(hist.first,hist.second,all));
96  }
97 
100  for (auto &hist : hists){
101  ATH_MSG_DEBUG ("Initializing " << hist.first << " " << hist.first->GetName() << " " << hist.second << "...");
102  ATH_CHECK(regHist(hist.first,hist.second,all));
103  }
104 
107  for (auto &hist : hists){
108  ATH_MSG_DEBUG ("Initializing " << hist.first << " " << hist.first->GetName() << " " << hist.second << "...");
109  ATH_CHECK(regHist(hist.first,hist.second,all));
110  }
111 
112  return StatusCode::SUCCESS;
113 }
114 
115 
117 {
118  ATH_MSG_DEBUG("Filling hists " << name() << "...");
119 
120  const EventContext& ctx = Gaudi::Hive::currentContext();
122  ATH_CHECK(eventInfo.isValid());
123 
124  float weight = eventInfo->beamSpotWeight();
125 
126  if (m_isMC) {
129 
130  // filling truth iso (prompt) particles from egammaTruthParticles container
131  // (containing only iso particles)
132  // validity check is only really needed for serial running. Remove when MT
133  // is only way.
134  ATH_CHECK(truthParticles.isValid());
135 
136  for (const auto* const truthParticle : *truthParticles) {
137 
138  //--electrons
139  if (std::abs(truthParticle->pdgId()) == 11 &&
140  MC::isStable(truthParticle) && HepMC::generations(truthParticle) < 1) {
142  *eventInfo);
144  *eventInfo);
145  } //-- end electrons
146 
147  //--photons
148  if (std::abs(truthParticle->pdgId()) == 22 &&
149  MC::isStable(truthParticle) && HepMC::generations(truthParticle) < 1) {
151  *eventInfo);
152  //-- filling conversions
153  const xAOD::TruthParticle* tmp =
154  xAOD::TruthHelpers::getTruthParticle(*truthParticle); // 20.7.0.1
155  // const xAOD::TruthParticle* tmp =
156  // xAOD::EgammaHelpers::getTruthParticle( truthParticle );
157  bool isTrueConv = false;
158  float trueR = -999;
159  float truthEta = -999;
160  if (tmp && tmp->hasDecayVtx()) {
161  float x = tmp->decayVtx()->x();
162  float y = tmp->decayVtx()->y();
163  trueR = std::sqrt(x * x + y * y);
164  }
165 
166  if (tmp != nullptr) {
167  truthEta = tmp->eta();
168  isTrueConv = xAOD::EgammaHelpers::isTrueConvertedPhoton(tmp); // rel20
169  }
170 
173  if (isTrueConv)
175  *eventInfo);
176  if (!isTrueConv)
178  *eventInfo);
179 
180  const xAOD::Photon* recoPhoton =
181  xAOD::EgammaHelpers::getRecoPhoton(truthParticle);
182  if (recoPhoton) {
185  trueR, truthEta, weight);
186 
188  *eventInfo);
189  if (isTrueConv) {
191  *eventInfo);
192  } else {
194  *eventInfo);
195  }
196  bool val_loose = false;
197  recoPhoton->passSelection(val_loose, "Loose");
198  if (val_loose) {
200  *eventInfo);
201  if (isTrueConv) {
203  *truthParticle, *eventInfo);
204  } else {
206  *truthParticle, *eventInfo);
207  }
208  } //-- end truth loose
209  bool val_tight = false;
210  recoPhoton->passSelection(val_tight, "Tight");
211  if (val_tight) {
213  *eventInfo);
214  if (isTrueConv) {
216  *truthParticle, *eventInfo);
217  } else {
219  *truthParticle, *eventInfo);
220  }
221  } //-- end truth tight
222  } //-- end recoPhoton
223  } //-- end Photons
224  } // -- end fill histos iso particles
225  // filling all truth particles from TruthParticles container (possibly will
226  // be deleted, also possibly to fill only prompt particles)
229  ATH_CHECK(truthallParticles.isValid());
230 
232  bool elecPrompt = false;
233  bool photonPrompt = false;
234 
235  for (const auto* const truthallParticle :
236  *truthallParticles) { // Electrons and photons from standard
237  // TruthParticle container
238 
239  //--electrons
240  if (std::abs(truthallParticle->pdgId()) == 11 &&
241  MC::isStable(truthallParticle) &&
242  HepMC::generations(truthallParticle) == 0) {
243 
244  auto type = m_truthClassifier->particleTruthClassifier(truthallParticle, &info);
245  if (type.first == IsoElectron)
246  elecPrompt = true;
247 
249  *eventInfo);
250  if (elecPrompt) {
252  *eventInfo);
254  *eventInfo);
255  }
256  } //-- end electrons
257 
258  //--photons
259  if (std::abs(truthallParticle->pdgId()) == 22 &&
260  MC::isStable(truthallParticle) &&
261  HepMC::generations(truthallParticle) == 0) {
262 
263  auto type = m_truthClassifier->particleTruthClassifier(truthallParticle, &info);
264  if (type.first == IsoPhoton)
265  photonPrompt = true;
266 
267 
269  *eventInfo);
270 
271  if (!photonPrompt)
272  continue;
273  if (truthallParticle->pt() / GeV > 20. &&
274  fabs(truthallParticle->eta()) < 2.47) {
275  m_oPhotonValidationPlots.m_oTruthAllIsoPlots.fill(*truthallParticle, *eventInfo);
276  m_truthClassifier->particleTruthClassifier(truthallParticle, &info);
277  ParticleOutCome photOutCome = info.particleOutCome;
278 
279  float convTruthR = 9999.;
280  if (truthallParticle->decayVtx())
281  convTruthR = truthallParticle->decayVtx()->perp();
282  // std::cout<<"Truth Conversion R "<<convTruthR<<std::endl;
283  // m_oPhotonValidationPlots.convTruthR->Fill(convTruthR);
284 
285  // fill only iso photon for conv and not converted
286  if (photOutCome == Converted && convTruthR < 800.)
288  *truthallParticle, *eventInfo);
289  else
291  *truthallParticle, *eventInfo);
292  } // end cuts on truth
293  } // -- end photons
294  }
295 
296  //---------Electrons----------------------
297  if (!fillRecoElecHistograms(truthParticles.ptr(), eventInfo.ptr())) {
298  ATH_MSG_ERROR("Filling reco elecectron hists failed " << name()
299  << "...");
300  return StatusCode::FAILURE;
301  }
302 
303  //---------LRTElectrons----------------------
305  if (!fillLRTElecHistograms(truthParticles.ptr(), eventInfo.ptr())) {
306  ATH_MSG_ERROR("Filling lrt elecectron hists failed " << name() << "...");
307  return StatusCode::FAILURE;
308  }
309  }
310 
311  //---------Frwd Electrons----------------------
312  if (!fillRecoFrwdElecHistograms(truthParticles.ptr(), eventInfo.ptr())) {
313  ATH_MSG_ERROR("Filling reco frwd elecectron hists failed " << name()
314  << "...");
315  return StatusCode::FAILURE;
316  }
317  //----------Photons
318  if (!fillRecoPhotHistograms(truthParticles.ptr(), eventInfo.ptr())) {
319  ATH_MSG_ERROR("Filling reco photon hists failed " << name() << "...");
320  return StatusCode::FAILURE;
321  }
322  } else // end is MC / code using truth particles
323  {//---------Electrons----------------------
324  if (!fillRecoElecHistograms(nullptr, eventInfo.ptr())) {
325  ATH_MSG_ERROR("Filling reco elecectron hists failed " << name()
326  << "...");
327  return StatusCode::FAILURE;
328  }
329  //---------Frwd Electrons----------------------
330  if (!fillRecoFrwdElecHistograms(nullptr, eventInfo.ptr())) {
331  ATH_MSG_ERROR("Filling reco frwd elecectron hists failed " << name()
332  << "...");
333  return StatusCode::FAILURE;
334  }
335  //----------Photons
336  if (!fillRecoPhotHistograms(nullptr, eventInfo.ptr())) {
337  ATH_MSG_ERROR("Filling reco photon hists failed " << name() << "...");
338  return StatusCode::FAILURE;
339  }
340 
341  }
342 
343 
344 
345  return StatusCode::SUCCESS;
346 }
347 
349 {
350  ATH_MSG_DEBUG ("Filling reco electron hists " << name() << "...");
351 
352  const EventContext& ctx = Gaudi::Hive::currentContext();
354  ATH_CHECK(Electrons.isValid());
355 
356  int numofele=0;
357 
358  float weight = eventInfo->beamSpotWeight();
359 
360  for(const auto *const electron : *Electrons){
361  bool isElecPrompt=false;
362 
363  if(!(electron->isGoodOQ (xAOD::EgammaParameters::BADCLUSELECTRON))) continue;
364 
367 
368  if(!m_isMC) m_oElectronValidationPlots.fill(*electron,*eventInfo,isElecPrompt);
369  else {
370  static const SG::ConstAccessor<int> truthTypeAcc ("truthType");
371  if(truthTypeAcc.isAvailable (*electron)) {
373  if(type==MCTruthPartClassifier::IsoElectron) {
374  isElecPrompt=true;
375  //fill energy scale
376  const xAOD::TruthParticle* thePart = xAOD::TruthHelpers::getTruthParticle(*electron); // 20.7.X.Y.I
377  if(thePart) {
378  float EtLin = (electron->pt()-thePart->pt())/thePart->pt();
379  m_oElectronValidationPlots.res_et->Fill(thePart->pt()/GeV,EtLin,weight);
380  m_oElectronValidationPlots.res_eta->Fill(thePart->eta(),EtLin,weight);
381  if (thePart->pt()/GeV>20.) {
382  m_oElectronValidationPlots.res_et_cut->Fill(thePart->pt()/GeV,EtLin,weight);
383  m_oElectronValidationPlots.res_eta_cut->Fill(thePart->eta(),EtLin,weight);
384  m_oElectronValidationPlots.res_et_cut_pt_20->Fill(thePart->pt()/GeV,EtLin,weight);
385  m_oElectronValidationPlots.res_eta_cut_pt_20->Fill(thePart->eta(),EtLin,weight);
386  }
387  m_oElectronValidationPlots.matrix->Fill(electron->pt()/GeV,thePart->pt()/GeV);
388  } else {
389  ATH_MSG_INFO ("Truth particle associated not in egamma truth collection");
390  }
391  }
392 
393  } else if(m_isMC){ if(Match(electron,11, truthParticles)!=nullptr ) isElecPrompt=true;}
394 
395  m_oElectronValidationPlots.fill(*electron,*eventInfo,isElecPrompt);
396  }
397  }
400 
401  return StatusCode::SUCCESS;
402 }
403 
405 {
406  ATH_MSG_DEBUG ("Filling lrt electron hists " << name() << "...");
407 
408  const EventContext& ctx = Gaudi::Hive::currentContext();
410  ATH_CHECK(LRTElectrons.isValid());
411 
412  int numofele=0;
413 
414  float weight = eventInfo->beamSpotWeight();
415 
416  for(const auto *const electron : *LRTElectrons){
417  bool isElecPrompt=false;
418 
419  if(!(electron->isGoodOQ (xAOD::EgammaParameters::BADCLUSELECTRON))) continue;
420 
421  // Retrieve electron ID, compute on-the-fly if decoration is missing (for AODs)
422  bool pass_LHVeryLooseNoPix = false;
423  if (m_acc_electronLLH_VeryLooseNoPix.isAvailable(*electron)) electron->passSelection(pass_LHVeryLooseNoPix, "DFCommonElectronsLHVeryLooseNoPix");
424  else pass_LHVeryLooseNoPix = static_cast<bool>(m_Electron_VeryLooseNoPix_LLHTool->accept(electron));
425 
426  bool pass_LHLooseNoPix = false;
427  if (m_acc_electronLLH_LooseNoPix.isAvailable(*electron)) electron->passSelection(pass_LHLooseNoPix, "DFCommonElectronsLHLooseNoPix");
428  else pass_LHLooseNoPix = static_cast<bool>(m_Electron_LooseNoPix_LLHTool->accept(electron));
429 
430  bool pass_LHMediumNoPix = false;
431  if (m_acc_electronLLH_MediumNoPix.isAvailable(*electron)) electron->passSelection(pass_LHMediumNoPix, "DFCommonElectronsLHMediumNoPix");
432  else pass_LHMediumNoPix = static_cast<bool>(m_Electron_MediumNoPix_LLHTool->accept(electron));
433 
434  bool pass_LHTightNoPix = false;
435  if (m_acc_electronLLH_TightNoPix.isAvailable(*electron)) electron->passSelection(pass_LHTightNoPix, "DFCommonElectronsLHTightNoPix");
436  else pass_LHTightNoPix = static_cast<bool>(m_Electron_TightNoPix_LLHTool->accept(electron));
437 
438  static const SG::ConstAccessor<int> truthTypeAcc ("truthType");
439  if(truthTypeAcc.isAvailable(*electron)) {
441  if(type==MCTruthPartClassifier::IsoElectron) {
442  isElecPrompt=true;
443  //fill energy scale
444  const xAOD::TruthParticle* thePart = xAOD::TruthHelpers::getTruthParticle(*electron); // 20.7.X.Y.I
445  if(thePart) {
446  float EtLin = (electron->pt()-thePart->pt())/thePart->pt();
447  m_oLRTElectronValidationPlots.res_et->Fill(thePart->pt()/GeV,EtLin,weight);
448  m_oLRTElectronValidationPlots.res_eta->Fill(thePart->eta(),EtLin,weight);
449  if (thePart->pt()/GeV>20.) {
450  m_oLRTElectronValidationPlots.res_et_cut->Fill(thePart->pt()/GeV,EtLin,weight);
451  m_oLRTElectronValidationPlots.res_eta_cut->Fill(thePart->eta(),EtLin,weight);
454  }
455  m_oLRTElectronValidationPlots.matrix->Fill(electron->pt()/GeV,thePart->pt()/GeV);
456  }else {
457  ATH_MSG_INFO ("Truth particle associated not in egamma truth collection");
458  }
459  }
460  } else if(m_isMC){ if(Match(electron,11, truthParticles)!=nullptr ) isElecPrompt=true;}
461 
462 
463  m_oLRTElectronValidationPlots.fill(*electron,*eventInfo, isElecPrompt, pass_LHVeryLooseNoPix, pass_LHLooseNoPix, pass_LHMediumNoPix, pass_LHTightNoPix);
466 
467  }
468 
471 
472  return StatusCode::SUCCESS;
473 }
474 
476 {
477  ATH_MSG_DEBUG ("Filling reco frwd electron hists " << name() << "...");
478 
479  const EventContext& ctx = Gaudi::Hive::currentContext();
481  ATH_CHECK(ElectronsFrwd.isValid());
482 
483  int numoffrwdele=0;
484  float weight = eventInfo->beamSpotWeight();
485 
486  for(const auto *const frwdelectron : *ElectronsFrwd){
487  if(!(frwdelectron->isGoodOQ (xAOD::EgammaParameters::BADCLUSELECTRON))) continue;
488  bool isElecPrompt=false;
489  if (m_isMC) {
490  if((Match(frwdelectron,11, truthParticles)!=nullptr )) isElecPrompt=true;
491  }
492  m_oElectronValidationPlots.fill(*frwdelectron,*eventInfo,isElecPrompt);
493  numoffrwdele++;
494  isElecPrompt=false;
495  }
496 
499 
500  return StatusCode::SUCCESS;
501 }
502 
504 {
505  ATH_MSG_DEBUG ("Filling reco photon hists " << name() << "...");
506 
507  const EventContext& ctx = Gaudi::Hive::currentContext();
509  ATH_CHECK(Photons.isValid());
510 
511  int numofPhot=0;
512  int numofTopo=0;
513  int numofAmb=0;
514  int numPhotAll=0;
515  int numofCnv=0;
516  float weight = eventInfo->beamSpotWeight();
517 
518  for(const auto *photon : *Photons){
519  bool isPhotPrompt=false;
520  if (photon->author()&xAOD::EgammaParameters::AuthorCaloTopo35) continue;//21.0.>7
521  if(!(photon->isGoodOQ (xAOD::EgammaParameters::BADCLUSPHOTON))) continue;
522  if (m_useOQQuality) {
523  if (!PhotonHelpers::passOQquality(*photon)) continue;
524  }
525 
526  if(photon->author()&xAOD::EgammaParameters::AuthorPhoton&&photon->pt()/GeV>7.) numofPhot++;
527  else if(photon->pt()*0.001<7.) numofTopo++;
528  else if(photon->author()&xAOD::EgammaParameters::AuthorAmbiguous&&photon->pt()/GeV>7.) numofAmb++;
529  if(xAOD::EgammaHelpers::isConvertedPhoton(photon)&&photon->pt()/GeV>7.) numofCnv++;
530  if(!m_isMC) m_oPhotonValidationPlots.fill(*photon,*eventInfo, isPhotPrompt);
531  else {
532  static const SG::ConstAccessor<int> truthTypeAcc ("truthType");
533  if(truthTypeAcc.isAvailable(*photon)) {
536  isPhotPrompt=true;
537  //fill energy scale
538  const xAOD::TruthParticle* thePart = xAOD::TruthHelpers::getTruthParticle(*photon);//20.7.X.Y.I
539  // const xAOD::TruthParticle* thePart = xAOD::EgammaHelpers::getTruthParticle(photon);
540  if(thePart&&thePart->pt()/GeV>20.) {
541  float EtLin = (photon->pt()-thePart->pt())/thePart->pt();
542  m_oPhotonValidationPlots.res_et->Fill(thePart->pt()/GeV,EtLin,weight);
543  m_oPhotonValidationPlots.res_eta->Fill(thePart->eta(),EtLin,weight);
544  if (std::abs(EtLin)<0.2){
545  m_oPhotonValidationPlots.res_et_cut->Fill(thePart->pt()/GeV,EtLin,weight);
546  m_oPhotonValidationPlots.res_eta_cut->Fill(thePart->eta(),EtLin,weight);
547  }
548  }else {
549  cout<<"Truth particle associated not in egamma truth collection"<<endl;
550  }
551  }
552 
553  } else if(m_isMC){if(Match(photon,22, truthParticles)!=nullptr ) isPhotPrompt=true;}
554 
555  m_oPhotonValidationPlots.fill(*photon,*eventInfo, isPhotPrompt);
556 
557  }
558  }
559  numPhotAll = numofPhot+numofTopo+numofAmb;
565 
571 
572 
573  return StatusCode::SUCCESS;
574 }
575 
577  {
578  ATH_MSG_INFO ("Finalising hists " << name() << "...");
581  return StatusCode::SUCCESS;
582  }
583 
585  int pdg,
586  const xAOD::TruthParticleContainer* truthParticles) {
587  float currentdr = 0.05;
588  const xAOD::TruthParticle* matchedTruthParticle = nullptr;
589  if (truthParticles){
590  for (const auto *truthParticle: *truthParticles){
591  if (std::abs(truthParticle->pdgId()) != pdg || !MC::isStable(truthParticle)) continue;
592  float dr = particle->p4().DeltaR(truthParticle->p4());
593  if (dr < currentdr){
594  currentdr = dr;
595  matchedTruthParticle = truthParticle;
596  }
597  }
598  }
599  return matchedTruthParticle;
600 }
601 
602 
603 }
604 
grepfile.info
info
Definition: grepfile.py:38
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::m_acc_electronLLH_MediumNoPix
SG::AuxElement::ConstAccessor< char > m_acc_electronLLH_MediumNoPix
Definition: EgammaPhysValMonitoringTool.h:149
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::fillRecoPhotHistograms
StatusCode fillRecoPhotHistograms(const xAOD::TruthParticleContainer *truthParticles, const xAOD::EventInfo *eventInfo)
Definition: EgammaPhysValMonitoringTool.cxx:503
Egamma::LRTElectronPlots::nParticles_weighted
TH1 * nParticles_weighted
Definition: LRTElectronPlots.h:98
LRTElectronValidationPlots::res_eta
TProfile * res_eta
Definition: LRTElectronValidationPlots.h:30
PhotonValidationPlots::m_oTruthAllPlots
Egamma::KinematicsPlots m_oTruthAllPlots
Definition: PhotonValidationPlots.h:32
IsoPhoton
@ IsoPhoton
Definition: TruthClasses.h:23
PhotonValidationPlots::convTruthMatchedRvsEta
TH2 * convTruthMatchedRvsEta
Definition: PhotonValidationPlots.h:53
Egamma::ElectronFrwdPlots::nParticles
TH1 * nParticles
Definition: ElectronFrwdPlots.h:33
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
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
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
ElectronValidationPlots::res_eta_cut
TProfile * res_eta_cut
Definition: ElectronValidationPlots.h:38
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::m_useOQQuality
Gaudi::Property< bool > m_useOQQuality
Definition: EgammaPhysValMonitoringTool.h:152
PhotonHelpers.h
AthCheckMacros.h
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::m_electronContainerKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronContainerKey
Definition: EgammaPhysValMonitoringTool.h:97
PhotonValidationPlots::m_oTruthRecoPlots
Egamma::KinematicsPlots m_oTruthRecoPlots
Definition: PhotonValidationPlots.h:36
PhotonValidationPlots::m_oTopoPhotPlots
Egamma::PhotonPlots m_oTopoPhotPlots
Definition: PhotonValidationPlots.h:29
PhotonValidationPlots::res_eta_cut
TProfile * res_eta_cut
Definition: PhotonValidationPlots.h:57
PhotonValidationPlots::m_oTruthRecoLooseConvPlots
Egamma::KinematicsPlots m_oTruthRecoLooseConvPlots
Definition: PhotonValidationPlots.h:40
ManagedMonitorToolBase
Provides functionality for users to implement and save histograms, ntuples, and summary data,...
Definition: ManagedMonitorToolBase.h:73
LRTElectronValidationPlots::res_et_cut_pt_20
TProfile * res_et_cut_pt_20
Definition: LRTElectronValidationPlots.h:33
EgammaPhysValMonitoringTool.h
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::m_Electron_LooseNoPix_LLHTool
ToolHandle< IAsgElectronLikelihoodTool > m_Electron_LooseNoPix_LLHTool
Definition: EgammaPhysValMonitoringTool.h:125
plotmaker.hist
hist
Definition: plotmaker.py:148
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::bookHistograms
virtual StatusCode bookHistograms()
An inheriting class should either override this function or bookHists().
Definition: EgammaPhysValMonitoringTool.cxx:87
Egamma::ElectronFrwdPlots::nParticles_weighted
TH1 * nParticles_weighted
Definition: ElectronFrwdPlots.h:34
Egamma::LRTElectronPlots::nParticles
TH1 * nParticles
Definition: LRTElectronPlots.h:97
ElectronValidationPlots::matrix
TH2 * matrix
Definition: ElectronValidationPlots.h:41
Egamma::ElectronPlots::nParticles_weighted
TH1 * nParticles_weighted
Definition: ElectronPlots.h:76
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::m_Electron_TightNoPix_LLHTool
ToolHandle< IAsgElectronLikelihoodTool > m_Electron_TightNoPix_LLHTool
Definition: EgammaPhysValMonitoringTool.h:139
IsoElectron
@ IsoElectron
Definition: TruthClasses.h:11
Converted
@ Converted
Definition: TruthClasses.h:109
xAOD::Egamma_v1
Definition: Egamma_v1.h:56
xAOD::EgammaParameters::BADCLUSELECTRON
const uint32_t BADCLUSELECTRON
Definition: EgammaDefs.h:116
SG::ConstAccessor< int >
MCTruthClassifier.h
python.TurnDataReader.dr
dr
Definition: TurnDataReader.py:112
Egamma::PhotonCnvPlots::m_nParticles
TH1 * m_nParticles
Definition: PhotonCnvPlots.h:29
Egamma::PhotonAmbPlots::m_nParticles
TH1 * m_nParticles
Definition: PhotonAmbPlots.h:28
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::m_EventInfoContainerKey
SG::ReadHandleKey< xAOD::EventInfo > m_EventInfoContainerKey
Definition: EgammaPhysValMonitoringTool.h:93
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::m_oPhotonValidationPlots
PhotonValidationPlots m_oPhotonValidationPlots
Definition: EgammaPhysValMonitoringTool.h:112
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::m_lrtelectronContainerKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_lrtelectronContainerKey
Definition: EgammaPhysValMonitoringTool.h:99
xAODTruthHelpers.h
x
#define x
PhotonValidationPlots::convTruthMatchedR
TH1 * convTruthMatchedR
Definition: PhotonValidationPlots.h:51
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::fillLRTElecHistograms
StatusCode fillLRTElecHistograms(const xAOD::TruthParticleContainer *truthParticles, const xAOD::EventInfo *eventInfo)
Definition: EgammaPhysValMonitoringTool.cxx:404
LRTElectronValidationPlots::matrix
TH2 * matrix
Definition: LRTElectronValidationPlots.h:35
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::m_acc_electronLLH_LooseNoPix
SG::AuxElement::ConstAccessor< char > m_acc_electronLLH_LooseNoPix
Definition: EgammaPhysValMonitoringTool.h:148
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::m_acc_electronLLH_VeryLooseNoPix
SG::AuxElement::ConstAccessor< char > m_acc_electronLLH_VeryLooseNoPix
Definition: EgammaPhysValMonitoringTool.h:147
Egamma::PhotonCnvPlots::m_nParticles_weighted
TH1 * m_nParticles_weighted
Definition: PhotonCnvPlots.h:30
LRTElectronValidationPlots::res_eta_cut
TProfile * res_eta_cut
Definition: LRTElectronValidationPlots.h:32
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
LRTElectronValidationPlots::m_oCentralElecPlots
Egamma::LRTElectronPlots m_oCentralElecPlots
Definition: LRTElectronValidationPlots.h:26
ElectronValidationPlots::m_oTruthAllPlots
Egamma::KinematicsPlots m_oTruthAllPlots
Definition: ElectronValidationPlots.h:28
Egamma::PhotonPlots::m_nParticles
TH1 * m_nParticles
Definition: PhotonPlots.h:41
ElectronValidationPlots::res_et_cut_pt_20
TProfile * res_et_cut_pt_20
Definition: ElectronValidationPlots.h:39
PhotonValidationPlots::m_oTruthRecoLoosePlots
Egamma::KinematicsPlots m_oTruthRecoLoosePlots
Definition: PhotonValidationPlots.h:39
PhotonHelpers::passOQquality
bool passOQquality(const xAOD::Photon &ph)
Helper to ease the implemmantation of the pass Quality requirements.
Definition: PhotonHelpers.cxx:12
MCTruthClassifierDefs.h
EgammaxAODHelpers.h
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::m_Electron_VeryLooseNoPix_LLHTool
ToolHandle< IAsgElectronLikelihoodTool > m_Electron_VeryLooseNoPix_LLHTool
Definition: EgammaPhysValMonitoringTool.h:118
PhotonValidationPlots::m_oAllPlots
Egamma::PhotonPlots m_oAllPlots
Definition: PhotonValidationPlots.h:27
PlotBase::retrieveBookedHistograms
std::vector< HistData > retrieveBookedHistograms()
Retrieve all booked histograms.
Definition: PlotBase.cxx:63
IMCTruthClassifier.h
xAOD::EgammaHelpers::isConvertedPhoton
bool isConvertedPhoton(const xAOD::Egamma *eg, bool excludeTRT=false)
is the object a converted photon
Definition: EgammaxAODHelpers.cxx:25
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
PlotBase::finalize
void finalize()
Definition: PlotBase.cxx:47
LRTElectronValidationPlots::res_eta_cut_pt_20
TProfile * res_eta_cut_pt_20
Definition: LRTElectronValidationPlots.h:34
PhotonValidationPlots::convTruthR
TH1 * convTruthR
Definition: PhotonValidationPlots.h:50
ManagedMonitorToolBase::initialize
virtual StatusCode initialize()
Definition: ManagedMonitorToolBase.cxx:617
PhotonValidationPlots::m_oTruthRecoLooseUncPlots
Egamma::KinematicsPlots m_oTruthRecoLooseUncPlots
Definition: PhotonValidationPlots.h:41
PhotonValidationPlots::m_oTruthRecoTightConvPlots
Egamma::KinematicsPlots m_oTruthRecoTightConvPlots
Definition: PhotonValidationPlots.h:43
PhotonValidationPlots::m_oTruthRecoUncPlots
Egamma::KinematicsPlots m_oTruthRecoUncPlots
Definition: PhotonValidationPlots.h:38
PlotBase::initialize
void initialize()
Definition: PlotBase.cxx:39
xAOD::EgammaParameters::AuthorCaloTopo35
const uint16_t AuthorCaloTopo35
Photon reconstructed by SW CaloTopo35 seeded clusters.
Definition: EgammaDefs.h:38
xAOD::EgammaParameters::AuthorAmbiguous
const uint16_t AuthorAmbiguous
Object Reconstructed by standard cluster-based algorithm.
Definition: EgammaDefs.h:32
PhotonValidationPlots::m_oTruthAllIsoConvPlots
Egamma::KinematicsPlots m_oTruthAllIsoConvPlots
Definition: PhotonValidationPlots.h:34
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
ElectronValidationPlots::fill
void fill(const xAOD::Electron &electron, const xAOD::EventInfo &eventInfo, bool isPrompt)
Definition: ElectronValidationPlots.cxx:41
PhotonValidationPlots::m_oTruthRecoTightPlots
Egamma::KinematicsPlots m_oTruthRecoTightPlots
Definition: PhotonValidationPlots.h:42
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::fillRecoFrwdElecHistograms
StatusCode fillRecoFrwdElecHistograms(const xAOD::TruthParticleContainer *truthParticles, const xAOD::EventInfo *eventInfo)
Definition: EgammaPhysValMonitoringTool.cxx:475
PhotonValidationPlots::m_oAmbPhotPlots
Egamma::PhotonAmbPlots m_oAmbPhotPlots
Definition: PhotonValidationPlots.h:30
Egamma::PhotonAmbPlots::m_nParticles_weighted
TH1 * m_nParticles_weighted
Definition: PhotonAmbPlots.h:29
LRTElectronValidationPlots::res_et
TProfile * res_et
Definition: LRTElectronValidationPlots.h:29
Egamma::PhotonPlots::m_nParticles_weighted
TH1 * m_nParticles_weighted
Definition: PhotonPlots.h:42
ElectronValidationPlots::res_et_cut
TProfile * res_et_cut
Definition: ElectronValidationPlots.h:37
PhotonxAODHelpers.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::fillRecoElecHistograms
StatusCode fillRecoElecHistograms(const xAOD::TruthParticleContainer *truthParticles, const xAOD::EventInfo *eventInfo)
Definition: EgammaPhysValMonitoringTool.cxx:348
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Egamma::ElectronPlots::nParticles
TH1 * nParticles
Definition: ElectronPlots.h:75
MakeTH3DFromTH2Ds.hists
hists
Definition: MakeTH3DFromTH2Ds.py:72
ElectronValidationPlots::m_oTruthAllIsoPlots
Egamma::KinematicsPlots m_oTruthAllIsoPlots
Definition: ElectronValidationPlots.h:29
PhotonValidationPlots::res_eta
TProfile * res_eta
Definition: PhotonValidationPlots.h:55
PhotonValidationPlots::m_oTruthRecoTightUncPlots
Egamma::KinematicsPlots m_oTruthRecoTightUncPlots
Definition: PhotonValidationPlots.h:44
PhotonValidationPlots::m_oTruthRecoConvPlots
Egamma::KinematicsPlots m_oTruthRecoConvPlots
Definition: PhotonValidationPlots.h:37
Egamma::KinematicsPlots::fill
void fill(const xAOD::IParticle &part, const xAOD::EventInfo &eventInfo)
Definition: Reconstruction/egamma/EgammaPhysValMonitoring/src/KinematicsPlots.cxx:28
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
ElectronValidationPlots::res_et
TProfile * res_et
Definition: ElectronValidationPlots.h:35
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
PhotonValidationPlots::m_oTruthAllIsoUncPlots
Egamma::KinematicsPlots m_oTruthAllIsoUncPlots
Definition: PhotonValidationPlots.h:35
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::m_oLRTElectronValidationPlots
LRTElectronValidationPlots m_oLRTElectronValidationPlots
Definition: EgammaPhysValMonitoringTool.h:113
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::fillHistograms
virtual StatusCode fillHistograms()
An inheriting class should either override this function or fillHists().
Definition: EgammaPhysValMonitoringTool.cxx:116
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
PhotonValidationPlots::m_oTruthIsoPlots
Egamma::KinematicsPlots m_oTruthIsoPlots
Definition: PhotonValidationPlots.h:45
createDCubeDigitHistograms.truthEta
truthEta
Definition: createDCubeDigitHistograms.py:49
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::initialize
virtual StatusCode initialize()
Definition: EgammaPhysValMonitoringTool.cxx:66
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::m_acc_electronLLH_TightNoPix
SG::AuxElement::ConstAccessor< char > m_acc_electronLLH_TightNoPix
Definition: EgammaPhysValMonitoringTool.h:150
PhotonValidationPlots::m_oTruthIsoConvPlots
Egamma::KinematicsPlots m_oTruthIsoConvPlots
Definition: PhotonValidationPlots.h:46
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
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::Match
static const xAOD::TruthParticle * Match(const xAOD::Egamma *particle, int pdg, const xAOD::TruthParticleContainer *truthParticles)
Definition: EgammaPhysValMonitoringTool.cxx:584
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::m_photonContainerKey
SG::ReadHandleKey< xAOD::PhotonContainer > m_photonContainerKey
Definition: EgammaPhysValMonitoringTool.h:95
LRTElectronValidationPlots::res_et_cut
TProfile * res_et_cut
Definition: LRTElectronValidationPlots.h:31
ElectronValidationPlots::m_oTruthAllPromptPlots
Egamma::KinematicsPlots m_oTruthAllPromptPlots
Definition: ElectronValidationPlots.h:31
xAOD::TruthParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TruthParticle_v1.cxx:174
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::m_oElectronValidationPlots
ElectronValidationPlots m_oElectronValidationPlots
Definition: EgammaPhysValMonitoringTool.h:111
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::m_Electron_MediumNoPix_LLHTool
ToolHandle< IAsgElectronLikelihoodTool > m_Electron_MediumNoPix_LLHTool
Definition: EgammaPhysValMonitoringTool.h:132
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
PhotonValidationPlots::m_oTruthIsoUncPlots
Egamma::KinematicsPlots m_oTruthIsoUncPlots
Definition: PhotonValidationPlots.h:47
SG::ReadHandle::ptr
const_pointer_type ptr()
Dereference the pointer.
EgammaEnums.h
xAOD::EgammaParameters::BADCLUSPHOTON
const uint32_t BADCLUSPHOTON
Definition: EgammaDefs.h:124
MC::isStable
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
Definition: HepMCHelpers.h:45
xAOD::photon
@ photon
Definition: TrackingPrimitives.h:199
y
#define y
xAOD::Photon_v1
Definition: Photon_v1.h:37
MCTruthPartClassifier
Definition: TruthClassifiers.h:12
PhotonValidationPlots::convTruthRvsEta
TH2 * convTruthRvsEta
Definition: PhotonValidationPlots.h:52
EgammaPhysValMonitoring
Definition: EgammaPhysValMonitoringTool.cxx:41
ElectronValidationPlots::m_oTruthPromptElecPlots
Egamma::KinematicsPlots m_oTruthPromptElecPlots
Definition: ElectronValidationPlots.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ElectronValidationPlots::m_oFrwdElecPlots
Egamma::ElectronFrwdPlots m_oFrwdElecPlots
Definition: ElectronValidationPlots.h:27
ElectronValidationPlots::res_eta_cut_pt_20
TProfile * res_eta_cut_pt_20
Definition: ElectronValidationPlots.h:40
PhotonValidationPlots::m_oConvPhotPlots
Egamma::PhotonCnvPlots m_oConvPhotPlots
Definition: PhotonValidationPlots.h:31
EgammaDefs.h
xAOD::EgammaParameters::electron
@ electron
Definition: EgammaEnums.h:18
xAOD::EgammaParameters::AuthorPhoton
const uint16_t AuthorPhoton
Object Reconstructed by standard cluster-based algorithm.
Definition: EgammaDefs.h:28
ManagedMonitorToolBase::all
@ all
Definition: ManagedMonitorToolBase.h:115
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::m_truthClassifier
ToolHandle< IMCTruthClassifier > m_truthClassifier
Definition: EgammaPhysValMonitoringTool.h:115
ElectronValidationPlots::m_oCentralElecPlots
Egamma::ElectronPlots m_oCentralElecPlots
Definition: ElectronValidationPlots.h:26
xAOD::TruthParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TruthParticle_v1.cxx:166
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
PhotonValidationPlots::m_oTruthAllIsoPlots
Egamma::KinematicsPlots m_oTruthAllIsoPlots
Definition: PhotonValidationPlots.h:33
ElectronValidationPlots::m_oTruthIsoPlots
Egamma::KinematicsPlots m_oTruthIsoPlots
Definition: ElectronValidationPlots.h:30
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::m_isMC
Gaudi::Property< bool > m_isMC
Definition: EgammaPhysValMonitoringTool.h:108
ReadHandle.h
Handle class for reading from StoreGate.
LRTElectronValidationPlots::fill
void fill(const xAOD::Electron &electron, const xAOD::EventInfo &eventInfo, bool isPrompt, bool pass_LHVeryLooseNoPix, bool pass_LHLooseNoPix, bool pass_LHMediumNoPix, bool pass_LHTightNoPix)
Definition: LRTElectronValidationPlots.cxx:41
HepMC::generations
int generations(const T &p)
Method to return how many interactions a particle has undergone during simulation (TODO migrate to be...
Definition: MagicNumbers.h:358
ParticleType
ParticleType
Definition: TruthClasses.h:8
PhotonValidationPlots::m_oPhotPlots
Egamma::PhotonPlots m_oPhotPlots
Definition: PhotonValidationPlots.h:28
MCTruthPartClassifier::Info
Definition: IMCTruthClassifier.h:49
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::procHistograms
virtual StatusCode procHistograms()
An inheriting class should either override this function or finalHists().
Definition: EgammaPhysValMonitoringTool.cxx:576
xAOD::EventInfo_v1::beamSpotWeight
float beamSpotWeight() const
Weight for beam spot size reweighting.
Definition: EventInfo_v1.cxx:970
ManagedMonitorToolBase::regHist
virtual StatusCode regHist(TH1 *h, const std::string &system, Interval_t interval, MgmtAttr_t histo_mgmt=ATTRIB_MANAGED, const std::string &chain="", const std::string &merge="")
Registers a TH1 (including TH2, TH3, and TProfile) to be included in the output stream using logical ...
Definition: ManagedMonitorToolBase.cxx:1346
ParticleOutCome
ParticleOutCome
Definition: TruthClasses.h:105
PhotonValidationPlots::res_et_cut
TProfile * res_et_cut
Definition: PhotonValidationPlots.h:56
HepMCHelpers.h
PhotonValidationPlots::res_et
TProfile * res_et
Definition: PhotonValidationPlots.h:54
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::m_electronContainerFrwdKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronContainerFrwdKey
Definition: EgammaPhysValMonitoringTool.h:101
xAOD::Egamma_v1::passSelection
bool passSelection(bool &value, const std::string &menu) const
Check if the egamma object pass a selection menu (using the name) If the menu decision is stored in t...
xAOD::EgammaParameters::AuthorElectron
const uint16_t AuthorElectron
Object Reconstructed by standard cluster-based algorithm.
Definition: EgammaDefs.h:24
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::m_truthParticleContainerKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleContainerKey
Definition: EgammaPhysValMonitoringTool.h:103
PhotonValidationPlots::fill
void fill(const xAOD::Photon &photon, const xAOD::EventInfo &eventInfo, bool isPrompt)
Definition: PhotonValidationPlots.cxx:55
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::m_egammaTruthContainerKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_egammaTruthContainerKey
Definition: EgammaPhysValMonitoringTool.h:105
ElectronValidationPlots::res_eta
TProfile * res_eta
Definition: ElectronValidationPlots.h:36