ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetValidation
InDetPhysValMonitoring
src
InDetPerfPlot_TrackParameters.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
9
10
11
#include "
InDetPhysValMonitoringUtilities.h
"
12
13
#include "
InDetPerfPlot_TrackParameters.h
"
14
#include "
AthContainers/ConstAccessor.h
"
15
#include <cmath>
16
using namespace
IDPVM
;
17
18
InDetPerfPlot_TrackParameters::InDetPerfPlot_TrackParameters
(
InDetPlotBase
* pParent,
const
std::string& sDir,
bool
hasHGTDReco) :
19
InDetPlotBase
(pParent, sDir),
m_hasHGTDReco
{hasHGTDReco}{
20
//nop
21
//variable initialised at declaration
22
}
23
24
void
25
InDetPerfPlot_TrackParameters::initializePlots
() {
26
27
book
(
m_reco_d0
,
"reco_d0"
);
28
book
(
m_reco_z0
,
"reco_z0"
);
29
book
(
m_reco_z0sin
,
"reco_z0sin"
);
30
book
(
m_reco_phi
,
"reco_phi"
);
31
book
(
m_reco_theta
,
"reco_theta"
);
32
book
(
m_reco_eta
,
"reco_eta"
);
33
book
(
m_reco_qoverp
,
"reco_qoverp"
);
34
book
(
m_reco_pt
,
"reco_pt"
);
35
book
(
m_reco_lowpt
,
"reco_lowpt"
);
36
book
(
m_reco_chi2
,
"reco_chi2"
);
37
book
(
m_reco_ndof
,
"reco_ndof"
);
38
book
(
m_reco_chi2Overndof
,
"reco_chi2Overndof"
);
39
book
(
m_reco_author
,
"reco_author"
);
40
if
(
m_hasHGTDReco
){
41
book
(
m_reco_time
,
"reco_time"
);
42
if
(
m_iDetailLevel
>= 100){
43
book
(
m_reco_HGTDChi2
,
"reco_HGTDChi2"
);
44
book
(
m_reco_timeResolution
,
"reco_timeResolution"
);
45
book
(
m_reco_meanTime
,
"reco_meanTime"
);
46
book
(
m_reco_meanTimeResolution
,
"reco_meanTimeResolution"
);
47
}
48
book
(
m_reco_hasValidTime_eff_vs_eta
,
"reco_hasValidTime_eff_vs_eta"
);
49
}
50
51
book
(
m_truth_d0
,
"truth_d0"
);
52
book
(
m_truth_z0
,
"truth_z0"
);
53
book
(
m_truth_z0sin
,
"truth_z0sin"
);
54
book
(
m_truth_phi
,
"truth_phi"
);
55
book
(
m_truth_theta
,
"truth_theta"
);
56
book
(
m_truth_eta
,
"truth_eta"
);
57
book
(
m_truth_qoverp
,
"truth_qoverp"
);
58
book
(
m_truth_pt
,
"truth_pt"
);
59
book
(
m_truth_lowpt
,
"truth_lowpt"
);
60
book
(
m_truth_prodR
,
"truth_prodR"
);
61
book
(
m_truth_prodZ
,
"truth_prodZ"
);
62
book
(
m_truth_time
,
"truth_time"
);
63
64
book
(
m_reco_pt_vs_eta
,
"reco_pt_vs_eta"
);
65
book
(
m_reco_phi_vs_eta
,
"reco_phi_vs_eta"
);
66
67
book
(
m_reco_d0_z0
,
"reco_d0_vs_z0"
);
68
book
(
m_reco_d0_z0sin
,
"reco_d0_vs_z0sin"
);
69
70
book
(
m_truth_pt_vs_eta
,
"truth_pt_vs_eta"
);
71
book
(
m_truth_phi_vs_eta
,
"truth_phi_vs_eta"
);
72
73
book
(
m_truth_hits
,
"truth_hits"
);
74
book
(
m_truth_hits_vs_eta
,
"truth_hits_vs_eta"
);
75
76
}
77
78
void
79
InDetPerfPlot_TrackParameters::fill
(
const
xAOD::TruthParticle
& particle,
float
weight) {
80
81
// quantities with xAOD::TruthParticle accessors:
82
float
eta
= particle.eta();
83
float
pt = particle.pt() / Gaudi::Units::GeV;
84
float
phi
= particle.phi();
85
86
static
const
SG::ConstAccessor<float>
d0Acc(
"d0"
);
87
static
const
SG::ConstAccessor<float>
z0Acc(
"z0"
);
88
static
const
SG::ConstAccessor<float>
thetaAcc(
"theta"
);
89
static
const
SG::ConstAccessor<float>
qOverPAcc(
"qOverP"
);
90
static
const
SG::ConstAccessor<float>
prodRAcc(
"prodR"
);
91
static
const
SG::ConstAccessor<float>
prodZAcc(
"prodZ"
);
92
static
const
SG::ConstAccessor<float>
timeAcc(
"time"
);
93
float
d0 = d0Acc.
isAvailable
(particle) ? d0Acc(particle) : -9999.;
94
float
z0 = z0Acc.
isAvailable
(particle) ? z0Acc(particle) : -9999.;
95
float
theta
= thetaAcc.
isAvailable
(particle) ? thetaAcc(particle) : -9999.;
96
float
z0sin = (z0Acc.
isAvailable
(particle) && z0Acc(particle)) ? z0 * std::sin(
theta
) : -9999.;
97
float
qOverP = qOverPAcc.
isAvailable
(particle) ? qOverPAcc(particle) : -9999.;
98
float
prodR = prodRAcc.
isAvailable
(particle) ? prodRAcc(particle) : -9999.;
99
float
prodZ = prodZAcc.
isAvailable
(particle) ? prodZAcc(particle) : -9999.;
100
float
time = timeAcc.
isAvailable
(particle) ? timeAcc(particle) : -9999.;
101
102
if
(d0 > -9000.)
fillHisto
(
m_truth_d0
, d0, weight);
103
if
(z0 > -9000.)
fillHisto
(
m_truth_z0
, z0, weight);
104
if
(
theta
> -9000.)
fillHisto
(
m_truth_theta
,
theta
, weight);
105
if
(
phi
> -9000.)
fillHisto
(
m_truth_phi
,
phi
, weight);
106
if
(z0sin > -9000.)
fillHisto
(
m_truth_z0sin
, z0sin, weight);
107
if
(qOverP > -9000.)
fillHisto
(
m_truth_qoverp
, qOverP, weight);
108
if
(prodR > -9000.)
fillHisto
(
m_truth_prodR
, prodR, weight);
109
if
(prodZ > -9000.)
fillHisto
(
m_truth_prodZ
, prodZ, weight);
110
if
(time > -9000.)
fillHisto
(
m_truth_time
, time, weight);
111
112
fillHisto
(
m_truth_eta
,
eta
, weight);
113
fillHisto
(
m_truth_pt
, pt, weight);
114
fillHisto
(
m_truth_lowpt
, pt, weight);
115
116
fillHisto
(
m_truth_pt_vs_eta
, pt,
eta
, weight);
117
fillHisto
(
m_truth_phi_vs_eta
,
phi
,
eta
, weight);
118
119
static
const
SG::AuxElement::ConstAccessor< float > nSilHitsAcc(
"nSilHits"
);
120
if
(nSilHitsAcc.isAvailable(particle)) {
121
float
hits = nSilHitsAcc(particle);
122
fillHisto
(
m_truth_hits
, hits, weight);
123
fillHisto
(
m_truth_hits_vs_eta
,
eta
, hits, weight);
124
}
125
}
126
127
void
128
InDetPerfPlot_TrackParameters::fill
(
const
xAOD::TrackParticle
& particle,
float
weight) {
129
130
float
pt = particle.pt() / Gaudi::Units::GeV;
131
float
eta
= particle.eta();
132
float
phi
= particle.phi0();
133
134
float
chi2
= particle.chiSquared();
135
float
ndof = particle.numberDoF();
136
float
chi2Overndof = ndof > 0 ?
chi2
/ ndof : 0;
137
138
139
fillHisto
(
m_reco_d0
, particle.d0(), weight);
140
fillHisto
(
m_reco_z0
, particle.z0(), weight);
141
fillHisto
(
m_reco_z0sin
, particle.z0()* std::sin(particle.theta()), weight);
142
143
fillHisto
(
m_reco_phi
,
phi
, weight);
144
fillHisto
(
m_reco_theta
, particle.theta(), weight);
145
fillHisto
(
m_reco_eta
,
eta
, weight);
146
fillHisto
(
m_reco_qoverp
, particle.qOverP(), weight);
147
fillHisto
(
m_reco_pt
, pt, weight);
148
fillHisto
(
m_reco_lowpt
, pt, weight);
149
150
fillHisto
(
m_reco_pt_vs_eta
, pt,
eta
, weight);
151
fillHisto
(
m_reco_phi_vs_eta
,
phi
,
eta
, weight);
152
153
fillHisto
(
m_reco_d0_z0
, particle.d0(), particle.z0(), weight);
154
fillHisto
(
m_reco_d0_z0sin
, particle.d0(), particle.z0()*std::sin(particle.theta()), weight);
155
156
fillHisto
(
m_reco_chi2
,
chi2
, weight);
157
fillHisto
(
m_reco_ndof
, ndof, weight);
158
fillHisto
(
m_reco_chi2Overndof
, chi2Overndof, weight);
159
160
std::bitset<xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo> patternInfo = particle.patternRecoInfo();
161
for
(
unsigned
int
i = 0; i <
xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo
; i++){
162
if
(patternInfo.test(i))
fillHisto
(
m_reco_author
, i, weight);
163
}
164
165
if
(
m_hasHGTDReco
){
166
static
const
SG::Accessor< uint8_t >
accValidTime(
"hasValidTime"
);
167
static
const
SG::Accessor< float >
accTime(
"time"
);
168
if
( accValidTime.
isAvailable
(particle) && accTime.
isAvailable
(particle) ) {
169
if
(particle.hasValidTime()) {
170
fillHisto
(
m_reco_time
, particle.time(), weight);
171
if
(
m_iDetailLevel
>= 100){
172
static
const
SG::Accessor<float>
hgtdMeanTime(
"HGTDMeanTime"
);
173
static
const
SG::Accessor<float>
hgtdMeanTimeResolution(
"HGTDMeanTimeResolution"
);
174
static
const
SG::Accessor<float>
hgtdTimeResolution(
"timeResolution"
);
175
static
const
SG::ConstAccessor<float>
hgtdChi2(
"HGTDChi2"
);
176
177
if
(hgtdMeanTime.
isAvailable
(particle)) {
178
float
chi2
= hgtdChi2(particle);
179
fillHisto
(
m_reco_HGTDChi2
,
chi2
>0 ? log10(
chi2
) : -std::numeric_limits<float>::infinity(), weight);
180
fillHisto
(
m_reco_meanTime
, hgtdMeanTime(particle), weight);
181
fillHisto
(
m_reco_meanTimeResolution
, hgtdMeanTimeResolution(particle), weight);
182
fillHisto
(
m_reco_timeResolution
, hgtdTimeResolution(particle), weight);
183
}
184
}
185
}
186
}
187
188
if
( accValidTime.
isAvailable
(particle) ) {
189
fillHisto
(
m_reco_hasValidTime_eff_vs_eta
,
eta
, particle.hasValidTime(), weight);
190
}
191
}
192
193
}
194
195
void
196
InDetPerfPlot_TrackParameters::finalizePlots
() {
197
198
//
199
//Pie
200
//
201
202
}
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
theta
Scalar theta() const
theta method
Definition
AmgMatrixBasePlugin.h:75
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
InDetPerfPlot_TrackParameters.h
InDetPhysValMonitoringUtilities.h
InDetPerfPlot_TrackParameters::m_reco_HGTDChi2
TH1 * m_reco_HGTDChi2
Definition
InDetPerfPlot_TrackParameters.h:48
InDetPerfPlot_TrackParameters::m_reco_author
TH1 * m_reco_author
Definition
InDetPerfPlot_TrackParameters.h:43
InDetPerfPlot_TrackParameters::m_truth_pt_vs_eta
TH2 * m_truth_pt_vs_eta
Definition
InDetPerfPlot_TrackParameters.h:70
InDetPerfPlot_TrackParameters::m_reco_lowpt
TH1 * m_reco_lowpt
Definition
InDetPerfPlot_TrackParameters.h:39
InDetPerfPlot_TrackParameters::m_hasHGTDReco
bool m_hasHGTDReco
Definition
InDetPerfPlot_TrackParameters.h:29
InDetPerfPlot_TrackParameters::m_reco_pt_vs_eta
TH2 * m_reco_pt_vs_eta
Definition
InDetPerfPlot_TrackParameters.h:64
InDetPerfPlot_TrackParameters::m_reco_pt
TH1 * m_reco_pt
Definition
InDetPerfPlot_TrackParameters.h:38
InDetPerfPlot_TrackParameters::m_truth_hits
TH1 * m_truth_hits
Definition
InDetPerfPlot_TrackParameters.h:74
InDetPerfPlot_TrackParameters::m_reco_meanTimeResolution
TH1 * m_reco_meanTimeResolution
Definition
InDetPerfPlot_TrackParameters.h:46
InDetPerfPlot_TrackParameters::m_truth_phi_vs_eta
TH2 * m_truth_phi_vs_eta
Definition
InDetPerfPlot_TrackParameters.h:71
InDetPerfPlot_TrackParameters::m_truth_d0
TH1 * m_truth_d0
Definition
InDetPerfPlot_TrackParameters.h:51
InDetPerfPlot_TrackParameters::m_reco_chi2Overndof
TH1 * m_reco_chi2Overndof
Definition
InDetPerfPlot_TrackParameters.h:42
InDetPerfPlot_TrackParameters::m_reco_time
TH1 * m_reco_time
Definition
InDetPerfPlot_TrackParameters.h:44
InDetPerfPlot_TrackParameters::m_truth_hits_vs_eta
TH2 * m_truth_hits_vs_eta
Definition
InDetPerfPlot_TrackParameters.h:73
InDetPerfPlot_TrackParameters::m_truth_prodR
TH1 * m_truth_prodR
Definition
InDetPerfPlot_TrackParameters.h:60
InDetPerfPlot_TrackParameters::finalizePlots
void finalizePlots()
Definition
InDetPerfPlot_TrackParameters.cxx:196
InDetPerfPlot_TrackParameters::InDetPerfPlot_TrackParameters
InDetPerfPlot_TrackParameters(InDetPlotBase *pParent, const std::string &dirName, bool hasHGTDReco)
Definition
InDetPerfPlot_TrackParameters.cxx:18
InDetPerfPlot_TrackParameters::m_reco_theta
TH1 * m_reco_theta
Definition
InDetPerfPlot_TrackParameters.h:35
InDetPerfPlot_TrackParameters::m_truth_z0
TH1 * m_truth_z0
Definition
InDetPerfPlot_TrackParameters.h:52
InDetPerfPlot_TrackParameters::m_truth_time
TH1 * m_truth_time
Definition
InDetPerfPlot_TrackParameters.h:62
InDetPerfPlot_TrackParameters::m_reco_d0_z0
TH2 * m_reco_d0_z0
Definition
InDetPerfPlot_TrackParameters.h:67
InDetPerfPlot_TrackParameters::m_reco_phi
TH1 * m_reco_phi
Definition
InDetPerfPlot_TrackParameters.h:34
InDetPerfPlot_TrackParameters::m_reco_ndof
TH1 * m_reco_ndof
Definition
InDetPerfPlot_TrackParameters.h:41
InDetPerfPlot_TrackParameters::m_reco_hasValidTime_eff_vs_eta
TEfficiency * m_reco_hasValidTime_eff_vs_eta
Definition
InDetPerfPlot_TrackParameters.h:49
InDetPerfPlot_TrackParameters::m_truth_theta
TH1 * m_truth_theta
Definition
InDetPerfPlot_TrackParameters.h:55
InDetPerfPlot_TrackParameters::m_truth_eta
TH1 * m_truth_eta
Definition
InDetPerfPlot_TrackParameters.h:56
InDetPerfPlot_TrackParameters::m_reco_d0
TH1 * m_reco_d0
Definition
InDetPerfPlot_TrackParameters.h:31
InDetPerfPlot_TrackParameters::m_reco_meanTime
TH1 * m_reco_meanTime
Definition
InDetPerfPlot_TrackParameters.h:45
InDetPerfPlot_TrackParameters::m_truth_pt
TH1 * m_truth_pt
Definition
InDetPerfPlot_TrackParameters.h:58
InDetPerfPlot_TrackParameters::m_reco_eta
TH1 * m_reco_eta
Definition
InDetPerfPlot_TrackParameters.h:36
InDetPerfPlot_TrackParameters::m_truth_qoverp
TH1 * m_truth_qoverp
Definition
InDetPerfPlot_TrackParameters.h:57
InDetPerfPlot_TrackParameters::m_reco_chi2
TH1 * m_reco_chi2
Definition
InDetPerfPlot_TrackParameters.h:40
InDetPerfPlot_TrackParameters::m_reco_phi_vs_eta
TH2 * m_reco_phi_vs_eta
Definition
InDetPerfPlot_TrackParameters.h:65
InDetPerfPlot_TrackParameters::m_truth_prodZ
TH1 * m_truth_prodZ
Definition
InDetPerfPlot_TrackParameters.h:61
InDetPerfPlot_TrackParameters::fill
void fill(const xAOD::TrackParticle &particle, float weight)
Definition
InDetPerfPlot_TrackParameters.cxx:128
InDetPerfPlot_TrackParameters::m_reco_z0sin
TH1 * m_reco_z0sin
Definition
InDetPerfPlot_TrackParameters.h:33
InDetPerfPlot_TrackParameters::m_truth_phi
TH1 * m_truth_phi
Definition
InDetPerfPlot_TrackParameters.h:54
InDetPerfPlot_TrackParameters::m_reco_z0
TH1 * m_reco_z0
Definition
InDetPerfPlot_TrackParameters.h:32
InDetPerfPlot_TrackParameters::m_reco_d0_z0sin
TH2 * m_reco_d0_z0sin
Definition
InDetPerfPlot_TrackParameters.h:68
InDetPerfPlot_TrackParameters::initializePlots
void initializePlots()
Definition
InDetPerfPlot_TrackParameters.cxx:25
InDetPerfPlot_TrackParameters::m_reco_timeResolution
TH1 * m_reco_timeResolution
Definition
InDetPerfPlot_TrackParameters.h:47
InDetPerfPlot_TrackParameters::m_reco_qoverp
TH1 * m_reco_qoverp
Definition
InDetPerfPlot_TrackParameters.h:37
InDetPerfPlot_TrackParameters::m_truth_lowpt
TH1 * m_truth_lowpt
Definition
InDetPerfPlot_TrackParameters.h:59
InDetPerfPlot_TrackParameters::m_truth_z0sin
TH1 * m_truth_z0sin
Definition
InDetPerfPlot_TrackParameters.h:53
InDetPlotBase::fillHisto
static void fillHisto(TProfile *pTprofile, const float bin, const float weight, const float weight2=1.0)
Definition
InDetPlotBase.cxx:82
InDetPlotBase::InDetPlotBase
InDetPlotBase(InDetPlotBase *pParent, const std::string &dirName)
Constructor taking parent node and directory name for plots.
Definition
InDetPlotBase.cxx:35
InDetPlotBase::book
void book(Htype *&pHisto, std::string_view histoIdentifier, std::string_view nameOverride="", std::string_view folder="default")
Helper method to book histograms using an identifier string.
PlotBase::m_iDetailLevel
int m_iDetailLevel
Definition
PlotBase.h:102
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition
Control/AthContainers/AthContainers/Accessor.h:68
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition
ConstAccessor.h:55
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition
comparitor.cxx:525
IDPVM
Class to retrieve associated truth from a track, implementing a cached response.
Definition
InDetPhysValMonitoringTool.h:56
xAOD::TrackParticle
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Definition
Event/xAOD/xAODTracking/xAODTracking/TrackParticle.h:13
xAOD::TruthParticle
TruthParticle_v1 TruthParticle
Typedef to implementation.
Definition
Event/xAOD/xAODTruth/xAODTruth/TruthParticle.h:15
xAOD::NumberOfTrackRecoInfo
@ NumberOfTrackRecoInfo
maximum number of enums
Definition
TrackingPrimitives.h:190
Generated on
for ATLAS Offline Software by
1.17.0