ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonValidation
MuonHistogramming
MuonHistUtils
Root
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
5
#include "
MuonHistUtils/MuonSegmentTruthRelatedPlots.h
"
6
7
#include "
GeoPrimitives/GeoPrimitives.h
"
8
#include "
xAODTracking/TrackingPrimitives.h
"
9
10
namespace
Muon
{
11
12
MuonSegmentTruthRelatedPlots::MuonSegmentTruthRelatedPlots
(
13
PlotBase
* pParent,
const
std::string& sDir)
14
:
PlotBase
(pParent, sDir),
15
nPrecisionHits
(this,
"diff_nPrecisionHits"
,
16
"diff(reco-truth) segment precision hits;hits;Entries"
, -5,
17
5),
18
nPhiLayers
(this,
"diff_nPhiLayers"
,
19
"diff(reco-truth) segment phi layers;#phi layers;Entries"
, -5,
20
5),
21
nTrigEtaLayers
(this,
"diff_nTrigEtaLayers"
,
22
"diff(reco-truth) segment eta trigger layers;#eta trigger "
23
"layers;Entries"
,
24
-5, 5) {
25
// booking histograms
26
dxpos
=
Book1D
(
"dxpos"
,
"Resolution x-position;#Delta x_{pos};Entries"
, 400,
27
-14000, 14000);
28
dypos
=
Book1D
(
"dypos"
,
"Resolution y-position;#Delta y_{pos};Entries"
, 400,
29
-14000, 14000);
30
dzpos
=
Book1D
(
"dzpos"
,
"Resolution z-position;#Delta z_{pos};Entries"
, 500,
31
-22000, 22000);
32
33
detapos
=
34
Book1D
(
"detapos"
,
"Resolution eta-position;#Delta#eta_{pos};Entries"
,
35
64, -3.2, 3.2);
36
dphipos
=
37
Book1D
(
"dphipos"
,
"Resolution phi-position;#Delta#phi_{pos};Entries"
,
38
64, -3.2, 3.2);
39
40
detadir
=
41
Book1D
(
"detadir"
,
"Resolution eta-direction;#Delta#eta_{dir};Entries"
,
42
100, -10., 10.);
43
dphidir
=
44
Book1D
(
"dphidir"
,
"Resolution phi-direction;#Delta#phi_{dir};Entries"
,
45
100, -10., 10.);
46
}
47
48
MuonSegmentTruthRelatedPlots::~MuonSegmentTruthRelatedPlots
() {}
49
50
void
MuonSegmentTruthRelatedPlots::fill
(
const
xAOD::MuonSegment
& muSeg,
51
const
xAOD::MuonSegment
& truthMuSeg,
52
float
weight) {
53
55
56
float
muSegEta = 0;
57
float
muSegPhi = 0;
58
Amg::Vector3D
globalPos{muSeg.
x
(), muSeg.
y
(), muSeg.
z
()};
59
Amg::Vector3D
truthGlobalPos{truthMuSeg.
x
(), truthMuSeg.
y
(),
60
truthMuSeg.
z
()};
61
62
if
(globalPos.mag()) {
63
// protect against cases with no hit information!
64
muSegEta = globalPos.eta();
65
muSegPhi = globalPos.phi();
66
}
67
68
nPrecisionHits
.fill(truthMuSeg.
nPrecisionHits
() - muSeg.
nPrecisionHits
(),
69
muSegEta, muSegPhi);
70
nPhiLayers
.fill(truthMuSeg.
nPhiLayers
() - muSeg.
nPhiLayers
(), muSegEta,
71
muSegPhi);
72
nTrigEtaLayers
.fill(truthMuSeg.
nTrigEtaLayers
() - muSeg.
nTrigEtaLayers
(),
73
muSegEta, muSegPhi);
74
76
77
// protect against cases with no hit information!
78
if
(globalPos.mag() < DBL_EPSILON || truthGlobalPos.mag() < DBL_EPSILON) {
79
return
;
80
}
81
82
dxpos
->Fill(muSeg.
x
() - truthMuSeg.
x
(), weight);
83
dypos
->Fill(muSeg.
y
() - truthMuSeg.
y
(), weight);
84
dzpos
->Fill(muSeg.
z
() - truthMuSeg.
z
(), weight);
85
86
detapos
->Fill(globalPos.eta() - truthGlobalPos.eta(), weight);
87
dphipos
->Fill(globalPos.deltaPhi(truthGlobalPos), weight);
88
89
Amg::Vector3D
globalDir(muSeg.
px
(), muSeg.
py
(), muSeg.
pz
());
90
Amg::Vector3D
truthGlobalDir(truthMuSeg.
px
(), truthMuSeg.
py
(),
91
truthMuSeg.
pz
());
92
93
dphidir
->Fill(globalDir.deltaPhi(truthGlobalDir), weight);
94
detadir
->Fill(globalDir.eta() - truthGlobalDir.eta(), weight);
95
}
96
97
}
// namespace Muon
GeoPrimitives.h
MuonSegmentTruthRelatedPlots.h
TrackingPrimitives.h
Muon::MuonSegmentTruthRelatedPlots::MuonSegmentTruthRelatedPlots
MuonSegmentTruthRelatedPlots(PlotBase *pParent, const std::string &sDir)
Definition
MuonSegmentTruthRelatedPlots.cxx:12
Muon::MuonSegmentTruthRelatedPlots::nTrigEtaLayers
Trk::HitTypePlots nTrigEtaLayers
Definition
MuonSegmentTruthRelatedPlots.h:28
Muon::MuonSegmentTruthRelatedPlots::dzpos
TH1 * dzpos
Definition
MuonSegmentTruthRelatedPlots.h:33
Muon::MuonSegmentTruthRelatedPlots::dxpos
TH1 * dxpos
Definition
MuonSegmentTruthRelatedPlots.h:31
Muon::MuonSegmentTruthRelatedPlots::dypos
TH1 * dypos
Definition
MuonSegmentTruthRelatedPlots.h:32
Muon::MuonSegmentTruthRelatedPlots::nPhiLayers
Trk::HitTypePlots nPhiLayers
Definition
MuonSegmentTruthRelatedPlots.h:27
Muon::MuonSegmentTruthRelatedPlots::dphidir
TH1 * dphidir
Definition
MuonSegmentTruthRelatedPlots.h:39
Muon::MuonSegmentTruthRelatedPlots::dphipos
TH1 * dphipos
Definition
MuonSegmentTruthRelatedPlots.h:36
Muon::MuonSegmentTruthRelatedPlots::nPrecisionHits
Trk::HitTypePlots nPrecisionHits
Definition
MuonSegmentTruthRelatedPlots.h:26
Muon::MuonSegmentTruthRelatedPlots::detadir
TH1 * detadir
Definition
MuonSegmentTruthRelatedPlots.h:38
Muon::MuonSegmentTruthRelatedPlots::detapos
TH1 * detapos
Definition
MuonSegmentTruthRelatedPlots.h:35
Muon::MuonSegmentTruthRelatedPlots::fill
void fill(const xAOD::MuonSegment &muonSeg, const xAOD::MuonSegment &truthMuonSeg, float weight=1.0)
Definition
MuonSegmentTruthRelatedPlots.cxx:50
Muon::MuonSegmentTruthRelatedPlots::~MuonSegmentTruthRelatedPlots
~MuonSegmentTruthRelatedPlots()
Definition
MuonSegmentTruthRelatedPlots.cxx:48
PlotBase::Book1D
TH1D * Book1D(std::string_view name, std::string_view labels, int nBins, float start, float end, bool prependDir=true)
Book a TH1D histogram.
Definition
PlotBase.cxx:94
PlotBase::PlotBase
PlotBase(PlotBase *parent, std::string_view sDir)
Definition
PlotBase.cxx:29
xAOD::MuonSegment_v1::px
float px() const
xAOD::MuonSegment_v1::y
float y() const
Returns the x position.
xAOD::MuonSegment_v1::nTrigEtaLayers
std::uint8_t nTrigEtaLayers() const
Returns the number of trigger eta hits.
xAOD::MuonSegment_v1::pz
float pz() const
Returns the pz.
xAOD::MuonSegment_v1::nPrecisionHits
std::uint8_t nPrecisionHits() const
Returns the number of precision hits.
xAOD::MuonSegment_v1::py
float py() const
Returns the py.
xAOD::MuonSegment_v1::x
float x() const
xAOD::MuonSegment_v1::nPhiLayers
std::uint8_t nPhiLayers() const
Returns the number of trigger phi hits.
xAOD::MuonSegment_v1::z
float z() const
Returns the y position.
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition
TrackSystemController.h:46
xAOD::MuonSegment
MuonSegment_v1 MuonSegment
Reference the current persistent version:
Definition
Event/xAOD/xAODMuon/xAODMuon/MuonSegment.h:13
Generated on
for ATLAS Offline Software by
1.17.0