ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetValidation
InDetTrackPerfMon
src
plots
FakeRatePlots.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
11
#include "
FakeRatePlots.h
"
12
#include "
../TrackParametersHelper.h
"
13
14
18
IDTPM::FakeRatePlots::FakeRatePlots
(
19
PlotMgr
* pParent,
const
std::string& dirName,
20
const
std::string& anaTag,
const
std::string& trackType,
21
bool
doGlobalPlots,
bool
doTruthMuPlots ) :
22
PlotMgr
( dirName, anaTag, pParent ),
23
m_trackType
( trackType ),
24
m_doGlobalPlots
( doGlobalPlots ),
25
m_doTruthMuPlots
( doTruthMuPlots ) { }
26
27
31
void
IDTPM::FakeRatePlots::initializePlots
()
32
{
33
StatusCode
sc
=
bookPlots
();
34
if
(
sc
.isFailure() ) {
35
ATH_MSG_ERROR
(
"Failed to book fake rate plots"
);
36
}
37
}
38
39
40
StatusCode
IDTPM::FakeRatePlots::bookPlots
()
41
{
42
ATH_MSG_DEBUG
(
"Booking efficiency plots in "
<<
getDirectory
() );
43
44
ATH_CHECK
(
retrieveAndBook
(
m_fakerate_vs_incl
,
"fakerate_vs_"
+
m_trackType
+
"_inclusive"
) );
45
ATH_CHECK
(
retrieveAndBook
(
m_fakerate_vs_pt
,
"fakerate_vs_"
+
m_trackType
+
"_pt"
) );
46
ATH_CHECK
(
retrieveAndBook
(
m_fakerate_vs_logPt
,
"fakerate_vs_"
+
m_trackType
+
"_logPt"
) );
47
ATH_CHECK
(
retrieveAndBook
(
m_fakerate_vs_eta
,
"fakerate_vs_"
+
m_trackType
+
"_eta"
) );
48
ATH_CHECK
(
retrieveAndBook
(
m_fakerate_vs_phi
,
"fakerate_vs_"
+
m_trackType
+
"_phi"
) );
49
ATH_CHECK
(
retrieveAndBook
(
m_fakerate_vs_d0
,
"fakerate_vs_"
+
m_trackType
+
"_d0"
) );
50
ATH_CHECK
(
retrieveAndBook
(
m_fakerate_vs_z0
,
"fakerate_vs_"
+
m_trackType
+
"_z0"
) );
51
if
(
m_doGlobalPlots
) {
52
ATH_CHECK
(
retrieveAndBook
(
m_fakerate_vs_actualMu
,
"fakerate_vs_actualMu"
) );
53
if
(
m_doTruthMuPlots
)
ATH_CHECK
(
retrieveAndBook
(
m_fakerate_vs_truthMu
,
"fakerate_vs_truthMu"
) );
54
}
55
return
StatusCode::SUCCESS;
56
}
57
58
62
template
<
typename
PARTICLE >
63
StatusCode
IDTPM::FakeRatePlots::fillPlots
(
64
const
PARTICLE& particle,
bool
isFake,
float
truthMu,
float
actualMu,
float
weight )
65
{
67
float
ppt =
pT
( particle ) / Gaudi::Units::GeV;
68
float
peta =
eta
( particle );
69
float
pphi =
phi
( particle );
70
float
pd0 =
d0
( particle );
71
float
pz0 =
z0
( particle );
72
74
ATH_CHECK
(
fill
(
m_fakerate_vs_incl
, 1, isFake, weight ) );
75
ATH_CHECK
(
fill
(
m_fakerate_vs_pt
, ppt, isFake, weight ) );
76
ATH_CHECK
(
fill
(
m_fakerate_vs_logPt
, ppt, isFake, weight ) );
77
ATH_CHECK
(
fill
(
m_fakerate_vs_eta
, peta, isFake, weight ) );
78
ATH_CHECK
(
fill
(
m_fakerate_vs_phi
, pphi, isFake, weight ) );
79
ATH_CHECK
(
fill
(
m_fakerate_vs_d0
, pd0, isFake, weight ) );
80
ATH_CHECK
(
fill
(
m_fakerate_vs_z0
, pz0, isFake, weight ) );
81
82
if
(
m_doGlobalPlots
) {
83
ATH_CHECK
(
fill
(
m_fakerate_vs_actualMu
, actualMu, isFake, weight ) );
84
if
(
m_doTruthMuPlots
)
ATH_CHECK
(
fill
(
m_fakerate_vs_truthMu
, truthMu, isFake, weight ) );
85
}
86
87
return
StatusCode::SUCCESS;
88
}
89
90
template
StatusCode
IDTPM::FakeRatePlots::fillPlots< xAOD::TrackParticle >
(
91
const
xAOD::TrackParticle
&,
bool
isFake,
float
truthMu,
float
actualMu,
float
weight );
92
93
template
StatusCode
IDTPM::FakeRatePlots::fillPlots< xAOD::TruthParticle >
(
94
const
xAOD::TruthParticle
&,
bool
isFake,
float
truthMu,
float
actualMu,
float
weight );
95
96
100
void
IDTPM::FakeRatePlots::finalizePlots
()
101
{
102
ATH_MSG_DEBUG
(
"Finalising fake rate plots"
);
104
}
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
FakeRatePlots.h
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
TrackParametersHelper.h
Utility methods to access track/truth particles parmeters in a consitent way in this package.
IDTPM::FakeRatePlots::m_fakerate_vs_z0
TEfficiency * m_fakerate_vs_z0
Definition
FakeRatePlots.h:63
IDTPM::FakeRatePlots::bookPlots
StatusCode bookPlots()
Definition
FakeRatePlots.cxx:40
IDTPM::FakeRatePlots::m_fakerate_vs_phi
TEfficiency * m_fakerate_vs_phi
Definition
FakeRatePlots.h:61
IDTPM::FakeRatePlots::m_doGlobalPlots
bool m_doGlobalPlots
Definition
FakeRatePlots.h:54
IDTPM::FakeRatePlots::m_fakerate_vs_actualMu
TEfficiency * m_fakerate_vs_actualMu
Definition
FakeRatePlots.h:65
IDTPM::FakeRatePlots::m_fakerate_vs_truthMu
TEfficiency * m_fakerate_vs_truthMu
Definition
FakeRatePlots.h:64
IDTPM::FakeRatePlots::m_fakerate_vs_logPt
TEfficiency * m_fakerate_vs_logPt
Definition
FakeRatePlots.h:59
IDTPM::FakeRatePlots::fillPlots
StatusCode fillPlots(const PARTICLE &particle, bool isFake, float truthMu, float actualMu, float weight)
Dedicated fill method (for tracks and/or truth particles).
Definition
FakeRatePlots.cxx:63
IDTPM::FakeRatePlots::m_trackType
std::string m_trackType
Definition
FakeRatePlots.h:53
IDTPM::FakeRatePlots::initializePlots
void initializePlots()
Book the histograms.
Definition
FakeRatePlots.cxx:31
IDTPM::FakeRatePlots::finalizePlots
void finalizePlots()
Print out final stats on histograms.
Definition
FakeRatePlots.cxx:100
IDTPM::FakeRatePlots::m_fakerate_vs_incl
TEfficiency * m_fakerate_vs_incl
Definition
FakeRatePlots.h:57
IDTPM::FakeRatePlots::FakeRatePlots
FakeRatePlots(PlotMgr *pParent, const std::string &dirName, const std::string &anaTag, const std::string &trackType, bool doGlobalPlots=false, bool doTruthMuPlots=false)
Constructor.
Definition
FakeRatePlots.cxx:18
IDTPM::FakeRatePlots::m_fakerate_vs_d0
TEfficiency * m_fakerate_vs_d0
Definition
FakeRatePlots.h:62
IDTPM::FakeRatePlots::m_doTruthMuPlots
bool m_doTruthMuPlots
Definition
FakeRatePlots.h:55
IDTPM::FakeRatePlots::m_fakerate_vs_pt
TEfficiency * m_fakerate_vs_pt
Definition
FakeRatePlots.h:58
IDTPM::FakeRatePlots::m_fakerate_vs_eta
TEfficiency * m_fakerate_vs_eta
Definition
FakeRatePlots.h:60
IDTPM::PlotMgr::retrieveAndBook
StatusCode retrieveAndBook(P *&pHisto, const std::string &identifier, std::string_view folderOverride="", std::string_view nameOverride="")
Definition
PlotMgr.h:65
IDTPM::PlotMgr::PlotMgr
PlotMgr(const std::string &dirName, const std::string &anaTag, PlotMgr *pParent=nullptr)
Constructor taking parent node and directory name for plots pParent = nullptr by default to book plot...
Definition
PlotMgr.cxx:25
PlotBase::getDirectory
const std::string & getDirectory()
Definition
PlotBase.h:89
IDTPM::pT
float pT(const U &p)
Accessor utility function for getting the value of pT.
Definition
TrackParametersHelper.h:33
IDTPM::z0
float z0(const U &p)
Definition
TrackParametersHelper.h:72
IDTPM::d0
float d0(const U &p)
Definition
TrackParametersHelper.h:84
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
fill
void fill(H5::Group &out_file, size_t iterations)
Definition
test-half-precision.cxx:64
Generated on
for ATLAS Offline Software by
1.17.0