CbmRoot
CbmCheckDataFormatGdpb2018.cxx
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 // ----- -----
3 // ----- CbmCheckDataFormatGdpb2018 -----
4 // ----- Created 10.07.2018 by P.-A. Loizeau -----
5 // ----- -----
6 // -----------------------------------------------------------------------------
7 
9 #include "CbmMcbm2018TofPar.h"
10 
12 
13 #include "CbmHistManager.h"
14 
15 #include "FairLogger.h"
16 #include "FairRootManager.h"
17 #include "FairRun.h"
18 #include "FairRunOnline.h"
19 #include "FairRuntimeDb.h"
20 
21 #include "Rtypes.h"
22 #include "TCanvas.h"
23 #include "TClonesArray.h"
24 #include "TF1.h"
25 #include "TH1.h"
26 #include "TH2.h"
27 #include "THStack.h"
28 #include "THttpServer.h"
29 #include "TMath.h"
30 #include "TPaveStats.h"
31 #include "TProfile.h"
32 #include "TProfile2D.h"
33 #include "TROOT.h"
34 #include "TString.h"
35 #include "TStyle.h"
36 #include <TFile.h>
37 
38 #include <algorithm>
39 #include <ctime>
40 #include <iomanip>
41 #include <iostream>
42 #include <stdint.h>
43 
46 
48  : CbmMcbmUnpack()
49  , fvMsComponentsList()
50  , fuNbCoreMsPerTs(0)
51  , fuNbOverMsPerTs(0)
52  , fbIgnoreOverlapMs(kFALSE)
53  , fuMsAcceptsPercent(100)
54  , fuTotalMsNb(0)
55  , fuOverlapMsNb(0)
56  , fuCoreMs(0)
57  , fdMsSizeInNs(0.0)
58  , fdTsCoreSizeInNs(0.0)
59  , fuMinNbGdpb(0)
60  , fuCurrNbGdpb(0)
61  , fUnpackPar()
62  , fuNrOfGdpbs(0)
63  , fuNrOfFeePerGdpb(0)
64  , fuNrOfGet4PerFee(0)
65  , fuNrOfChannelsPerGet4(0)
66  , fuNrOfChannelsPerFee(0)
67  , fuNrOfGet4(0)
68  , fuNrOfGet4PerGdpb(0)
69  , fuNrOfChannelsPerGdpb(0)
70  , fuDiamondDpbIdx(10000)
71  , // Crazy default value => should never make troubles given the price
72  fsHistoFilename("data/HistosCheckGdpb.root")
73  , fulCurrentTsIndex(0)
74  , fuCurrentMs(0)
75  , fuCurrentMsSysId(0)
76  , fdMsIndex(0)
77  , fuGdpbId(0)
78  , fuGdpbNr(0)
79  , fuGet4Id(0)
80  , fuGet4Nr(0)
81  , fiEquipmentId(0)
82  , fvulCurrentEpoch()
83  ,
84  /*
85  fvbFirstEpochSeen(),
86  fvulCurrentEpochCycle(),
87  fvulCurrentEpochFull(),
88 */
89  fulCurrentEpochTime(0)
90  , fGdpbIdIndexMap()
91  , fcMsSizeAll(NULL)
92  , fdStartTimeMsSz(-1.)
93  , fvhMsSzPerLink(12, NULL)
94  , fvhMsSzTimePerLink(12, NULL)
95  , fhMessType(NULL)
96  , fhSysMessType(NULL)
97  , fhGet4MessType(NULL)
98  , fhGet4ChanScm(NULL)
99  , fhGet4ChanErrors(NULL)
100  , fhGet4EpochFlags(NULL)
101  , fhGdpbMessType(NULL)
102  , fhGdpbSysMessType(NULL)
103  , fhGdpbSysMessPattType(NULL)
104  , fhGdpbEpochFlags(NULL)
105  , fhGdpbEpochSyncEvo(NULL)
106  , fhGdpbEpochMissEvo(NULL)
107  , fvhGdpbGet4MessType()
108  , fhPatternMissmatch(NULL)
109  , fhPatternEnable(NULL)
110  , fhPatternResync(NULL)
111  , fvuGdpbNbEpochPerMs()
112  , fvvuChanNbHitsPerMs()
113  , fhEpochsPerMs_gDPB()
114  , fhEpochsPerMsPerTs_gDPB()
115  , fhEpochsDiff_gDPB()
116  , fhEpochsDiffPerTs_gDPB()
117  , fhEpochsJumpBitsPre_gDPB()
118  , fhEpochsJumpBitsNew_gDPB()
119  , fhEpochsJumpDigitsPre_gDPB()
120  , fhEpochsJumpDigitsNew_gDPB()
121  , fhStartEpochPerMs_gDPB()
122  , fhCloseEpochPerMs_gDPB()
123  , fhHitsPerMsFirstChan_gDPB()
124  , fvhChannelRatePerMs_gDPB()
125  , fcFormatGdpb()
126  , fTimeLastHistoSaving() {}
127 
129 
131  LOG(info) << "Initializing Get4 monitor";
132 
133  FairRootManager* ioman = FairRootManager::Instance();
134  if (ioman == NULL) {
135  LOG(fatal) << "No FairRootManager instance";
136  } // if( ioman == NULL )
137 
138  return kTRUE;
139 }
140 
142  LOG(info) << "Setting parameter containers for " << GetName();
143  fUnpackPar =
144  (CbmMcbm2018TofPar*) (FairRun::Instance()->GetRuntimeDb()->getContainer(
145  "CbmMcbm2018TofPar"));
146 }
147 
149  LOG(info) << "Init parameter containers for " << GetName();
150  Bool_t initOK = ReInitContainers();
151 
153 
155  for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
156  fvulCurrentEpoch[uGdpb] = 0;
157  } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
158 
159  return initOK;
160 }
161 
163  LOG(info) << "ReInit parameter containers for " << GetName();
164 
166  LOG(info) << "Nr. of Tof GDPBs: " << fuNrOfGdpbs;
168 
170  LOG(info) << "Nr. of FEEs per Tof GDPB: " << fuNrOfFeePerGdpb;
171 
173  LOG(info) << "Nr. of GET4 per Tof FEE: " << fuNrOfGet4PerFee;
174 
176  LOG(info) << "Nr. of channels per GET4: " << fuNrOfChannelsPerGet4;
177 
179  LOG(info) << "Nr. of channels per FEE: " << fuNrOfChannelsPerFee;
180 
182  LOG(info) << "Nr. of GET4s: " << fuNrOfGet4;
183 
185  LOG(info) << "Nr. of GET4s per GDPB: " << fuNrOfGet4PerGdpb;
186 
188  LOG(info) << "Nr. of channels per GDPB: " << fuNrOfChannelsPerGdpb;
189 
190  fGdpbIdIndexMap.clear();
191  for (UInt_t i = 0; i < fuNrOfGdpbs; ++i) {
193  LOG(info) << "GDPB Id of TOF " << i << " : " << std::hex
194  << fUnpackPar->GetGdpbId(i) << std::dec;
195  } // for( UInt_t i = 0; i < fuNrOfGdpbs; ++i )
196 
198  LOG(info) << "Nr. of GBTx: " << fuNrOfGbtx;
199 
205  LOG(info) << "Timeslice parameters: " << fuTotalMsNb
206  << " MS per link, of which " << fuOverlapMsNb
207  << " overlap MS, each MS is " << fdMsSizeInNs << " ns";
208 
209  return kTRUE;
210 }
211 
212 
214  size_t component,
215  UShort_t /*usDetectorId*/) {
217  for (UInt_t uCompIdx = 0; uCompIdx < fvMsComponentsList.size(); ++uCompIdx)
218  if (component == fvMsComponentsList[uCompIdx]) return;
219 
221  fvMsComponentsList.push_back(component);
222 
224  if (NULL == fvhMsSzPerLink[component]) {
225  TString sMsSzName = Form("MsSz_link_%02lu", component);
226  TString sMsSzTitle =
227  Form("Size of MS from link %02lu; Ms Size [bytes]", component);
228  fvhMsSzPerLink[component] =
229  new TH1F(sMsSzName.Data(), sMsSzTitle.Data(), 160000, 0., 20000.);
230 
231  sMsSzName = Form("MsSzTime_link_%02lu", component);
232  sMsSzTitle = Form(
233  "Size of MS vs time for gDPB of link %02lu; Time[s] ; Ms Size [bytes]",
234  component);
235  fvhMsSzTimePerLink[component] = new TProfile(
236  sMsSzName.Data(), sMsSzTitle.Data(), 100 * 1800, 0., 2 * 1800);
237  THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
238  if (server) {
239  server->Register("/FlibRaw", fvhMsSzPerLink[component]);
240  server->Register("/FlibRaw", fvhMsSzTimePerLink[component]);
241  } // if( server )
242  if (NULL != fcMsSizeAll) {
243  fcMsSizeAll->cd(1 + component);
244  gPad->SetLogy();
245  fvhMsSzTimePerLink[component]->Draw("hist le0");
246  } // if( NULL != fcMsSizeAll )
247  LOG(info) << "Added MS size histo for component (link): " << component;
248  } // if( NULL == fvhMsSzPerLink[ component ] )
249 }
251  size_t uOverlapMsNb) {
252  fuNbCoreMsPerTs = uCoreMsNb;
253  fuNbOverMsPerTs = uOverlapMsNb;
254 
255  // UInt_t uNbMsTotal = fuNbCoreMsPerTs + fuNbOverMsPerTs;
256 }
257 
259  LOG(info) << "create Histos for " << fuNrOfGdpbs << " gDPBs ";
260 
261  THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
262 
263  TString name {""};
264  TString title {""};
265  UInt_t uHistoryHistoSize = 1800;
266 
267  /*******************************************************************/
268  name = "hMessageType";
269  title = "Nb of message for each type; Type";
270  // Test Big Data readout with plotting
271  fhMessType = new TH1I(name,
272  title,
274  0.,
276  fhMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_HIT, "HIT");
277  fhMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_EPOCH, "EPOCH");
278  fhMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_SLOWC, "SLOWC");
279  fhMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_SYST, "SYST");
280  fhMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_STAR_TRI_A, "TRI_A");
281  fhMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_STAR_TRI_B, "TRI_B");
282  fhMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_STAR_TRI_C, "TRI_C");
283  fhMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_STAR_TRI_D, "TRI_D");
284 
285  /*******************************************************************/
286  name = "hSysMessType";
287  title = "Nb of system message for each type; System Type";
288  fhSysMessType = new TH1I(
289  name, title, 1 + gdpbv100::SYS_PATTERN, 0., 1 + gdpbv100::SYS_PATTERN);
290  fhSysMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::SYS_GET4_ERROR,
291  "GET4 ERROR");
292  fhSysMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::SYS_GDPB_UNKWN,
293  "UNKW GET4 MSG");
294  fhSysMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::SYS_GET4_SYNC_MISS,
295  "SYS_GET4_SYNC_MISS");
296  fhSysMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::SYS_PATTERN,
297  "SYS_PATTERN");
298 
299  /*******************************************************************/
300  name = "hGet4MessType";
301  title = "Nb of message for each type per GET4; GET4 chip # ; Type";
302  fhGet4MessType = new TH2I(name, title, fuNrOfGet4, 0., fuNrOfGet4, 4, 0., 4.);
303  fhGet4MessType->GetYaxis()->SetBinLabel(1, "DATA 32b");
304  fhGet4MessType->GetYaxis()->SetBinLabel(2, "EPOCH");
305  fhGet4MessType->GetYaxis()->SetBinLabel(3, "S.C. M");
306  fhGet4MessType->GetYaxis()->SetBinLabel(4, "ERROR");
307 
308  /*******************************************************************/
309  name = "hGet4ChanScm";
310  title = "SC messages per GET4 channel; GET4 channel # ; SC type";
311  fhGet4ChanScm = new TH2I(name,
312  title,
314  0.,
316  5,
317  0.,
318  5.);
319  fhGet4ChanScm->GetYaxis()->SetBinLabel(1, "Hit Scal");
320  fhGet4ChanScm->GetYaxis()->SetBinLabel(2, "Deadtime");
321  fhGet4ChanScm->GetYaxis()->SetBinLabel(3, "SPI");
322  fhGet4ChanScm->GetYaxis()->SetBinLabel(4, "SEU Scal");
323  fhGet4ChanScm->GetYaxis()->SetBinLabel(5, "START");
324 
325  /*******************************************************************/
326  name = "hGet4ChanErrors";
327  title = "Error messages per GET4 channel; GET4 channel # ; Error";
328  fhGet4ChanErrors = new TH2I(name,
329  title,
331  0.,
333  21,
334  0.,
335  21.);
336  fhGet4ChanErrors->GetYaxis()->SetBinLabel(1, "0x00: Readout Init ");
337  fhGet4ChanErrors->GetYaxis()->SetBinLabel(2, "0x01: Sync ");
338  fhGet4ChanErrors->GetYaxis()->SetBinLabel(3, "0x02: Epoch count sync");
339  fhGet4ChanErrors->GetYaxis()->SetBinLabel(4, "0x03: Epoch ");
340  fhGet4ChanErrors->GetYaxis()->SetBinLabel(5, "0x04: FIFO Write ");
341  fhGet4ChanErrors->GetYaxis()->SetBinLabel(6, "0x05: Lost event ");
342  fhGet4ChanErrors->GetYaxis()->SetBinLabel(7, "0x06: Channel state ");
343  fhGet4ChanErrors->GetYaxis()->SetBinLabel(8, "0x07: Token Ring state");
344  fhGet4ChanErrors->GetYaxis()->SetBinLabel(9, "0x08: Token ");
345  fhGet4ChanErrors->GetYaxis()->SetBinLabel(10, "0x09: Error Readout ");
346  fhGet4ChanErrors->GetYaxis()->SetBinLabel(11, "0x0a: SPI ");
347  fhGet4ChanErrors->GetYaxis()->SetBinLabel(
348  12, "0x0b: DLL Lock error "); // <- From GET4 v1.2
349  fhGet4ChanErrors->GetYaxis()->SetBinLabel(
350  13, "0x0c: DLL Reset invoc."); // <- From GET4 v1.2
351  fhGet4ChanErrors->GetYaxis()->SetBinLabel(14, "0x11: Overwrite ");
352  fhGet4ChanErrors->GetYaxis()->SetBinLabel(15, "0x12: ToT out of range");
353  fhGet4ChanErrors->GetYaxis()->SetBinLabel(16, "0x13: Event Discarded ");
354  fhGet4ChanErrors->GetYaxis()->SetBinLabel(
355  17, "0x14: Add. Rising edge"); // <- From GET4 v1.3
356  fhGet4ChanErrors->GetYaxis()->SetBinLabel(
357  18, "0x15: Unpaired Falling"); // <- From GET4 v1.3
358  fhGet4ChanErrors->GetYaxis()->SetBinLabel(
359  19, "0x16: Sequence error "); // <- From GET4 v1.3
360  fhGet4ChanErrors->GetYaxis()->SetBinLabel(20, "0x7f: Unknown ");
361  fhGet4ChanErrors->GetYaxis()->SetBinLabel(21, "Corrupt/unsuprtd error");
362 
363  /*******************************************************************/
364  name = "hGet4EpochFlags";
365  title = "Epoch flags per GET4; GET4 chip # ; Type";
367  new TH2I(name, title, fuNrOfGet4, 0., fuNrOfGet4, 4, 0., 4.);
368  fhGet4EpochFlags->GetYaxis()->SetBinLabel(1, "SYNC");
369  fhGet4EpochFlags->GetYaxis()->SetBinLabel(2, "Ep LOSS");
370  fhGet4EpochFlags->GetYaxis()->SetBinLabel(3, "Da LOSS");
371  fhGet4EpochFlags->GetYaxis()->SetBinLabel(4, "MISSMAT");
372 
373  /*******************************************************************/
374  name = "hGdpbMessageType";
375  title = "Nb of message for each type per Gdpb; Type; Gdpb Idx []";
376  // Test Big Data readout with plotting
377  fhGdpbMessType = new TH2I(name,
378  title,
380  0.,
382  fuNrOfGdpbs,
383  -0.5,
384  fuNrOfGdpbs - 0.5);
385  fhGdpbMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_HIT, "HIT");
386  fhGdpbMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_EPOCH, "EPOCH");
387  fhGdpbMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_SLOWC, "SLOWC");
388  fhGdpbMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_SYST, "SYST");
389  fhGdpbMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_STAR_TRI_A,
390  "TRI_A");
391  fhGdpbMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_STAR_TRI_B,
392  "TRI_B");
393  fhGdpbMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_STAR_TRI_C,
394  "TRI_C");
395  fhGdpbMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_STAR_TRI_D,
396  "TRI_D");
397 
398  /*******************************************************************/
399  name = "hGdpbSysMessType";
400  title =
401  "Nb of system message for each type per Gdpb; System Type; Gdpb Idx []";
402  fhGdpbSysMessType = new TH2I(name,
403  title,
405  0.,
407  fuNrOfGdpbs,
408  -0.5,
409  fuNrOfGdpbs - 0.5);
410  fhGdpbSysMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::SYS_GET4_ERROR,
411  "GET4 ERROR");
412  fhGdpbSysMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::SYS_GDPB_UNKWN,
413  "UNKW GET4 MSG");
414  fhGdpbSysMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::SYS_GET4_SYNC_MISS,
415  "SYS_GET4_SYNC_MISS");
416  fhGdpbSysMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::SYS_PATTERN,
417  "SYS_PATTERN");
418 
419  /*******************************************************************/
420  name = "hGdpbSysMessPattType";
421  title =
422  "Nb of pattern message for each type per Gdpb; Pattern Type; Gdpb Idx []";
423  fhGdpbSysMessPattType = new TH2I(name,
424  title,
426  0.,
428  fuNrOfGdpbs,
429  -0.5,
430  fuNrOfGdpbs - 0.5);
431  fhGdpbSysMessPattType->GetXaxis()->SetBinLabel(1 + gdpbv100::PATT_MISSMATCH,
432  "PATT_MISSMATCH");
433  fhGdpbSysMessPattType->GetXaxis()->SetBinLabel(1 + gdpbv100::PATT_ENABLE,
434  "PATT_ENABLE");
435  fhGdpbSysMessPattType->GetXaxis()->SetBinLabel(1 + gdpbv100::PATT_RESYNC,
436  "PATT_RESYNC");
437 
438  /*******************************************************************/
439  name = "hGdpbEpochFlags";
440  title = "Epoch flags per gDPB; gDPB # ; Type";
442  new TH2I(name, title, fuNrOfGdpbs, 0., fuNrOfGdpbs, 4, 0., 4.);
443  fhGdpbEpochFlags->GetYaxis()->SetBinLabel(1, "SYNC");
444  fhGdpbEpochFlags->GetYaxis()->SetBinLabel(2, "Ep LOSS");
445  fhGdpbEpochFlags->GetYaxis()->SetBinLabel(3, "Da LOSS");
446  fhGdpbEpochFlags->GetYaxis()->SetBinLabel(4, "MISSMAT");
447 
448  /*******************************************************************/
449  name = Form("hGdpbEpochSyncEvo");
450  title = Form("Epoch SYNC per second and gDPB; Time[s]; gDPB #; SYNC Nb");
451  fhGdpbEpochSyncEvo = new TH2D(name.Data(),
452  title.Data(),
453  uHistoryHistoSize,
454  0,
455  uHistoryHistoSize,
456  fuNrOfGdpbs,
457  0.,
458  fuNrOfGdpbs);
459 
460  /*******************************************************************/
461  name = Form("hGdpbEpochMissEvo");
462  title =
463  Form("Epoch Missmatch per second and gDPB; Time[s]; gDPB #; Missmatch Nb");
464  fhGdpbEpochMissEvo = new TH2D(name.Data(),
465  title.Data(),
466  uHistoryHistoSize,
467  0,
468  uHistoryHistoSize,
469  fuNrOfGdpbs,
470  0.,
471  fuNrOfGdpbs);
472 
473 
474  /*******************************************************************/
475  name = "hPatternMissmatch";
476  title = "Missmatch pattern integral per Gdpb; ASIC Pattern []; Gdpb Idx []";
477  fhPatternMissmatch = new TH2I(name,
478  title,
480  0.,
482  fuNrOfGdpbs,
483  -0.5,
484  fuNrOfGdpbs - 0.5);
485  name = "hPatternEnable";
486  title = "Enable pattern integral per Gdpb; ASIC Pattern []; Gdpb Idx []";
487  fhPatternEnable = new TH2I(name,
488  title,
490  0.,
492  fuNrOfGdpbs,
493  -0.5,
494  fuNrOfGdpbs - 0.5);
495  name = "hPatternResync";
496  title = "Resync pattern integral per Gdpb; ASIC Pattern []; Gdpb Idx []";
497  fhPatternResync = new TH2I(name,
498  title,
500  0.,
502  fuNrOfGdpbs,
503  -0.5,
504  fuNrOfGdpbs - 0.5);
505 
506 
507  /*******************************************************************/
508  fvuGdpbNbEpochPerMs.resize(fuNrOfGdpbs, 0);
510  for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
511  /*******************************************************************/
512  name = Form("hGdpbGet4MessType_%02u", uGdpb);
513  title = Form(
514  "Nb of message for each type per GET4 in gDPB %02u; GET4 chip # ; Type",
515  uGdpb);
516  fvhGdpbGet4MessType.push_back(new TH2I(
517  name, title, fuNrOfGet4PerGdpb, 0., fuNrOfGet4PerGdpb, 4, 0., 4.));
518  fvhGdpbGet4MessType[uGdpb]->GetYaxis()->SetBinLabel(1, "DATA 32b");
519  fvhGdpbGet4MessType[uGdpb]->GetYaxis()->SetBinLabel(2, "EPOCH");
520  fvhGdpbGet4MessType[uGdpb]->GetYaxis()->SetBinLabel(3, "S.C. M");
521  fvhGdpbGet4MessType[uGdpb]->GetYaxis()->SetBinLabel(4, "ERROR");
522 
523  /*******************************************************************/
524  name = Form("hGdpbGet4ChanErrors_%02u", uGdpb);
525  title = Form(
526  "Error messages per GET4 channel in gDPB %02u; GET4 channel # ; Error",
527  uGdpb);
528  fvhGdpbGet4ChanErrors.push_back(new TH2I(name,
529  title,
531  0.,
533  22,
534  0.,
535  22.));
536  fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(
537  1, "0x00: Readout Init ");
538  fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(
539  2, "0x01: Sync ");
540  fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(
541  3, "0x02: Epoch count sync");
542  fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(
543  4, "0x03: Epoch ");
544  fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(
545  5, "0x04: FIFO Write ");
546  fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(
547  6, "0x05: Lost event ");
548  fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(
549  7, "0x06: Channel state ");
550  fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(
551  8, "0x07: Token Ring state");
552  fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(
553  9, "0x08: Token ");
554  fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(
555  10, "0x09: Error Readout ");
556  fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(
557  11, "0x0a: SPI ");
558  fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(
559  12, "0x0b: DLL Lock error "); // <- From GET4 v1.2
560  fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(
561  13, "0x0c: DLL Reset invoc."); // <- From GET4 v1.2
562  fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(
563  14, "0x11: Overwrite "); // <- From GET4 v1.0 to 1.3
564  fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(
565  15, "0x12: ToT out of range");
566  fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(
567  16, "0x13: Event Discarded ");
568  fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(
569  17, "0x14: Add. Rising edge"); // <- From GET4 v1.3
570  fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(
571  18, "0x15: Unpaired Falling"); // <- From GET4 v1.3
572  fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(
573  19, "0x16: Sequence error "); // <- From GET4 v1.3
574  fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(
575  20, "0x17: Epoch Overflow "); // <- From GET4 v2.0
576  fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(
577  21, "0x7f: Unknown ");
578  fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(
579  22, "Corrupt/unsuprtd error");
580 
582  fvvuChanNbHitsPerMs[uGdpb].resize(fuNrOfChannelsPerGdpb, 0);
583  fhEpochsPerMs_gDPB.push_back(new TH1D(
584  Form("hEpochsPerMs_gDPB%02u", uGdpb),
585  Form("Epoch Counts per MS in gDPB %02u; Epochs/MS []; MS nb[]", uGdpb),
586  1000,
587  -0.5,
588  999.5));
589  fhEpochsPerMsPerTs_gDPB.push_back(new TH2D(
590  Form("hEpochsPerMsPerTs_gDPB%02u", uGdpb),
591  Form("Epoch Counts per MS in gDPB %02u; TS []; Epochs/MS []; MS nb[]",
592  uGdpb),
593  10000,
594  0,
595  10000,
596  100,
597  -0.5,
598  99.5));
599  fhEpochsDiff_gDPB.push_back(
600  new TH1D(Form("hEpochsDiff_gDPB%02u", uGdpb),
601  Form("Epoch index difference per MS in gDPB %02u; Ep(N) - Ep(N "
602  "- 1) []; MS nb[]",
603  uGdpb),
604  1001,
605  -500.5,
606  500.5));
607  fhEpochsDiffPerTs_gDPB.push_back(
608  new TH2D(Form("hEpochsDiffPerTs_gDPB%02u", uGdpb),
609  Form("Epoch index difference per MS in gDPB %02u; TS []; Ep(N) "
610  "- Ep(N - 1) []; MS nb[]",
611  uGdpb),
612  10000,
613  0,
614  10000,
615  101,
616  -50.5,
617  50.5));
618  fhEpochsJumpBitsPre_gDPB.push_back(
619  new TH2D(Form("hEpochsJumpBitsPre_gDPB%02u", uGdpb),
620  Form("Bits value in previous epoch when diff not 1 in gDPB "
621  "%02u; TS []; Bit []; Value[]",
622  uGdpb),
623  32,
624  -0.5,
625  31.5,
626  2,
627  -0.5,
628  1.5));
629  fhEpochsJumpBitsNew_gDPB.push_back(
630  new TH2D(Form("hEpochsJumpBitsNew_gDPB%02u", uGdpb),
631  Form("Bits value in new epoch when diff not 1 in gDPB %02u; TS "
632  "[]; Bit []; Value[]",
633  uGdpb),
634  32,
635  -0.5,
636  31.5,
637  2,
638  -0.5,
639  1.5));
640  fhEpochsJumpDigitsPre_gDPB.push_back(
641  new TH2D(Form("hEpochsJumpDigitsPre_gDPB%02u", uGdpb),
642  Form("Digits value in previous epoch when diff not 1 in gDPB "
643  "%02u; TS []; Digit []; Value[]",
644  uGdpb),
645  10,
646  -0.5,
647  9.5,
648  10,
649  -0.5,
650  9.5));
651  fhEpochsJumpDigitsNew_gDPB.push_back(
652  new TH2D(Form("hEpochsJumpDigitsNew_gDPB%02u", uGdpb),
653  Form("Digits value in new epoch when diff not 1 in gDPB %02u; "
654  "TS []; Digit []; Value[]",
655  uGdpb),
656  10,
657  -0.5,
658  9.5,
659  10,
660  -0.5,
661  9.5));
662  fhStartEpochPerMs_gDPB.push_back(
663  new TH2D(Form("fhStartEpochPerMs_gDPB%02u", uGdpb),
664  Form("MS start with Epoch in gDPB %02u?; TS []; 1st Msg is "
665  "Epoch? []; MS nb[]",
666  uGdpb),
667  10000,
668  0,
669  10000,
670  2,
671  -0.5,
672  1.5));
673  fhCloseEpochPerMs_gDPB.push_back(
674  new TH2D(Form("fhCloseEpochPerMs_gDPB%02u", uGdpb),
675  Form("MS close with Epoch in gDPB %02u?; TS []; Last Msg is "
676  "Epoch? []; MS nb[]",
677  uGdpb),
678  10000,
679  0,
680  10000,
681  2,
682  -0.5,
683  1.5));
684  fhHitsPerMsFirstChan_gDPB.push_back(
685  new TH2D(Form("hHitsPerMsFirstChan_gDPB%02u", uGdpb),
686  Form("Hit Counts per MS in first channel in gDPB %02u; TS []; "
687  "Hits/MS []; MS nb[]",
688  uGdpb),
689  10000,
690  0,
691  10000,
692  150,
693  -0.5,
694  149.5));
695  fvhChannelRatePerMs_gDPB.push_back(
696  new TProfile2D(Form("hChannelRatePerMs_gDPB%02u", uGdpb),
697  Form("Mean Hit count per MS and channel vs Time in gDPB "
698  "%02u; TS []; Channel []; <Hits/Ms> []",
699  uGdpb),
700  10000,
701  0,
702  10000,
704  -0.5,
705  fuNrOfChannelsPerGdpb - 0.5));
706  } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
707 
708  if (server) {
709  server->Register("/TofRaw", fhMessType);
710  server->Register("/TofRaw", fhSysMessType);
711  server->Register("/TofRaw", fhGet4MessType);
712  server->Register("/TofRaw", fhGet4ChanScm);
713  server->Register("/TofRaw", fhGet4ChanErrors);
714  server->Register("/TofRaw", fhGet4EpochFlags);
715 
716  server->Register("/TofRaw", fhGdpbMessType);
717  server->Register("/TofRaw", fhGdpbSysMessType);
718  server->Register("/TofRaw", fhGdpbSysMessPattType);
719  server->Register("/TofRaw", fhGdpbEpochFlags);
720  server->Register("/TofRaw", fhGdpbEpochSyncEvo);
721  server->Register("/TofRaw", fhGdpbEpochMissEvo);
722 
723  server->Register("/TofRaw", fhPatternMissmatch);
724  server->Register("/TofRaw", fhPatternEnable);
725  server->Register("/TofRaw", fhPatternResync);
726 
727  for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
728  server->Register("/TofRaw", fvhGdpbGet4MessType[uGdpb]);
729  server->Register("/TofRaw", fvhGdpbGet4ChanErrors[uGdpb]);
730 
731  server->Register("/Tof_Ep_FineCount", fhEpochsPerMs_gDPB[uGdpb]);
732  server->Register("/Tof_Ep_FineCount", fhEpochsPerMsPerTs_gDPB[uGdpb]);
733  server->Register("/Tof_Ep_FineCount", fhEpochsDiff_gDPB[uGdpb]);
734  server->Register("/Tof_Ep_FineCount", fhEpochsDiffPerTs_gDPB[uGdpb]);
735  server->Register("/Tof_Ep_FineCount", fhEpochsJumpBitsPre_gDPB[uGdpb]);
736  server->Register("/Tof_Ep_FineCount", fhEpochsJumpBitsNew_gDPB[uGdpb]);
737  server->Register("/Tof_Ep_FineCount", fhEpochsJumpDigitsPre_gDPB[uGdpb]);
738  server->Register("/Tof_Ep_FineCount", fhEpochsJumpDigitsNew_gDPB[uGdpb]);
739  server->Register("/Tof_Ep_FineCount", fhStartEpochPerMs_gDPB[uGdpb]);
740  server->Register("/Tof_Ep_FineCount", fhCloseEpochPerMs_gDPB[uGdpb]);
741 
742  server->Register("/ChanFineRate", fhHitsPerMsFirstChan_gDPB[uGdpb]);
743  server->Register("/ChanFineRate", fvhChannelRatePerMs_gDPB[uGdpb]);
744  } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
745 
746  server->RegisterCommand("/Reset_All_eTOF",
747  "bCheckFormatGdpbResetHistos=kTRUE");
748  server->RegisterCommand("/Save_All_eTof",
749  "bCheckFormatGdpbSaveHistos=kTRUE");
750 
751  server->Restrict("/Reset_All_eTof", "allow=admin");
752  server->Restrict("/Save_All_eTof", "allow=admin");
753  } // if( server )
754 
756  Double_t w = 10;
757  Double_t h = 10;
758  fcSummary = new TCanvas("cSummary", "gDPB Monitoring Summary");
759  fcSummary->Divide(2, 3);
760 
761  // 1st Column: Messages types
762  fcSummary->cd(1);
763  gPad->SetLogy();
764  fhMessType->Draw();
765 
766  fcSummary->cd(2);
767  gPad->SetLogy();
768  fhSysMessType->Draw();
769 
770  fcSummary->cd(3);
771  gPad->SetLogz();
772  fhGet4MessType->Draw("colz");
773 
774  // 2nd Column: GET4 Errors + Epoch flags + SCm
775  fcSummary->cd(4);
776  gPad->SetLogz();
777  fhGet4ChanErrors->Draw("colz");
778 
779  fcSummary->cd(5);
780  gPad->SetLogz();
781  fhGet4EpochFlags->Draw("colz");
782 
783  fcSummary->cd(6);
784  fhGet4ChanScm->Draw("colz");
785 
786  server->Register("/canvases", fcSummary);
787  /*****************************/
788 
789  for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
790  fcFormatGdpb.push_back(
791  new TCanvas(Form("cFormatGdpb%02u", uGdpb),
792  Form("gDPB %02u Data Format Check", uGdpb)));
793  fcFormatGdpb[uGdpb]->Divide(4, 2);
794 
795  fcFormatGdpb[uGdpb]->cd(1);
796  gPad->SetGridx();
797  gPad->SetGridy();
798  fhEpochsPerMsPerTs_gDPB[uGdpb]->Draw("colz");
799 
800  fcFormatGdpb[uGdpb]->cd(2);
801  gPad->SetGridx();
802  gPad->SetGridy();
803  fhEpochsDiffPerTs_gDPB[uGdpb]->Draw("colz");
804 
805  fcFormatGdpb[uGdpb]->cd(3);
806  gPad->SetGridx();
807  gPad->SetGridy();
808  fhStartEpochPerMs_gDPB[uGdpb]->Draw("colz");
809 
810  fcFormatGdpb[uGdpb]->cd(4);
811  gPad->SetGridx();
812  gPad->SetGridy();
813  fhCloseEpochPerMs_gDPB[uGdpb]->Draw("colz");
814 
815  fcFormatGdpb[uGdpb]->cd(5);
816  gPad->SetGridx();
817  gPad->SetGridy();
818  fhHitsPerMsFirstChan_gDPB[uGdpb]->Draw("colz");
819 
820  fcFormatGdpb[uGdpb]->cd(6);
821  gPad->SetGridx();
822  gPad->SetGridy();
823  gPad->SetLogz();
824  fvhChannelRatePerMs_gDPB[uGdpb]->Draw("colz");
825 
826  fcFormatGdpb[uGdpb]->cd(7);
827  gPad->SetGridx();
828  gPad->SetGridy();
829  gPad->SetLogz();
830  fhEpochsJumpBitsPre_gDPB[uGdpb]->Draw("colz");
831 
832  fcFormatGdpb[uGdpb]->cd(8);
833  gPad->SetGridx();
834  gPad->SetGridy();
835  gPad->SetLogz();
836  fhEpochsJumpBitsNew_gDPB[uGdpb]->Draw("colz");
837 
838  server->Register("/canvases", fcFormatGdpb[uGdpb]);
839  } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
840  /*****************************/
841 
843  // Try to recover canvas in case it was created already by another monitor
844  // If not existing, create it
845  fcMsSizeAll = dynamic_cast<TCanvas*>(gROOT->FindObject("cMsSizeAll"));
846  if (NULL == fcMsSizeAll) {
847  fcMsSizeAll =
848  new TCanvas("cMsSizeAll", "Evolution of MS size in last 300 s", w, h);
849  fcMsSizeAll->Divide(4, 3);
850  LOG(info) << "Created MS size canvas in TOF monitor";
851  } // if( NULL == fcMsSizeAll )
852  else
853  LOG(info) << "Recovered MS size canvas in TOF monitor";
854 
855  server->Register("/canvases", fcMsSizeAll);
856 
857  LOG(info) << "Leaving CreateHistograms";
858 }
859 
860 Bool_t CbmCheckDataFormatGdpb2018::DoUnpack(const fles::Timeslice& ts,
861  size_t component) {
863  LOG(info) << "Reset eTOF STAR histos ";
864  ResetAllHistos();
866  } // if( bCheckFormatGdpbResetHistos )
868  LOG(info) << "Start saving eTOF STAR histos ";
869  SaveAllHistos("data/histos_Shift_StarTof.root");
871  } // if( bSaveStsHistos )
872 
874  std::chrono::time_point<std::chrono::system_clock> timeCurrent =
875  std::chrono::system_clock::now();
876  std::chrono::duration<double> elapsed_seconds =
877  timeCurrent - fTimeLastHistoSaving;
878  if (0 == fTimeLastHistoSaving.time_since_epoch().count()) {
879  fTimeLastHistoSaving = timeCurrent;
880  } // if( 0 == fTimeLastHistoSaving.time_since_epoch().count() )
881  else if (300 < elapsed_seconds.count()) {
882  std::time_t cTimeCurrent =
883  std::chrono::system_clock::to_time_t(timeCurrent);
884  char tempBuff[80];
885  std::strftime(tempBuff, 80, "%F %T", localtime(&cTimeCurrent));
886  fTimeLastHistoSaving = timeCurrent;
887  SaveAllHistos("data/histosCheckGdpbAuto.root");
888  } // else if( 300 < elapsed_seconds.count() )
889 
890  LOG(debug1) << "Timeslice contains " << ts.num_microslices(component)
891  << "microslices.";
892 
894  if (0 == ts.index()) return kTRUE;
895 
897  UInt_t uNbMsLoop = fuNbCoreMsPerTs;
898  if (kFALSE == fbIgnoreOverlapMs) uNbMsLoop += fuNbOverMsPerTs;
899 
901  // UInt_t uTsIndexHeader = ts.index();
902  UInt_t uTsIndexHeader = fulCurrentTsIndex;
903 
904  Int_t messageType = -111;
905  // Double_t dTsStartTime = -1;
906 
908  for (UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx++) {
909  if (fuMsAcceptsPercent < uMsIdx) continue;
910 
911  fuCurrentMs = uMsIdx;
912 
913  if (0 == fulCurrentTsIndex && 0 == uMsIdx) {
914  for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size();
915  ++uMsCompIdx) {
916  UInt_t uMsComp = fvMsComponentsList[uMsCompIdx];
917  auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
918  /*
919  LOG(info) << "hi hv eqid flag si sv idx/start crc size offset";
920  LOG(info) << Form( "%02x %02x %04x %04x %02x %02x %016llx %08x %08x %016llx",
921  static_cast<unsigned int>(msDescriptor.hdr_id),
922  static_cast<unsigned int>(msDescriptor.hdr_ver), msDescriptor.eq_id, msDescriptor.flags,
923  static_cast<unsigned int>(msDescriptor.sys_id),
924  static_cast<unsigned int>(msDescriptor.sys_ver), msDescriptor.idx, msDescriptor.crc,
925  msDescriptor.size, msDescriptor.offset );
926 */
927  LOG(info) << FormatMsHeaderPrintout(msDescriptor);
928  } // for( UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx )
929  } // if( 0 == fulCurrentTsIndex && 0 == uMsIdx )
930 
932  for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size();
933  ++uMsCompIdx) {
934  constexpr uint32_t kuBytesPerMessage = 8;
935 
936  UInt_t uMsComp = fvMsComponentsList[uMsCompIdx];
937  auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
938  fiEquipmentId = msDescriptor.eq_id;
939  fdMsIndex = static_cast<double>(msDescriptor.idx);
940  fuCurrentMsSysId = static_cast<unsigned int>(msDescriptor.sys_id);
941  const uint8_t* msContent =
942  reinterpret_cast<const uint8_t*>(ts.content(uMsComp, uMsIdx));
943 
944  uint32_t size = msDescriptor.size;
945  // fulLastMsIdx = msDescriptor.idx;
946  if (size > 0)
947  LOG(debug) << "Microslice: " << msDescriptor.idx
948  << " has size: " << size;
949 
950  // if( 0 == uMsIdx && 0 == uMsCompIdx )
951  // dTsStartTime = (1e-9) * fdMsIndex;
952 
953  if (fdStartTimeMsSz < 0) fdStartTimeMsSz = (1e-9) * fdMsIndex;
954  fvhMsSzPerLink[uMsComp]->Fill(size);
955  fvhMsSzTimePerLink[uMsComp]->Fill((1e-9) * fdMsIndex - fdStartTimeMsSz,
956  size);
957 
958  // If not integer number of message in input buffer, print warning/error
959  if (0 != (size % kuBytesPerMessage))
960  LOG(error) << "The input microslice buffer does NOT "
961  << "contain only complete nDPB messages!";
962 
963  // Compute the number of complete messages in the input microslice buffer
964  uint32_t uNbMessages =
965  (size - (size % kuBytesPerMessage)) / kuBytesPerMessage;
966 
967  // Get the gDPB ID from the MS header
969 
971  auto it = fGdpbIdIndexMap.find(fuGdpbId);
972  if (it == fGdpbIdIndexMap.end()) {
973  LOG(info)
974  << "---------------------------------------------------------------";
975  /*
976  LOG(info) << "hi hv eqid flag si sv idx/start crc size offset";
977  LOG(info) << Form( "%02x %02x %04x %04x %02x %02x %016llx %08x %08x %016llx",
978  static_cast<unsigned int>(msDescriptor.hdr_id),
979  static_cast<unsigned int>(msDescriptor.hdr_ver), msDescriptor.eq_id, msDescriptor.flags,
980  static_cast<unsigned int>(msDescriptor.sys_id),
981  static_cast<unsigned int>(msDescriptor.sys_ver), msDescriptor.idx, msDescriptor.crc,
982  msDescriptor.size, msDescriptor.offset );
983 */
984  LOG(info) << FormatMsHeaderPrintout(msDescriptor);
985  LOG(error) << "Could not find the gDPB index for AFCK id 0x" << std::hex
986  << fuGdpbId << std::dec << " in timeslice "
987  << fulCurrentTsIndex << " in microslice " << fdMsIndex
988  << " component " << uMsCompIdx << "\n"
989  << "If valid this index has to be added in the TOF "
990  "parameter file in the RocIdArray field";
991  continue;
992  } // if( it == fGdpbIdIndexMap.end() )
993  else
995 
996  // Prepare variables for the loop on contents
997  const uint64_t* pInBuff = reinterpret_cast<const uint64_t*>(msContent);
998  for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx++) {
999  // Fill message
1000  uint64_t ulData = static_cast<uint64_t>(pInBuff[uIdx]);
1001 
1003  if (0 == uIdx) {
1004  continue;
1005  } // if( 0 == uIdx && kFALSE == fbOldFwData )
1006 
1007  gdpbv100::Message mess(ulData);
1008 
1009  // Detect message types
1010  // and fill the corresponding histogram
1011  messageType = mess.getMessageType();
1012  fhMessType->Fill(messageType);
1013  fhGdpbMessType->Fill(messageType, fuGdpbNr);
1014 
1017  if (fuGdpbNr == fuDiamondDpbIdx || 0x90 == fuCurrentMsSysId)
1018  fuGet4Id = mess.getGdpbGenChipId();
1020 
1021  if (fuNrOfGet4PerGdpb <= fuGet4Id && !mess.isStarTrigger()
1023  LOG(warning) << "Message with Get4 ID too high: " << fuGet4Id
1024  << " VS " << fuNrOfGet4PerGdpb << " set in parameters.";
1025 
1026  if (1 == uIdx)
1028  uTsIndexHeader, gdpbv100::MSG_EPOCH == messageType);
1029  if (uNbMessages - 1 == uIdx)
1031  uTsIndexHeader, gdpbv100::MSG_EPOCH == messageType);
1032 
1033  switch (messageType) {
1034  case gdpbv100::MSG_HIT: {
1035  if (mess.getGdpbHitIs24b()) {
1036  fhGet4MessType->Fill(fuGet4Nr, 4);
1039  } // if( getGdpbHitIs24b() )
1040  else {
1041  fhGet4MessType->Fill(fuGet4Nr, 0);
1043 
1044  UInt_t uChannel = mess.getGdpbHitChanId();
1045  UInt_t uChannelNr = fuGet4Id * fuNrOfChannelsPerGet4 + uChannel;
1046  fvvuChanNbHitsPerMs[fuGdpbNr][uChannelNr]++;
1047  } // else of if( getGdpbHitIs24b() )
1048  break;
1049  } // case gdpbv100::MSG_HIT:
1050  case gdpbv100::MSG_EPOCH: {
1052  if (1 == mess.getGdpbEpSync()) {
1053  fhGdpbEpochFlags->Fill(fuGdpbNr, 0);
1054  fhGdpbEpochSyncEvo->Fill((1e-9) * fdMsIndex - fdStartTimeMsSz,
1055  fuGdpbNr);
1056  } // if (1 == mess.getGdpbEpSync())
1057 
1058  if (1 == mess.getGdpbEpDataLoss())
1059  fhGdpbEpochFlags->Fill(fuGdpbNr, 1);
1060 
1061  if (1 == mess.getGdpbEpEpochLoss())
1062  fhGdpbEpochFlags->Fill(fuGdpbNr, 2);
1063 
1064  if (1 == mess.getGdpbEpMissmatch()) {
1065  fhGdpbEpochFlags->Fill(fuGdpbNr, 3);
1066  fhGdpbEpochMissEvo->Fill((1e-9) * fdMsIndex - fdStartTimeMsSz,
1067  fuGdpbNr);
1068  } // if (1 == mess.getGdpbEpMissmatch())
1069 
1070  for (uint32_t uGet4Index = 0; uGet4Index < fuNrOfGet4PerGdpb;
1071  uGet4Index++) {
1072  fuGet4Id = uGet4Index;
1074  gdpbv100::Message tmpMess(mess);
1075  tmpMess.setGdpbGenChipId(uGet4Index);
1076 
1077  fhGet4MessType->Fill(fuGet4Nr, 1);
1079  } // for( uint32_t uGet4Index = 0; uGet4Index < fuNrOfGet4PerGdpb; uGetIndex ++ )
1080 
1083 
1085  ULong64_t ulEpochNr = mess.getGdpbEpEpochNb();
1086  Long64_t iEpDiff = ulEpochNr;
1087  iEpDiff -= fvulCurrentEpoch[fuGdpbNr];
1088  fhEpochsDiff_gDPB[fuGdpbNr]->Fill(iEpDiff);
1089  fhEpochsDiffPerTs_gDPB[fuGdpbNr]->Fill(uTsIndexHeader, iEpDiff);
1090 
1091  if (1 != iEpDiff && 0 < fvulCurrentEpoch[fuGdpbNr]) {
1092  for (UInt_t uBit = 0; uBit < 32; ++uBit) {
1094  uBit, (fvulCurrentEpoch[fuGdpbNr] >> uBit) & 0x1);
1096  uBit, (ulEpochNr >> uBit) & 0x1);
1097  } // for( UInt_t uBit = 0; uBit < 32; ++uBit )
1098 
1099  UInt_t uPower = 1;
1100  for (UInt_t uDigit = 0; uDigit < 10; ++uDigit) {
1102  uDigit,
1103  TMath::Floor((fvulCurrentEpoch[fuGdpbNr] % (10 * uPower))
1104  / uPower));
1106  uDigit, TMath::Floor((ulEpochNr % (10 * uPower)) / uPower));
1107  uPower *= 10;
1108  } // for( UInt_t uDigit = 0; uDigit < 10; ++uDigit )
1109  /*
1110  LOG(info) << Form( " Non consecutive epochs for Gdpb %2u in TS %8u MS %4u Msg %6u",
1111  fuGdpbNr, uTsIndexHeader, uMsIdx, uIdx )
1112  << Form( " : old Ep %08llx new Ep %08llx Diff %lld ", fvulCurrentEpoch[ fuGdpbNr ], ulEpochNr, iEpDiff )
1113  << std::endl;
1114 */
1115  } // if( 1 != iEpDiff )
1116 
1118  fvulCurrentEpoch[fuGdpbNr] = ulEpochNr;
1119  } // if this epoch message is a merged one valid for all chips
1120  else {
1122  } // if single chip epoch message
1123  break;
1124  } // case gdpbv100::MSG_EPOCH:
1125  case gdpbv100::MSG_SLOWC: {
1126  fhGet4MessType->Fill(fuGet4Nr, 2);
1128  break;
1129  } // case gdpbv100::MSG_SLOWC:
1130  case gdpbv100::MSG_SYST: {
1131  fhSysMessType->Fill(mess.getGdpbSysSubType());
1134  fhGet4MessType->Fill(fuGet4Nr, 3);
1136 
1137  // UInt_t uFeeNr = (fuGet4Id / fuNrOfGet4PerFee);
1138 
1139  Int_t dGdpbChId =
1141  Int_t dFullChId =
1143  switch (mess.getGdpbSysErrData()) {
1145  fhGet4ChanErrors->Fill(dFullChId, 0);
1146  fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 0);
1147  break;
1149  fhGet4ChanErrors->Fill(dFullChId, 1);
1150  fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 1);
1151  break;
1153  fhGet4ChanErrors->Fill(dFullChId, 2);
1154  fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 2);
1155  break;
1157  fhGet4ChanErrors->Fill(dFullChId, 3);
1158  fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 3);
1159  break;
1161  fhGet4ChanErrors->Fill(dFullChId, 4);
1162  fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 4);
1163  break;
1165  fhGet4ChanErrors->Fill(dFullChId, 5);
1166  fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 5);
1167  break;
1169  fhGet4ChanErrors->Fill(dFullChId, 6);
1170  fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 6);
1171  break;
1173  fhGet4ChanErrors->Fill(dFullChId, 7);
1174  fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 7);
1175  break;
1177  fhGet4ChanErrors->Fill(dFullChId, 8);
1178  fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 8);
1179  break;
1181  fhGet4ChanErrors->Fill(dFullChId, 9);
1182  fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 9);
1183  break;
1185  fhGet4ChanErrors->Fill(dFullChId, 10);
1186  fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 10);
1187  break;
1189  fhGet4ChanErrors->Fill(dFullChId, 11);
1190  fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 11);
1191  break;
1193  fhGet4ChanErrors->Fill(dFullChId, 12);
1194  fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 12);
1195  break;
1197  fhGet4ChanErrors->Fill(dFullChId, 13);
1198  fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 13);
1199  break;
1201  fhGet4ChanErrors->Fill(dFullChId, 14);
1202  fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 14);
1203  break;
1205  fhGet4ChanErrors->Fill(dFullChId, 15);
1206  fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 15);
1207  break;
1209  fhGet4ChanErrors->Fill(dFullChId, 16);
1210  fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 16);
1211  break;
1213  fhGet4ChanErrors->Fill(dFullChId, 17);
1214  fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 17);
1215  break;
1217  fhGet4ChanErrors->Fill(dFullChId, 18);
1218  fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 18);
1219  break;
1221  fhGet4ChanErrors->Fill(dFullChId, 19);
1222  fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 19);
1223  break;
1225  fhGet4ChanErrors->Fill(dFullChId, 20);
1226  fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 20);
1227  break;
1228  default: // Corrupt error or not yet supported error
1229  fhGet4ChanErrors->Fill(dFullChId, 21);
1230  fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 21);
1231  break;
1232  } // Switch( mess.getGdpbSysErrData() )
1233  } // if( gdpbv100::SYSMSG_GET4_EVENT == mess.getGdpbSysSubType() )
1234  if (gdpbv100::SYS_PATTERN == mess.getGdpbSysSubType()) {
1236  } // if( gdpbv100::SYS_PATTERN == mess.getGdpbSysSubType() )
1237  break;
1238  } // case gdpbv100::MSG_SYST:
1243  fhGet4MessType->Fill(fuGet4Nr, 5);
1245  break;
1246  default:
1247  LOG(error) << "Message type " << std::hex << std::setw(2)
1248  << static_cast<uint16_t>(messageType)
1249  << " not included in Get4 unpacker.";
1250  } // switch( mess.getMessageType() )
1251  } // for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx ++)
1252  } // for( UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx )
1253 
1254  for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1255  fhEpochsPerMs_gDPB[uGdpb]->Fill(fvuGdpbNbEpochPerMs[uGdpb]);
1256  fhEpochsPerMsPerTs_gDPB[uGdpb]->Fill(uTsIndexHeader,
1257  fvuGdpbNbEpochPerMs[uGdpb]);
1258  fhHitsPerMsFirstChan_gDPB[uGdpb]->Fill(uTsIndexHeader,
1259  fvvuChanNbHitsPerMs[uGdpb][0]);
1260  for (UInt_t uChan = 0; uChan < fuNrOfChannelsPerGdpb; ++uChan) {
1261  fvhChannelRatePerMs_gDPB[uGdpb]->Fill(
1262  uTsIndexHeader, uChan, 1.0 * fvvuChanNbHitsPerMs[uGdpb][uChan]);
1263  fvvuChanNbHitsPerMs[uGdpb][uChan] = 0;
1264  } // for( UInt_t uChan = 0; uChan < fuNrOfChannelsPerGdpb; ++uChan )
1265  fvuGdpbNbEpochPerMs[uGdpb] = 0;
1266  } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1267  } // for( UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx ++ )
1268 
1270 
1271  return kTRUE;
1272 }
1273 
1275 
1277 
1279  TDirectory* oldDir = NULL;
1280  TFile* histoFile = NULL;
1281  if ("" != sFileName) {
1282  // Store current directory position to allow restore later
1283  oldDir = gDirectory;
1284  // open separate histo file in recreate mode
1285  histoFile = new TFile(sFileName, "RECREATE");
1286  histoFile->cd();
1287  } // if( "" != sFileName )
1288 
1289  gDirectory->mkdir("Tof_Raw_gDPB");
1290  gDirectory->cd("Tof_Raw_gDPB");
1291 
1292  fhMessType->Write();
1293  fhSysMessType->Write();
1294  fhGet4MessType->Write();
1295  fhGet4ChanScm->Write();
1296  fhGet4ChanErrors->Write();
1297  fhGet4EpochFlags->Write();
1298 
1299  fhGdpbMessType->Write();
1300  fhGdpbSysMessType->Write();
1301  fhGdpbSysMessPattType->Write();
1302  fhGdpbEpochFlags->Write();
1303  fhGdpbEpochSyncEvo->Write();
1304  fhGdpbEpochMissEvo->Write();
1305 
1306  fhPatternMissmatch->Write();
1307  fhPatternEnable->Write();
1308  fhPatternResync->Write();
1309 
1310  for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1311  fvhGdpbGet4MessType[uGdpb]->Write();
1312  fvhGdpbGet4ChanErrors[uGdpb]->Write();
1313  } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1314 
1315 
1316  gDirectory->mkdir("Tof_Ep_FineCount");
1317  gDirectory->cd("Tof_Ep_FineCount");
1318  for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1319  fhEpochsPerMs_gDPB[uGdpb]->Write();
1320  fhEpochsPerMsPerTs_gDPB[uGdpb]->Write();
1321  fhEpochsDiff_gDPB[uGdpb]->Write();
1322  fhEpochsDiffPerTs_gDPB[uGdpb]->Write();
1323  fhEpochsJumpBitsPre_gDPB[uGdpb]->Write();
1324  fhEpochsJumpBitsNew_gDPB[uGdpb]->Write();
1325  fhEpochsJumpDigitsPre_gDPB[uGdpb]->Write();
1326  fhEpochsJumpDigitsNew_gDPB[uGdpb]->Write();
1327  fhStartEpochPerMs_gDPB[uGdpb]->Write();
1328  fhCloseEpochPerMs_gDPB[uGdpb]->Write();
1329  } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1330  gDirectory->cd("..");
1331 
1332  gDirectory->mkdir("Tof_Chan_FineCount");
1333  gDirectory->cd("Tof_Chan_FineCount");
1334  for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1335  fhHitsPerMsFirstChan_gDPB[uGdpb]->Write();
1336  fvhChannelRatePerMs_gDPB[uGdpb]->Write();
1337  } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1338  gDirectory->cd("..");
1339 
1340  gDirectory->mkdir("Flib_Raw");
1341  gDirectory->cd("Flib_Raw");
1342  for (UInt_t uLinks = 0; uLinks < fvhMsSzPerLink.size(); uLinks++) {
1343  if (NULL == fvhMsSzPerLink[uLinks]) continue;
1344 
1345  fvhMsSzPerLink[uLinks]->Write();
1346  fvhMsSzTimePerLink[uLinks]->Write();
1347  } // for( UInt_t uLinks = 0; uLinks < fvhMsSzPerLink.size(); uLinks++ )
1348 
1349  TH1* pMissedTsH1 = dynamic_cast<TH1*>(gROOT->FindObjectAny("Missed_TS"));
1350  if (NULL != pMissedTsH1) pMissedTsH1->Write();
1351 
1352  TProfile* pMissedTsEvoP =
1353  dynamic_cast<TProfile*>(gROOT->FindObjectAny("Missed_TS_Evo"));
1354  if (NULL != pMissedTsEvoP) pMissedTsEvoP->Write();
1355 
1356  gDirectory->cd("..");
1357 
1358  gDirectory->mkdir("canvases");
1359  gDirectory->cd("canvases");
1360  fcSummary->Write();
1361  for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1362  fcFormatGdpb[uGdpb]->Write();
1363  } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1364  gDirectory->cd("..");
1365 
1366  if ("" != sFileName) {
1367  // Restore original directory position
1368  histoFile->Close();
1369  oldDir->cd();
1370  } // if( "" != sFileName )
1371 }
1372 
1374  LOG(info) << "Reseting all TOF histograms.";
1375 
1376  fhMessType->Reset();
1377  fhSysMessType->Reset();
1378  fhGet4MessType->Reset();
1379  fhGet4ChanScm->Reset();
1380  fhGet4ChanErrors->Reset();
1381  fhGet4EpochFlags->Reset();
1382 
1383  fhGdpbMessType->Reset();
1384  fhGdpbSysMessType->Reset();
1385  fhGdpbSysMessPattType->Reset();
1386  fhGdpbEpochFlags->Reset();
1387  fhGdpbEpochSyncEvo->Reset();
1388  fhGdpbEpochMissEvo->Reset();
1389 
1390  fhPatternMissmatch->Reset();
1391  fhPatternEnable->Reset();
1392  fhPatternResync->Reset();
1393 
1394 
1395  for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1396  fvhGdpbGet4MessType[uGdpb]->Reset();
1397  fvhGdpbGet4ChanErrors[uGdpb]->Reset();
1398  } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1399 
1400  for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1401  fhEpochsPerMs_gDPB[uGdpb]->Reset();
1402  fhEpochsPerMsPerTs_gDPB[uGdpb]->Reset();
1403  fhEpochsDiff_gDPB[uGdpb]->Reset();
1404  fhEpochsDiffPerTs_gDPB[uGdpb]->Reset();
1405  fhEpochsJumpBitsPre_gDPB[uGdpb]->Reset();
1406  fhEpochsJumpBitsNew_gDPB[uGdpb]->Reset();
1407  fhEpochsJumpDigitsPre_gDPB[uGdpb]->Reset();
1408  fhEpochsJumpDigitsNew_gDPB[uGdpb]->Reset();
1409  fhStartEpochPerMs_gDPB[uGdpb]->Reset();
1410  fhCloseEpochPerMs_gDPB[uGdpb]->Reset();
1411  fhHitsPerMsFirstChan_gDPB[uGdpb]->Reset();
1412  fvhChannelRatePerMs_gDPB[uGdpb]->Reset();
1413  } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1414 
1415  for (UInt_t uLinks = 0; uLinks < fvhMsSzPerLink.size(); uLinks++) {
1416  if (NULL == fvhMsSzPerLink[uLinks]) continue;
1417 
1418  fvhMsSzPerLink[uLinks]->Reset();
1419  fvhMsSzTimePerLink[uLinks]->Reset();
1420  } // for( UInt_t uLinks = 0; uLinks < fvhMsSzPerLink.size(); uLinks++ )
1421 
1422  fdStartTimeMsSz = -1;
1423 }
gdpbv100::MSG_STAR_TRI_A
@ MSG_STAR_TRI_A
Definition: gDpbMessv100.h:63
gdpbv100::Message
Definition: gDpbMessv100.h:133
bCheckFormatGdpbResetHistos
Bool_t bCheckFormatGdpbResetHistos
Definition: CbmCheckDataFormatGdpb2018.cxx:44
CbmCheckDataFormatGdpb2018::fhGet4ChanScm
TH2 * fhGet4ChanScm
Definition: CbmCheckDataFormatGdpb2018.h:165
CbmCheckDataFormatGdpb2018::fuOverlapMsNb
size_t fuOverlapMsNb
Definition: CbmCheckDataFormatGdpb2018.h:87
CbmCheckDataFormatGdpb2018::fvhMsSzTimePerLink
std::vector< TProfile * > fvhMsSzTimePerLink
Definition: CbmCheckDataFormatGdpb2018.h:157
gdpbv100::Message::getGdpbSysErrChanId
uint16_t getGdpbSysErrChanId() const
Definition: gDpbMessv100.h:251
CbmCheckDataFormatGdpb2018::CreateHistograms
void CreateHistograms()
Definition: CbmCheckDataFormatGdpb2018.cxx:258
gdpbv100::Message::getGdpbEpEpochNb
uint32_t getGdpbEpEpochNb() const
Definition: gDpbMessv100.h:231
CbmCheckDataFormatGdpb2018::fhGdpbSysMessType
TH2 * fhGdpbSysMessType
Definition: CbmCheckDataFormatGdpb2018.h:170
CbmCheckDataFormatGdpb2018::fuCurrentMsSysId
size_t fuCurrentMsSysId
Definition: CbmCheckDataFormatGdpb2018.h:123
CbmMcbm2018TofPar::ElinkIdxToGet4Idx
Int_t ElinkIdxToGet4Idx(UInt_t uElink)
Definition: CbmMcbm2018TofPar.cxx:172
CbmCheckDataFormatGdpb2018::fuNrOfGet4
UInt_t fuNrOfGet4
Definition: CbmCheckDataFormatGdpb2018.h:102
CbmCheckDataFormatGdpb2018::fuGet4Nr
UInt_t fuGet4Nr
Definition: CbmCheckDataFormatGdpb2018.h:131
CbmCheckDataFormatGdpb2018::fhGdpbEpochMissEvo
TH2 * fhGdpbEpochMissEvo
Definition: CbmCheckDataFormatGdpb2018.h:174
gdpbv100::GET4_V2X_ERR_TOT_OVERWRT
@ GET4_V2X_ERR_TOT_OVERWRT
Definition: gDpbMessv100.h:121
CbmCheckDataFormatGdpb2018::fcFormatGdpb
std::vector< TCanvas * > fcFormatGdpb
Definition: CbmCheckDataFormatGdpb2018.h:200
bCheckFormatGdpbSaveHistos
Bool_t bCheckFormatGdpbSaveHistos
Definition: CbmCheckDataFormatGdpb2018.cxx:45
CbmCheckDataFormatGdpb2018::fhGet4EpochFlags
TH2 * fhGet4EpochFlags
Definition: CbmCheckDataFormatGdpb2018.h:167
CbmMcbm2018TofPar::GetNbMsTot
Int_t GetNbMsTot()
Definition: CbmMcbm2018TofPar.h:79
CbmMcbm2018TofPar::GetGdpbId
Int_t GetGdpbId(Int_t i)
Definition: CbmMcbm2018TofPar.h:67
CbmCheckDataFormatGdpb2018::fuGdpbId
UInt_t fuGdpbId
Definition: CbmCheckDataFormatGdpb2018.h:125
gdpbv100::Message::getGdpbEpSync
bool getGdpbEpSync() const
Definition: gDpbMessv100.h:232
CbmCheckDataFormatGdpb2018::fdStartTimeMsSz
Double_t fdStartTimeMsSz
Definition: CbmCheckDataFormatGdpb2018.h:155
CbmMcbm2018TofPar.h
gdpbv100::SYS_GET4_ERROR
@ SYS_GET4_ERROR
Definition: gDpbMessv100.h:70
CbmCheckDataFormatGdpb2018::fcSummary
TCanvas * fcSummary
Canvases.
Definition: CbmCheckDataFormatGdpb2018.h:199
CbmCheckDataFormatGdpb2018::fbIgnoreOverlapMs
Bool_t fbIgnoreOverlapMs
Definition: CbmCheckDataFormatGdpb2018.h:80
CbmCheckDataFormatGdpb2018::SetParContainers
void SetParContainers()
Definition: CbmCheckDataFormatGdpb2018.cxx:141
gdpbv100::MSG_HIT
@ MSG_HIT
Definition: gDpbMessv100.h:59
CbmCheckDataFormatGdpb2018::ResetAllHistos
void ResetAllHistos()
Definition: CbmCheckDataFormatGdpb2018.cxx:1373
CbmCheckDataFormatGdpb2018::fhPatternResync
TH2 * fhPatternResync
Definition: CbmCheckDataFormatGdpb2018.h:181
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmCheckDataFormatGdpb2018::fvuGdpbNbEpochPerMs
std::vector< UInt_t > fvuGdpbNbEpochPerMs
Definition: CbmCheckDataFormatGdpb2018.h:183
gdpbv100::Message::getGdpbSysPattType
uint16_t getGdpbSysPattType() const
Definition: gDpbMessv100.h:259
gdpbv100::MSG_SLOWC
@ MSG_SLOWC
Definition: gDpbMessv100.h:61
gdpbv100::Message::setGdpbGenChipId
void setGdpbGenChipId(uint32_t v)
Definition: gDpbMessv100.h:215
CbmCheckDataFormatGdpb2018::fvhChannelRatePerMs_gDPB
std::vector< TProfile2D * > fvhChannelRatePerMs_gDPB
Definition: CbmCheckDataFormatGdpb2018.h:196
CbmCheckDataFormatGdpb2018::fuNrOfGet4PerGdpb
UInt_t fuNrOfGet4PerGdpb
Definition: CbmCheckDataFormatGdpb2018.h:103
gdpbv100::Message::getMessageType
uint8_t getMessageType() const
Returns the message type. Valid for all message types. 4 bit.
Definition: gDpbMessv100.h:206
gdpbv100::MSG_STAR_TRI_D
@ MSG_STAR_TRI_D
Definition: gDpbMessv100.h:66
CbmCheckDataFormatGdpb2018::fhHitsPerMsFirstChan_gDPB
std::vector< TH2 * > fhHitsPerMsFirstChan_gDPB
Definition: CbmCheckDataFormatGdpb2018.h:195
gdpbv100::Message::getGdpbSysSubType
uint16_t getGdpbSysSubType() const
Definition: gDpbMessv100.h:245
CbmCheckDataFormatGdpb2018::fuMinNbGdpb
UInt_t fuMinNbGdpb
Definition: CbmCheckDataFormatGdpb2018.h:91
CbmCheckDataFormatGdpb2018::fhSysMessType
TH1 * fhSysMessType
Definition: CbmCheckDataFormatGdpb2018.h:162
gdpbv100::GET4_V2X_ERR_TOKEN
@ GET4_V2X_ERR_TOKEN
Definition: gDpbMessv100.h:116
CbmCheckDataFormatGdpb2018::fhEpochsJumpDigitsPre_gDPB
std::vector< TH2 * > fhEpochsJumpDigitsPre_gDPB
Definition: CbmCheckDataFormatGdpb2018.h:191
CbmCheckDataFormatGdpb2018::fhEpochsPerMs_gDPB
std::vector< TH1 * > fhEpochsPerMs_gDPB
Definition: CbmCheckDataFormatGdpb2018.h:185
gdpbv100::GET4_V2X_ERR_CHAN_STATE
@ GET4_V2X_ERR_CHAN_STATE
Definition: gDpbMessv100.h:114
CbmMcbm2018TofPar::GetNrOfGbtx
Int_t GetNrOfGbtx()
Definition: CbmMcbm2018TofPar.h:72
gdpbv100::Message::isStarTrigger
bool isStarTrigger() const
Returns true is message type is MSG_STAR_TRI_A, _B, _C, _D (STAR Trigger message)
Definition: gDpbMessv100.h:329
CbmMcbm2018TofPar::GetNbMsOverlap
Int_t GetNbMsOverlap()
Definition: CbmMcbm2018TofPar.h:80
gdpbv100::Message::getGdpbSysErrData
uint16_t getGdpbSysErrData() const
Definition: gDpbMessv100.h:253
CbmCheckDataFormatGdpb2018::fuNrOfFeePerGdpb
UInt_t fuNrOfFeePerGdpb
Definition: CbmCheckDataFormatGdpb2018.h:97
CbmCheckDataFormatGdpb2018::fuNrOfChannelsPerFee
UInt_t fuNrOfChannelsPerFee
Definition: CbmCheckDataFormatGdpb2018.h:101
CbmHistManager.h
Histogram manager.
CbmCheckDataFormatGdpb2018::AddMsComponentToList
virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Definition: CbmCheckDataFormatGdpb2018.cxx:213
CbmCheckDataFormatGdpb2018::fhCloseEpochPerMs_gDPB
std::vector< TH2 * > fhCloseEpochPerMs_gDPB
Definition: CbmCheckDataFormatGdpb2018.h:194
gdpbv100::GET4_V2X_ERR_DLL_LOCK
@ GET4_V2X_ERR_DLL_LOCK
Definition: gDpbMessv100.h:119
gdpbv100::GET4_V2X_ERR_FIFO_WRITE
@ GET4_V2X_ERR_FIFO_WRITE
Definition: gDpbMessv100.h:112
CbmCheckDataFormatGdpb2018::fvvuChanNbHitsPerMs
std::vector< std::vector< UInt_t > > fvvuChanNbHitsPerMs
Definition: CbmCheckDataFormatGdpb2018.h:184
CbmMcbm2018TofPar::GetNrOfGdpbs
Int_t GetNrOfGdpbs()
FIXME: replace with method returning the correspondign constants! see Star2019 parameter.
Definition: CbmMcbm2018TofPar.h:66
CbmCheckDataFormatGdpb2018::fuGdpbNr
UInt_t fuGdpbNr
Definition: CbmCheckDataFormatGdpb2018.h:127
gdpbv100::PATT_MISSMATCH
@ PATT_MISSMATCH
Definition: gDpbMessv100.h:81
gdpbv100::GET4_V2X_ERR_UNKNOWN
@ GET4_V2X_ERR_UNKNOWN
Definition: gDpbMessv100.h:130
CbmCheckDataFormatGdpb2018::fuNrOfChannelsPerGet4
UInt_t fuNrOfChannelsPerGet4
Definition: CbmCheckDataFormatGdpb2018.h:99
gdpbv100::MSG_STAR_TRI_C
@ MSG_STAR_TRI_C
Definition: gDpbMessv100.h:65
CbmCheckDataFormatGdpb2018::fhGet4MessType
TH2 * fhGet4MessType
Per GET4 in system.
Definition: CbmCheckDataFormatGdpb2018.h:164
CbmCheckDataFormatGdpb2018::fuCoreMs
size_t fuCoreMs
Definition: CbmCheckDataFormatGdpb2018.h:88
CbmCheckDataFormatGdpb2018::fGdpbIdIndexMap
std::map< UInt_t, UInt_t > fGdpbIdIndexMap
Map of ID to index for the gDPBs.
Definition: CbmCheckDataFormatGdpb2018.h:149
CbmCheckDataFormatGdpb2018::Init
virtual Bool_t Init()
Definition: CbmCheckDataFormatGdpb2018.cxx:130
gdpbv100::PATT_RESYNC
@ PATT_RESYNC
Definition: gDpbMessv100.h:83
gdpbv100::GET4_V2X_ERR_EP
@ GET4_V2X_ERR_EP
Definition: gDpbMessv100.h:111
h
Data class with information on a STS local track.
CbmCheckDataFormatGdpb2018::Finish
virtual void Finish()
Definition: CbmCheckDataFormatGdpb2018.cxx:1276
gdpbv100::GET4_V2X_ERR_SYNC
@ GET4_V2X_ERR_SYNC
Definition: gDpbMessv100.h:109
gdpbv100::GET4_V2X_ERR_EP_CNT_SYNC
@ GET4_V2X_ERR_EP_CNT_SYNC
Definition: gDpbMessv100.h:110
CbmCheckDataFormatGdpb2018::SaveAllHistos
void SaveAllHistos(TString sFileName="")
Definition: CbmCheckDataFormatGdpb2018.cxx:1278
gdpbv100::GET4_V2X_ERR_SEQUENCE_ER
@ GET4_V2X_ERR_SEQUENCE_ER
Definition: gDpbMessv100.h:127
CbmCheckDataFormatGdpb2018::Reset
virtual void Reset()
Definition: CbmCheckDataFormatGdpb2018.cxx:1274
CbmCheckDataFormatGdpb2018::fhEpochsPerMsPerTs_gDPB
std::vector< TH2 * > fhEpochsPerMsPerTs_gDPB
Definition: CbmCheckDataFormatGdpb2018.h:186
CbmCheckDataFormatGdpb2018::SetNbMsInTs
virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
Definition: CbmCheckDataFormatGdpb2018.cxx:250
gdpbv100::GET4_V2X_ERR_TOK_RING_ST
@ GET4_V2X_ERR_TOK_RING_ST
Definition: gDpbMessv100.h:115
CbmCheckDataFormatGdpb2018::fuNbCoreMsPerTs
size_t fuNbCoreMsPerTs
Definition: CbmCheckDataFormatGdpb2018.h:77
CbmCheckDataFormatGdpb2018::fvulCurrentEpoch
std::vector< ULong64_t > fvulCurrentEpoch
Definition: CbmCheckDataFormatGdpb2018.h:140
gdpbv100::kuChipIdMergedEpoch
const uint32_t kuChipIdMergedEpoch
Definition: gDpbMessv100.h:51
gdpbv100::GET4_V2X_ERR_ADD_RIS_EDG
@ GET4_V2X_ERR_ADD_RIS_EDG
Definition: gDpbMessv100.h:125
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmCheckDataFormatGdpb2018::fuNbOverMsPerTs
size_t fuNbOverMsPerTs
Definition: CbmCheckDataFormatGdpb2018.h:78
CbmCheckDataFormatGdpb2018::fhPatternMissmatch
TH2 * fhPatternMissmatch
Pattern messages per gDPB.
Definition: CbmCheckDataFormatGdpb2018.h:179
CbmCheckDataFormatGdpb2018::fhEpochsJumpBitsPre_gDPB
std::vector< TH2 * > fhEpochsJumpBitsPre_gDPB
Definition: CbmCheckDataFormatGdpb2018.h:189
gdpbv100::MSG_SYST
@ MSG_SYST
Definition: gDpbMessv100.h:62
CbmCheckDataFormatGdpb2018::fvhMsSzPerLink
std::vector< TH1 * > fvhMsSzPerLink
Definition: CbmCheckDataFormatGdpb2018.h:156
CbmCheckDataFormatGdpb2018::fuTotalMsNb
size_t fuTotalMsNb
Definition: CbmCheckDataFormatGdpb2018.h:85
CbmCheckDataFormatGdpb2018::fuNrOfGbtx
UInt_t fuNrOfGbtx
Definition: CbmCheckDataFormatGdpb2018.h:106
CbmCheckDataFormatGdpb2018::fhGdpbEpochFlags
TH2 * fhGdpbEpochFlags
Definition: CbmCheckDataFormatGdpb2018.h:172
CbmCheckDataFormatGdpb2018::fhMessType
TH1 * fhMessType
In System.
Definition: CbmCheckDataFormatGdpb2018.h:161
CbmCheckDataFormatGdpb2018::fdMsIndex
Double_t fdMsIndex
Definition: CbmCheckDataFormatGdpb2018.h:124
CbmCheckDataFormatGdpb2018::CbmCheckDataFormatGdpb2018
CbmCheckDataFormatGdpb2018()
Definition: CbmCheckDataFormatGdpb2018.cxx:47
CbmCheckDataFormatGdpb2018::fhGdpbMessType
TH2 * fhGdpbMessType
Per Gdpb.
Definition: CbmCheckDataFormatGdpb2018.h:169
gdpbv100::GET4_V2X_ERR_TOT_RANGE
@ GET4_V2X_ERR_TOT_RANGE
Definition: gDpbMessv100.h:123
CbmCheckDataFormatGdpb2018::fhGet4ChanErrors
TH2 * fhGet4ChanErrors
Definition: CbmCheckDataFormatGdpb2018.h:166
FormatMsHeaderPrintout
std::string FormatMsHeaderPrintout(const fles::MicrosliceDescriptor &msDescriptor)
Definition: CbmFormatMsHeaderPrintout.cxx:5
gdpbv100::GET4_V2X_ERR_DLL_RESET
@ GET4_V2X_ERR_DLL_RESET
Definition: gDpbMessv100.h:120
CbmCheckDataFormatGdpb2018::fdMsSizeInNs
Double_t fdMsSizeInNs
Definition: CbmCheckDataFormatGdpb2018.h:89
gdpbv100::GET4_V2X_ERR_SPI
@ GET4_V2X_ERR_SPI
Definition: gDpbMessv100.h:118
CbmCheckDataFormatGdpb2018::fTimeLastHistoSaving
std::chrono::time_point< std::chrono::system_clock > fTimeLastHistoSaving
Definition: CbmCheckDataFormatGdpb2018.h:206
gdpbv100::GET4_V2X_ERR_READ_INIT
@ GET4_V2X_ERR_READ_INIT
Definition: gDpbMessv100.h:108
CbmCheckDataFormatGdpb2018::fulCurrentTsIndex
uint64_t fulCurrentTsIndex
Definition: CbmCheckDataFormatGdpb2018.h:121
CbmMcbm2018TofPar
Definition: CbmMcbm2018TofPar.h:18
CbmMcbm2018TofPar::GetNrOfChannelsPerGet4
Int_t GetNrOfChannelsPerGet4()
Definition: CbmMcbm2018TofPar.h:70
CbmMcbm2018TofPar::GetSizeMsInNs
Double_t GetSizeMsInNs()
Definition: CbmMcbm2018TofPar.h:81
gdpbv100::MSG_EPOCH
@ MSG_EPOCH
Definition: gDpbMessv100.h:60
CbmCheckDataFormatGdpb2018::fcMsSizeAll
TCanvas * fcMsSizeAll
Histograms and histogram control variables.
Definition: CbmCheckDataFormatGdpb2018.h:153
gdpbv100::GET4_V2X_ERR_LOST_EVT
@ GET4_V2X_ERR_LOST_EVT
Definition: gDpbMessv100.h:113
CbmCheckDataFormatGdpb2018::fsHistoFilename
TString fsHistoFilename
Definition: CbmCheckDataFormatGdpb2018.h:118
CbmCheckDataFormatGdpb2018
Definition: CbmCheckDataFormatGdpb2018.h:33
CbmCheckDataFormatGdpb2018::fhEpochsJumpBitsNew_gDPB
std::vector< TH2 * > fhEpochsJumpBitsNew_gDPB
Definition: CbmCheckDataFormatGdpb2018.h:190
gdpbv100::Message::getGdpbHitIs24b
uint16_t getGdpbHitIs24b() const
Definition: gDpbMessv100.h:218
gdpbv100::Message::getGdpbEpEpochLoss
bool getGdpbEpEpochLoss() const
Definition: gDpbMessv100.h:234
gdpbv100::Message::getGdpbGenChipId
uint16_t getGdpbGenChipId() const
Definition: gDpbMessv100.h:214
CbmCheckDataFormatGdpb2018::fuNrOfGdpbs
UInt_t fuNrOfGdpbs
Definition: CbmCheckDataFormatGdpb2018.h:96
CbmCheckDataFormatGdpb2018::fiEquipmentId
Int_t fiEquipmentId
Definition: CbmCheckDataFormatGdpb2018.h:132
gdpbv100::GET4_V2X_ERR_READOUT_ERR
@ GET4_V2X_ERR_READOUT_ERR
Definition: gDpbMessv100.h:117
CbmCheckDataFormatGdpb2018::fhPatternEnable
TH2 * fhPatternEnable
Definition: CbmCheckDataFormatGdpb2018.h:180
CbmCheckDataFormatGdpb2018::fhEpochsDiff_gDPB
std::vector< TH1 * > fhEpochsDiff_gDPB
Definition: CbmCheckDataFormatGdpb2018.h:187
gdpbv100::Message::getGdpbEpDataLoss
bool getGdpbEpDataLoss() const
Definition: gDpbMessv100.h:233
gdpbv100::MSG_STAR_TRI_B
@ MSG_STAR_TRI_B
Definition: gDpbMessv100.h:64
CbmCheckDataFormatGdpb2018::ReInitContainers
Bool_t ReInitContainers()
Definition: CbmCheckDataFormatGdpb2018.cxx:162
CbmCheckDataFormatGdpb2018::fdTsCoreSizeInNs
Double_t fdTsCoreSizeInNs
Definition: CbmCheckDataFormatGdpb2018.h:90
gdpbv100::SYS_PATTERN
@ SYS_PATTERN
Definition: gDpbMessv100.h:76
CbmCheckDataFormatGdpb2018::fhGdpbEpochSyncEvo
TH2 * fhGdpbEpochSyncEvo
Definition: CbmCheckDataFormatGdpb2018.h:173
CbmCheckDataFormatGdpb2018::fuNrOfChannelsPerGdpb
UInt_t fuNrOfChannelsPerGdpb
Definition: CbmCheckDataFormatGdpb2018.h:104
CbmCheckDataFormatGdpb2018::fhEpochsJumpDigitsNew_gDPB
std::vector< TH2 * > fhEpochsJumpDigitsNew_gDPB
Definition: CbmCheckDataFormatGdpb2018.h:192
CbmCheckDataFormatGdpb2018::fuNrOfGet4PerFee
UInt_t fuNrOfGet4PerFee
Definition: CbmCheckDataFormatGdpb2018.h:98
CbmCheckDataFormatGdpb2018::~CbmCheckDataFormatGdpb2018
virtual ~CbmCheckDataFormatGdpb2018()
Definition: CbmCheckDataFormatGdpb2018.cxx:128
CbmCheckDataFormatGdpb2018::fuMsAcceptsPercent
size_t fuMsAcceptsPercent
/‍** Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice **‍/
Definition: CbmCheckDataFormatGdpb2018.h:84
CbmCheckDataFormatGdpb2018::fuGet4Id
UInt_t fuGet4Id
Definition: CbmCheckDataFormatGdpb2018.h:129
gdpbv100::Message::getGdpbHitChanId
uint16_t getGdpbHitChanId() const
Definition: gDpbMessv100.h:219
CbmCheckDataFormatGdpb2018.h
CbmCheckDataFormatGdpb2018::fuDiamondDpbIdx
UInt_t fuDiamondDpbIdx
Definition: CbmCheckDataFormatGdpb2018.h:117
CbmCheckDataFormatGdpb2018::InitContainers
Bool_t InitContainers()
Definition: CbmCheckDataFormatGdpb2018.cxx:148
gdpbv100::Message::getGdpbEpMissmatch
bool getGdpbEpMissmatch() const
Definition: gDpbMessv100.h:235
CbmMcbmUnpack
Definition: CbmMcbmUnpack.h:15
CbmCheckDataFormatGdpb2018::DoUnpack
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
Definition: CbmCheckDataFormatGdpb2018.cxx:860
CbmCheckDataFormatGdpb2018::fvMsComponentsList
std::vector< size_t > fvMsComponentsList
FLES containers.
Definition: CbmCheckDataFormatGdpb2018.h:72
CbmCheckDataFormatGdpb2018::fhEpochsDiffPerTs_gDPB
std::vector< TH2 * > fhEpochsDiffPerTs_gDPB
Definition: CbmCheckDataFormatGdpb2018.h:188
gdpbv100::PATT_ENABLE
@ PATT_ENABLE
Definition: gDpbMessv100.h:82
CbmMcbm2018TofPar::GetNrOfGet4PerFee
Int_t GetNrOfGet4PerFee()
Definition: CbmMcbm2018TofPar.h:69
gdpbv100::GET4_V2X_ERR_UNPAIR_FALL
@ GET4_V2X_ERR_UNPAIR_FALL
Definition: gDpbMessv100.h:126
gdpbv100::SYS_GET4_SYNC_MISS
@ SYS_GET4_SYNC_MISS
Definition: gDpbMessv100.h:73
CbmCheckDataFormatGdpb2018::fhStartEpochPerMs_gDPB
std::vector< TH2 * > fhStartEpochPerMs_gDPB
Definition: CbmCheckDataFormatGdpb2018.h:193
CbmCheckDataFormatGdpb2018::fuCurrentMs
size_t fuCurrentMs
Definition: CbmCheckDataFormatGdpb2018.h:122
CbmCheckDataFormatGdpb2018::fhGdpbSysMessPattType
TH2 * fhGdpbSysMessPattType
Definition: CbmCheckDataFormatGdpb2018.h:171
CbmFormatMsHeaderPrintout.h
CbmMcbm2018TofPar::GetNrOfFeesPerGdpb
Int_t GetNrOfFeesPerGdpb()
Definition: CbmMcbm2018TofPar.h:68
gdpbv100::GET4_V2X_ERR_EVT_DISCARD
@ GET4_V2X_ERR_EVT_DISCARD
Definition: gDpbMessv100.h:124
CbmCheckDataFormatGdpb2018::fvhGdpbGet4ChanErrors
std::vector< TH2 * > fvhGdpbGet4ChanErrors
Definition: CbmCheckDataFormatGdpb2018.h:177
gdpbv100::GET4_V2X_ERR_EPOCH_OVERF
@ GET4_V2X_ERR_EPOCH_OVERF
Definition: gDpbMessv100.h:128
CbmCheckDataFormatGdpb2018::fvhGdpbGet4MessType
std::vector< TH2 * > fvhGdpbGet4MessType
Per GET4 in gDPB.
Definition: CbmCheckDataFormatGdpb2018.h:176
gdpbv100::SYS_GDPB_UNKWN
@ SYS_GDPB_UNKWN
Definition: gDpbMessv100.h:71
CbmCheckDataFormatGdpb2018::fUnpackPar
CbmMcbm2018TofPar * fUnpackPar
Definition: CbmCheckDataFormatGdpb2018.h:95