ATLAS Offline Software
Loading...
Searching...
No Matches
SiHitPlots.cxx
Go to the documentation of this file.
1
12
13#include "SiHitPlots.h"
14
15IDTPM2::SiHitPlots::SiHitPlots( const std::string& name, ToolHandle<GenericMonitoringTool>* m )
16 : IPlotBase( name, m ) {
17}
18
19
20
21
25
28 m_reference.initialize( this, "reference");
29 m_test.initialize( this, "test");
30
31}
32
33
34
36
37 static const std::array<bool,NHitPars> proc = { true, true, false, false, true, true, true, true, true, false, true, true, true };
38
39 for ( size_t i=0 ; i<nHitParNames() ; i++ ) {
40
41 if ( !proc[i] ) continue;
42
43 m_hits[i] = TIDA::Histogram<float>( p->monTool(), hitParName(i), s );
44
46
47 m_hits_vs_pt[i] = TIDA::Histogram<float>( p->monTool(), hitParName(i)+"_vs_pt", s );
48 m_hits_vs_eta[i] = TIDA::Histogram<float>( p->monTool(), hitParName(i)+"_vs_eta", s );
49 m_hits_vs_phi[i] = TIDA::Histogram<float>( p->monTool(), hitParName(i)+"_vs_phi", s );
50 m_hits_vs_d0[i] = TIDA::Histogram<float>( p->monTool(), hitParName(i)+"_vs_d0", s );
51
52 }
53
54}
55
56
58
62
65
66 // const xAOD::TrackParticle* tp = t->as<xAOD::TrackParticle>();
67
68 // if ( !tp ) return; /// no point trying to fill anything unless it's an xAOD::TrackParticle
69
73
82
83 // can add the rest of these histgrams as and when we need to ...
84
86 std::array<float,NHitPars> hitP = {};
87
88#if 1
89 hitP[NInnerMostPixelHits] = t->nPixelsInner();
90 hitP[NInnerMostPixelEndcapHits] = t->nPixelsInnerEndcap();
91 // hitP[NNextToInnerMostPixelHits] = t->nNextToInnerMostPixelHits();
92 // hitP[NNextToInnerMostPixelEndcapHits] = t->nNextToInnerMostPixelEndcapHits();
93 hitP[NInnerMostPixelSharedHits] = t->nPixelsInnerShared();
94 hitP[NInnerMostPixelSharedEndcapHits] = t->nPixelsInnerSharedEndcap();
95 hitP[NPixelHits] = t->nPixels();
96 hitP[NPixelHoles] = t->nPixelHoles();
97 hitP[NPixelSharedHits] = t->nPixelsShared();
98 // hitP[PixeldEdx] = t->pixeldEdx();
99 hitP[NSCTHits] = t->nSCT();
100 hitP[NSCTHoles] = t->nSCTHoles();
101 hitP[NSCTSharedHits] = t->nSCTShared();
102
103 // hitP[NInnerMostPixelOutliers] = t->nPixelsInnerOutliers();
104 // hitP[NInnerMostPixelEndcapOutliers] = t->nPixelsInnerEndcapOutliers();
105 // hitP[NInnerMostPixelSplitHits] = t->nPixelsInnerSplit();
106 // hitP[NInnerMostPixelSplitEndcapHits] = t->nPixelsEndcapSplit();
107
108 // hitP[NExpectedInnerMostPixelHits] = t->nExpectedInnerMostPixelHits();
109 // hitP[NExpectedNextToInnerMostPixelHits] = t->nExpectedNextToInnerMostPixelHits();
110
111 // hitP[NPixelOutliers] = t->nPixelOutliers();
112 // hitP[NPixelContribLayers] = t->nPixelContribLayers();
113 // hitP[NPixelSplitHits] = t->nPixelsSplit();
114 // hitP[NPixelGangedHits] = t->nPixelsGanged();
115 // hitP[NPixelGangedHitsFlaggedFakes] = t->nPixelGangedHitsFlaggedFakes();
116 // hitP[NPixelDeadSensors] = t->nPixelDeadSensors();
117 // hitP[NSCTOutliers] = t->nSCTOutliers();
118 // hitP[NSCTDoubleHoles] = t->nSCTDoubleHoles();
119 // hitP[NSCTDeadSensors] = t->nSCTDeadSensors();
120
121#else
123 hitP[NInnerMostPixelHits] = t->nInnerMostPixelHits();
124 hitP[NInnerMostPixelEndcapHits] = t->nInnerMostPixelEndcapHits();
125 hitP[NNextToInnerMostPixelHits] = t->nNextToInnerMostPixelHits();
126 hitP[NNextToInnerMostPixelEndcapHits] = t->nNextToInnerMostPixelEndcapHits();
127 hitP[NInnerMostPixelSharedHits] = t->nInnerMostPixelSharedHits();
128 hitP[NInnerMostPixelSharedEndcapHits] = t->nInnerMostPixelSharedEndcapHits();
129 hitP[NPixelHits] = t->nPixelHits();
130 hitP[NPixelHoles] = t->nPixelHoles();
131 hitP[NPixelSharedHits] = t->nPixelSharedHits();
132 hitP[PixeldEdx] = t->pixeldEdx();
133 hitP[NSCTHits] = t->nSCTHits();
134 hitP[NSCTHoles] = t->nSCTHoles();
135 hitP[NSCTSharedHits] = t->nSCTSharedHits();
136 hitP[NInnerMostPixelOutliers] = t->nInnerMostPixelOutliers();
137 hitP[NInnerMostPixelEndcapOutliers] = t->nInnerMostPixelEndcapOutliers();
138 hitP[NInnerMostPixelSplitHits] = t->nInnerMostPixelSplitHits();
139 hitP[NInnerMostPixelSplitEndcapHits] = t->nInnerMostPixelSplitEndcapHits();
140 hitP[NExpectedInnerMostPixelHits] = t->nExpectedInnerMostPixelHits();
141 hitP[NExpectedNextToInnerMostPixelHits] = t->nExpectedNextToInnerMostPixelHits();
142 hitP[NPixelOutliers] = t->nPixelOutliers();
143 hitP[NPixelContribLayers] = t->nPixelContribLayers();
144 hitP[NPixelSplitHits] = t->nPixelSplitHits();
145 hitP[NPixelGangedHits] = t->nPixelGangedHits();
146 hitP[NPixelGangedHitsFlaggedFakes] = t->nPixelGangedHitsFlaggedFakes();
147 hitP[NPixelDeadSensors] = t->nPixelDeadSensors();
148 hitP[NSCTOutliers] = t->nSCTOutliers();
149 hitP[NSCTDoubleHoles] = t->nSCTDoubleHoles();
150 hitP[NSCTDeadSensors] = t->nSCTDeadSensors();
151#endif
152
153 float pt = std::fabs(t->pt())*0.001;
154 float eta = t->eta();
155 float phi = t->phi();
156 float d0 = t->d0();
157
158 // std::cout << "SiHits: track: " << *t << std::endl;
159
160 static const std::array<bool,NHitPars> proc = { true, true, false, false, true, true, true, true, true, false, true, true, true };
161
162 for ( int i=0 ; i<NHitPars ; i++ ) {
163
164 if ( !proc[i] ) continue;
165
166 // std::cout << "\tfill par; " << hitParName(i) << "\t: " << hitP[i] << std::endl;
167
168 m_hits[i].Fill( hitP[i] );
169
170 m_hits_vs_pt[i].Fill( pt, hitP[i] );
171 m_hits_vs_eta[i].Fill( eta, hitP[i] );
172 m_hits_vs_phi[i].Fill( phi, hitP[i] );
173 m_hits_vs_d0[i].Fill( d0, hitP[i] );
174 }
175
176}
177
178
179
180void IDTPM2::SiHitPlots::execute( const TrackAnalysisStore& collections ) const {
181
182#if 0
184
185 double mu = 0;
186
187 const xAOD::EventInfo* eventinfo = collections.eventInfo();
188
189 if (eventinfo) {
191 mu = collections.eventInfo()->averageInteractionsPerCrossing();
192 }
193#endif
194
195 const std::vector<const TrackView*>& ref = collections.reference_tracks();
196 const std::vector<const TrackView*>& test = collections.test_tracks();
197
198 for ( size_t i=0 ; i<ref.size() ; i++ ) { m_reference.fill( ref[i] ); }
199 for ( size_t i=0 ; i<test.size() ; i++ ) { m_test.fill( test[i] ); }
200
202
203}
204
205
208
const std::regex ref(r_ef)
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
const std::string & name() const
generic utilities, just in case
Definition IPlotBase.h:68
IPlotBase(const std::string &name, ToolHandle< GenericMonitoringTool > *m=0)
built from dirName and anaTag
Definition IPlotBase.h:41
void finalize()
Print out final stats on histograms.
Histograms m_test
Definition SiHitPlots.h:176
Histograms m_reference
actual class histogram sets - this avoid needlessly duplicating all the histograms with _ref,...
Definition SiHitPlots.h:175
SiHitPlots(const std::string &name, ToolHandle< GenericMonitoringTool > *m)
void execute(const TrackAnalysisStore &collections) const
this can be over ridden if need be
forward declaration required for function prototype
Definition TrackView.h:43
EventInfo_v1 EventInfo
Definition of the latest event info version.
TIDA::Histogram< float > m_hits_vs_d0[NHitPars]
Definition SiHitPlots.h:136
TIDA::Histogram< float > m_hits_vs_phi[NHitPars]
Definition SiHitPlots.h:135
const std::string & hitParName(int i) const
Definition SiHitPlots.h:117
TIDA::Histogram< float > m_hits_vs_pt[NHitPars]
for theis "2D" histograms, could use yet another enum, and some parname vector, but prefer to keep it...
Definition SiHitPlots.h:133
void initialize(SiHitPlots *p, const std::string &s="")
void fill(const TrackView *t) const
TIDA::Histogram< float > m_hits[NHitPars]
actual stored histograms
Definition SiHitPlots.h:126
TIDA::Histogram< float > m_hits_vs_eta[NHitPars]
Definition SiHitPlots.h:134