ATLAS Offline Software
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 
InDetPerfPlot_Duplicate::m_number_vs_pt
TProfile * m_number_vs_pt
Definition: InDetPerfPlot_Duplicate.h:25
InDetPerfPlot_Duplicate::m_number_vs_eta
TProfile * m_number_vs_eta
Definition: InDetPerfPlot_Duplicate.h:26
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
InDetPlotBase::book
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.
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
python.copyTCTOutput.sDir
sDir
Definition: copyTCTOutput.py:60
test_pyathena.pt
pt
Definition: test_pyathena.py:11
InDetPerfPlot_Duplicate::m_rate_vs_eta
TEfficiency * m_rate_vs_eta
Definition: InDetPerfPlot_Duplicate.h:23
InDetPerfPlot_Duplicate.h
InDetPerfPlot_Duplicate::InDetPerfPlot_Duplicate
InDetPerfPlot_Duplicate(InDetPlotBase *pParent, const std::string &dirName)
Definition: InDetPerfPlot_Duplicate.cxx:9
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
InDetPlotBase
Mixin class to give extra capabilities to plots such as ATH_MSG and an easier booking interface,...
Definition: InDetPlotBase.h:33
InDetPerfPlot_Duplicate::m_number_nonzero_vs_eta
TProfile * m_number_nonzero_vs_eta
Definition: InDetPerfPlot_Duplicate.h:29
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
InDetPerfPlot_Duplicate::m_number_nonzero_vs_pt
TProfile * m_number_nonzero_vs_pt
Definition: InDetPerfPlot_Duplicate.h:28
InDetPerfPlot_Duplicate::fill
void fill(const xAOD::TruthParticle &truth, unsigned int ntracks, float weight)
Definition: InDetPerfPlot_Duplicate.cxx:28
xAOD::TruthParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TruthParticle_v1.cxx:174
InDetPerfPlot_Duplicate::initializePlots
void initializePlots()
Definition: InDetPerfPlot_Duplicate.cxx:14
xAOD::TruthParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TruthParticle_v1.cxx:166
InDetPlotBase::fillHisto
static void fillHisto(TProfile *pTprofile, const float bin, const float weight, const float weight2=1.0)
Definition: InDetPlotBase.cxx:82
InDetPerfPlot_Duplicate::m_rate_vs_pt
TEfficiency * m_rate_vs_pt
Definition: InDetPerfPlot_Duplicate.h:22