ATLAS Offline Software
EgammaPhysValMonitoringTool.cxx
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // EgammaPhysValMonitoringTool.cxx
8 // Implementation file for class EgammaPhysValMonitoringTool
9 // Author:
11 
12 // PhysVal includes
14 
15 // STL includes
16 #include <vector>
17 
18 // FrameWork includes
19 #include "GaudiKernel/IToolSvc.h"
21 #include "xAODEgamma/EgammaEnums.h"
22 #include "xAODEgamma/EgammaDefs.h"
26 
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() << "...");
70  ATH_CHECK(m_truthClassifier.retrieve());
76  ATH_CHECK(m_photonContainerKey.initialize());
82 
83  return StatusCode::SUCCESS;
84 }
85 
86 //-------------------------------------------------------------------
88 //-------------------------------------------------------------------
89 {
90  ATH_MSG_INFO ("Booking hists " << name() << "...");
91 
94  for (auto &hist : hists){
95  ATH_MSG_INFO ("Initializing " << hist.first << " " << hist.first->GetName() << " " << hist.second << "...");
96  ATH_CHECK(regHist(hist.first,hist.second,all));
97  }
98 
101  for (auto &hist : hists){
102  ATH_MSG_INFO ("Initializing " << hist.first << " " << hist.first->GetName() << " " << hist.second << "...");
103  ATH_CHECK(regHist(hist.first,hist.second,all));
104  }
105 
108  for (auto &hist : hists){
109  ATH_MSG_INFO ("Initializing " << hist.first << " " << hist.first->GetName() << " " << hist.second << "...");
110  ATH_CHECK(regHist(hist.first,hist.second,all));
111  }
112 
113  return StatusCode::SUCCESS;
114 }
115 
116 
117 //-------------------------------------------------------------------
119 //-------------------------------------------------------------------
120 {
121  ATH_MSG_DEBUG("Filling hists " << name() << "...");
122 
123  const EventContext& ctx = Gaudi::Hive::currentContext();
125  ATH_CHECK(eventInfo.isValid());
126 
127  float weight = eventInfo->beamSpotWeight();
128 
129  if (m_isMC) {
132 
133  // filling truth iso (prompt) particles from egammaTruthParticles container
134  // (containing only iso particles)
135  // validity check is only really needed for serial running. Remove when MT
136  // is only way.
137  ATH_CHECK(truthParticles.isValid());
138 
139  for (const auto* const truthParticle : *truthParticles) {
140 
141  //--electrons
142  if (std::abs(truthParticle->pdgId()) == 11 &&
143  MC::isStable(truthParticle) && HepMC::generations(truthParticle) < 1) {
145  *eventInfo);
147  *eventInfo);
148  } //-- end electrons
149 
150  //--photons
151  if (std::abs(truthParticle->pdgId()) == 22 &&
152  MC::isStable(truthParticle) && HepMC::generations(truthParticle) < 1) {
154  *eventInfo);
155  //-- filling conversions
156  const xAOD::TruthParticle* tmp =
157  xAOD::TruthHelpers::getTruthParticle(*truthParticle); // 20.7.0.1
158  // const xAOD::TruthParticle* tmp =
159  // xAOD::EgammaHelpers::getTruthParticle( truthParticle );
160  bool isTrueConv = false;
161  float trueR = -999;
162  float truthEta = -999;
163  if (tmp && tmp->hasDecayVtx()) {
164  float x = tmp->decayVtx()->x();
165  float y = tmp->decayVtx()->y();
166  trueR = std::sqrt(x * x + y * y);
167  }
168 
169  if (tmp != nullptr) {
170  truthEta = tmp->eta();
171  isTrueConv = xAOD::EgammaHelpers::isTrueConvertedPhoton(tmp); // rel20
172  }
173 
176  if (isTrueConv)
178  *eventInfo);
179  if (!isTrueConv)
181  *eventInfo);
182 
183  const xAOD::Photon* recoPhoton =
184  xAOD::EgammaHelpers::getRecoPhoton(truthParticle);
185  if (recoPhoton) {
188  trueR, truthEta, weight);
189 
191  *eventInfo);
192  if (isTrueConv) {
194  *eventInfo);
195  } else {
197  *eventInfo);
198  }
199  bool val_loose = false;
200  recoPhoton->passSelection(val_loose, "Loose");
201  if (val_loose) {
203  *eventInfo);
204  if (isTrueConv) {
206  *truthParticle, *eventInfo);
207  } else {
209  *truthParticle, *eventInfo);
210  }
211  } //-- end truth loose
212  bool val_tight = false;
213  recoPhoton->passSelection(val_tight, "Tight");
214  if (val_tight) {
216  *eventInfo);
217  if (isTrueConv) {
219  *truthParticle, *eventInfo);
220  } else {
222  *truthParticle, *eventInfo);
223  }
224  } //-- end truth tight
225  } //-- end recoPhoton
226  } //-- end Photons
227  } // -- end fill histos iso particles
228  // filling all truth particles from TruthParticles container (possibly will
229  // be deleted, also possibly to fill only prompt particles)
232  ATH_CHECK(truthallParticles.isValid());
233 
235  bool elecPrompt = false;
236  bool photonPrompt = false;
237 
238  for (const auto* const truthallParticle :
239  *truthallParticles) { // Electrons and photons from standard
240  // TruthParticle container
241 
242  //--electrons
243  if (std::abs(truthallParticle->pdgId()) == 11 &&
244  MC::isStable(truthallParticle) &&
245  HepMC::generations(truthallParticle) == 0) {
246 
247  auto type =
248  m_truthClassifier->particleTruthClassifier(truthallParticle, &info);
249  if (type.first == IsoElectron)
250  elecPrompt = true;
251 
253  *eventInfo);
254  if (elecPrompt) {
256  *eventInfo);
258  *eventInfo);
259  }
260  } //-- end electrons
261 
262  //--photons
263  if (std::abs(truthallParticle->pdgId()) == 22 &&
264  MC::isStable(truthallParticle) &&
265  HepMC::generations(truthallParticle) == 0) {
266 
267  auto type =
268  m_truthClassifier->particleTruthClassifier(truthallParticle, &info);
269  if (type.first == IsoPhoton)
270  photonPrompt = true;
271 
272 
274  *eventInfo);
275 
276  if (!photonPrompt)
277  continue;
278  if (truthallParticle->pt() / GeV > 20. &&
279  fabs(truthallParticle->eta()) < 2.47) {
281  *eventInfo);
282  m_truthClassifier->particleTruthClassifier(truthallParticle, &info);
283  ParticleOutCome photOutCome = info.particleOutCome;
284 
285  float convTruthR = 9999.;
286  if (truthallParticle->decayVtx())
287  convTruthR = truthallParticle->decayVtx()->perp();
288  // std::cout<<"Truth Conversion R "<<convTruthR<<std::endl;
289  // m_oPhotonValidationPlots.convTruthR->Fill(convTruthR);
290 
291  // fill only iso photon for conv and not converted
292  if (photOutCome == Converted && convTruthR < 800.)
294  *truthallParticle, *eventInfo);
295  else
297  *truthallParticle, *eventInfo);
298  } // end cuts on truth
299  } // -- end photons
300  }
301 
302  //---------Electrons----------------------
303  if (!fillRecoElecHistograms(truthParticles.ptr(), eventInfo.ptr())) {
304  ATH_MSG_ERROR("Filling reco elecectron hists failed " << name()
305  << "...");
306  return StatusCode::FAILURE;
307  }
308 
309  //---------LRTElectrons----------------------
311  if (!fillLRTElecHistograms(truthParticles.ptr(), eventInfo.ptr())) {
312  ATH_MSG_ERROR("Filling lrt elecectron hists failed " << name() << "...");
313  return StatusCode::FAILURE;
314  }
315  }
316 
317  //---------Frwd Electrons----------------------
318  if (!fillRecoFrwdElecHistograms(truthParticles.ptr(), eventInfo.ptr())) {
319  ATH_MSG_ERROR("Filling reco frwd elecectron hists failed " << name()
320  << "...");
321  return StatusCode::FAILURE;
322  }
323  //----------Photons
324  if (!fillRecoPhotHistograms(truthParticles.ptr(), eventInfo.ptr())) {
325  ATH_MSG_ERROR("Filling reco photon hists failed " << name() << "...");
326  return StatusCode::FAILURE;
327  }
328  } else // end is MC / code using truth particles
329  {//---------Electrons----------------------
330  if (!fillRecoElecHistograms(nullptr, eventInfo.ptr())) {
331  ATH_MSG_ERROR("Filling reco elecectron hists failed " << name()
332  << "...");
333  return StatusCode::FAILURE;
334  }
335  //---------Frwd Electrons----------------------
336  if (!fillRecoFrwdElecHistograms(nullptr, eventInfo.ptr())) {
337  ATH_MSG_ERROR("Filling reco frwd elecectron hists failed " << name()
338  << "...");
339  return StatusCode::FAILURE;
340  }
341  //----------Photons
342  if (!fillRecoPhotHistograms(nullptr, eventInfo.ptr())) {
343  ATH_MSG_ERROR("Filling reco photon hists failed " << name() << "...");
344  return StatusCode::FAILURE;
345  }
346 
347  }
348 
349 
350 
351  return StatusCode::SUCCESS;
352 }
353 
354 //-------------------------------------------------------------------
356 //-------------------------------------------------------------------
357 {
358  ATH_MSG_DEBUG ("Filling reco electron hists " << name() << "...");
359 
360  const EventContext& ctx = Gaudi::Hive::currentContext();
362  ATH_CHECK(Electrons.isValid());
363 
364  int numofele=0;
365 
366  float weight = eventInfo->beamSpotWeight();
367 
368  for(const auto *const electron : *Electrons){
369  bool isElecPrompt=false;
370 
371  if(!(electron->isGoodOQ (xAOD::EgammaParameters::BADCLUSELECTRON))) continue;
372 
375 
376  if(!m_isMC) m_oElectronValidationPlots.fill(*electron,*eventInfo,isElecPrompt);
377  else {
378  static const SG::ConstAccessor<int> truthTypeAcc ("truthType");
379  if(truthTypeAcc.isAvailable (*electron)) {
381  if(type==MCTruthPartClassifier::IsoElectron) {
382  isElecPrompt=true;
383  //fill energy scale
384  const xAOD::TruthParticle* thePart = xAOD::TruthHelpers::getTruthParticle(*electron); // 20.7.X.Y.I
385  if(thePart) {
386  float EtLin = (electron->pt()-thePart->pt())/thePart->pt();
387  m_oElectronValidationPlots.res_et->Fill(thePart->pt()/GeV,EtLin,weight);
388  m_oElectronValidationPlots.res_eta->Fill(thePart->eta(),EtLin,weight);
389  if (thePart->pt()/GeV>20.) {
390  m_oElectronValidationPlots.res_et_cut->Fill(thePart->pt()/GeV,EtLin,weight);
391  m_oElectronValidationPlots.res_eta_cut->Fill(thePart->eta(),EtLin,weight);
392  m_oElectronValidationPlots.res_et_cut_pt_20->Fill(thePart->pt()/GeV,EtLin,weight);
393  m_oElectronValidationPlots.res_eta_cut_pt_20->Fill(thePart->eta(),EtLin,weight);
394  }
395  m_oElectronValidationPlots.matrix->Fill(electron->pt()/GeV,thePart->pt()/GeV);
396  } else {
397  ATH_MSG_INFO ("Truth particle associated not in egamma truth collection");
398  }
399  }
400 
401  } else if(m_isMC){ if(Match(electron,11, truthParticles)!=nullptr ) isElecPrompt=true;}
402 
403  m_oElectronValidationPlots.fill(*electron,*eventInfo,isElecPrompt);
404  }
405  }
408 
409  return StatusCode::SUCCESS;
410 }
411 
412 //-------------------------------------------------------------------
414 //-------------------------------------------------------------------
415 {
416  ATH_MSG_DEBUG ("Filling lrt electron hists " << name() << "...");
417 
418  const EventContext& ctx = Gaudi::Hive::currentContext();
420  ATH_CHECK(LRTElectrons.isValid());
421 
422  int numofele=0;
423 
424  float weight = eventInfo->beamSpotWeight();
425 
426  for(const auto *const electron : *LRTElectrons){
427  bool isElecPrompt=false;
428 
429  if(!(electron->isGoodOQ (xAOD::EgammaParameters::BADCLUSELECTRON))) continue;
430 
431  // Retrieve electron ID, compute on-the-fly if decoration is missing (for AODs)
432  bool pass_LHVeryLooseNoPix = false;
433  if (m_acc_electronLLH_VeryLooseNoPix.isAvailable(*electron)) electron->passSelection(pass_LHVeryLooseNoPix, "DFCommonElectronsLHVeryLooseNoPix");
434  else pass_LHVeryLooseNoPix = static_cast<bool>(m_Electron_VeryLooseNoPix_LLHTool->accept(electron));
435 
436  bool pass_LHLooseNoPix = false;
437  if (m_acc_electronLLH_LooseNoPix.isAvailable(*electron)) electron->passSelection(pass_LHLooseNoPix, "DFCommonElectronsLHLooseNoPix");
438  else pass_LHLooseNoPix = static_cast<bool>(m_Electron_LooseNoPix_LLHTool->accept(electron));
439 
440  bool pass_LHMediumNoPix = false;
441  if (m_acc_electronLLH_MediumNoPix.isAvailable(*electron)) electron->passSelection(pass_LHMediumNoPix, "DFCommonElectronsLHMediumNoPix");
442  else pass_LHMediumNoPix = static_cast<bool>(m_Electron_MediumNoPix_LLHTool->accept(electron));
443 
444  bool pass_LHTightNoPix = false;
445  if (m_acc_electronLLH_TightNoPix.isAvailable(*electron)) electron->passSelection(pass_LHTightNoPix, "DFCommonElectronsLHTightNoPix");
446  else pass_LHTightNoPix = static_cast<bool>(m_Electron_TightNoPix_LLHTool->accept(electron));
447 
448  static const SG::ConstAccessor<int> truthTypeAcc ("truthType");
449  if(truthTypeAcc.isAvailable(*electron)) {
451  if(type==MCTruthPartClassifier::IsoElectron) {
452  isElecPrompt=true;
453  //fill energy scale
454  const xAOD::TruthParticle* thePart = xAOD::TruthHelpers::getTruthParticle(*electron); // 20.7.X.Y.I
455  if(thePart) {
456  float EtLin = (electron->pt()-thePart->pt())/thePart->pt();
457  m_oLRTElectronValidationPlots.res_et->Fill(thePart->pt()/GeV,EtLin,weight);
458  m_oLRTElectronValidationPlots.res_eta->Fill(thePart->eta(),EtLin,weight);
459  if (thePart->pt()/GeV>20.) {
460  m_oLRTElectronValidationPlots.res_et_cut->Fill(thePart->pt()/GeV,EtLin,weight);
461  m_oLRTElectronValidationPlots.res_eta_cut->Fill(thePart->eta(),EtLin,weight);
464  }
465  m_oLRTElectronValidationPlots.matrix->Fill(electron->pt()/GeV,thePart->pt()/GeV);
466  }else {
467  ATH_MSG_INFO ("Truth particle associated not in egamma truth collection");
468  }
469  }
470  } else if(m_isMC){ if(Match(electron,11, truthParticles)!=nullptr ) isElecPrompt=true;}
471 
472 
473  m_oLRTElectronValidationPlots.fill(*electron,*eventInfo, isElecPrompt, pass_LHVeryLooseNoPix, pass_LHLooseNoPix, pass_LHMediumNoPix, pass_LHTightNoPix);
476 
477  }
478 
481 
482  return StatusCode::SUCCESS;
483 }
484 
486 {
487  ATH_MSG_DEBUG ("Filling reco frwd electron hists " << name() << "...");
488 
489  const EventContext& ctx = Gaudi::Hive::currentContext();
491  ATH_CHECK(ElectronsFrwd.isValid());
492 
493  int numoffrwdele=0;
494  float weight = eventInfo->beamSpotWeight();
495 
496  for(const auto *const frwdelectron : *ElectronsFrwd){
497  if(!(frwdelectron->isGoodOQ (xAOD::EgammaParameters::BADCLUSELECTRON))) continue;
498  bool isElecPrompt=false;
499  if (m_isMC) {
500  if((Match(frwdelectron,11, truthParticles)!=nullptr )) isElecPrompt=true;
501  }
502  m_oElectronValidationPlots.fill(*frwdelectron,*eventInfo,isElecPrompt);
503  numoffrwdele++;
504  isElecPrompt=false;
505  }
506 
509 
510  return StatusCode::SUCCESS;
511 }
512 //-------------------------------------------------------------------
514 //-------------------------------------------------------------------
515 {
516  ATH_MSG_DEBUG ("Filling reco photon hists " << name() << "...");
517 
518  const EventContext& ctx = Gaudi::Hive::currentContext();
520  ATH_CHECK(Photons.isValid());
521 
522  int numofPhot=0;
523  int numofTopo=0;
524  int numofAmb=0;
525  int numPhotAll=0;
526  int numofCnv=0;
527  float weight = eventInfo->beamSpotWeight();
528 
529  for(const auto *photon : *Photons){
530  bool isPhotPrompt=false;
531  if (photon->author()&xAOD::EgammaParameters::AuthorCaloTopo35) continue;//21.0.>7
532  if(!(photon->isGoodOQ (xAOD::EgammaParameters::BADCLUSPHOTON))) continue;
533 
534  if(photon->author()&xAOD::EgammaParameters::AuthorPhoton&&photon->pt()/GeV>7.) numofPhot++;
535  else if(photon->pt()*0.001<7.) numofTopo++;
536  else if(photon->author()&xAOD::EgammaParameters::AuthorAmbiguous&&photon->pt()/GeV>7.) numofAmb++;
537  if(xAOD::EgammaHelpers::isConvertedPhoton(photon)&&photon->pt()/GeV>7.) numofCnv++;
538  if(!m_isMC) m_oPhotonValidationPlots.fill(*photon,*eventInfo, isPhotPrompt);
539  else {
540  static const SG::ConstAccessor<int> truthTypeAcc ("truthType");
541  if(truthTypeAcc.isAvailable(*photon)) {
544  isPhotPrompt=true;
545  //fill energy scale
546  const xAOD::TruthParticle* thePart = xAOD::TruthHelpers::getTruthParticle(*photon);//20.7.X.Y.I
547  // const xAOD::TruthParticle* thePart = xAOD::EgammaHelpers::getTruthParticle(photon);
548  if(thePart&&thePart->pt()/GeV>20.) {
549  float EtLin = (photon->pt()-thePart->pt())/thePart->pt();
550  m_oPhotonValidationPlots.res_et->Fill(thePart->pt()/GeV,EtLin,weight);
551  m_oPhotonValidationPlots.res_eta->Fill(thePart->eta(),EtLin,weight);
552  if (std::abs(EtLin)<0.2){
553  m_oPhotonValidationPlots.res_et_cut->Fill(thePart->pt()/GeV,EtLin,weight);
554  m_oPhotonValidationPlots.res_eta_cut->Fill(thePart->eta(),EtLin,weight);
555  }
556  }else {
557  cout<<"Truth particle associated not in egamma truth collection"<<endl;
558  }
559  }
560 
561  } else if(m_isMC){if(Match(photon,22, truthParticles)!=nullptr ) isPhotPrompt=true;}
562 
563  m_oPhotonValidationPlots.fill(*photon,*eventInfo, isPhotPrompt);
564 
565  }
566  }
567  numPhotAll = numofPhot+numofTopo+numofAmb;
573 
579 
580 
581  return StatusCode::SUCCESS;
582 }
583 //-------------------------------------------------------------------
585 //-------------------------------------------------------------------
586  {
587  ATH_MSG_INFO ("Finalising hists " << name() << "...");
590  return StatusCode::SUCCESS;
591  }
592 
593 //--------------------------------------------------------------------------------------------
595  int pdg,
596  const xAOD::TruthParticleContainer* truthParticles) {
597 //-------------------------------------------------------------------------------------------
598  float currentdr = 0.05;
599  const xAOD::TruthParticle* matchedTruthParticle = nullptr;
600  for (const auto *truthParticle: *truthParticles){
601  if (std::abs(truthParticle->pdgId()) != pdg || !MC::isStable(truthParticle)) continue;
602  float dr = particle->p4().DeltaR(truthParticle->p4());
603  if (dr < currentdr){
604  currentdr = dr;
605  matchedTruthParticle = truthParticle;
606  }
607  }
608  return matchedTruthParticle;
609 }
610 
611 
612 }
613 
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:513
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
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
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:74
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 >
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:413
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:200
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
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:57
IMCTruthClassifier.h
xAOD::EgammaHelpers::isConvertedPhoton
bool isConvertedPhoton(const xAOD::Egamma *eg, bool excludeTRT=false)
is the object a converted photon
Definition: EgammaxAODHelpers.cxx:26
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
PlotBase::finalize
void finalize()
Definition: PlotBase.cxx:41
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:669
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:33
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:41
EgammaPhysValMonitoring::EgammaPhysValMonitoringTool::fillRecoFrwdElecHistograms
StatusCode fillRecoFrwdElecHistograms(const xAOD::TruthParticleContainer *truthParticles, const xAOD::EventInfo *eventInfo)
Definition: EgammaPhysValMonitoringTool.cxx:485
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:355
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:581
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:118
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:192
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:594
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)
Definition: HepMCHelpers.h:30
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:116
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:302
ParticleType
ParticleType
Definition: TruthClasses.h:8
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
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:584
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:1454
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