Belle II Software prerelease-11-00-00a
trgrawdataModule.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#ifndef TRGRAWDATAModule_h
9#define TRGRAWDATAModule_h
10
11#include <vector>
12
13#include <framework/core/HistoModule.h>
14#include <framework/datastore/StoreObjPtr.h>
15#include <framework/database/DBObjPtr.h>
16#include <TH2D.h>
17
18namespace Belle2 {
23 class EventMetaData;
24 class TRGGDLDBUnpacker;
25
26 static const int intNaN = std::numeric_limits<int>::quiet_NaN();
27
32
33 public:
37 virtual ~TRGRAWDATAModule() {}
38
39 public:
41 virtual void initialize() override;
43 virtual void beginRun() override {}
45 virtual void event() override;
47 virtual void endRun() override {}
49 virtual void terminate() override
50 {
51
52 bool m_ons[c_nModules] = {
53 m_on_2d0, m_on_2d1, m_on_2d2, m_on_2d3,
54 m_on_3d0, m_on_3d1, m_on_3d2, m_on_3d3,
55 m_on_nn0, m_on_nn1, m_on_nn2, m_on_nn3,
56 m_on_sl0, m_on_sl1, m_on_sl2, m_on_sl3,
57 m_on_sl4, m_on_sl5, m_on_sl6, m_on_sl8,
58 m_on_gdl, m_on_etf, m_on_grl, m_on_top
59 };
60 /*
61 const char* moduleNames[c_nModules] = {
62 "2D0", "2D1", "2D2", "2D3",
63 "3D0", "3D1", "3D2", "3D3",
64 "NN0", "NN1", "NN2", "NN3",
65 "SL0", "SL1", "SL2", "SL3",
66 "SL4", "SL5", "SL6", "SL8",
67 "GDL", "ETF", "GRL"
68 };
69 */
70
71 printf("-%3s---%8s---%8s---%8s---%8s---%8s---%8s---%8s---%8s---%8s---%8s---%8s---%8s--\n",
72 "---", "--------", "--------", "--------", "--------", "--------", "--------", "--------",
73 "--------", "--------", "--------", "--------", "--------");
74 printf(" %3s | %-8s | %-8s | %-8s | %-8s | %-8s | %-8s | %-8s | %-8s | %-8s | %-8s | %-8s | %-8s |\n",
75// printf(" %3s | %8s | %8s | %8s | %8s | %8s | %8s | %8s | %8s | %8s | %8s | %8s | %8s |\n",
76 "",
77 "a)dataOk", // m_cntr_nwn[i], Data event that has no problem
78 "b)hdrOk", // m_cntr_nw3[i], Header event that has no problem (except cc check)
79 "c)ccOk", // m_cntr_good_odr[i]); Data event that has good cc
80 "d)hdrTag", // m_cntr_nw3_badtrg[i] Header event that has bad number
81 "e)hdrL1", // m_cntr_nw3_badrvc[i] Header event that has L1 timing
82 "f)hdrScl", // m_cntr_nw3_badvet[i] Header event that should not be header event
83 "g)dataTag", // m_cntr_nwn_badtrg[i] Data event that has bad bad event number in data
84 "h)dataL1", // m_cntr_nwn_badrvc[i] Data event that has bad L1 timing
85 "i)bbbb", // m_cntr_nwn_badbbb[i] Data event from dummy buffer
86 "j)#wd", // m_cntr_bad_nwd[i], Data event that does not have expected #word
87 "k)ddsft", // m_cntr_bad_ddd[i], Data event that does not have expected dddd in clock cycle
88 "l)ccodr" // m_cntr_bad_odr[i], Data event that has bad cc cycle
89 );
90 printf("-%3s---%8s---%8s---%8s---%8s---%8s---%8s---%8s---%8s---%8s---%8s---%8s---%8s--\n",
91 "---", "--------", "--------", "--------", "--------", "--------", "--------", "--------",
92 "--------", "--------", "--------", "--------", "--------");
93 for (unsigned i = 0; i < c_nModules; ++i) {
94 if (m_ons[i]) {
95 printf(" %3s | %8d | %8d | %8d | %8d | %8d | %8d | %8d | %8d | %8d | %8d | %8d | %8d |\n",
96 moduleNames[i],
97 m_cntr_nwn[i],
98 m_cntr_nw3[i],
99 m_cntr_good_odr[i],
100 m_cntr_nw3_badtrg[i],
101 m_cntr_nw3_badrvc[i],
102 m_cntr_nw3_badvet[i],
103 m_cntr_nwn_badtrg[i],
104 m_cntr_nwn_badrvc[i],
105 m_cntr_nwn_badbbb[i],
106 m_cntr_bad_nwd[i],
107 m_cntr_bad_ddd[i],
108 m_cntr_bad_odr[i]
109 );
110 }
111 }
112 printf("-%3s---%8s---%8s---%8s---%8s---%8s---%8s---%8s---%8s---%8s---%8s---%8s---%8s--\n",
113 "---", "--------", "--------", "--------", "--------", "--------", "--------", "--------",
114 "--------", "--------", "--------", "--------", "--------");
115 printf("%-10s: %-s\n"
116 "%-10s: %-s\n"
117 "%-10s: %-s\n"
118 "%-10s: %-s\n"
119 "%-10s: %-s\n"
120 "%-10s: %-s\n"
121 "%-10s: %-s\n"
122 "%-10s: %-s\n"
123 "%-10s: %-s\n"
124 "%-10s: %-s\n"
125 "%-10s: %-s\n"
126 "%-10s: %-s\n",
127 "a)dataOk", "Data event that has no problem (except cc check)",
128 "b)hdrOk", "Header event that has no problem",
129 "c)ccOk", "Data event that has good cc cycle",
130 "d)hdrTag", "Header event that has bad event number in header",
131 "e)hdrL1", "Header event that has bad L1 timing in header",
132 "f)hdrScl", "Header event that should not be header event",
133 "g)dataTag", "Data event that has bad event number in data (can be dummy buffer)",
134 "h)dataL1", "Data event that has bad L1 timing in header",
135 "i)bbbb", "Data event from dummy buffer",
136 "j)#wd", "Data event that does not have expected #word",
137 "k)ddsft", "Data event that does not have expected dddd in clock cycle (can be dummy buffer)",
138 "l)ccodr", "Data event that has bad cc cycle");
139
140 }
141
143 virtual void defineHisto() override;
144
146 static const unsigned int c_nModules = 24;
147
148 const char* moduleNames[c_nModules] = {
149 "2D0", "2D1", "2D2", "2D3",
150 "3D0", "3D1", "3D2", "3D3",
151 "NN0", "NN1", "NN2", "NN3",
152 "SL0", "SL1", "SL2", "SL3",
153 "SL4", "SL5", "SL6", "SL8",
154 "GDL", "ETF", "GRL", "TOP"
155 };
156
157
158 enum EModuleNum {
159 e_2d0 = 0,
160 e_2d1 = 1,
161 e_2d2 = 2,
162 e_2d3 = 3,
163 e_3d0 = 4,
164 e_3d1 = 5,
165 e_3d2 = 6,
166 e_3d3 = 7,
167 e_nn0 = 8,
168 e_nn1 = 9,
169 e_nn2 = 10,
170 e_nn3 = 11,
171 e_sl0 = 12,
172 e_sl1 = 13,
173 e_sl2 = 14,
174 e_sl3 = 15,
175 e_sl4 = 16,
176 e_sl5 = 17,
177 e_sl6 = 18,
178 e_sl8 = 19,
179 e_gdl = 20,
180 e_etf = 21,
181 e_grl = 22,
182 e_top = 23
183 };
184
185 private:
186
187 int m_mydebug;
188 bool m_cc_check;
189 bool m_print_cc;
190 bool m_print_dbmap;
191 bool m_print_clkcyc_err;
192 bool m_histRecord;
193
194 int m_hdr_nwd_sl0 = intNaN;
195 int m_hdr_nwd_sl1 = intNaN;
196 int m_hdr_nwd_sl2 = intNaN;
197 int m_hdr_nwd_sl3 = intNaN;
198 int m_hdr_nwd_sl4 = intNaN;
199 int m_hdr_nwd_sl5 = intNaN;
200 int m_hdr_nwd_sl6 = intNaN;
201 //int m_hdr_nwd_sl7 = intNaN;
202 int m_hdr_nwd_sl8 = intNaN;
203 int m_hdr_nwd_2d0 = intNaN;
204 int m_hdr_nwd_2d1 = intNaN;
205 int m_hdr_nwd_2d2 = intNaN;
206 int m_hdr_nwd_2d3 = intNaN;
207 int m_hdr_nwd_3d0 = intNaN;
208 int m_hdr_nwd_3d1 = intNaN;
209 int m_hdr_nwd_3d2 = intNaN;
210 int m_hdr_nwd_3d3 = intNaN;
211 int m_hdr_nwd_nn0 = intNaN;
212 int m_hdr_nwd_nn1 = intNaN;
213 int m_hdr_nwd_nn2 = intNaN;
214 int m_hdr_nwd_nn3 = intNaN;
215 int m_hdr_nwd_gdl = intNaN;
216 int m_hdr_nwd_etf = intNaN;
217 int m_hdr_nwd_grl = intNaN;
218 int m_hdr_nwd_top = intNaN;
219
220 unsigned m_cpr_sl0 = intNaN;
221 unsigned m_cpr_sl1 = intNaN;
222 unsigned m_cpr_sl2 = intNaN;
223 unsigned m_cpr_sl3 = intNaN;
224 unsigned m_cpr_sl4 = intNaN;
225 unsigned m_cpr_sl5 = intNaN;
226 unsigned m_cpr_sl6 = intNaN;
227 int m_cpr_sl7 = intNaN;
228 unsigned m_cpr_sl8 = intNaN;
229 unsigned m_cpr_2d0 = intNaN;
230 unsigned m_cpr_2d1 = intNaN;
231 unsigned m_cpr_2d2 = intNaN;
232 unsigned m_cpr_2d3 = intNaN;
233 unsigned m_cpr_3d0 = intNaN;
234 unsigned m_cpr_3d1 = intNaN;
235 unsigned m_cpr_3d2 = intNaN;
236 unsigned m_cpr_3d3 = intNaN;
237 unsigned m_cpr_nn0 = intNaN;
238 unsigned m_cpr_nn1 = intNaN;
239 unsigned m_cpr_nn2 = intNaN;
240 unsigned m_cpr_nn3 = intNaN;
241 unsigned m_cpr_gdl = intNaN;
242 unsigned m_cpr_etf = intNaN;
243 int m_cpr_grl = intNaN;
244 unsigned m_cpr_top = intNaN;
245
246 /*
247 int m_hslb_sl0 = intNaN;
248 int m_hslb_sl1 = intNaN;
249 int m_hslb_sl2 = intNaN;
250 int m_hslb_sl3 = intNaN;
251 int m_hslb_sl4 = intNaN;
252 int m_hslb_sl5 = intNaN;
253 int m_hslb_sl6 = intNaN;
254 int m_hslb_sl7 = intNaN;
255 int m_hslb_sl8 = intNaN;
256 int m_hslb_2d0 = intNaN;
257 int m_hslb_2d1 = intNaN;
258 int m_hslb_2d2 = intNaN;
259 int m_hslb_2d3 = intNaN;
260 int m_hslb_3d0 = intNaN;
261 int m_hslb_3d1 = intNaN;
262 int m_hslb_3d2 = intNaN;
263 int m_hslb_3d3 = intNaN;
264 int m_hslb_nn0 = intNaN;
265 int m_hslb_nn1 = intNaN;
266 int m_hslb_nn2 = intNaN;
267 int m_hslb_nn3 = intNaN;
268 int m_hslb_gdl = intNaN;
269 int m_hslb_etf = intNaN;
270 int m_hslb_grl = intNaN;
271 int m_hslb_top = intNaN;
272 */
273
274 int m_fmid_sl0 = intNaN;
275 int m_fmid_sl1 = intNaN;
276 int m_fmid_sl2 = intNaN;
277 int m_fmid_sl3 = intNaN;
278 int m_fmid_sl4 = intNaN;
279 int m_fmid_sl5 = intNaN;
280 int m_fmid_sl6 = intNaN;
281 int m_fmid_sl7 = intNaN;
282 int m_fmid_sl8 = intNaN;
283 int m_fmid_2d0 = intNaN;
284 int m_fmid_2d1 = intNaN;
285 int m_fmid_2d2 = intNaN;
286 int m_fmid_2d3 = intNaN;
287 int m_fmid_3d0 = intNaN;
288 int m_fmid_3d1 = intNaN;
289 int m_fmid_3d2 = intNaN;
290 int m_fmid_3d3 = intNaN;
291 int m_fmid_nn0 = intNaN;
292 int m_fmid_nn1 = intNaN;
293 int m_fmid_nn2 = intNaN;
294 int m_fmid_nn3 = intNaN;
295 unsigned m_fmid_gdl = intNaN;
296 int m_fmid_etf = intNaN;
297 int m_fmid_grl = intNaN;
298 int m_fmid_top = intNaN;
299
300 int m_scale_sl0 = intNaN;
301 int m_scale_sl1 = intNaN;
302 int m_scale_sl2 = intNaN;
303 int m_scale_sl3 = intNaN;
304 int m_scale_sl4 = intNaN;
305 int m_scale_sl5 = intNaN;
306 int m_scale_sl6 = intNaN;
307 int m_scale_sl7 = intNaN;
308 int m_scale_sl8 = intNaN;
309 int m_scale_2ds = intNaN;
310 int m_scale_3ds = intNaN;
311 int m_scale_nns = intNaN;
312 int m_scale_gdl = intNaN;
313 int m_scale_etf = intNaN;
314 int m_scale_grl = intNaN;
315 int m_scale_top = intNaN;
316
317 bool m_on_sl0 = false;
318 bool m_on_sl1 = false;
319 bool m_on_sl2 = false;
320 bool m_on_sl3 = false;
321 bool m_on_sl4 = false;
322 bool m_on_sl5 = false;
323 bool m_on_sl6 = false;
324 bool m_on_sl7 = false;
325 bool m_on_sl8 = false;
326 bool m_on_2d0 = false;
327 bool m_on_2d1 = false;
328 bool m_on_2d2 = false;
329 bool m_on_2d3 = false;
330 bool m_on_3d0 = false;
331 bool m_on_3d1 = false;
332 bool m_on_3d2 = false;
333 bool m_on_3d3 = false;
334 bool m_on_nn0 = false;
335 bool m_on_nn1 = false;
336 bool m_on_nn2 = false;
337 bool m_on_nn3 = false;
338 bool m_on_gdl = false;
339 bool m_on_etf = false;
340 bool m_on_grl = false;
341 bool m_on_top = false;
342
343 int m_nwd_sl0 = intNaN;
344 int m_nwd_sl1 = intNaN;
345 int m_nwd_sl2 = intNaN;
346 int m_nwd_sl3 = intNaN;
347 int m_nwd_sl4 = intNaN;
348 int m_nwd_sl5 = intNaN;
349 int m_nwd_sl6 = intNaN;
350 int m_nwd_sl7 = intNaN;
351 int m_nwd_sl8 = intNaN;
352 int m_nwd_2ds = intNaN;
353 int m_nwd_3ds = intNaN;
354 int m_nwd_nns = intNaN;
355 int m_nwd_gdl = intNaN;
356 int m_nwd_etf = intNaN;
357 int m_nwd_grl = intNaN;
358 int m_nwd_top = intNaN;
359
360 int m_nclk_cdctrg = intNaN;
361 int m_nclk_sl0 = intNaN;
362 int m_nclk_sl1 = intNaN;
363 int m_nclk_sl2 = intNaN;
364 int m_nclk_sl3 = intNaN;
365 int m_nclk_sl4 = intNaN;
366 int m_nclk_sl5 = intNaN;
367 int m_nclk_sl6 = intNaN;
368 int m_nclk_sl7 = intNaN;
369 int m_nclk_sl8 = intNaN;
370 int m_nclk_2ds = intNaN;
371 int m_nclk_3ds = intNaN;
372 int m_nclk_nns = intNaN;
373 int m_nclk_gdl = intNaN;
374 int m_nclk_etf = intNaN;
375 int m_nclk_grl = intNaN;
376 int m_nclk_top = intNaN;
377
378
379 //TODO is zero default value good for these arrays
380 int m_cntr_good_odr[50] = {0};
381 int m_cntr_bad_odr[50] = {0};
382 int m_cntr_bad_ddd[50] = {0};
383 int m_cntr_bad_nwd[50] = {0};
384
385 int m_cntr_nw3[50] = {0};
386 int m_cntr_nw3_badvet[50] = {0};
387 int m_cntr_nw3_badtrg[50] = {0};
388 int m_cntr_nw3_badrvc[50] = {0};
389
390 int m_cntr_nwn[50] = {0};
391 // int m_cntr_nwn_badvet[50] = {0};
392 int m_cntr_nwn_badtrg[50] = {0};
393 int m_cntr_nwn_badrvc[50] = {0};
394
395 int m_cntr_nwn_badbbb[50] = {0};
396 int m_cntr_nwn_badddd[50] = {0};
397
398 int m_cntr_nwe_badnwd[50] = {0};
399
400 protected :
404 std::vector<std::vector<int>> BitMap;
405 };
406
408}
409
410#endif
Class for accessing objects in the database.
Definition DBObjPtr.h:21
Store event, run, and experiment numbers.
HistoModule()
Constructor.
Definition HistoModule.h:32
Type-safe access to single objects in the data store.
Definition StoreObjPtr.h:96
The payload class for PXD cluster charge calibrations.
virtual void endRun() override
End Run.
static const unsigned int c_nModules
number of modules
virtual void terminate() override
terminate
virtual void initialize() override
initialize
virtual void event() override
Event.
virtual void beginRun() override
begin Run
StoreObjPtr< EventMetaData > m_eventMetaDataPtr
Event Meta Data.
virtual ~TRGRAWDATAModule()
Destrunctor.
virtual void defineHisto() override
Define Histogram.
static const int intNaN
constant for integer NaN
Abstract base class for different kinds of events.