ATLAS Offline Software
Loading...
Searching...
No Matches
ChargeDepParamPlots.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include <utility>
6
8
9namespace Muon{
10
11ChargeDepParamPlots::ChargeDepParamPlots(PlotBase* pParent, const std::string& sDir, std::string sType)
12 :PlotBase(pParent, sDir)
13 , m_sType(std::move(sType))
14{}
15
17 q_times_eta = Book1D("qTimesEta_"+m_sType,"qTimesEta_"+m_sType+";charge*Pseudo-Rapidity;Entries", 128, -3.2, 3.2);
18 q_over_pt = Book1D("qOverPt_"+m_sType ,"qOverPt_"+m_sType+";charge over Transverse Momentum [GeV^{-1}];Entries",200,-0.5,0.5);
19 q_over_p = Book1D("qOverP_"+m_sType, "qOverP_"+m_sType+";charge over Momentum [GeV^{-1}];Entries",200,-0.5,0.5);
20
21 //charge comparison of ID, MS, ME tracks
22 qMS_times_qCB = Book1D("qMS_times_qCB_"+m_sType,"qMS_times_qCB_"+m_sType+";qMS*qCB;Entries",3,-1.5,1.5);
23 qID_times_qCB = Book1D("qID_times_qCB_"+m_sType,"qID_times_qCB_"+m_sType+";qID*qCB;Entries",3,-1.5,1.5);
24}
25
26
27 void ChargeDepParamPlots::fill(const xAOD::Muon& mu, float weight)
28{
29 const xAOD::TrackParticle* trkprt = mu.trackParticle(xAOD::Muon::Primary);
30 if (!trkprt) return;
31
32 q_times_eta->Fill(trkprt->charge()*trkprt->eta(),weight);
33 q_over_pt->Fill(trkprt->charge()/trkprt->pt()/0.001, weight);
34 q_over_p->Fill(trkprt->qOverP()/0.001, weight);
35
36 const xAOD::TrackParticle* trkprtID = mu.trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
37 const xAOD::TrackParticle* trkprtMS = mu.trackParticle(xAOD::Muon::MuonSpectrometerTrackParticle);
38
39 if (trkprtID)
40 qID_times_qCB->Fill(trkprtID->charge()*trkprt->charge(),weight);
41
42 if (trkprtMS)
43 qMS_times_qCB->Fill(trkprtMS->charge()*trkprt->charge(),weight);
44}
45
46}
ChargeDepParamPlots(PlotBase *pParent, const std::string &sDir, std::string sType)
void fill(const xAOD::Muon &mu, float weight=1.0)
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
float qOverP() const
Returns the parameter.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
float charge() const
Returns the charge.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
STL namespace.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Muon_v1 Muon
Reference the current persistent version: