ATLAS Offline Software
Loading...
Searching...
No Matches
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
11namespace 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
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}
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
PlotBase(PlotBase *parent, const std::string &sDir)
Definition PlotBase.cxx:29
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
std::string m_sParticleType
Definition ParamPlots.h:27
ParamPlots(PlotBase *pParent, const std::string &sDir, std::string sParticleType)
void fill(const xAOD::IParticle &prt, float weight=1.0)
void initializePlots()
Class providing the definition of the 4-vector interface.
virtual double eta() const =0
The pseudorapidity ( ) of the particle.
virtual double pt() const =0
The transverse momentum ( ) of the particle.
virtual double phi() const =0
The azimuthal angle ( ) of the particle.
Ensure that the ATLAS eigen extensions are properly loaded.
STL namespace.