ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetValidation
InDetTrackPerfMon
src
plots
OfflineElectronPlots.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
12
#include "
OfflineElectronPlots.h
"
13
#include "
../TrackParametersHelper.h
"
14
#include "
../OfflineObjectDecorHelper.h
"
15
16
20
IDTPM::OfflineElectronPlots::OfflineElectronPlots
(
21
PlotMgr
* pParent,
const
std::string& dirName,
22
const
std::string& anaTag,
bool
doEfficiency ) :
23
PlotMgr
( dirName, anaTag, pParent ),
24
m_doEfficiency
( doEfficiency ) { }
25
26
30
void
IDTPM::OfflineElectronPlots::initializePlots
()
31
{
32
StatusCode
sc
=
bookPlots
();
33
if
(
sc
.isFailure() ) {
34
ATH_MSG_ERROR
(
"Failed to book offline electron plots"
);
35
}
36
}
37
38
39
StatusCode
IDTPM::OfflineElectronPlots::bookPlots
()
40
{
41
ATH_MSG_DEBUG
(
"Booking offline electron plots in "
<<
getDirectory
() );
42
43
if
( not
m_doEfficiency
) {
44
ATH_CHECK
(
retrieveAndBook
(
m_Et
,
"offEle_Et"
) );
45
ATH_CHECK
(
retrieveAndBook
(
m_EtOverPt
,
"offEle_EtOverPt"
) );
46
}
else
{
47
ATH_CHECK
(
retrieveAndBook
(
m_eff_vs_Et
,
"eff_vs_offEle_Et"
) );
48
ATH_CHECK
(
retrieveAndBook
(
m_eff_vs_EtOverPt
,
"eff_vs_offEle_EtOverPt"
) );
49
}
50
51
return
StatusCode::SUCCESS;
52
}
53
54
58
StatusCode
IDTPM::OfflineElectronPlots::fillPlots
(
59
const
xAOD::TrackParticle
& track,
60
bool
isMatched,
float
weight )
61
{
62
const
xAOD::Electron
* ele =
getLinkedElectron
( track );
63
64
if
( not ele ) {
65
ATH_MSG_ERROR
(
"Electron not found"
);
66
return
StatusCode::FAILURE;
67
}
68
70
float
ppt =
pT
( track ) / Gaudi::Units::GeV;
71
float
pet =
eT
( *ele ) / Gaudi::Units::GeV;
72
74
if
( not
m_doEfficiency
) {
75
ATH_CHECK
(
fill
(
m_Et
, pet, weight ) );
76
ATH_CHECK
(
fill
(
m_EtOverPt
, (pet/ppt), weight ) );
77
}
else
{
78
ATH_CHECK
(
fill
(
m_eff_vs_Et
, pet, isMatched, weight ) );
79
ATH_CHECK
(
fill
(
m_eff_vs_EtOverPt
, (pet/ppt), isMatched, weight ) );
80
}
81
82
return
StatusCode::SUCCESS;
83
}
84
85
86
StatusCode
IDTPM::OfflineElectronPlots::fillPlots
(
87
const
xAOD::TruthParticle
&,
bool
,
float
)
88
{
89
ATH_MSG_ERROR
(
"Fill method disabled for truth particles"
);
90
return
StatusCode::FAILURE;
91
}
92
93
97
void
IDTPM::OfflineElectronPlots::finalizePlots
()
98
{
99
ATH_MSG_DEBUG
(
"Finalising offline electron plots"
);
101
}
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
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
OfflineElectronPlots.h
OfflineObjectDecorHelper.h
Utility methods to access offline object decorations.
TrackParametersHelper.h
Utility methods to access track/truth particles parmeters in a consitent way in this package.
IDTPM::OfflineElectronPlots::m_Et
TH1 * m_Et
Definition
OfflineElectronPlots.h:55
IDTPM::OfflineElectronPlots::finalizePlots
void finalizePlots()
Print out final stats on histograms.
Definition
OfflineElectronPlots.cxx:97
IDTPM::OfflineElectronPlots::bookPlots
StatusCode bookPlots()
Definition
OfflineElectronPlots.cxx:39
IDTPM::OfflineElectronPlots::m_doEfficiency
bool m_doEfficiency
Definition
OfflineElectronPlots.h:53
IDTPM::OfflineElectronPlots::OfflineElectronPlots
OfflineElectronPlots(PlotMgr *pParent, const std::string &dirName, const std::string &anaTag, bool doEfficiency=false)
Constructor.
Definition
OfflineElectronPlots.cxx:20
IDTPM::OfflineElectronPlots::fillPlots
StatusCode fillPlots(const xAOD::TrackParticle &track, bool isMatched, float weight)
Dedicated fill methods.
Definition
OfflineElectronPlots.cxx:58
IDTPM::OfflineElectronPlots::m_eff_vs_EtOverPt
TEfficiency * m_eff_vs_EtOverPt
Definition
OfflineElectronPlots.h:60
IDTPM::OfflineElectronPlots::initializePlots
void initializePlots()
Book the histograms.
Definition
OfflineElectronPlots.cxx:30
IDTPM::OfflineElectronPlots::m_EtOverPt
TH1 * m_EtOverPt
Definition
OfflineElectronPlots.h:56
IDTPM::OfflineElectronPlots::m_eff_vs_Et
TEfficiency * m_eff_vs_Et
TODO - include more plots.
Definition
OfflineElectronPlots.h:59
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::eT
float eT(const U &p)
Accessor utility function for getting the value of Tranverse energy.
Definition
TrackParametersHelper.h:122
IDTPM::getLinkedElectron
const xAOD::Electron * getLinkedElectron(const xAOD::TrackParticle &track, const std::string &quality)
getLinkedElectron
Definition
OfflineObjectDecorHelper.cxx:18
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::Electron
Electron_v1 Electron
Definition of the current "egamma version".
Definition
Event/xAOD/xAODEgamma/xAODEgamma/Electron.h:17
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