ATLAS Offline Software
Loading...
Searching...
No Matches
RecoMuonPlotOrganizer.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7namespace Muon {
8
10 const std::string& sDir,
11 std::vector<int> selPlots)
12 : PlotBase(pParent, sDir) {
13
14 if (selPlots.empty()) {
15 for (unsigned int i = 0; i < MAX_RECOPLOTCLASS; i++) {
16 m_selPlots.push_back(i);
17 }
18 } else {
19 m_selPlots = std::move(selPlots);
20 }
21
22 for (int p : m_selPlots) {
23 switch (p) {
24 case MUON_TRKPARAM:
25 m_oTrkParamPlots = std::make_unique<Trk::ParamPlots>(
26 this, "/kinematics/", "RecoMuon");
27 break;
28 case MUON_PARAM:
29 m_oMuonParamPlots = std::make_unique<Muon::MuonParamPlots>(
30 this, "/parameters/");
31 break;
32 case MUON_RECOINFO:
33 m_oMuRecoInfoPlots =
34 std::make_unique<Muon::RecoInfoPlots>(this, "/parameters/");
35 break;
36 case MUON_TRKIMPACT:
37 m_oImpactPlots =
38 std::make_unique<Trk::ImpactPlots>(this, "/parameters/");
39 break;
40 case MUON_MOMPULLS:
41 m_oMomentumPullPlots =
42 std::make_unique<Muon::MomentumPullPlots>(
43 this, "/momentumPulls/");
44 break;
45 case MUON_HITS:
46 m_oMuonHitSummaryPlots =
47 std::make_unique<Muon::MuonHitSummaryPlots>(this, "/hits/");
48 break;
49 case MUON_IDHITS:
50 m_oIDHitPlots =
51 std::make_unique<Muon::IDHitSummaryPlots>(this, "/hits/");
52 break;
53 case MUON_ISO:
54 m_oMuonIsolationPlots =
55 std::make_unique<Muon::MuonIsolationPlots>(this,
56 "/isolation/");
57 break;
59 m_oChargeParamPlotsLowPt =
60 std::make_unique<Muon::ChargeDepParamPlots>(
61 this, "/kinematics/", "lowPt");
62 m_oChargeParamPlotsHighPt =
63 std::make_unique<Muon::ChargeDepParamPlots>(
64 this, "/kinematics/", "highPt");
65 break;
66 }
67 }
68}
69
70RecoMuonPlotOrganizer::~RecoMuonPlotOrganizer() = default;
71
72void RecoMuonPlotOrganizer::fill(const xAOD::Muon& mu, float weight) {
73 if (m_oIDHitPlots && mu.trackParticle(xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle)) {
74 m_oIDHitPlots->fill(
75 *mu.trackParticle(xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle), weight);
76 }
77 if (m_oTrkParamPlots) {
78 m_oTrkParamPlots->fill(mu, weight);
79 }
81 m_oMuonParamPlots->fill(mu, weight);
82 }
84 m_oMuRecoInfoPlots->fill(mu, weight);
85 }
87 m_oMomentumPullPlots->fill(mu, weight);
88 }
90 m_oMuonHitSummaryPlots->fill(mu, weight);
91 }
93 m_oMuonIsolationPlots->fill(mu, weight);
94 }
96 if (mu.pt() < 8000) {
97 m_oChargeParamPlotsLowPt->fill(mu, weight);
98 } else {
99 m_oChargeParamPlotsHighPt->fill(mu, weight);
100 }
101 }
102
103 // tracking related plots
104 const xAOD::TrackParticle* primaryTrk =
105 mu.trackParticle(xAOD::Muon::Primary);
106 if (!primaryTrk) {
107 return;
108 }
109 if (m_oImpactPlots) {
110 m_oImpactPlots->fill(*primaryTrk, weight);
111 }
112}
113
114} // namespace Muon
std::unique_ptr< Muon::MuonIsolationPlots > m_oMuonIsolationPlots
RecoMuonPlotOrganizer(PlotBase *pParent, const std::string &sDir, std::vector< int > selPlots={})
std::unique_ptr< Muon::MomentumPullPlots > m_oMomentumPullPlots
std::unique_ptr< Muon::ChargeDepParamPlots > m_oChargeParamPlotsHighPt
std::unique_ptr< Trk::ImpactPlots > m_oImpactPlots
std::unique_ptr< Muon::MuonParamPlots > m_oMuonParamPlots
std::unique_ptr< Muon::RecoInfoPlots > m_oMuRecoInfoPlots
std::unique_ptr< Trk::ParamPlots > m_oTrkParamPlots
std::unique_ptr< Muon::MuonHitSummaryPlots > m_oMuonHitSummaryPlots
void fill(const xAOD::Muon &mu, float weight=1.0)
std::unique_ptr< Muon::ChargeDepParamPlots > m_oChargeParamPlotsLowPt
std::unique_ptr< Muon::IDHitSummaryPlots > m_oIDHitPlots
PlotBase(PlotBase *parent, std::string_view sDir)
Definition PlotBase.cxx:29
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Muon_v1 Muon
Reference the current persistent version: