ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
egamma
egammaValidation
src
TrackHistograms.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrackHistograms.h
"
6
#include "GaudiKernel/ITHistSvc.h"
7
#include "
AsgMessaging/Check.h
"
8
#include "
xAODBase/IParticle.h
"
9
#include "
xAODTracking/TrackParticle.h
"
10
#include "
xAODEgamma/EgammaxAODHelpers.h
"
11
12
#include "TH1D.h"
13
#include "TProfile.h"
14
15
using namespace
egammaMonitoring
;
16
using
xAOD::EgammaHelpers::summaryValueFloat
;
17
using
xAOD::EgammaHelpers::summaryValueInt
;
18
19
StatusCode
TrackHistograms::initializePlots
() {
20
21
const
char
* fN =
m_name
.c_str();
22
23
histoMap
[
"pT"
] =
new
TH1D(Form(
"%s_pT"
,fN),
";p_{T} [GeV];Tracks"
, 100, 0., 100.);
24
25
histoMap
[
"PrecisionHitFraction"
] =
new
TH1D(Form(
"%s_PrecisionHitFraction"
,fN),
";Precision hit fraction;Tracks"
, 20, 0., 1.);
26
histoMap
[
"PrecisionHitFraction_lowmu"
] =
new
TH1D(Form(
"%s_PrecisionHitFraction_lowmu"
,fN),
";Precision hit fraction;Tracks"
, 20, 0., 1.);
27
histoMap
[
"PrecisionHitFraction_highmu"
] =
new
TH1D(Form(
"%s_PrecisionHitFraction_highmu"
,fN),
";Precision hit fraction;Tracks"
, 20, 0., 1.);
28
29
histoMap
[
"eProbabilityHT"
] =
new
TH1D(Form(
"%s_eProbabilityHT"
,fN),
";eProbabilityHT;Tracks"
, 20, 0., 1.);
30
histoMap
[
"eProbabilityHT_lowmu"
] =
new
TH1D(Form(
"%s_eProbabilityHT_lowmu"
,fN),
";eProbabilityHT;Tracks"
, 20, 0., 1.);
31
histoMap
[
"eProbabilityHT_highmu"
] =
new
TH1D(Form(
"%s_eProbabilityHT_highmu"
,fN),
";eProbabilityHT;Tracks"
, 20, 0., 1.);
32
33
profileMap
[
"PrecisionHitFractionvsmu"
] =
new
TProfile(Form(
"%s_PrecisionHitFractionvsmu"
,fN),
";mu;Precision hit fraction"
, 35, 0., 70., 0., 1.);
34
profileMap
[
"eProbabilityHTvsmu"
] =
new
TProfile(Form(
"%s_eProbabilityHTvsmu"
,fN),
";mu;eProbabilityHT"
, 35, 0., 70., 0., 1.);
35
36
ATH_CHECK
(
m_rootHistSvc
->regHist(
m_folder
+
"pT"
,
histoMap
[
"pT"
]));
37
38
ATH_CHECK
(
m_rootHistSvc
->regHist(
m_folder
+
"PrecisionHitFraction"
,
histoMap
[
"PrecisionHitFraction"
]));
39
ATH_CHECK
(
m_rootHistSvc
->regHist(
m_folder
+
"PrecisionHitFraction_lowmu"
,
histoMap
[
"PrecisionHitFraction_lowmu"
]));
40
ATH_CHECK
(
m_rootHistSvc
->regHist(
m_folder
+
"PrecisionHitFraction_highmu"
,
histoMap
[
"PrecisionHitFraction_highmu"
]));
41
42
ATH_CHECK
(
m_rootHistSvc
->regHist(
m_folder
+
"eProbabilityHT"
,
histoMap
[
"eProbabilityHT"
]));
43
ATH_CHECK
(
m_rootHistSvc
->regHist(
m_folder
+
"eProbabilityHT_lowmu"
,
histoMap
[
"eProbabilityHT_lowmu"
]));
44
ATH_CHECK
(
m_rootHistSvc
->regHist(
m_folder
+
"eProbabilityHT_highmu"
,
histoMap
[
"eProbabilityHT_highmu"
]));
45
46
ATH_CHECK
(
m_rootHistSvc
->regHist(
m_folder
+
"PrecisionHitFractionvsmu"
,
profileMap
[
"PrecisionHitFractionvsmu"
]));
47
ATH_CHECK
(
m_rootHistSvc
->regHist(
m_folder
+
"eProbabilityHTvsmu"
,
profileMap
[
"eProbabilityHTvsmu"
]));
48
49
return
StatusCode::SUCCESS;
50
51
}
// initializePlots
52
53
54
void
TrackHistograms::fill
(
const
xAOD::IParticle
& track) {
55
TrackHistograms::fill
(track,0.);
56
}
57
58
void
59
TrackHistograms::fill
(
const
xAOD::IParticle
& track,
float
mu)
60
{
61
62
const
xAOD::TrackParticle
* tp =
63
static_cast<
const
xAOD::TrackParticle
*
>
(&track);
64
65
int
nTRTHits =
summaryValueInt
(*tp,
xAOD::numberOfTRTHits
);
66
int
nTRTTubeHits =
summaryValueInt
(*tp,
xAOD::numberOfTRTTubeHits
);
67
float
precHitFrac = (nTRTHits > 0 && nTRTTubeHits >= 0)
68
? (1. - ((
float
)nTRTTubeHits) / ((
float
)nTRTHits))
69
: -999.;
70
71
float
eProbabilityHT =
summaryValueFloat
(*tp,
xAOD::eProbabilityHT
);
72
73
histoMap
[
"pT"
]->Fill(tp->
pt
() / 1000.);
74
75
histoMap
[
"PrecisionHitFraction"
]->Fill(precHitFrac);
76
histoMap
[
"eProbabilityHT"
]->Fill(eProbabilityHT);
77
78
if
(mu < 25.) {
79
histoMap
[
"PrecisionHitFraction_lowmu"
]->Fill(precHitFrac);
80
histoMap
[
"eProbabilityHT_lowmu"
]->Fill(eProbabilityHT);
81
}
82
83
if
(mu > 35.) {
84
histoMap
[
"PrecisionHitFraction_highmu"
]->Fill(precHitFrac);
85
histoMap
[
"eProbabilityHT_highmu"
]->Fill(eProbabilityHT);
86
}
87
88
profileMap
[
"PrecisionHitFractionvsmu"
]->Fill(mu, precHitFrac);
89
profileMap
[
"eProbabilityHTvsmu"
]->Fill(mu, eProbabilityHT);
90
}
summaryValueInt
int summaryValueInt(const xAOD::TrackParticle &tp, const xAOD::SummaryType &info, int deflt=-999)
return the summary value for a TrackParticle or default value (-999) (to be used mostly in python whe...
Definition
EgammaxAODHelpers.cxx:173
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
Check.h
EgammaxAODHelpers.h
IParticle.h
TrackParticle.h
summaryValueFloat
float summaryValueFloat(const xAOD::TrackParticle &tp, const xAOD::SummaryType &info, float deflt=-999.)
return the summary value for a TrackParticle or default value (-999)
Definition
EgammaxAODHelpers.cxx:180
TrackHistograms.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::TrackHistograms::initializePlots
StatusCode initializePlots()
Definition
TrackHistograms.cxx:19
egammaMonitoring::TrackHistograms::profileMap
std::map< std::string, TProfile * > profileMap
Definition
TrackHistograms.h:22
egammaMonitoring::TrackHistograms::fill
void fill(const xAOD::IParticle &track, float mu)
Definition
TrackHistograms.cxx:59
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition
Event/xAOD/xAODBase/xAODBase/IParticle.h:41
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::EgammaHelpers::summaryValueFloat
float summaryValueFloat(const xAOD::TrackParticle &tp, const xAOD::SummaryType &info, float deflt=-999.)
return the summary value for a TrackParticle or default value (-999)
Definition
EgammaxAODHelpers.cxx:180
xAOD::EgammaHelpers::summaryValueInt
int summaryValueInt(const xAOD::TrackParticle &tp, const xAOD::SummaryType &info, int deflt=-999)
return the summary value for a TrackParticle or default value (-999) (to be used mostly in python whe...
Definition
EgammaxAODHelpers.cxx:173
xAOD::TrackParticle
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Definition
Event/xAOD/xAODTracking/xAODTracking/TrackParticle.h:13
xAOD::numberOfTRTHits
@ numberOfTRTHits
number of TRT hits [unit8_t].
Definition
TrackingPrimitives.h:276
xAOD::numberOfTRTTubeHits
@ numberOfTRTTubeHits
number of TRT tube hits [unit8_t].
Definition
TrackingPrimitives.h:284
xAOD::eProbabilityHT
@ eProbabilityHT
Electron probability from High Threshold (HT) information [float].
Definition
TrackingPrimitives.h:307
Generated on
for ATLAS Offline Software by
1.17.0