ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkValidation
TrkValHistUtils
Root
ParamPlots.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include <utility>
6
7
8
9
#include "
TrkValHistUtils/ParamPlots.h
"
10
11
namespace
Trk
{
12
ParamPlots::ParamPlots
(
PlotBase
*pParent,
const
std::string& sDir, std::string sParticleType) :
PlotBase
(pParent, sDir),
13
m_sParticleType
(
std
::move(sParticleType)) {
14
eta
=
nullptr
;
15
phi
=
nullptr
;
16
pt
=
nullptr
;
17
18
eta_phi
=
nullptr
;
19
eta_pt
=
nullptr
;
20
}
21
22
void
23
ParamPlots::initializePlots
() {
24
pt
=
Book1D
(
"pt"
,
m_sParticleType
+
" pt;"
+
m_sParticleType
+
" Transverse Momentum [GeV];Entries / 1 GeV"
, 200,
25
0., 200);
26
eta
=
27
Book1D
(
"eta"
,
m_sParticleType
+
" eta;"
+
m_sParticleType
+
" Pseudo-Rapidity;Entries / 0.05"
, 128, -3.2, 3.2);
28
phi
=
29
Book1D
(
"phi"
,
m_sParticleType
+
" phi;"
+
m_sParticleType
+
" Azimuthal Angle;Entries / 0.05"
, 128, -3.2, 3.2);
30
31
eta_pt
=
Book2D
(
"eta_pt"
,
32
m_sParticleType
+
" eta vs pt;"
+
m_sParticleType
+
" eta;"
+
m_sParticleType
+
" pt;Entries.0.05/1 GeV"
, 128, -3.2, 3.2, 200, 0.,
33
200);
34
eta_phi
=
Book2D
(
"eta_phi"
,
35
m_sParticleType
+
" eta vs phi;"
+
m_sParticleType
+
" eta;"
+
m_sParticleType
+
" phi;Entries.0.05/0.5"
, 128, -3.2, 3.2, 128, -3.2,
36
3.2);
37
}
38
39
void
40
ParamPlots::fill
(
const
xAOD::IParticle
&prt,
float
weight) {
41
pt
->Fill(prt.
pt
() * 0.001, weight);
42
eta
->Fill(prt.
eta
(),weight);
43
phi
->Fill(prt.
phi
(),weight);
44
eta_pt
->Fill(prt.
eta
(), prt.
pt
() * 0.001, weight);
45
eta_phi
->Fill(prt.
eta
(), prt.
phi
(),weight);
46
}
47
}
ParamPlots.h
PlotBase::Book1D
TH1D * Book1D(std::string_view name, std::string_view labels, int nBins, float start, float end, bool prependDir=true)
Book a TH1D histogram.
Definition
PlotBase.cxx:94
PlotBase::PlotBase
PlotBase(PlotBase *parent, std::string_view sDir)
Definition
PlotBase.cxx:29
PlotBase::Book2D
TH2F * Book2D(std::string_view name, std::string_view labels, int nBinsX, float startX, float endX, int nBinsY, float startY, float endY, bool prependDir=true)
Book a TH2F histogram.
Definition
PlotBase.cxx:123
Trk::ParamPlots::eta_pt
TH2 * eta_pt
Definition
ParamPlots.h:23
Trk::ParamPlots::m_sParticleType
std::string m_sParticleType
Definition
ParamPlots.h:27
Trk::ParamPlots::phi
TH1 * phi
Definition
ParamPlots.h:19
Trk::ParamPlots::ParamPlots
ParamPlots(PlotBase *pParent, const std::string &sDir, std::string sParticleType)
Definition
ParamPlots.cxx:12
Trk::ParamPlots::fill
void fill(const xAOD::IParticle &prt, float weight=1.0)
Definition
ParamPlots.cxx:40
Trk::ParamPlots::initializePlots
void initializePlots()
Definition
ParamPlots.cxx:23
Trk::ParamPlots::eta_phi
TH2 * eta_phi
Definition
ParamPlots.h:22
Trk::ParamPlots::pt
TH1 * pt
Definition
ParamPlots.h:20
Trk::ParamPlots::eta
TH1 * eta
Definition
ParamPlots.h:18
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition
Event/xAOD/xAODBase/xAODBase/IParticle.h:41
xAOD::IParticle::eta
virtual double eta() const =0
The pseudorapidity ( ) of the particle.
xAOD::IParticle::pt
virtual double pt() const =0
The transverse momentum ( ) of the particle.
xAOD::IParticle::phi
virtual double phi() const =0
The azimuthal angle ( ) of the particle.
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition
FakeTrackBuilder.h:9
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0