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