ATLAS Offline Software
Loading...
Searching...
No Matches
InDetPerfPlot_Duplicate.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include "GaudiKernel/SystemOfUnits.h" //for Gaudi::Units
7
9(InDetPlotBase* pParent, const std::string& sDir) :
10 InDetPlotBase(pParent, sDir){
11 // nop
12}
13
15
16 book(m_rate_vs_pt, "duplicate_rate_vs_pt");
17 book(m_rate_vs_eta, "duplicate_rate_vs_eta");
18
19 book(m_number_vs_pt, "duplicate_number_vs_pt");
20 book(m_number_vs_eta, "duplicate_number_vs_eta");
21
22 book(m_number_nonzero_vs_pt, "duplicate_number_nonzero_vs_pt");
23 book(m_number_nonzero_vs_eta, "duplicate_number_nonzero_vs_eta");
24
25}
26
28(const xAOD::TruthParticle& truth, unsigned int ntracks, float weight) {
29 double eta = truth.eta();
30 double pt = truth.pt() / Gaudi::Units::GeV; // convert MeV to GeV
31
32 fillHisto(m_rate_vs_pt, pt, ntracks>1, weight);
33 fillHisto(m_rate_vs_eta, eta, ntracks>1, weight);
34
35 m_number_vs_pt->Fill(pt, ntracks, weight);
36 m_number_vs_eta->Fill(eta, ntracks, weight);
37
38 if(ntracks>0){
39 m_number_nonzero_vs_pt->Fill(pt, ntracks, weight);
40 m_number_nonzero_vs_eta->Fill(eta, ntracks, weight);
41 }
42}
43
44
Scalar eta() const
pseudorapidity method
InDetPerfPlot_Duplicate(InDetPlotBase *pParent, const std::string &dirName)
void fill(const xAOD::TruthParticle &truth, unsigned int ntracks, float weight)
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.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
TruthParticle_v1 TruthParticle
Typedef to implementation.