ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
egamma
egammaValidation
src
RecoElectronHistograms.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
RecoElectronHistograms.h
"
6
#include "
AsgMessaging/Check.h
"
7
#include "GaudiKernel/ITHistSvc.h"
8
9
#include "TH2D.h"
10
#include "TH3D.h"
11
12
using namespace
egammaMonitoring
;
13
14
StatusCode
RecoElectronHistograms::initializePlots
() {
15
16
ATH_CHECK
(
ParticleHistograms::initializePlots
());
17
18
const
char
* fN =
m_name
.c_str();
19
20
if
(!
m_isData
) {
21
histoMap
[
"truthType"
] =
new
TH1D(Form(
"%s_truthType"
,fN),
";truth type; Events"
, 41,-1,40);
22
histoMap
[
"truthOrigin"
] =
new
TH1D(Form(
"%s_truthOrigin"
,fN),
";truth origin; Events"
,51,-1,50);
23
ATH_CHECK
(
m_rootHistSvc
->regHist(
m_folder
+
"truthType"
,
histoMap
[
"truthType"
]));
24
ATH_CHECK
(
m_rootHistSvc
->regHist(
m_folder
+
"truthOrigin"
,
histoMap
[
"truthOrigin"
]));
25
}
26
27
histo2DMap
[
"eta_nTracks"
] =
new
TH2D(Form(
"%s_eta_nTracks"
,fN),
28
";#eta;n_{trk}; Events"
, 90, -4.5, 4.5, 10, 0,10);
29
ATH_CHECK
(
m_rootHistSvc
->regHist(
m_folder
+
"eta_nTracks"
,
histo2DMap
[
"eta_nTracks"
]));
30
31
histo3DMap
[
"eteta_eop"
] =
new
TH3D(Form(
"%s_eteta_eop"
,fN),
32
";E_{T} [GeV];#eta;E/p; Events"
, 20, 0, 200, 25, 0, 2.5, 250, 0.5,3.);
33
ATH_CHECK
(
m_rootHistSvc
->regHist(
m_folder
+
"eteta_eop"
,
histo3DMap
[
"eteta_eop"
]));
34
35
return
StatusCode::SUCCESS;
36
37
}
38
39
void
RecoElectronHistograms::fill
(
const
xAOD::Electron
& elrec) {
40
41
ParticleHistograms::fill
(elrec);
42
43
if
(!
m_isData
) {
44
static
const
SG::AuxElement::ConstAccessor<int> accType(
"truthType"
);
45
static
const
SG::AuxElement::ConstAccessor<int> accOrigin(
"truthOrigin"
);
46
if
(accOrigin.isAvailable(elrec))
47
histoMap
[
"truthOrigin"
]->Fill(accOrigin(elrec));
48
else
49
histoMap
[
"truthOrigin"
]->Fill(-1);
50
if
(accType.isAvailable(elrec))
51
histoMap
[
"truthType"
]->Fill(accType(elrec));
52
else
53
histoMap
[
"truthType"
]->Fill(-1);
54
}
55
56
histo2DMap
[
"eta_nTracks"
]->Fill(elrec.
eta
(),elrec.
nTrackParticles
());
57
if
(elrec.
nTrackParticles
())
58
histo3DMap
[
"eteta_eop"
]->Fill(elrec.
pt
()*1e-3,std::abs(elrec.
eta
()),elrec.
pt
()/elrec.
trackParticle
()->
pt
());
59
60
}
61
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
Check.h
RecoElectronHistograms.h
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::IHistograms::m_name
std::string m_name
Definition
IHistograms.h:45
egammaMonitoring::IHistograms::histoMap
std::map< std::string, TH1D * > histoMap
Definition
IHistograms.h:42
egammaMonitoring::ParticleHistograms::initializePlots
StatusCode initializePlots()
Definition
ParticleHistograms.cxx:13
egammaMonitoring::ParticleHistograms::fill
void fill(const xAOD::IParticle &egamma)
Definition
ParticleHistograms.cxx:41
egammaMonitoring::RecoElectronHistograms::histo2DMap
std::map< std::string, TH2D * > histo2DMap
Definition
RecoElectronHistograms.h:21
egammaMonitoring::RecoElectronHistograms::initializePlots
StatusCode initializePlots()
Definition
RecoElectronHistograms.cxx:14
egammaMonitoring::RecoElectronHistograms::histo3DMap
std::map< std::string, TH3D * > histo3DMap
Definition
RecoElectronHistograms.h:22
egammaMonitoring::RecoElectronHistograms::m_isData
bool m_isData
Definition
RecoElectronHistograms.h:32
egammaMonitoring::RecoElectronHistograms::fill
void fill(const xAOD::Electron &elrec)
Definition
RecoElectronHistograms.cxx:39
xAOD::Egamma_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition
Egamma_v1.cxx:66
xAOD::Egamma_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition
Egamma_v1.cxx:71
xAOD::Electron_v1::trackParticle
const xAOD::TrackParticle * trackParticle(size_t index=0) const
Pointer to the xAOD::TrackParticle/s that match the electron candidate.
Definition
Electron_v1.cxx:60
xAOD::Electron_v1::nTrackParticles
size_t nTrackParticles() const
Return the number xAOD::TrackParticles that match the electron candidate.
Definition
Electron_v1.cxx:49
xAOD::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition
TrackParticle_v1.cxx:75
egammaMonitoring
Definition
ClusterHistograms.h:19
xAOD::Electron
Electron_v1 Electron
Definition of the current "egamma version".
Definition
Event/xAOD/xAODEgamma/xAODEgamma/Electron.h:17
Generated on
for ATLAS Offline Software by
1.17.0