ATLAS Offline Software
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 
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
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
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 }
Trk::ParamPlots::fill
void fill(const xAOD::IParticle &prt, float weight=1.0)
Definition: Tracking/TrkValidation/TrkValHistUtils/Root/ParamPlots.cxx:40
PlotBase
Definition: PlotBase.h:34
Trk::ParamPlots::pt
TH1 * pt
Definition: Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ParamPlots.h:20
python.copyTCTOutput.sDir
sDir
Definition: copyTCTOutput.py:60
PlotBase::Book2D
TH2F * Book2D(const std::string &name, const std::string &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
TH1 * eta
Definition: Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ParamPlots.h:18
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
PlotBase::Book1D
TH1D * Book1D(const std::string &name, const std::string &labels, int nBins, float start, float end, bool prependDir=true)
Book a TH1D histogram.
Definition: PlotBase.cxx:94
Trk::ParamPlots::eta_pt
TH2 * eta_pt
Definition: Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ParamPlots.h:23
Trk::ParamPlots::initializePlots
void initializePlots()
Definition: Tracking/TrkValidation/TrkValHistUtils/Root/ParamPlots.cxx:23
xAOD::IParticle::pt
virtual double pt() const =0
The transverse momentum ( ) of the particle.
Trk::ParamPlots::m_sParticleType
std::string m_sParticleType
Definition: Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ParamPlots.h:27
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::ParamPlots::ParamPlots
ParamPlots(PlotBase *pParent, const std::string &sDir, std::string sParticleType)
Definition: Tracking/TrkValidation/TrkValHistUtils/Root/ParamPlots.cxx:12
xAOD::IParticle::eta
virtual double eta() const =0
The pseudorapidity ( ) of the particle.
xAOD::IParticle::phi
virtual double phi() const =0
The azimuthal angle ( ) of the particle.
Trk::ParamPlots::eta_phi
TH2 * eta_phi
Definition: Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ParamPlots.h:22
Trk::ParamPlots::phi
TH1 * phi
Definition: Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ParamPlots.h:19
ParamPlots.h