ATLAS Offline Software
Loading...
Searching...
No Matches
GeneratorPlots.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef GeneratorPhysValPlots_GeneratorPlots_H
6#define GeneratorPhysValPlots_GeneratorPlots_H
7
10
11namespace GeneratorPhysVal
12{
13 class GeneratorPlots : public PlotBase
14 {
15 public:
16 TH1* pT = nullptr;
17 TH1* eta = nullptr;
18 TH1* phi = nullptr;
19
20 GeneratorPlots(PlotBase* pParent, const std::string& sDir, const std::string& sType = ""): PlotBase(pParent, sDir), m_sType(sType)
21 {
22 pT = Book1D("pT", "p_{T} of " + m_sType + ";pT(GeV);Entries", 15, 0., 15.);
23 eta = Book1D("eta", "#eta of " + m_sType + ";#eta; Events ", 400, -10, 10.);
24 phi = Book1D("phi", "#varphi of " + m_sType + ";#varphi;Events ", 128, -3.2, 3.2);
25 }
26
27 void fill(const xAOD::IParticle* part)
28 {
29 pT->Fill(0.001 * part->pt());
30 eta->Fill(part->eta());
31 phi->Fill(part->phi());
32 }
33
34 void fill(const std::vector< TLorentzVector >& part)
35 {
36 for(const auto &parti : part ){
37 pT->Fill(0.001 * parti.Pt());
38 eta->Fill(parti.Eta());
39 phi->Fill(parti.Phi());
40 }
41 }
42
43
44
45 private:
46 std::string m_sType = "";
47 };
48
49}
50
51#endif
void fill(const std::vector< TLorentzVector > &part)
GeneratorPlots(PlotBase *pParent, const std::string &sDir, const std::string &sType="")
void fill(const xAOD::IParticle *part)
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
Class providing the definition of the 4-vector interface.