ATLAS Offline Software
Loading...
Searching...
No Matches
Reconstruction
egamma
egammaValidation
src
RecoPhotonHistograms.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
RecoPhotonHistograms.h
"
6
7
#include "
AsgMessaging/Check.h
"
8
#include "GaudiKernel/ITHistSvc.h"
9
#include "
xAODTruth/TruthParticle.h
"
10
#include "
xAODTruth/TruthVertex.h
"
11
#include "
xAODTruth/xAODTruthHelpers.h
"
12
13
#include "TH1D.h"
14
15
using namespace
egammaMonitoring
;
16
17
StatusCode
RecoPhotonHistograms::initializePlots
() {
18
19
ATH_CHECK
(
ParticleHistograms::initializePlots
());
20
21
const
char
* fN =
m_name
.c_str();
22
23
histoMap
[
"convRadius"
] =
new
TH1D(Form(
"%s_convRadius"
,fN),
";Conversion Radius [mm]; Events"
, 14,
m_cR_bins
);
24
histoMap
[
"truthType"
] =
new
TH1D(Form(
"%s_truthType"
,fN),
";truth type; Events"
, 41,-1,40);
25
histoMap
[
"truthOrigin"
] =
new
TH1D(Form(
"%s_truthOrigin"
,fN),
";truth origin; Events"
,51,-1,50);
26
27
ATH_CHECK
(
m_rootHistSvc
->regHist(
m_folder
+
"convRadius"
,
histoMap
[
"convRadius"
]));
28
ATH_CHECK
(
m_rootHistSvc
->regHist(
m_folder
+
"truthType"
,
histoMap
[
"truthType"
]));
29
ATH_CHECK
(
m_rootHistSvc
->regHist(
m_folder
+
"truthOrigin"
,
histoMap
[
"truthOrigin"
]));
30
31
return
StatusCode::SUCCESS;
32
}
33
34
void
RecoPhotonHistograms::fill
(
const
xAOD::Photon
& phrec) {
35
36
ParticleHistograms::fill
(phrec);
37
38
static
const
SG::AuxElement::ConstAccessor<int>
accType(
"truthType"
);
39
static
const
SG::AuxElement::ConstAccessor<int>
accOrigin(
"truthOrigin"
);
40
if
(accOrigin.
isAvailable
(phrec))
41
histoMap
[
"truthOrigin"
]->Fill(accOrigin(phrec));
42
else
43
histoMap
[
"truthOrigin"
]->Fill(-1);
44
if
(accType.
isAvailable
(phrec))
45
histoMap
[
"truthType"
]->Fill(accType(phrec));
46
else
47
histoMap
[
"truthType"
]->Fill(-1);
48
49
double
trueR(-999);
50
const
xAOD::TruthParticle
*tmp =
xAOD::TruthHelpers::getTruthParticle
(phrec);
51
if
(tmp) {
52
if
(tmp->pdgId() == 22 && tmp->hasDecayVtx()) {
53
54
float
x
= tmp->decayVtx()->x();
55
float
y
= tmp->decayVtx()->y();
56
trueR = std::sqrt(
x
*
x
+
y
*
y
);
57
58
}
59
}
60
histoMap
[
"convRadius"
]->Fill(trueR);
61
62
63
}
// fill
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
Check.h
TruthParticle.h
RecoPhotonHistograms.h
TruthVertex.h
y
#define y
x
#define x
SG::AuxElement::ConstAccessor
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition
AuxElement.h:569
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
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::RecoPhotonHistograms::m_cR_bins
float m_cR_bins[15]
Definition
RecoPhotonHistograms.h:26
egammaMonitoring::RecoPhotonHistograms::initializePlots
StatusCode initializePlots()
Definition
RecoPhotonHistograms.cxx:17
egammaMonitoring::RecoPhotonHistograms::fill
void fill(const xAOD::Photon &phrec)
Definition
RecoPhotonHistograms.cxx:34
egammaMonitoring
Definition
ClusterHistograms.h:19
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::TruthParticle
TruthParticle_v1 TruthParticle
Typedef to implementation.
Definition
Event/xAOD/xAODTruth/xAODTruth/TruthParticle.h:15
xAOD::Photon
Photon_v1 Photon
Definition of the current "egamma version".
Definition
Event/xAOD/xAODEgamma/xAODEgamma/Photon.h:17
xAODTruthHelpers.h
Generated on
for ATLAS Offline Software by
1.14.0