ATLAS Offline Software
Loading...
Searching...
No Matches
InDetPerfPlot_nTracks.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
11
12
13InDetPerfPlot_nTracks::InDetPerfPlot_nTracks(InDetPlotBase* pParent, const std::string& sDir) : InDetPlotBase(pParent, sDir) {
14 // nop
15}
16
17void
19 const bool prependDirectory(false);
21 m_counters[ALLRECO] = Book1D(hd.name, hd.allTitles, hd.nBinsX, hd.xAxis.first, hd.xAxis.second, prependDirectory);
22 hd = retrieveDefinition("ntracksel");
23 m_counters[SELECTEDRECO] = Book1D(hd.name, hd.allTitles, hd.nBinsX, hd.xAxis.first, hd.xAxis.second, prependDirectory);
24 hd = retrieveDefinition("nparticle");
25 m_counters[ALLTRUTH] = Book1D(hd.name, hd.allTitles, hd.nBinsX, hd.xAxis.first, hd.xAxis.second, prependDirectory);
26 hd = retrieveDefinition("nparticlesel");
27 m_counters[SELECTEDTRUTH] = Book1D(hd.name, hd.allTitles, hd.nBinsX, hd.xAxis.first, hd.xAxis.second, prependDirectory);
28 hd = retrieveDefinition("num_truthmatch_match");
30 Book1D(hd.name, hd.allTitles, hd.nBinsX, hd.xAxis.first, hd.xAxis.second, prependDirectory);
31
32 book(m_ntracks_vs_truthMu, "ntracks_vs_truthMu");
33 book(m_ntracks_vs_truthMu_absEta_0_2p5, "ntracks_vs_truthMu_absEta_0_2p5");
34 book(m_ntracks_vs_truthMu_pT_1GeV, "ntracks_vs_truthMu_pT_1GeV");
35 book(m_ntracks_vs_actualMu, "ntracks_vs_actualMu");
36 book(m_ntracks_vs_actualMu_absEta_0_2p5, "ntracks_vs_actualMu_absEta_0_2p5");
37 book(m_ntracks_vs_actualMu_pT_1GeV, "ntracks_vs_actualMu_pT_1GeV");
38 book(m_ntracks_vs_nvertices, "ntracks_vs_nvertices");
39 book(m_ntracks_vs_nvertices_absEta_0_2p5, "ntracks_vs_nvertices_absEta_0_2p5");
40 book(m_ntracks_vs_nvertices_pT_1GeV, "ntracks_vs_nvertices_pT_1GeV");
41
42}
43
44void
45InDetPerfPlot_nTracks::fill(const unsigned int freq, const CounterCategory counter, float weight) {
46 if (counter < N_COUNTERS) {
47 fillHisto((m_counters[counter]), freq, weight);
48 }
49}
50
52(const unsigned int ntracksFull, const unsigned int ntracksCentral,
53 const unsigned int ntracksPt1GeV, const unsigned int truthMu,
54 const float actualMu, const unsigned int nvertices, const float weight) {
55
56 fillHisto(m_ntracks_vs_truthMu, truthMu, ntracksFull, weight);
57 fillHisto(m_ntracks_vs_actualMu, actualMu, ntracksFull, weight);
58 fillHisto(m_ntracks_vs_nvertices, nvertices, ntracksFull, weight);
59 fillHisto(m_ntracks_vs_truthMu_absEta_0_2p5, truthMu, ntracksCentral, weight);
60 fillHisto(m_ntracks_vs_actualMu_absEta_0_2p5, actualMu, ntracksCentral, weight);
61 fillHisto(m_ntracks_vs_nvertices_absEta_0_2p5, nvertices, ntracksCentral, weight);
62 fillHisto(m_ntracks_vs_truthMu_pT_1GeV, truthMu, ntracksPt1GeV, weight);
63 fillHisto(m_ntracks_vs_actualMu_pT_1GeV, actualMu, ntracksPt1GeV, weight);
64 fillHisto(m_ntracks_vs_nvertices_pT_1GeV, nvertices, ntracksPt1GeV, weight);
65
66}
InDetPerfPlot_nTracks(InDetPlotBase *pParent, const std::string &dirName)
void fill(const unsigned int freq, const CounterCategory counter, float weight=1.0)
static void fillHisto(TProfile *pTprofile, const float bin, const float weight, const float weight2=1.0)
void book(Htype *&pHisto, const std::string &histoIdentifier, const std::string &nameOverride="", const std::string &folder="default")
Helper method to book histograms using an identifier string.
InDetPlotBase(InDetPlotBase *pParent, const std::string &dirName)
Constructor taking parent node and directory name for plots.
SingleHistogramDefinition retrieveDefinition(const std::string &histoIdentifier, const std::string &folder="default", const std::string &nameOverride="")
Retrieve a single histogram definition, given the unique string identifier.
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
Almost-a-struct for holding the single histogram definition.
IHistogramDefinitionSvc::axesLimits_t xAxis