ATLAS Offline Software
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 
9 namespace Muon{
10 
11 ChargeDepParamPlots::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 
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.h
xAOD::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TrackParticle_v1.cxx:73
PlotBase::Book1D
TH1F * 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:88
PlotBase
Definition: PlotBase.h:33
xAOD::TrackParticle_v1::charge
float charge() const
Returns the charge.
Definition: TrackParticle_v1.cxx:150
python.copyTCTOutput.sDir
sDir
Definition: copyTCTOutput.py:60
xAOD::TrackParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TrackParticle_v1.cxx:77
Muon::ChargeDepParamPlots::q_over_p
TH1 * q_over_p
Definition: ChargeDepParamPlots.h:21
Muon::ChargeDepParamPlots::qMS_times_qCB
TH1 * qMS_times_qCB
Definition: ChargeDepParamPlots.h:23
Muon::ChargeDepParamPlots::fill
void fill(const xAOD::Muon &mu, float weight=1.0)
Definition: ChargeDepParamPlots.cxx:27
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:49
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
Muon::ChargeDepParamPlots::ChargeDepParamPlots
ChargeDepParamPlots(PlotBase *pParent, const std::string &sDir, std::string sType)
Definition: ChargeDepParamPlots.cxx:11
Muon::ChargeDepParamPlots::qID_times_qCB
TH1 * qID_times_qCB
Definition: ChargeDepParamPlots.h:24
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:200
InDet::ExclusiveOrigin::Primary
@ Primary
Definition: InDetTrackTruthOriginDefs.h:163
Muon::ChargeDepParamPlots::q_times_eta
TH1 * q_times_eta
Definition: ChargeDepParamPlots.h:20
TH1::Fill
int Fill(double)
Definition: rootspy.cxx:285
Muon::ChargeDepParamPlots::m_sType
std::string m_sType
Definition: ChargeDepParamPlots.h:28
xAOD::TrackParticle_v1::qOverP
float qOverP() const
Returns the parameter.
Muon::ChargeDepParamPlots::initializePlots
void initializePlots()
Definition: ChargeDepParamPlots.cxx:16
Muon::ChargeDepParamPlots::q_over_pt
TH1 * q_over_pt
Definition: ChargeDepParamPlots.h:22
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53