ATLAS Offline Software
MuonTruthHitPlots.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 namespace Muon{
11 
12 MuonTruthHitPlots::MuonTruthHitPlots(PlotBase* pParent, const std::string& sDir):
13 PlotBase(pParent, sDir)
14 
15 {
16  precMatchedHitsSummed=Book1D("precMatchedHitsSummed","summed precision hits matched to truth (all chambers)",21,-0.5,20.5);
17  precMatchedHitsBIS=Book1D("precMatchedHitsBIS","BIS precision hits matched to truth;matched hits;entries",21,-0.5,20.5);
18  precMatchedHitsBIL=Book1D("precMatchedHitsBIL","BIL precision hits matched to truth;matched hits;entries",21,-0.5,20.5);
19  precMatchedHitsBMS=Book1D("precMatchedHitsBMS","BMS precision hits matched to truth;matched hits;entries",21,-0.5,20.5);
20  precMatchedHitsBML=Book1D("precMatchedHitsBML","BML precision hits matched to truth;matched hits;entries",21,-0.5,20.5);
21  precMatchedHitsBOS=Book1D("precMatchedHitsBOS","BOS precision hits matched to truth;matched hits;entries",21,-0.5,20.5);
22  precMatchedHitsBOL=Book1D("precMatchedHitsBOL","BOL precision hits matched to truth;matched hits;entries",21,-0.5,20.5);
23  precMatchedHitsBEE=Book1D("precMatchedHitsBEE","BEE precision hits matched to truth;matched hits;entries",21,-0.5,20.5);
24  precMatchedHitsEIS=Book1D("precMatchedHitsEIS","EIS precision hits matched to truth;matched hits;entries",21,-0.5,20.5);
25  precMatchedHitsEIL=Book1D("precMatchedHitsEIL","EIL precision hits matched to truth;matched hits;entries",21,-0.5,20.5);
26  precMatchedHitsEMS=Book1D("precMatchedHitsEMS","EMS precision hits matched to truth;matched hits;entries",21,-0.5,20.5);
27  precMatchedHitsEML=Book1D("precMatchedHitsEML","EML precision hits matched to truth;matched hits;entries",21,-0.5,20.5);
28  precMatchedHitsEOS=Book1D("precMatchedHitsEOS","EOS precision hits matched to truth;matched hits;entries",21,-0.5,20.5);
29  precMatchedHitsEOL=Book1D("precMatchedHitsEOL","EOL precision hits matched to truth;matched hits;entries",21,-0.5,20.5);
30  precMatchedHitsEES=Book1D("precMatchedHitsEES","EES precision hits matched to truth;matched hits;entries",21,-0.5,20.5);
31  precMatchedHitsEEL=Book1D("precMatchedHitsEEL","EEL precision hits matched to truth;matched hits;entries",21,-0.5,20.5);
32  precMatchedHitsCSS=Book1D("precMatchedHitsCSS","CSS precision hits matched to truth;matched hits;entries",21,-0.5,20.5);
33  precMatchedHitsCSL=Book1D("precMatchedHitsCSL","CSL precision hits matched to truth;matched hits;entries",21,-0.5,20.5);
34 
35  phiMatchedHitsSummed=Book1D("phiMatchedHitsSummed","summed phi hits matched to truth (all chambers)",21,-0.5,20.5 );
36  phiMatchedHitsBM1=Book1D("phiMatchedHitsBM1","BM1 phi hits matched to truth;matched hits;entries",21,-0.5,20.5 );
37  phiMatchedHitsBM2=Book1D("phiMatchedHitsBM2","BM2 phi hits matched to truth;matched hits;entries",21,-0.5,20.5 );
38  phiMatchedHitsBO1=Book1D("phiMatchedHitsBO1","BO1 phi hits matched to truth;matched hits;entries",21,-0.5,20.5 );
39  phiMatchedHitsBO2=Book1D("phiMatchedHitsBO2","BO2 phi hits matched to truth;matched hits;entries",21,-0.5,20.5 );
40  phiMatchedHitsT1=Book1D("phiMatchedHitsT1","T1 phi hits matched to truth;matched hits;entries",21,-0.5,20.5 );
41  phiMatchedHitsT2=Book1D("phiMatchedHitsT2","T2 phi hits matched to truth;matched hits;entries",21,-0.5,20.5 );
42  phiMatchedHitsT3=Book1D("phiMatchedHitsT3","T3 phi hits matched to truth;matched hits;entries",21,-0.5,20.5 );
43  phiMatchedHitsT4=Book1D("phiMatchedHitsT4","T4 phi hits matched to truth;matched hits;entries",21,-0.5,20.5 );
44  phiMatchedHitsCSC=Book1D("phiMatchedHitsCSC","CSC phi hits matched to truth;matched hits;entries",21,-0.5,20.5 );
45 
46  trigEtaMatchedHitsSummed=Book1D("trigEtaMatchedHitsSummed","summed trigEta hits matched to truth (all chambers)",21,-0.5,20.5 );
47  trigEtaMatchedHitsBM1=Book1D("trigEtaMatchedHitsBM1","BM1 trigEta hits matched to truth;matched hits;entries",21,-0.5,20.5 );
48  trigEtaMatchedHitsBM2=Book1D("trigEtaMatchedHitsBM2","BM2 trigEta hits matched to truth;matched hits;entries",21,-0.5,20.5 );
49  trigEtaMatchedHitsBO1=Book1D("trigEtaMatchedHitsBO1","BO1 trigEta hits matched to truth;matched hits;entries",21,-0.5,20.5 );
50  trigEtaMatchedHitsBO2=Book1D("trigEtaMatchedHitsBO2","BO2 trigEta hits matched to truth;matched hits;entries",21,-0.5,20.5 );
51  trigEtaMatchedHitsT1=Book1D("trigEtaMatchedHitsT1","T1 trigEta hits matched to truth;matched hits;entries",21,-0.5,20.5 );
52  trigEtaMatchedHitsT2=Book1D("trigEtaMatchedHitsT2","T2 trigEta hits matched to truth;matched hits;entries",21,-0.5,20.5 );
53  trigEtaMatchedHitsT3=Book1D("trigEtaMatchedHitsT3","T3 trigEta hits matched to truth;matched hits;entries",21,-0.5,20.5 );
54  trigEtaMatchedHitsT4=Book1D("trigEtaMatchedHitsT4","T4 trigEta hits matched to truth;matched hits;entries",21,-0.5,20.5 );
55  // trigEtaMatchedHitsCSC=Book1D("trigEtaMatchedHitsCSC","CSC trigEta hits matched to truth;matched hits;entries",21,-0.5,20.5 );
56 
57  }
58 
60 
61  fillPlot(precMatchedHitsSummed,"nprecMatchedHitsPerChamberLayer", muon, weight);
62  fillPlot(precMatchedHitsBIS,"nprecMatchedHitsPerChamberLayer", ChIdx::BIS, muon, weight);
63  fillPlot(precMatchedHitsBIL,"nprecMatchedHitsPerChamberLayer", ChIdx::BIL, muon, weight);
64  fillPlot(precMatchedHitsBMS,"nprecMatchedHitsPerChamberLayer", ChIdx::BMS, muon, weight);
65  fillPlot(precMatchedHitsBML,"nprecMatchedHitsPerChamberLayer", ChIdx::BML, muon, weight);
66  fillPlot(precMatchedHitsBOS,"nprecMatchedHitsPerChamberLayer", ChIdx::BOS, muon, weight);
67  fillPlot(precMatchedHitsBOL,"nprecMatchedHitsPerChamberLayer", ChIdx::BOL, muon, weight);
68  fillPlot(precMatchedHitsBEE,"nprecMatchedHitsPerChamberLayer", ChIdx::BEE, muon, weight);
69  fillPlot(precMatchedHitsEIS,"nprecMatchedHitsPerChamberLayer", ChIdx::EIS, muon, weight);
70  fillPlot(precMatchedHitsEIL,"nprecMatchedHitsPerChamberLayer", ChIdx::EIL, muon, weight);
71  fillPlot(precMatchedHitsEMS,"nprecMatchedHitsPerChamberLayer", ChIdx::EMS, muon, weight);
72  fillPlot(precMatchedHitsEML,"nprecMatchedHitsPerChamberLayer", ChIdx::EML, muon, weight);
73  fillPlot(precMatchedHitsEOS,"nprecMatchedHitsPerChamberLayer", ChIdx::EOS, muon, weight);
74  fillPlot(precMatchedHitsEOL,"nprecMatchedHitsPerChamberLayer", ChIdx::EOL, muon, weight);
75  fillPlot(precMatchedHitsEES,"nprecMatchedHitsPerChamberLayer", ChIdx::EES, muon, weight);
76  fillPlot(precMatchedHitsEEL,"nprecMatchedHitsPerChamberLayer", ChIdx::EEL, muon, weight);
77  fillPlot(precMatchedHitsCSS,"nprecMatchedHitsPerChamberLayer", ChIdx::CSS, muon, weight);
78  fillPlot(precMatchedHitsCSL,"nprecMatchedHitsPerChamberLayer", ChIdx::CSL, muon, weight);
79 
80  fillPlot(phiMatchedHitsSummed,"nphiMatchedHitsPerChamberLayer", muon, weight);
81  fillPlot(phiMatchedHitsBM1, "nphiMatchedHitsPerChamberLayer", PhiIdx::BM1, muon,weight);
82  fillPlot(phiMatchedHitsBM2, "nphiMatchedHitsPerChamberLayer", PhiIdx::BM2, muon, weight);
83  fillPlot(phiMatchedHitsBO1, "nphiMatchedHitsPerChamberLayer", PhiIdx::BO1, muon, weight);
84  fillPlot(phiMatchedHitsBO2, "nphiMatchedHitsPerChamberLayer", PhiIdx::BO2, muon, weight);
85  fillPlot(phiMatchedHitsT1, "nphiMatchedHitsPerChamberLayer", PhiIdx::T1, muon, weight);
86  fillPlot(phiMatchedHitsT2, "nphiMatchedHitsPerChamberLayer", PhiIdx::T2, muon, weight);
87  fillPlot(phiMatchedHitsT3, "nphiMatchedHitsPerChamberLayer", PhiIdx::T3, muon, weight);
88  fillPlot(phiMatchedHitsT4, "nphiMatchedHitsPerChamberLayer", PhiIdx::T4, muon, weight);
89  fillPlot(phiMatchedHitsCSC, "nphiMatchedHitsPerChamberLayer", PhiIdx::CSC, muon, weight);
90 
91  fillPlot(trigEtaMatchedHitsSummed,"ntrigEtaMatchedHitsPerChamberLayer", muon, weight);
92  fillPlot(trigEtaMatchedHitsBM1, "ntrigEtaMatchedHitsPerChamberLayer", PhiIdx::BM1, muon, weight);
93  fillPlot(trigEtaMatchedHitsBM2, "ntrigEtaMatchedHitsPerChamberLayer", PhiIdx::BM2, muon, weight);
94  fillPlot(trigEtaMatchedHitsBO1, "ntrigEtaMatchedHitsPerChamberLayer", PhiIdx::BO1, muon, weight);
95  fillPlot(trigEtaMatchedHitsBO2, "ntrigEtaMatchedHitsPerChamberLayer", PhiIdx::BO2, muon, weight);
96  fillPlot(trigEtaMatchedHitsT1, "ntrigEtaMatchedHitsPerChamberLayer", PhiIdx::T1, muon, weight);
97  fillPlot(trigEtaMatchedHitsT2, "ntrigEtaMatchedHitsPerChamberLayer", PhiIdx::T2, muon, weight);
98  fillPlot(trigEtaMatchedHitsT3, "ntrigEtaMatchedHitsPerChamberLayer", PhiIdx::T3, muon, weight);
99  fillPlot(trigEtaMatchedHitsT4, "ntrigEtaMatchedHitsPerChamberLayer", PhiIdx::T4, muon, weight);
100  // fillPlot(trigEtaMatchedHitsCSC, "ntrigEtaMatchedHitsPerChamberLayer", PhiIdx::CSC, muon);
101 
102 }
103 
104  void MuonTruthHitPlots::fillPlot(TH1* hitPlots, const std::string& sInfo,const xAOD::Muon& muon, float weight){
105  //protection
106  if (muon.author()!=xAOD::Muon::MuidCo && muon.author()!=xAOD::Muon::MuidSA && muon.author()!=xAOD::Muon::MuGirl) return;
107 
109  if (!acc.isAvailable(muon)) return;
110  std::vector<unsigned int> vec=acc(muon);
111  for (unsigned int i=0;i<vec.size();i++) {
112  hitPlots->Fill(vec[i], weight);
113  }
114 }
115 
116  void MuonTruthHitPlots::fillPlot(TH1* hitPlots, const std::string& sInfo, const Muon::MuonStationIndex::ChIndex& index, const xAOD::Muon& muon, float weight){
117  //protection
118  if (muon.author()!=xAOD::Muon::MuidCo && muon.author()!=xAOD::Muon::MuidSA && muon.author()!=xAOD::Muon::MuGirl) return;
119 
121  if (!acc.isAvailable(muon)) return;
122  std::vector<unsigned int> vec=acc(muon);
123  hitPlots->Fill(vec[index], weight);
124 
125 }
126  void MuonTruthHitPlots::fillPlot(TH1* hitPlots, const std::string& sInfo, const Muon::MuonStationIndex::PhiIndex& index, const xAOD::Muon& muon, float weight){
127  //protection
128  if (muon.author()!=xAOD::Muon::MuidCo && muon.author()!=xAOD::Muon::MuidSA && muon.author()!=xAOD::Muon::MuGirl) return;
129 
131  if (!acc.isAvailable(muon)) return;
132  std::vector<unsigned int> vec=acc(muon);
133  hitPlots->Fill(vec[index], weight);
134 
135 }
136 
137 
138 }
BIS
@ BIS
Definition: RegSelEnums.h:11
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
CSS
@ CSS
Definition: ParabolaCscClusterFitter.h:25
BIL
@ BIL
Definition: RegSelEnums.h:10
xAOD::MuGirl
@ MuGirl
MuGirl.
Definition: TrackingPrimitives.h:141
PlotBase
Definition: PlotBase.h:34
Muon::MuonTruthHitPlots::precMatchedHitsEIS
TH1 * precMatchedHitsEIS
Definition: MuonTruthHitPlots.h:29
Muon::MuonTruthHitPlots::precMatchedHitsBIL
TH1 * precMatchedHitsBIL
Definition: MuonTruthHitPlots.h:23
index
Definition: index.py:1
python.copyTCTOutput.sDir
sDir
Definition: copyTCTOutput.py:60
Muon::ChIdx
MuonStationIndex::ChIndex ChIdx
Definition: MuonSegmentPlots.cxx:13
xAOD::L2MuonParameters::BEE
@ BEE
BEE measurement point.
Definition: TrigMuonDefs.h:24
Muon::MuonTruthHitPlots::trigEtaMatchedHitsSummed
TH1 * trigEtaMatchedHitsSummed
Definition: MuonTruthHitPlots.h:51
Muon::MuonTruthHitPlots::precMatchedHitsEES
TH1 * precMatchedHitsEES
Definition: MuonTruthHitPlots.h:35
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
Muon::MuonTruthHitPlots::phiMatchedHitsT1
TH1 * phiMatchedHitsT1
Definition: MuonTruthHitPlots.h:45
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
Muon::MuonTruthHitPlots::MuonTruthHitPlots
MuonTruthHitPlots(PlotBase *pParent, const std::string &sDir)
Definition: MuonTruthHitPlots.cxx:12
Muon::MuonTruthHitPlots::precMatchedHitsEML
TH1 * precMatchedHitsEML
Definition: MuonTruthHitPlots.h:32
Muon::MuonTruthHitPlots::precMatchedHitsBOL
TH1 * precMatchedHitsBOL
Definition: MuonTruthHitPlots.h:27
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
Muon::MuonTruthHitPlots::precMatchedHitsEOL
TH1 * precMatchedHitsEOL
Definition: MuonTruthHitPlots.h:34
BOL
@ BOL
Definition: RegSelEnums.h:14
Muon::MuonTruthHitPlots::trigEtaMatchedHitsBM1
TH1 * trigEtaMatchedHitsBM1
Definition: MuonTruthHitPlots.h:52
Muon::MuonTruthHitPlots::trigEtaMatchedHitsT2
TH1 * trigEtaMatchedHitsT2
Definition: MuonTruthHitPlots.h:57
Muon::MuonStationIndex::PhiIndex
PhiIndex
enum to classify the different phi layers in the muon spectrometer
Definition: MuonStationIndex.h:31
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
Muon::MuonTruthHitPlots::precMatchedHitsBIS
TH1 * precMatchedHitsBIS
Definition: MuonTruthHitPlots.h:22
Muon::MuonTruthHitPlots::trigEtaMatchedHitsBM2
TH1 * trigEtaMatchedHitsBM2
Definition: MuonTruthHitPlots.h:53
Muon::MuonTruthHitPlots::phiMatchedHitsCSC
TH1 * phiMatchedHitsCSC
Definition: MuonTruthHitPlots.h:49
Muon::MuonTruthHitPlots::fill
void fill(const xAOD::Muon &muon, float weight=1.0)
Definition: MuonTruthHitPlots.cxx:59
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
PlotBase::Book1D
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
Muon::MuonTruthHitPlots::trigEtaMatchedHitsT4
TH1 * trigEtaMatchedHitsT4
Definition: MuonTruthHitPlots.h:59
Muon::MuonTruthHitPlots::phiMatchedHitsBM1
TH1 * phiMatchedHitsBM1
Definition: MuonTruthHitPlots.h:41
Muon::MuonTruthHitPlots::precMatchedHitsEOS
TH1 * precMatchedHitsEOS
Definition: MuonTruthHitPlots.h:33
Muon::MuonTruthHitPlots::phiMatchedHitsBO1
TH1 * phiMatchedHitsBO1
Definition: MuonTruthHitPlots.h:43
lumiFormat.i
int i
Definition: lumiFormat.py:85
Muon::MuonTruthHitPlots::precMatchedHitsCSS
TH1 * precMatchedHitsCSS
Definition: MuonTruthHitPlots.h:37
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
Muon::MuonTruthHitPlots::phiMatchedHitsT3
TH1 * phiMatchedHitsT3
Definition: MuonTruthHitPlots.h:47
Muon::MuonTruthHitPlots::phiMatchedHitsBM2
TH1 * phiMatchedHitsBM2
Definition: MuonTruthHitPlots.h:42
Muon::MuonTruthHitPlots::precMatchedHitsBMS
TH1 * precMatchedHitsBMS
Definition: MuonTruthHitPlots.h:24
Muon::MuonTruthHitPlots::trigEtaMatchedHitsBO1
TH1 * trigEtaMatchedHitsBO1
Definition: MuonTruthHitPlots.h:54
Muon::MuonTruthHitPlots::precMatchedHitsBML
TH1 * precMatchedHitsBML
Definition: MuonTruthHitPlots.h:25
Muon::MuonTruthHitPlots::precMatchedHitsCSL
TH1 * precMatchedHitsCSL
Definition: MuonTruthHitPlots.h:38
Muon::MuonTruthHitPlots::phiMatchedHitsT4
TH1 * phiMatchedHitsT4
Definition: MuonTruthHitPlots.h:48
Muon::MuonTruthHitPlots::precMatchedHitsBEE
TH1 * precMatchedHitsBEE
Definition: MuonTruthHitPlots.h:28
Muon::MuonTruthHitPlots::precMatchedHitsSummed
TH1 * precMatchedHitsSummed
Definition: MuonTruthHitPlots.h:21
Muon::MuonTruthHitPlots::precMatchedHitsBOS
TH1 * precMatchedHitsBOS
Definition: MuonTruthHitPlots.h:26
Muon::MuonTruthHitPlots::trigEtaMatchedHitsT3
TH1 * trigEtaMatchedHitsT3
Definition: MuonTruthHitPlots.h:58
Muon::MuonTruthHitPlots::trigEtaMatchedHitsT1
TH1 * trigEtaMatchedHitsT1
Definition: MuonTruthHitPlots.h:56
MuonParameters::MuidSA
@ MuidSA
Definition: MuonParamDefs.h:59
Muon::MuonTruthHitPlots::precMatchedHitsEMS
TH1 * precMatchedHitsEMS
Definition: MuonTruthHitPlots.h:31
MuonParameters::MuidCo
@ MuidCo
Definition: MuonParamDefs.h:60
BML
@ BML
Definition: RegSelEnums.h:12
BMS
@ BMS
Definition: RegSelEnums.h:13
Muon::MuonTruthHitPlots::phiMatchedHitsSummed
TH1 * phiMatchedHitsSummed
Definition: MuonTruthHitPlots.h:40
Muon::MuonTruthHitPlots::phiMatchedHitsT2
TH1 * phiMatchedHitsT2
Definition: MuonTruthHitPlots.h:46
Muon::MuonStationIndex::ChIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Definition: MuonStationIndex.h:15
Muon::MuonTruthHitPlots::precMatchedHitsEEL
TH1 * precMatchedHitsEEL
Definition: MuonTruthHitPlots.h:36
CSC
@ CSC
Definition: RegSelEnums.h:34
Muon::MuonTruthHitPlots::fillPlot
void fillPlot(TH1 *hitPlots, const std::string &sInfo, const Muon::MuonStationIndex::ChIndex &index, const xAOD::Muon &muon, float weight=1.0)
Definition: MuonTruthHitPlots.cxx:116
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
Muon::MuonTruthHitPlots::phiMatchedHitsBO2
TH1 * phiMatchedHitsBO2
Definition: MuonTruthHitPlots.h:44
CSL
@ CSL
Definition: ParabolaCscClusterFitter.h:25
BOS
@ BOS
Definition: RegSelEnums.h:15
Muon::MuonTruthHitPlots::precMatchedHitsEIL
TH1 * precMatchedHitsEIL
Definition: MuonTruthHitPlots.h:30
Muon::MuonTruthHitPlots::trigEtaMatchedHitsBO2
TH1 * trigEtaMatchedHitsBO2
Definition: MuonTruthHitPlots.h:55
MuonTruthHitPlots.h