ATLAS Offline Software
Loading...
Searching...
No Matches
RecoMuonTrackPlots.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7RecoMuonTrackPlots::RecoMuonTrackPlots(PlotBase* pParent, const std::string& sDir):PlotBase(pParent, sDir),
8m_oAllPlots(this, "/", "Reco Muon"),
9m_oImpactPlots(this, "/"),
10m_oTrkRecoInfoPlots(this, "/"),
11m_pt_broad(nullptr),
12m_eta_phi_broad(nullptr)
13{}
14
16 //booking histograms
17 m_pt_broad = Book1D("_pt_broad", "High p_{T} Distribution", 70, 100, 1500);
18 m_eta_phi_broad = Book2D("_eta_phi_broad", "High p_{T} Muon #eta #phi Distribution;#eta;#phi", 52, -2.6, 2.6, 64, -3.2, 3.2);
19}
20
21//when the plot function called with a Muon Container
22//loop through each muon, get the corresponding link and fill it
23
24//when the plot function called with a Muon
25//get's the corresponding link and fill it
26void RecoMuonTrackPlots::fill(const xAOD::Muon& mu, int component){
27
28 if (component == 0 ) {
29 const ElementLink<xAOD::TrackParticleContainer>& Mu_MStrack = mu.muonSpectrometerTrackParticleLink();
30 if(Mu_MStrack.isValid()){
31 const xAOD::TrackParticle* trk = *Mu_MStrack;
32 fill(*trk);
33 }
34 }
35
36 if (component == 1 ){
37
38 const ElementLink<xAOD::TrackParticleContainer>& Mu_metrack = mu.trackParticleLink(xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle);
39 if(Mu_metrack.isValid()){
40 const xAOD::TrackParticle* trk = *Mu_metrack;
41 fill(*trk);
42 }
43 }
44}
45
46
48 m_oAllPlots.fill(muTP);
49 m_oImpactPlots.fill(muTP);
50 m_oTrkRecoInfoPlots.fill(muTP);
51
52 if (muTP.pt()/1000.0 > 100) {//ony for high pt muons
53 m_pt_broad->Fill(muTP.pt()/1000.0);
54 m_eta_phi_broad->Fill(muTP.eta(), muTP.phi());
55 }
56
57}
58
59
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
TH2F * Book2D(const std::string &name, const std::string &labels, int nBinsX, float startX, float endX, int nBinsY, float startY, float endY, bool prependDir=true)
Book a TH2F histogram.
Definition PlotBase.cxx:123
Trk::ParamPlots m_oAllPlots
Trk::ImpactPlots m_oImpactPlots
RecoMuonTrackPlots(PlotBase *pParent, const std::string &sDir)
void fill(const xAOD::Muon &mu, int component)
Trk::RecoInfoPlots m_oTrkRecoInfoPlots
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Muon_v1 Muon
Reference the current persistent version: