ATLAS Offline Software
Public Member Functions | Public Attributes | Protected Attributes | Private Attributes | List of all members
egammaMonitoring::TruthPhotonHistograms Class Reference

#include <TruthPhotonHistograms.h>

Inheritance diagram for egammaMonitoring::TruthPhotonHistograms:
Collaboration diagram for egammaMonitoring::TruthPhotonHistograms:

Public Member Functions

StatusCode initializePlots ()
 
void fill (const xAOD::IParticle &)
 
void fill (const xAOD::IParticle &, float mu)
 
StatusCode initializePlots ()
 
void fill (const xAOD::IParticle &egamma)
 
void fill (const xAOD::IParticle &egamma, float mu)
 
void hasFwd (bool a=true)
 
 IHistograms ()
 
 IHistograms (std::string name, std::string title, std::string folder, SmartIF< ITHistSvc > rootHistSvc)
 

Public Attributes

std::map< std::string, TH2D * > histo2DMap
 
std::map< std::string, TH1D * > histoMap
 

Protected Attributes

std::string m_name
 
std::string m_title
 
std::string m_folder
 
SmartIF< ITHistSvc > m_rootHistSvc
 

Private Attributes

float m_cR_bins [15] = {0, 50, 89, 123, 170, 210, 250, 299, 335, 371, 443, 514, 554, 800, 1085}
 
bool m_hasFwd = false
 

Detailed Description

Definition at line 18 of file TruthPhotonHistograms.h.

Member Function Documentation

◆ fill() [1/4]

void TruthPhotonHistograms::fill ( const xAOD::IParticle phrec)
virtual

Reimplemented from egammaMonitoring::ParticleHistograms.

Definition at line 65 of file TruthPhotonHistograms.cxx.

65  {
67 }

◆ fill() [2/4]

void TruthPhotonHistograms::fill ( const xAOD::IParticle phrec,
float  mu 
)
virtual

Reimplemented from egammaMonitoring::ParticleHistograms.

Definition at line 69 of file TruthPhotonHistograms.cxx.

69  {
70 
72 
74 
75  float trueR = -999;
76  if (truth) {
77  if (truth->pdgId() == 22 && truth->hasDecayVtx()) {
78 
79  trueR = truth->decayVtx()->perp();
80 
81  }
82  }
83 
84  histoMap["convRadius_all"]->Fill(trueR);
85  histoMap["convRadius"]->Fill(trueR);
86  histoMap["pileup"]->Fill(mu);
87  histoMap["onebin"]->Fill(0.5);
88 
89  if(phrec.pt()/1000. > 15) {
90  histoMap["convRadius_15GeV"]->Fill(trueR);
91  histoMap["pileup_15GeV"]->Fill(mu);
92  histoMap["onebin_15GeV"]->Fill(0.5);
93  }
94 
95  // access reco photon from the xAOD::TruthParticle (can't use the IParticle* here)
96  const auto *truthParticle = dynamic_cast<const xAOD::TruthParticle*>(&phrec);
97  if (truthParticle) {
99 
100  if (photon) {
101  float res_e = photon->e()/truth->e() - 1.;
102  float res_eta = photon->eta() - truth->eta();
103  float res_phi = photon->phi() - truth->phi();
105 
106  // Resolution histograms only make sense if there was a reco particle !
107  // And for resolution on R, only if true conv, reco conv
108  if (recoR < 1000 && trueR > 0)
109  histoMap["convRadiusTrueVsReco"]->Fill(recoR - trueR);
110 
111  histoMap["resolution_e"]->Fill(res_e);
112  histoMap["resolution_eta"]->Fill(res_eta);
113  histoMap["resolution_phi"]->Fill(res_phi);
114 
115  histo2DMap["resolution_e_vs_pT"]->Fill(phrec.pt()/1000., res_e);
116  histo2DMap["resolution_e_vs_eta"]->Fill(std::abs(phrec.eta()), res_e);
117 
118  }
119  }
120 
121 
122 } // fill

◆ fill() [3/4]

void egammaMonitoring::ParticleHistograms::fill

Definition at line 23 of file ParticleHistograms.cxx.

41  {
43  }

◆ fill() [4/4]

void egammaMonitoring::ParticleHistograms::fill

Definition at line 24 of file ParticleHistograms.cxx.

45  {
46 
47  double pT = egamma.pt()*1e-3;
48  if (pT > 0)
49  histoMap["pT"]->Fill(pT);
50  histoMap["eta"]->Fill(egamma.eta());
51  histoMap["phi"]->Fill(egamma.phi());
52 
53  if (pT > 15) {
54  histoMap["eta_15GeV"]->Fill(egamma.eta());
55  histoMap["phi_15GeV"]->Fill(egamma.phi());
56  }
57 
58  if (m_hasFwd && std::abs(egamma.eta()) < 4.) {
59  histoMap["pT_eta4"]->Fill(pT);
60  histoMap["phi_eta4"]->Fill(egamma.phi());
61  }
62 
63  }

◆ hasFwd()

void egammaMonitoring::ParticleHistograms::hasFwd ( bool  a = true)
inlineinherited

Definition at line 26 of file ParticleHistograms.h.

26 { m_hasFwd = a; }

◆ IHistograms() [1/2]

egammaMonitoring::IHistograms::IHistograms
inherited

◆ IHistograms() [2/2]

egammaMonitoring::IHistograms::IHistograms
inlineinherited

Definition at line 26 of file IHistograms.h.

30  :
31  m_name(std::move(std::move(name))),
32  m_title(std::move(std::move(title))),
33  m_folder(std::move(std::move(folder))),
34  m_rootHistSvc(std::move(rootHistSvc)) {}

◆ initializePlots() [1/2]

StatusCode egammaMonitoring::ParticleHistograms::initializePlots

Definition at line 21 of file ParticleHistograms.cxx.

13  {
14 
15  const char* fN = m_name.c_str();
16 
17  histoMap["pT"] = new TH1D(Form("%s_pT",fN) , ";p_{T} [GeV];Events", 40, 0, 200);
18  histoMap["eta"] = new TH1D(Form("%s_eta",fN), ";#eta;Events" , 90, -4.5, 4.5);
19  histoMap["phi"] = new TH1D(Form("%s_phi",fN), ";#phi;Events" , 20, -TMath::Pi(), TMath::Pi());
20 
21  histoMap["eta_15GeV"] = new TH1D(Form("%s_eta_15GeV",fN), ";#eta;Events", 90, -4.5, 4.5);
22  histoMap["phi_15GeV"] = new TH1D(Form("%s_phi_15GeV",fN), ";#phi;Events", 20, -TMath::Pi(), TMath::Pi());
23 
24  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"pT", histoMap["pT"]));
25  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"eta", histoMap["eta"]));
26  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"phi", histoMap["phi"]));
27 
28  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"eta_15GeV", histoMap["eta_15GeV"]));
29  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"phi_15GeV", histoMap["phi_15GeV"]));
30 
31  if (m_hasFwd) {
32  histoMap["pT_eta4"] = new TH1D(Form("%s_pT_eta4",fN) , ";p_{T} [GeV];Events",40, 0, 200);
33  histoMap["phi_eta4"] = new TH1D(Form("%s_phi_eta4",fN), ";#phi;Events" ,20, -TMath::Pi(), TMath::Pi());
34  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"pT_eta4", histoMap["pT_eta4"]));
35  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"phi_eta4", histoMap["phi_eta4"]));
36  }
37 
38  return StatusCode::SUCCESS;
39  }

◆ initializePlots() [2/2]

StatusCode TruthPhotonHistograms::initializePlots ( )
virtual

Reimplemented from egammaMonitoring::ParticleHistograms.

Definition at line 21 of file TruthPhotonHistograms.cxx.

21  {
22 
24 
25  const char* fN = m_name.c_str();
26 
27  histoMap["convRadius_all"] = new TH1D(Form("%s_convRadius_all",fN), ";Conversion Radius [mm]; Conversion Radius Events", 200, 0, 2000);
28  histoMap["convRadius"] = new TH1D(Form("%s_convRadius",fN), ";Conversion Radius [mm]; Conversion Radius Events", 14, m_cR_bins);
29  histoMap["convRadius_15GeV"] = new TH1D(Form("%s_convRadius_15GeV",fN), ";Conversion Radius [mm]; Conversion Radius Events", 14, m_cR_bins);
30  histoMap["convRadiusTrueVsReco"] = new TH1D(Form("%s_convRadiusTrueVsReco",fN), ";R^{reco}_{conv. vtx} - R^{true}_{conv. vtx} [mm]; Events", 100, -200, 200);
31 
32  histoMap["pileup"] = new TH1D(Form("%s_pileup",fN), ";mu; mu Events", 35, 0., 70.);
33  histoMap["pileup_15GeV"] = new TH1D(Form("%s_pileup_15GeV",fN), ";mu; mu Events", 35, 0., 70.);
34  histoMap["onebin"] = new TH1D(Form("%s_onebin",fN), "; ; Events", 1, 0., 1.);
35  histoMap["onebin_15GeV"] = new TH1D(Form("%s_onebin_15GeV",fN), "; ; Events", 1, 0., 1.);
36 
37  histoMap["resolution_e"] = new TH1D(Form("%s_resolution_e",fN), "; E_{reco} / E_{true} - 1; Events", 40, -0.2, 0.2);
38  histoMap["resolution_eta"] = new TH1D(Form("%s_resolution_eta",fN), "; #eta_{reco} - #eta_{true}; Events", 20, -0.05, 0.05);
39  histoMap["resolution_phi"] = new TH1D(Form("%s_resolution_phi",fN), "; #phi_{reco} - #phi_{true}; Events", 20, -0.05, 0.05);
40 
41  histo2DMap["resolution_e_vs_pT"] = new TH2D(Form("%s_resolution_e_vs_pT",fN), ";p_{T} [GeV];E_{reco} / E_{true} - 1", 40, 0, 200, 160, -0.2, 0.2);
42  histo2DMap["resolution_e_vs_eta"] = new TH2D(Form("%s_resolution_e_vs_eta",fN), ";|#eta|;E_{reco} / E_{true} - 1", 25, 0, 2.5, 160, -0.2, 0.2);
43 
44  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"convRadius_all", histoMap["convRadius_all"]));
45  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"convRadius", histoMap["convRadius"]));
46  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"convRadius_15GeV", histoMap["convRadius_15GeV"]));
47  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"convRadiusTrueVsReco", histoMap["convRadiusTrueVsReco"]));
48 
49  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"pileup", histoMap["pileup"]));
50  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"pileup_15GeV", histoMap["pileup_15GeV"]));
51  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"onebin", histoMap["onebin"]));
52  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"onebin_15GeV", histoMap["onebin_15GeV"]));
53 
54  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"resolution_e", histoMap["resolution_e"]));
55  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"resolution_eta", histoMap["resolution_eta"]));
56  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"resolution_phi", histoMap["resolution_phi"]));
57 
58  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"resolution_e_vs_pT", histo2DMap["resolution_e_vs_pT"]));
59  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"resolution_e_vs_eta", histo2DMap["resolution_e_vs_eta"]));
60 
61  return StatusCode::SUCCESS;
62 
63 }

Member Data Documentation

◆ histo2DMap

std::map<std::string, TH2D* > egammaMonitoring::TruthPhotonHistograms::histo2DMap

Definition at line 24 of file TruthPhotonHistograms.h.

◆ histoMap

std::map<std::string, TH1D*> egammaMonitoring::IHistograms::histoMap
inherited

Definition at line 42 of file IHistograms.h.

◆ m_cR_bins

float egammaMonitoring::TruthPhotonHistograms::m_cR_bins[15] = {0, 50, 89, 123, 170, 210, 250, 299, 335, 371, 443, 514, 554, 800, 1085}
private

Definition at line 35 of file TruthPhotonHistograms.h.

◆ m_folder

std::string egammaMonitoring::IHistograms::m_folder
protectedinherited

Definition at line 47 of file IHistograms.h.

◆ m_hasFwd

bool egammaMonitoring::ParticleHistograms::m_hasFwd = false
privateinherited

Definition at line 29 of file ParticleHistograms.h.

◆ m_name

std::string egammaMonitoring::IHistograms::m_name
protectedinherited

Definition at line 45 of file IHistograms.h.

◆ m_rootHistSvc

SmartIF<ITHistSvc> egammaMonitoring::IHistograms::m_rootHistSvc
protectedinherited

Definition at line 48 of file IHistograms.h.

◆ m_title

std::string egammaMonitoring::IHistograms::m_title
protectedinherited

Definition at line 46 of file IHistograms.h.


The documentation for this class was generated from the following files:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
CalculateHighPtTerm.pT
pT
Definition: ICHEP2016/CalculateHighPtTerm.py:57
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::TruthPhotonHistograms::m_cR_bins
float m_cR_bins[15]
Definition: TruthPhotonHistograms.h:35
ParticleImpl::pt
virtual double pt() const
transverse momentum
Definition: ParticleImpl.h:554
egammaMonitoring::ParticleHistograms::fill
void fill(const xAOD::IParticle &egamma)
Definition: ParticleHistograms.cxx:41
egamma
Definition: egamma.h:58
xAOD::TruthParticle_v1::hasDecayVtx
bool hasDecayVtx() const
Check for a decay vertex on this particle.
egammaMonitoring::IHistograms::m_folder
std::string m_folder
Definition: IHistograms.h:47
xAOD::TruthParticle_v1::e
virtual double e() const override final
The total energy of the particle.
egammaMonitoring::IHistograms::m_rootHistSvc
SmartIF< ITHistSvc > m_rootHistSvc
Definition: IHistograms.h:48
egammaMonitoring::ParticleHistograms::initializePlots
StatusCode initializePlots()
Definition: ParticleHistograms.cxx:13
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
covarianceTool.title
title
Definition: covarianceTool.py:542
xAOD::TruthVertex_v1::perp
float perp() const
Vertex transverse distance from the beam line.
Definition: TruthVertex_v1.cxx:163
ParticleImpl::phi
virtual double phi() const
phi in [-pi,pi[
Definition: ParticleImpl.h:524
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ParticleImpl::eta
virtual double eta() const
pseudo rapidity
Definition: ParticleImpl.h:514
egammaMonitoring::TruthPhotonHistograms::histo2DMap
std::map< std::string, TH2D * > histo2DMap
Definition: TruthPhotonHistograms.h:24
xAOD::IParticle::pt
virtual double pt() const =0
The transverse momentum ( ) of the particle.
xAOD::TruthParticle_v1::decayVtx
const TruthVertex_v1 * decayVtx() const
The decay vertex of this particle.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
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
xAOD::EgammaHelpers::conversionRadius
float conversionRadius(const xAOD::Vertex *vx)
return the conversion radius or 9999.
Definition: PhotonxAODHelpers.cxx:76
xAOD::TruthParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TruthParticle_v1.cxx:174
egammaMonitoring::TruthPhotonHistograms::fill
void fill(const xAOD::IParticle &)
Definition: TruthPhotonHistograms.cxx:65
xAOD::photon
@ photon
Definition: TrackingPrimitives.h:199
a
TList * a
Definition: liststreamerinfos.cxx:10
xAOD::Photon_v1
Definition: Photon_v1.h:37
xAOD::TruthParticle_v1::phi
virtual double phi() const override final
The azimuthal angle ( ) of the particle.
Definition: TruthParticle_v1.cxx:181
xAOD::IParticle::eta
virtual double eta() const =0
The pseudorapidity ( ) of the particle.
CaloCondBlobAlgs_fillNoiseFromASCII.folder
folder
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:56
egammaMonitoring::IHistograms::m_title
std::string m_title
Definition: IHistograms.h:46
xAOD::TruthParticle_v1::pdgId
int pdgId() const
PDG ID code.
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
egammaMonitoring::ParticleHistograms::m_hasFwd
bool m_hasFwd
Definition: ParticleHistograms.h:29
egammaMonitoring::IHistograms::m_name
std::string m_name
Definition: IHistograms.h:45
egammaMonitoring::IHistograms::histoMap
std::map< std::string, TH1D * > histoMap
Definition: IHistograms.h:40