ATLAS Offline Software
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 
9 namespace 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 
31 {
32 }
33 
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
Muon::MuonSegmentTruthRelatedPlots::dzpos
TH1 * dzpos
Definition: MuonSegmentTruthRelatedPlots.h:31
xAOD::MuonSegment_v1::x
float x() const
PlotBase
Definition: PlotBase.h:34
xAOD::MuonSegment_v1::nTrigEtaLayers
int nTrigEtaLayers() const
Returns the number of trigger eta layers.
python.copyTCTOutput.sDir
sDir
Definition: copyTCTOutput.py:60
Muon::MuonSegmentTruthRelatedPlots::nTrigEtaLayers
Trk::HitTypePlots nTrigEtaLayers
Definition: MuonSegmentTruthRelatedPlots.h:26
xAOD::MuonSegment_v1
Class describing a MuonSegment.
Definition: MuonSegment_v1.h:33
xAOD::MuonSegment_v1::pz
float pz() const
Returns the pz.
xAOD::MuonSegment_v1::px
float px() const
MuonSegmentTruthRelatedPlots.h
Muon::MuonSegmentTruthRelatedPlots::detadir
TH1 * detadir
Definition: MuonSegmentTruthRelatedPlots.h:36
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:45
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
GeoPrimitives.h
Muon::MuonSegmentTruthRelatedPlots::dxpos
TH1 * dxpos
Definition: MuonSegmentTruthRelatedPlots.h:29
Trk::HitTypePlots::fill
void fill(int iHits, float fEta, float fPhi, float weight=1.0)
Definition: HitTypePlots.cxx:32
xAOD::MuonSegment_v1::py
float py() const
Returns the py.
Muon::MuonSegmentTruthRelatedPlots::MuonSegmentTruthRelatedPlots
MuonSegmentTruthRelatedPlots(PlotBase *pParent, const std::string &sDir)
Definition: MuonSegmentTruthRelatedPlots.cxx:11
xAOD::MuonSegment_v1::nPhiLayers
int nPhiLayers() const
Returns the number of phi layers.
Muon::MuonSegmentTruthRelatedPlots::fill
void fill(const xAOD::MuonSegment &muonSeg, const xAOD::MuonSegment &truthMuonSeg, float weight=1.0)
Definition: MuonSegmentTruthRelatedPlots.cxx:34
xAOD::MuonSegment_v1::nPrecisionHits
int nPrecisionHits() const
Muon::MuonSegmentTruthRelatedPlots::dypos
TH1 * dypos
Definition: MuonSegmentTruthRelatedPlots.h:30
Muon::MuonSegmentTruthRelatedPlots::dphidir
TH1 * dphidir
Definition: MuonSegmentTruthRelatedPlots.h:37
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
xAOD::MuonSegment_v1::z
float z() const
Returns the y position.
Muon::MuonSegmentTruthRelatedPlots::nPhiLayers
Trk::HitTypePlots nPhiLayers
Definition: MuonSegmentTruthRelatedPlots.h:25
xAOD::MuonSegment_v1::y
float y() const
Returns the x position.
Muon::MuonSegmentTruthRelatedPlots::dphipos
TH1 * dphipos
Definition: MuonSegmentTruthRelatedPlots.h:34
Muon::MuonSegmentTruthRelatedPlots::detapos
TH1 * detapos
Definition: MuonSegmentTruthRelatedPlots.h:33
Muon::MuonSegmentTruthRelatedPlots::nPrecisionHits
Trk::HitTypePlots nPrecisionHits
Definition: MuonSegmentTruthRelatedPlots.h:24
Muon::MuonSegmentTruthRelatedPlots::~MuonSegmentTruthRelatedPlots
~MuonSegmentTruthRelatedPlots()
Definition: MuonSegmentTruthRelatedPlots.cxx:30
TrackingPrimitives.h