ATLAS Offline Software
Loading...
Searching...
No Matches
MuonHitDiffSummaryPlots.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
11MuonHitDiffSummaryPlots::MuonHitDiffSummaryPlots(PlotBase* pParent, const std::string& sDir):PlotBase(pParent, sDir),
12innerSmallHits(this, "diff_innersmallhits", "diff(reco - truth) inner small hits", -10, 10),
13innerLargeHits(this, "diff_innerlargehits", "diff(reco - truth) inner large hits", -10, 10),
14middleSmallHits(this, "diff_middlesmallhits", "diff(reco - truth) middle small hits", -10, 10),
15middleLargeHits(this, "diff_middlelargehits", "diff(reco - truth) middle large hits", -10, 10),
16outerSmallHits(this, "diff_outersmallhits", "diff(reco - truth) outer small hits", -10, 10),
17outerLargeHits(this, "diff_outerlargehits", "diff(reco - truth) outer large hits", -10, 10),
18extendedSmallHits(this, "diff_extendedsmallhits", "diff(reco - truth) extended small hits", -10, 10),
19extendedLargeHits(this, "diff_extendedlargehits", "diff(reco - truth) extended large hits", -10, 10),
20
21phiLayer1Hits(this, "diff_phiLayer1hits", "diff(reco - truth) phi Layer 1 hits", -10, 10),
22phiLayer2Hits(this, "diff_phiLayer2hits", "diff(reco - truth) phi Layer 2 hits", -10, 10),
23phiLayer3Hits(this, "diff_phiLayer3hits", "diff(reco - truth) phi Layer 3 hits", -10, 10),
24phiLayer4Hits(this, "diff_phiLayer4hits", "diff(reco - truth) phi Layer 4 hits", -10, 10),
25
26etaLayer1Hits(this, "diff_etaLayer1hits", "diff(reco - truth) eta Layer 1 hits", -10, 10),
27etaLayer2Hits(this, "diff_etaLayer2hits", "diff(reco - truth) eta Layer 2 hits", -10, 10),
28etaLayer3Hits(this, "diff_etaLayer3hits", "diff(reco - truth) eta Layer 3 hits", -10, 10),
29etaLayer4Hits(this, "diff_etaLayer4hits", "diff(reco - truth) eta Layer 4 hits", -10, 10)
30{
31}
32
33 void MuonHitDiffSummaryPlots::fill(const xAOD::Muon& muon, const xAOD::TruthParticle& truthprt, float weight) {
34 fillPlot(innerSmallHits, xAOD::innerSmallHits, muon, "innerSmallHits", truthprt, weight);
35 fillPlot(innerLargeHits, xAOD::innerLargeHits, muon, "innerLargeHits", truthprt, weight);
36 fillPlot(middleSmallHits, xAOD::middleSmallHits, muon, "middleSmallHits", truthprt, weight);
37 fillPlot(middleLargeHits, xAOD::middleLargeHits, muon, "middleLargeHits", truthprt, weight);
38 fillPlot(outerSmallHits, xAOD::outerSmallHits, muon, "outerSmallHits", truthprt, weight);
39 fillPlot(outerLargeHits, xAOD::outerLargeHits, muon, "outerLargeHits", truthprt, weight);
40 fillPlot(extendedSmallHits, xAOD::extendedSmallHits, muon, "extendedSmallHits", truthprt, weight);
41 fillPlot(extendedLargeHits, xAOD::extendedLargeHits, muon, "extendedLargeHits", truthprt, weight);
42 fillPlot(phiLayer1Hits, xAOD::phiLayer1Hits, muon, "phiLayer1Hits", truthprt, weight);
43 fillPlot(phiLayer2Hits, xAOD::phiLayer2Hits, muon, "phiLayer2Hits", truthprt, weight);
44 fillPlot(phiLayer3Hits, xAOD::phiLayer3Hits, muon, "phiLayer3Hits", truthprt, weight);
45 fillPlot(phiLayer4Hits, xAOD::phiLayer4Hits, muon, "phiLayer4Hits", truthprt, weight);
46 fillPlot(etaLayer1Hits, xAOD::etaLayer1Hits, muon, "etaLayer1Hits", truthprt, weight);
47 fillPlot(etaLayer2Hits, xAOD::etaLayer2Hits, muon, "etaLayer2Hits", truthprt, weight);
48 fillPlot(etaLayer3Hits, xAOD::etaLayer3Hits, muon, "etaLayer3Hits", truthprt, weight);
49 fillPlot(etaLayer4Hits, xAOD::etaLayer4Hits, muon, "etaLayer4Hits", truthprt, weight);
50}
51
52 void MuonHitDiffSummaryPlots::fillPlot(Trk::HitTypePlots& hitPlots, xAOD::MuonSummaryType info, const xAOD::Muon& muon, const std::string& sInfo, const xAOD::TruthParticle& truthprt, float weight){
53 uint8_t hitval = 0;
54 if (!muon.summaryValue(hitval,info)) return;
55 static const SG::ConstAccessor<uint8_t> acc (sInfo);
56 if (!acc.isAvailable(truthprt)) return;
57 hitPlots.fill(hitval - acc(truthprt), muon.eta(), muon.phi(), weight);
58}
59
60}
Helper class to provide constant type-safe access to aux data.
MuonHitDiffSummaryPlots(PlotBase *pParent, const std::string &sDir)
void fill(const xAOD::Muon &muon, const xAOD::TruthParticle &truthprt, float weight=1.0)
void fillPlot(Trk::HitTypePlots &hitPlots, xAOD::MuonSummaryType info, const xAOD::Muon &muon, const std::string &sInfo, const xAOD::TruthParticle &truthprt, float weight=1.0)
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)
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
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)
@ 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
@ outerLargeHits
number of precision hits in the outer large layer
@ etaLayer3Hits
number of eta hits 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)
@ phiLayer1Hits
number of phi hits in the first trigger layer (BML1 ot T4)
@ 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)
@ innerLargeHits
number of precision hits in the inner large layer
@ etaLayer4Hits
number of eta hits in the fourth trigger layer (T3)
@ etaLayer2Hits
number of eta hits in the second trigger layer (BML2 ot T1)
@ innerSmallHits
number of precision hits in the inner small layer