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