ATLAS Offline Software
Loading...
Searching...
No Matches
SiHitPlots.h
Go to the documentation of this file.
1/* emacs: this is -*- c++ -*- */
22
23
24#ifndef IDTPM2_SIHITPLOTS_H
25#define IDTPM2_SIHITPLOTS_H
26
27#include "IPlotBase.h"
28
35
36#define HIT_PARAMS(X) \
37 X(NInnerMostPixelHits) \
38 X(NInnerMostPixelEndcapHits) \
39 X(NNextToInnerMostPixelHits) \
40 X(NNextToInnerMostPixelEndcapHits) \
41 X(NInnerMostPixelSharedHits) \
42 X(NInnerMostPixelSharedEndcapHits) \
43 X(NPixelHits) \
44 X(NPixelHoles) \
45 X(NPixelSharedHits) \
46 X(NPixeldEdx) \
47 X(NSCTHits) \
48 X(NSCTHoles) \
49 X(NSCTSharedHits) \
50 \
51 X(NInnerMostPixelOutliers) \
52 X(NInnerMostPixelEndcapOutliers) \
53 X(NInnerMostPixelSplitHits) \
54 X(NInnerMostPixelSplitEndcapHits) \
55 X(NExpectedInnerMostPixelHits) \
56 X(NExpectedNextToInnerMostPixelHits) \
57 X(NPixelOutliers) \
58 X(NPixelContribLayers) \
59 X(NPixelSplitHits) \
60 X(NPixelGangedHits) \
61 X(NPixelGangedHitsFlaggedFakes) \
62 X(NPixelDeadSensors) \
63 X(NSCTOutliers) \
64 X(NSCTDoubleHoles) \
65 X(NSCTDeadSensors)
66
67
68namespace IDTPM2 {
69
70class SiHitPlots : public IPlotBase {
71
72public:
73
74 SiHitPlots( const std::string& name, ToolHandle<GenericMonitoringTool>* m );
75
76 virtual ~SiHitPlots() { }
77
78 void initialize();
79
80 void execute( const TrackAnalysisStore& collections ) const;
81
83 void finalize();
84
85private:
86
90
92
93 struct Histograms {
94
97
100
101 enum HitPar {
102# define X(x) x,
104# undef X
106 };
107
109 std::vector<std::string> m_hitParNames = {
110# define X(x) #x,
112# undef X
113 };
114
115 size_t nHitParNames() const { return m_hitParNames.size(); }
116
117 const std::string& hitParName(int i) const { return m_hitParNames.at(i); }
118
119 void initialize( SiHitPlots* p, const std::string& s="" );
120
121 void fill( const TrackView* t ) const;
122
123#if 1
125
127
132
137
138#else
139
144
145# define X(x) TIDA::Histogram<float> m_##x;
147# undef X
148
149# define X(x) TIDA::Histogram2D<float> m_##x##_vs_pt;
151# undef X
152
153# define X(x) TIDA::Histogram2D<float> m_##x##_vs_eta;
155# undef X
156
157# define X(x) TIDA::Histogram2D<float> m_##x##_vs_phi;
159# undef X
160
161# define X(x) TIDA::Histogram2D<float> m_##x##_vs_d0;
163# undef X
164
165#endif
166
167 };
168
169private:
170
174
177
178};
179
180} // namespace IDTPM2
181
182
183inline std::ostream& operator<<( std::ostream& s, const IDTPM2::SiHitPlots& ) {
184 return s;
185}
186
187
188#endif // IDTPM2_SIHITPLOTS_H
189
190
191
192
193
194
195
196
197
198
std::ostream & operator<<(std::ostream &s, const IDTPM2::SiHitPlots &)
Definition SiHitPlots.h:183
#define X(x)
Definition SiHitPlots.h:102
#define HIT_PARAMS(X)
all these enums for all the histograms are really nasty and the names for them, and making sure they ...
Definition SiHitPlots.h:36
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.
virtual ~SiHitPlots()
Definition SiHitPlots.h:76
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
Search the ancestor history, looking for an ancestor that satifies the predicate ....
Definition AnalysisR4.h:31
oh dear, just the (too many!) histogram variables (we will need these for the test and reference,...
Definition SiHitPlots.h:93
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
HitPar
ugly, but it gets the jobs done - this is the price you pay for have SO MANY STUPIDLY LONG NAMED PARA...
Definition SiHitPlots.h:101
std::vector< std::string > m_hitParNames
probably should use an std::array<string,NparNames>
Definition SiHitPlots.h:109
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