ATLAS Offline Software
Loading...
Searching...
No Matches
IDHitSummaryPlots.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <utility>
8
10
11namespace Muon {
12
14HitFracTypePlots::HitFracTypePlots(PlotBase* pParent, std::string sHitType,
15 std::string sHitLabel)
16 : PlotBase(pParent, ""),
17 m_sHitType(std::move(sHitType)),
18 m_sHitLabel(std::move(sHitLabel)) {}
20 fracHits = Book1D(m_sHitType, m_sHitLabel + ";" + m_sHitLabel + ";Entries",
21 30, 0., 0.6);
23 m_sHitLabel + ";" + m_sHitLabel + ";#eta;Entries",
24 30, 0., 0.3, 54, -2.7, 2.7);
25}
26void HitFracTypePlots::fill(float fHits, float fEta, float weight) {
27 fracHits->Fill(fHits, weight);
28 // unclear how to weight this
29 fracHitsVsEta->Fill(fHits, fEta);
30}
31
32
33IDHitSummaryPlots::IDHitSummaryPlots(PlotBase* pParent, const std::string& sDir)
34 : PlotBase(pParent, sDir),
35 nBLayerHitsIfExpected(this, "nBLayerHitsIfExpected", "B-Layer clusters",
36 0, 4),
37 nPixelHitsPlusDead(this, "nPixelHitsPlusDead", "Pixel clusters", 0, 9),
38 nSCTHitsPlusDead(this, "nSCTHitsPlusDead", "SCT clusters", 0, 20),
39 nTRTHitsPlusDead(this, "nTRTHitsPlusDead", "TRT clusters", 0, 60),
40 nTRTHitsPlusOutliers(this, "nTRTHitsPlusOutliers", "TRT hits+Outliers", 0,
41 60),
42 nPixSCTHoles(this, "nPixSCTHoles", "Pix+SCT holes", 0, 5),
43 fPixelOutliers(this, "fPixelOutliers", "Fraction of Pix Outliers"),
44 fSCTOutliers(this, "fSCTOutliers", "Fraction of SCT outliers"),
45 fTRTOutliers(this, "fTRTOutliers", "Fraction of TRT Outliers") {}
46
47void IDHitSummaryPlots::fill(const xAOD::TrackParticle& trk, float weight) {
48 float eta = trk.eta();
49 float phi = trk.phi();
50
51 uint8_t iBLayerHits(0), bExpectBLayerHit(0);
54 nBLayerHitsIfExpected.fill(bExpectBLayerHit * iBLayerHits, eta, phi,
55 weight);
56
57 uint8_t iPixHits(0), iPixDead(0);
60 nPixelHitsPlusDead.fill(iPixHits + iPixDead, eta, phi, weight);
61
62 uint8_t iSCTHits(0), iSCTDead(0);
65 nSCTHitsPlusDead.fill(iSCTHits + iSCTDead, eta, phi, weight);
66
67 uint8_t iTRTHits(0), iTRTDead(0), iTRTOutliers(0);
70 trk.summaryValue(iTRTOutliers, xAOD::numberOfTRTOutliers);
71 nTRTHitsPlusDead.fill(iTRTHits + iTRTDead, eta, phi, weight);
72 nTRTHitsPlusOutliers.fill(iTRTHits + iTRTOutliers, eta, phi, weight);
73
74 uint8_t iPixHoles(0), iSCTHoles(0);
77 nPixSCTHoles.fill(iPixHoles + iSCTHoles, eta, phi, weight);
78
79 uint8_t iPixelOutliers(0);
80 trk.summaryValue(iPixelOutliers, xAOD::numberOfPixelOutliers);
81 float nPix = (int)iPixelOutliers + (int)iPixHits;
82 float fracPixOutliers = (nPix > 0) ? 1. * ((int)iPixelOutliers) / nPix : 0;
83 fPixelOutliers.fill(fracPixOutliers, eta, weight);
84
85 uint8_t iSCTOutliers(0);
86 trk.summaryValue(iSCTOutliers, xAOD::numberOfSCTOutliers);
87 float nSCT = (int)iSCTOutliers + (int)iSCTHits;
88 float fracSCTOutliers = (nSCT > 0) ? 1. * ((int)iSCTOutliers) / nSCT : 0;
89 fSCTOutliers.fill(fracSCTOutliers, eta, weight);
90
91 float nTRT = ((int)iTRTOutliers) + ((int)iTRTHits);
92 float fracTRTOutliers = (nTRT > 0) ? ((int)iTRTOutliers) / nTRT : 0;
93 fTRTOutliers.fill(fracTRTOutliers, eta, weight);
94}
95
96} // namespace Muon
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
void fill(float hitval, float trketa, float weight=1.0)
HitFracTypePlots(PlotBase *pParent, std::string sHitType, std::string sHitLabel)
Trk::HitTypePlots nSCTHitsPlusDead
void fill(const xAOD::TrackParticle &trk, float weight=1.0)
Trk::HitTypePlots nPixSCTHoles
IDHitSummaryPlots(PlotBase *pParent, const std::string &sDir)
Trk::HitTypePlots nTRTHitsPlusDead
HitFracTypePlots fTRTOutliers
HitFracTypePlots fSCTOutliers
Trk::HitTypePlots nBLayerHitsIfExpected
Trk::HitTypePlots nPixelHitsPlusDead
HitFracTypePlots fPixelOutliers
Trk::HitTypePlots nTRTHitsPlusOutliers
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 *parent, std::string_view sDir)
Definition PlotBase.cxx:29
TH2F * Book2D(std::string_view name, std::string_view labels, int nBinsX, float startX, float endX, int nBinsY, float startY, float endY, bool prependDir=true)
Book a TH2F histogram.
Definition PlotBase.cxx:123
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .).
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
STL namespace.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
@ expectInnermostPixelLayerHit
Do we expect a 0th-layer barrel hit for this track?
@ numberOfTRTDeadStraws
number of dead TRT straws crossed [unit8_t].
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
@ numberOfPixelOutliers
these are the pixel outliers, including the b-layer [unit8_t].
@ numberOfTRTHits
number of TRT hits [unit8_t].
@ numberOfSCTDeadSensors
number of dead SCT sensors crossed [unit8_t].
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ numberOfSCTOutliers
number of SCT outliers [unit8_t].
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
@ numberOfTRTOutliers
number of TRT outliers [unit8_t].
@ numberOfPixelDeadSensors
number of dead pixel sensors crossed [unit8_t].
@ numberOfSCTHoles
number of SCT holes [unit8_t].