ATLAS Offline Software
Loading...
Searching...
No Matches
MuonSegmentTruthRelatedPlots.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
8
9namespace Muon{
10
12 PlotBase(pParent, sDir),
13 nPrecisionHits(this,"diff_nPrecisionHits","diff(reco-truth) segment precision hits;hits;Entries",-5,5),
14 nPhiLayers(this,"diff_nPhiLayers","diff(reco-truth) segment phi layers;#phi layers;Entries",-5,5),
15 nTrigEtaLayers(this,"diff_nTrigEtaLayers","diff(reco-truth) segment eta trigger layers;#eta trigger layers;Entries",-5,5)
16{
17 //booking histograms
18 dxpos = Book1D("dxpos","Resolution x-position;#Delta x_{pos};Entries",400,-14000,14000);
19 dypos = Book1D("dypos","Resolution y-position;#Delta y_{pos};Entries",400,-14000,14000);
20 dzpos = Book1D("dzpos","Resolution z-position;#Delta z_{pos};Entries",500,-22000,22000);
21
22 detapos = Book1D("detapos","Resolution eta-position;#Delta#eta_{pos};Entries",64,-3.2,3.2);
23 dphipos = Book1D("dphipos","Resolution phi-position;#Delta#phi_{pos};Entries",64,-3.2,3.2);
24
25 detadir = Book1D("detadir","Resolution eta-direction;#Delta#eta_{dir};Entries",100,-10.,10.);
26 dphidir = Book1D("dphidir","Resolution phi-direction;#Delta#phi_{dir};Entries",100,-10.,10.);
27
28}
29
33
34 void MuonSegmentTruthRelatedPlots::fill(const xAOD::MuonSegment& muSeg,const xAOD::MuonSegment& truthMuSeg, float weight)
35{
36
38
39 float muSegEta = 0;
40 float muSegPhi = 0;
41 Amg::Vector3D globalPos{muSeg.x(),muSeg.y(),muSeg.z()};
42 Amg::Vector3D truthGlobalPos{truthMuSeg.x(),truthMuSeg.y(),truthMuSeg.z()};
43
44 if (globalPos.mag()) {
45 //protect against cases with no hit information!
46 muSegEta = globalPos.eta();
47 muSegPhi = globalPos.phi();
48 }
49
50 nPrecisionHits.fill(truthMuSeg.nPrecisionHits()-muSeg.nPrecisionHits(), muSegEta, muSegPhi);
51 nPhiLayers.fill(truthMuSeg.nPhiLayers()-muSeg.nPhiLayers(), muSegEta, muSegPhi);
52 nTrigEtaLayers.fill(truthMuSeg.nTrigEtaLayers()-muSeg.nTrigEtaLayers(), muSegEta, muSegPhi);
53
54
56
57 //protect against cases with no hit information!
58 if (globalPos.mag() < DBL_EPSILON || truthGlobalPos.mag() < DBL_EPSILON ) return;
59
60 dxpos->Fill(muSeg.x()-truthMuSeg.x(), weight);
61 dypos->Fill(muSeg.y()-truthMuSeg.y(), weight);
62 dzpos->Fill(muSeg.z()-truthMuSeg.z(), weight);
63
64 detapos->Fill(globalPos.eta()-truthGlobalPos.eta(), weight);
65 dphipos->Fill(globalPos.deltaPhi(truthGlobalPos), weight);
66
67 Amg::Vector3D globalDir(muSeg.px(),muSeg.py(),muSeg.pz());
68 Amg::Vector3D truthGlobalDir(truthMuSeg.px(),truthMuSeg.py(),truthMuSeg.pz());
69
70 dphidir->Fill(globalDir.deltaPhi(truthGlobalDir),weight);
71 detadir->Fill(globalDir.eta()-truthGlobalDir.eta(),weight);
72
73}
74
75} // closing namespace Muon
MuonSegmentTruthRelatedPlots(PlotBase *pParent, const std::string &sDir)
void fill(const xAOD::MuonSegment &muonSeg, const xAOD::MuonSegment &truthMuonSeg, float weight=1.0)
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
float px() const
float y() const
Returns the x position.
float pz() const
Returns the pz.
int nTrigEtaLayers() const
Returns the number of trigger eta layers.
int nPrecisionHits() const
float py() const
Returns the py.
int nPhiLayers() const
Returns the number of phi layers.
float z() const
Returns the y position.
Eigen::Matrix< double, 3, 1 > Vector3D
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
MuonSegment_v1 MuonSegment
Reference the current persistent version: