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

#include <TruthElectronHistograms.h>

Inheritance diagram for egammaMonitoring::TruthElectronHistograms:
Collaboration diagram for egammaMonitoring::TruthElectronHistograms:

Public Member Functions

virtual StatusCode initializePlots () override
 
StatusCode initializePlots (bool reducedHistSet)
 
void fill (const xAOD::TruthParticle *truth, const xAOD::Electron *el=nullptr)
 
virtual ~TruthElectronHistograms ()
 
void fill (const xAOD::IParticle &egamma)
 
void fill (const xAOD::IParticle &egamma, float mu)
 
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 * > histoMap2D
 
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

bool m_reducedHistSet
 
bool m_hasFwd = false
 

Detailed Description

Definition at line 16 of file TruthElectronHistograms.h.

Constructor & Destructor Documentation

◆ ~TruthElectronHistograms()

virtual egammaMonitoring::TruthElectronHistograms::~TruthElectronHistograms ( )
inlinevirtual

Definition at line 29 of file TruthElectronHistograms.h.

29 {};

Member Function Documentation

◆ fill() [1/5]

void egammaMonitoring::ParticleHistograms::fill ( const xAOD::IParticle egamma)
virtualinherited

Implements egammaMonitoring::IHistograms.

Reimplemented in egammaMonitoring::TruthPhotonHistograms.

Definition at line 41 of file ParticleHistograms.cxx.

41  {
43  }

◆ fill() [2/5]

void egammaMonitoring::ParticleHistograms::fill

Definition at line 23 of file ParticleHistograms.cxx.

41  {
43  }

◆ fill() [3/5]

void egammaMonitoring::ParticleHistograms::fill ( const xAOD::IParticle egamma,
float  mu 
)
virtualinherited

Implements egammaMonitoring::IHistograms.

Reimplemented in egammaMonitoring::TruthPhotonHistograms.

Definition at line 45 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  }

◆ fill() [4/5]

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  }

◆ fill() [5/5]

void TruthElectronHistograms::fill ( const xAOD::TruthParticle truth,
const xAOD::Electron el = nullptr 
)

Definition at line 67 of file TruthElectronHistograms.cxx.

67  {
68 
70 
71  if (!electron || m_reducedHistSet) return;
72 
73  const xAOD::TrackParticle* track = electron->trackParticle();
74 
75  // This can happen if we use it for forwardElectron
76  if (!track) return;
77 
78  bool has2DHis = !histoMap2D.empty();
79 
80  float dphires2(0.);
81  float dphi2(0.);
82  float deta2(0);
83 
84  if (electron->trackCaloMatchValue(dphires2, xAOD::EgammaParameters::deltaPhiRescaled2)) {
85  histoMap["deltaPhiRescaled2"]->Fill(dphires2);
86  if (has2DHis) histoMap2D["eta_deltaPhiRescaled2"]->Fill(electron->eta(),dphires2);
87  }
88  if (electron->trackCaloMatchValue(dphi2, xAOD::EgammaParameters::deltaPhi2)) {
89  histoMap["deltaPhi2"]->Fill(dphi2);
90  if (has2DHis) histoMap2D["eta_deltaPhi2"]->Fill(electron->eta(),dphi2);
91  }
92  if (electron->trackCaloMatchValue(deta2, xAOD::EgammaParameters::deltaEta2)) {
93  histoMap["deltaEta2"]->Fill(deta2);
94  if (has2DHis) histoMap2D["eta_deltaEta2"]->Fill(electron->eta(),deta2);
95  }
96 
97  float d0 = track->d0();
98  float reco_qp = track->qOverP();
99  float truth_qp = truth->charge()/(truth->pt()*cosh(truth->eta()));
100  float vard0 = track->definingParametersCovMatrix()(0, 0);
101 
102  if (vard0 > 0) {
103  histoMap["d0Oversigmad0"]->Fill(d0/sqrtf(vard0));
104  if (has2DHis) histoMap2D["eta_d0Oversigmad0"]->Fill(electron->eta(),d0/sqrtf(vard0));
105  }
106 
107  if (truth_qp > 0) {
108  histoMap["qOverp_resolution"]->Fill((reco_qp-truth_qp)/truth_qp);
109  if (has2DHis) histoMap2D["eta_qOverp_resolution"]->Fill(electron->eta(),(reco_qp-truth_qp)/truth_qp);
110  }
111 
112 
113 }

◆ 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 TruthElectronHistograms::initializePlots ( )
overridevirtual

Reimplemented from egammaMonitoring::ParticleHistograms.

Definition at line 17 of file TruthElectronHistograms.cxx.

17  {
18  return initializePlots (false);
19 }

◆ initializePlots() [2/2]

StatusCode TruthElectronHistograms::initializePlots ( bool  reducedHistSet)

Definition at line 21 of file TruthElectronHistograms.cxx.

21  {
22 
23  const char* fN = m_name.c_str();
24 
25  if (!reducedHistSet) {
26  histoMap["deltaPhi2"] = new TH1D(Form("%s_deltaPhi2",fN), ";deltaPhi2; Events", 40, -0.06, 0.06);
27  histoMap["deltaEta2"] = new TH1D(Form("%s_deltaEta2",fN), ";deltaEta2; Events", 40, -0.04, 0.04);
28  histoMap["deltaPhiRescaled2"] = new TH1D(Form("%s_deltaPhiRescaled2",fN), ";deltaPhiRescaled2; Events", 40, -0.04, 0.04);
29 
30  histoMap["d0Oversigmad0"] = new TH1D(Form("%s_d0Oversigmad0",fN), "; d0Oversigmad0; Events", 40, -10, 10);
31  histoMap["qOverp_resolution"] = new TH1D(Form("%s_qOverp_resolution",fN), ";(q/P reco - q/P truth)/ q/p truth; Events", 60, -1, 1.5);
32 
33  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"deltaPhi2", histoMap["deltaPhi2"]));
34  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"deltaEta2", histoMap["deltaEta2"]));
35  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"deltaPhiRescaled2", histoMap["deltaPhiRescaled2"]));
36  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"d0Oversigmad0", histoMap["d0Oversigmad0"]));
37  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"qOverp_resolution", histoMap["qOverp_resolution"]));
38 
39  // 2D only for truthPromptElectronWithRecoTrack (temporary)
40  if (m_name == "truthPromptElectronWithRecoTrack") {
41  histoMap2D["eta_deltaPhi2"] = new TH2D(Form("%s_eta_deltaPhi2",fN),
42  ";#eta;#Delta#phi_{2}; Events", 90, -4.5, 4.5, 40, -0.06, 0.06);
43  histoMap2D["eta_deltaEta2"] = new TH2D(Form("%s_eta_deltaEta2",fN),
44  ";#eta;#Delta#eta_{2}; Events", 90, -4.5, 4.5, 40, -0.06, 0.06);
45  histoMap2D["eta_deltaPhiRescaled2"] = new TH2D(Form("%s_eta_deltaPhiRescaled2",fN),
46  ";#eta;#Delta#phi_{2}^{Rescaled}; Events", 90, -4.5, 4.5, 40, -0.06, 0.06);
47  histoMap2D["eta_d0Oversigmad0"] = new TH2D(Form("%s_eta_d0Oversigmad0",fN),
48  ";#eta;d_{0}/#sigma_{d_{0}}; Events", 90, -4.5, 4.5, 40, -10, 10);
49  histoMap2D["eta_qOverp_resolution"] = new TH2D(Form("%s_eta_qOverp_resolution",fN),
50  ";#eta;(q/P_{reco})/(q/P_{truth}) -1; Events", 90, -4.5, 4.5, 60, -1, 1.5);
51 
52  for (const auto& e : histoMap2D) {
53  ATH_CHECK(m_rootHistSvc->regHist(m_folder+e.first, e.second));
54  }
55  }
56  }
57 
59 
60  m_reducedHistSet = reducedHistSet;
61 
62  return StatusCode::SUCCESS;
63 
64 }

Member Data Documentation

◆ histoMap

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

Definition at line 42 of file IHistograms.h.

◆ histoMap2D

std::map<std::string, TH2D*> egammaMonitoring::TruthElectronHistograms::histoMap2D

Definition at line 31 of file TruthElectronHistograms.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_reducedHistSet

bool egammaMonitoring::TruthElectronHistograms::m_reducedHistSet
private

Definition at line 35 of file TruthElectronHistograms.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:
egammaMonitoring::TruthElectronHistograms::m_reducedHistSet
bool m_reducedHistSet
Definition: TruthElectronHistograms.h:35
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
CalculateHighPtTerm.pT
pT
Definition: ICHEP2016/CalculateHighPtTerm.py:57
ParticleImpl::pt
virtual double pt() const
transverse momentum
Definition: ParticleImpl.h:554
egammaMonitoring::TruthElectronHistograms::histoMap2D
std::map< std::string, TH2D * > histoMap2D
Definition: TruthElectronHistograms.h:29
xAOD::EgammaParameters::deltaEta2
@ deltaEta2
difference between the cluster eta (second sampling) and the eta of the track extrapolated to the sec...
Definition: EgammaEnums.h:187
egammaMonitoring::TruthElectronHistograms::initializePlots
virtual StatusCode initializePlots() override
Definition: TruthElectronHistograms.cxx:17
egammaMonitoring::ParticleHistograms::fill
void fill(const xAOD::IParticle &egamma)
Definition: ParticleHistograms.cxx:41
egamma
Definition: egamma.h:58
egammaMonitoring::IHistograms::m_folder
std::string m_folder
Definition: IHistograms.h:47
egammaMonitoring::IHistograms::m_rootHistSvc
SmartIF< ITHistSvc > m_rootHistSvc
Definition: IHistograms.h:48
egammaMonitoring::ParticleHistograms::initializePlots
StatusCode initializePlots()
Definition: ParticleHistograms.cxx:13
covarianceTool.title
title
Definition: covarianceTool.py:542
TRT::Track::d0
@ d0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:62
ParticleImpl::phi
virtual double phi() const
phi in [-pi,pi[
Definition: ParticleImpl.h:524
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
xAOD::EgammaParameters::deltaPhiRescaled2
@ deltaPhiRescaled2
difference between the cluster phi (second sampling) and the phi of the track extrapolated to the sec...
Definition: EgammaEnums.h:225
ParticleImpl::eta
virtual double eta() const
pseudo rapidity
Definition: ParticleImpl.h:514
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
xAOD::EgammaParameters::deltaPhi2
@ deltaPhi2
difference between the cluster phi (second sampling) and the phi of the track extrapolated to the sec...
Definition: EgammaEnums.h:204
xAOD::TruthParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TruthParticle_v1.cxx:174
a
TList * a
Definition: liststreamerinfos.cxx:10
xAOD::EgammaParameters::electron
@ electron
Definition: EgammaEnums.h:18
CaloCondBlobAlgs_fillNoiseFromASCII.folder
folder
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:56
xAOD::TruthParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TruthParticle_v1.cxx:166
egammaMonitoring::IHistograms::m_title
std::string m_title
Definition: IHistograms.h:46
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
egammaMonitoring::ParticleHistograms::m_hasFwd
bool m_hasFwd
Definition: ParticleHistograms.h:29
xAOD::TruthParticle_v1::charge
double charge() const
Physical charge.
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