ATLAS Offline Software
Loading...
Searching...
No Matches
MuonHitSummaryPlots.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
8
9namespace Muon{
10
11MuonHitSummaryPlots::MuonHitSummaryPlots(PlotBase* pParent, const std::string& sDir):
12PlotBase(pParent, sDir),
13
14m_oMSHitPlots(this, ""),
15
16innerSmallHits(this, "innersmallhits", "inner small hits", 0, 20),
17innerLargeHits(this, "innerlargehits", "inner large hits", 0, 30),
18middleSmallHits(this, "middlesmallhits", "middle small hits", 0, 20),
19middleLargeHits(this, "middlelargehits", "middle large hits", 0, 20),
20outerSmallHits(this, "outersmallhits", "outer small hits", 0, 15),
21outerLargeHits(this, "outerlargehits", "outer large hits", 0, 20),
22extendedSmallHits(this, "extendedsmallhits", "extended small hits", 0, 15),
23extendedLargeHits(this, "extendedlargehits", "extended large hits", 0, 15),
24
25phiLayer1Hits(this, "phiLayer1hits", "phi Layer 1 hits", 0, 10),
26phiLayer2Hits(this, "phiLayer2hits", "phi Layer 2 hits", 0, 10),
27phiLayer3Hits(this, "phiLayer3hits", "phi Layer 3 hits", 0, 10),
28phiLayer4Hits(this, "phiLayer4hits", "phi Layer 4 hits", 0, 10),
29
30etaLayer1Hits(this, "etaLayer1hits", "eta Layer 1 hits", 0, 10),
31etaLayer2Hits(this, "etaLayer2hits", "eta Layer 2 hits", 0, 15), //more hits for this one
32etaLayer3Hits(this, "etaLayer3hits", "eta Layer 3 hits", 0, 10),
33etaLayer4Hits(this, "etaLayer4hits", "eta Layer 4 hits", 0, 10),
34
35innerSmallHoles(this, "innersmallholes", "inner small holes", 0, 5),
36innerLargeHoles(this, "innerlargeholes", "inner large holes", 0, 5),
37middleSmallHoles(this, "middlesmallholes", "middle small holes", 0, 5),
38middleLargeHoles(this, "middlelargeholes", "middle large holes", 0, 5),
39outerSmallHoles(this, "outersmallholes", "outer small holes", 0, 5),
40outerLargeHoles(this, "outerlargeholes", "outer large holes", 0, 5),
41extendedSmallHoles(this, "extendedsmallholes", "extended small holes", 0, 5),
42extendedLargeHoles(this, "extendedlargeholes", "extended large holes", 0, 5),
43
44phiHoles(this, "phiHoles", "phi holes", 0, 5),
45etaHoles(this, "etaHoles", "eta holes", 0, 5),
46etaphiHoles(this, "etaphiHoles", "eta+phi holes", 0, 5)
47
48// phiLayer1Holes(this, "phiLayer1holes", "phi Layer 1 holes", 0, 5),
49// phiLayer2Holes(this, "phiLayer2holes", "phi Layer 2 holes", 0, 5),
50// phiLayer3Holes(this, "phiLayer3holes", "phi Layer 3 holes", 0, 5),
51// phiLayer4Holes(this, "phiLayer4holes", "phi Layer 4 holes", 0, 5),
52
53// etaLayer1Holes(this, "etaLayer1holes", "eta Layer 1 holes", 0, 5),
54// etaLayer2Holes(this, "etaLayer2holes", "eta Layer 2 holes", 0, 5),
55// etaLayer3Holes(this, "etaLayer3holes", "eta Layer 3 holes", 0, 5),
56// etaLayer4Holes(this, "etaLayer4holes", "eta Layer 4 holes", 0, 5)
57
58{ }
59
60
61 void MuonHitSummaryPlots::fill(const xAOD::Muon& muon, float weight){
62
63 const xAOD::TrackParticle *tp = (muon.muonType()==xAOD::Muon::SiliconAssociatedForwardMuon)? muon.trackParticle(xAOD::Muon::CombinedTrackParticle) : muon.trackParticle(xAOD::Muon::Primary);
64 if (tp) m_oMSHitPlots.fill(*tp);
65
82
91
92 int netaholes=0, nphiholes=0;
93 uint8_t hitval = 0;
94 if (muon.summaryValue(hitval,xAOD::etaLayer1Holes)) netaholes+=(int)hitval;
95 if (muon.summaryValue(hitval,xAOD::etaLayer2Holes)) netaholes+=(int)hitval;
96 if (muon.summaryValue(hitval,xAOD::etaLayer3Holes)) netaholes+=(int)hitval;
97 if (muon.summaryValue(hitval,xAOD::etaLayer4Holes)) netaholes+=(int)hitval;
98
99 if (muon.summaryValue(hitval,xAOD::phiLayer1Holes)) nphiholes+=(int)hitval;
100 if (muon.summaryValue(hitval,xAOD::phiLayer2Holes)) nphiholes+=(int)hitval;
101 if (muon.summaryValue(hitval,xAOD::phiLayer3Holes)) nphiholes+=(int)hitval;
102 if (muon.summaryValue(hitval,xAOD::phiLayer4Holes)) nphiholes+=(int)hitval;
103
104 etaHoles.fill(netaholes, muon.eta(), muon.phi(), weight);
105 phiHoles.fill(nphiholes, muon.eta(), muon.phi(), weight);
106 etaphiHoles.fill(netaholes+nphiholes, muon.eta(), muon.phi(), weight);
107
108 // fillPlot(phiLayer1Holes, xAOD::phiLayer1Holes, muon);
109 // fillPlot(phiLayer2Holes, xAOD::phiLayer2Holes, muon);
110 // fillPlot(phiLayer3Holes, xAOD::phiLayer3Holes, muon);
111 // fillPlot(phiLayer4Holes, xAOD::phiLayer4Holes, muon);
112 // fillPlot(etaLayer1Holes, xAOD::etaLayer1Holes, muon);
113 // fillPlot(etaLayer2Holes, xAOD::etaLayer2Holes, muon);
114 // //fillPlot(etaLayer3Holes, xAOD::etaLayer3Holes, muon);
115 // fillPlot(etaLayer4Holes, xAOD::etaLayer4Holes, muon);
116
117}
118
119 void MuonHitSummaryPlots::fill(const xAOD::TruthParticle& truthprt, float weight){
120
121 m_oMSHitPlots.fill(truthprt);
122
123 fillPlot(innerSmallHits, "innerSmallHits", truthprt, weight);
124 fillPlot(innerLargeHits, "innerLargeHits", truthprt, weight);
125 fillPlot(middleSmallHits, "middleSmallHits", truthprt, weight);
126 fillPlot(middleLargeHits, "middleLargeHits", truthprt, weight);
127 fillPlot(outerSmallHits, "outerSmallHits", truthprt, weight);
128 fillPlot(outerLargeHits, "outerLargeHits", truthprt, weight);
129 fillPlot(extendedSmallHits, "extendedSmallHits", truthprt, weight);
130 fillPlot(extendedLargeHits, "extendedLargeHits", truthprt, weight);
131 fillPlot(phiLayer1Hits, "phiLayer1Hits", truthprt, weight);
132 fillPlot(phiLayer2Hits, "phiLayer2Hits", truthprt, weight);
133 fillPlot(phiLayer3Hits, "phiLayer3Hits", truthprt, weight);
134 fillPlot(phiLayer4Hits, "phiLayer4Hits", truthprt, weight);
135 fillPlot(etaLayer1Hits, "etaLayer1Hits", truthprt, weight);
136 fillPlot(etaLayer2Hits, "etaLayer2Hits", truthprt, weight);
137 fillPlot(etaLayer3Hits, "etaLayer3Hits", truthprt, weight);
138 fillPlot(etaLayer4Hits, "etaLayer4Hits", truthprt, weight);
139}
140
141 void MuonHitSummaryPlots::fillPlot(Trk::HitTypePlots& hitPlots, xAOD::MuonSummaryType info, const xAOD::Muon& muon, float weight){
142 uint8_t hitval = 0;
143 if (!muon.summaryValue(hitval,info)) return;
144 hitPlots.fill(hitval, muon.eta(), muon.phi(),weight);
145}
146
147 void MuonHitSummaryPlots::fillPlot(Trk::HitTypePlots& hitPlots, const std::string& sInfo, const xAOD::TruthParticle& truthprt, float weight){
148 SG::ConstAccessor<uint8_t> acc (sInfo);
149 if (!acc.isAvailable(truthprt)) return;
150 hitPlots.fill(acc(truthprt), truthprt.eta(), truthprt.phi(), weight);
151}
152
153
154}
Helper class to provide constant type-safe access to aux data.
Trk::HitTypePlots innerLargeHoles
Trk::HitTypePlots outerSmallHoles
Trk::HitTypePlots middleLargeHoles
Trk::HitTypePlots middleSmallHoles
Trk::HitTypePlots innerSmallHoles
Trk::HitTypePlots extendedLargeHoles
void fill(const xAOD::Muon &muon, float weight=1.0)
MuonHitSummaryPlots(PlotBase *pParent, const std::string &sDir)
Trk::HitTypePlots extendedLargeHits
Trk::HitTypePlots middleSmallHits
Trk::HitTypePlots middleLargeHits
Trk::HitTypePlots outerLargeHoles
Trk::HitTypePlots extendedSmallHits
void fillPlot(Trk::HitTypePlots &hitPlots, xAOD::MuonSummaryType info, const xAOD::Muon &muon, float weight=1.0)
Trk::HitTypePlots extendedSmallHoles
PlotBase(PlotBase *parent, const std::string &sDir)
Definition PlotBase.cxx:29
Helper class to provide constant type-safe access to aux data.
void fill(int iHits, float fEta, float fPhi, float weight=1.0)
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
virtual double phi() const override final
The azimuthal angle ( ) of the particle.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TruthParticle_v1 TruthParticle
Typedef to implementation.
Muon_v1 Muon
Reference the current persistent version:
MuonSummaryType
Enumerates the different types of information stored in Summary.
@ phiLayer3Hits
number of phi hits in the third trigger layer (BOL1 ot T2)
@ middleSmallHoles
number of precision holes in the middle small layer
@ outerSmallHits
number of precision hits in the outer small layer
@ phiLayer2Hits
number of phi hits in the second trigger layer (BML2 ot T1)
@ middleSmallHits
number of precision hits in the middle small layer
@ phiLayer4Holes
number of phi holes in the fourth trigger layer (T3)
@ phiLayer1Holes
number of phi holes in the first trigger layer (BML1 ot T4)
@ outerLargeHits
number of precision hits in the outer large layer
@ etaLayer3Hits
number of eta hits in the third trigger layer (BOL1 ot T2)
@ etaLayer3Holes
number of eta holes in the third trigger layer (BOL1 ot T2)
@ middleLargeHits
number of precision hits in the middle large layer
@ etaLayer1Hits
number of eta hits in the first trigger layer (BML1 ot T4)
@ phiLayer2Holes
number of phi holes in the second trigger layer (BML2 ot T1)
@ phiLayer1Hits
number of phi hits in the first trigger layer (BML1 ot T4)
@ phiLayer3Holes
number of phi holes in the third trigger layer (BOL1 ot T2)
@ etaLayer4Holes
number of eta holes in the fourth trigger layer (T3)
@ extendedSmallHits
number of precision hits in the extended small layer
@ extendedLargeHits
number of precision hits in the extended large layer
@ phiLayer4Hits
number of phi hits in the fourth trigger layer (T3)
@ outerLargeHoles
number of precision holes in the outer large layer
@ extendedSmallHoles
number of precision holes in the extended small layer
@ innerLargeHits
number of precision hits in the inner large layer
@ middleLargeHoles
number of precision holes in the middle large layer
@ innerLargeHoles
number of precision holes in the inner large layer
@ etaLayer4Hits
number of eta hits in the fourth trigger layer (T3)
@ etaLayer2Holes
number of eta holes in the second trigger layer (BML2 ot T1)
@ etaLayer2Hits
number of eta hits in the second trigger layer (BML2 ot T1)
@ innerSmallHoles
number of precision holes in the inner small layer
@ etaLayer1Holes
number of eta holes in the first trigger layer (BML1 ot T4)
@ extendedLargeHoles
number of precision holes in the extended large layer
@ outerSmallHoles
number of precision holes in the outer small layer
@ innerSmallHits
number of precision hits in the inner small layer