CbmRoot
CbmMcbm2018MonitorMcbmPulser.cxx
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 // ----- -----
3 // ----- CbmMcbm2018MonitorMcbmPulser -----
4 // ----- Created 20/02/19 by P.-A. Loizeau -----
5 // ----- -----
6 // -----------------------------------------------------------------------------
7 
9 
10 // Data
11 
12 // CbmRoot
13 #include "CbmMcbm2018StsPar.h"
14 #include "CbmMcbm2018TofPar.h"
15 
16 // FairRoot
17 #include "FairLogger.h"
18 #include "FairRootManager.h"
19 #include "FairRun.h"
20 #include "FairRunOnline.h"
21 #include "FairRuntimeDb.h"
22 
23 // Root
24 #include "TClonesArray.h"
25 #include "TF1.h"
26 #include "THttpServer.h"
27 #include "TMath.h"
28 #include "TROOT.h"
29 #include "TRandom.h"
30 #include "TString.h"
31 #include "TStyle.h"
32 #include <TFile.h>
33 
34 // C++11
35 
36 // C/C++
37 #include <iomanip>
38 #include <iostream>
39 #include <stdint.h>
40 
41 Bool_t bMcbm2018ResetPulser = kFALSE;
42 Bool_t bMcbm2018WritePulser = kFALSE;
43 /*
44 Bool_t bMcbm2018ResetPulser = kFALSE;
45 Bool_t bMcbm2018WritePulser = kFALSE;
46 */
47 /*
48 Bool_t bMcbm2018SyncResetHistosTof = kFALSE;
49 Bool_t bMcbm2018SyncSaveHistosTof = kFALSE;
50 Bool_t bMcbm2018SyncUpdateZoomedFit = kFALSE;
51 */
52 
54  : CbmMcbmUnpack()
55  , fvMsComponentsListSts()
56  , fvMsComponentsListTof()
57  , fuNbCoreMsPerTs(0)
58  , fuNbOverMsPerTs(0)
59  , fbIgnoreOverlapMs(kFALSE)
60  , fUnpackParSts(nullptr)
61  , fuStsNrOfDpbs(0)
62  , fmStsDpbIdIndexMap()
63  , fuMuchDpbIdx(1)
64  , fUnpackParTof(nullptr)
65  , fuTofNrOfDpbs(0)
66  , fmTofDpbIdIndexMap()
67  , fuDiamondDpbIdx(2)
68  , fuTotalNrOfDpb(0)
69  , fdStsTofOffsetNs(0.0)
70  , fdMuchTofOffsetNs(0.0)
71  , fbUseBestPair(kFALSE)
72  , fbTsLevelAna(kFALSE)
73  , fsHistoFileFullname("data/mCBMsyncHistos.root")
74  , fbPrintMessages(kFALSE)
75  , fPrintMessCtrlSts(stsxyter::MessagePrintMask::msg_print_Human)
76  , fulCurrentTsIdx(0)
77  , fulCurrentMsIdx(0)
78  , fmMsgCounter()
79  , fuCurrentEquipmentId(0)
80  , fuCurrDpbId(0)
81  , fuCurrDpbIdx(0)
82  , fiRunStartDateTimeSec(-1)
83  , fiBinSizeDatePlots(-1)
84  , fvulStsCurrentTsMsb()
85  , fvuStsCurrentTsMsbCycle()
86  , fvmStsSdpbHitsInMs()
87  , fvmStsSdpbHitsInTs()
88  , fulTofCurrentTsIndex(0)
89  , fuTofCurrentMs(0)
90  , fdTofMsIndex(0)
91  , fuTofGdpbId(0)
92  , fuTofGdpbNr(0)
93  , fiTofEquipmentId(0)
94  , fviTofMsgCounter(1 + gdpbv100::MSG_STAR_TRI_D, 0)
95  , fvulTofCurrentEpoch()
96  , fvulTofCurrentEpochCycle()
97  , fvulTofCurrentEpochFull()
98  , fulTofCurrentEpochTime(0)
99  , fvmTofEpSupprBuffer()
100  , fvmTofGdpbHitsInMs()
101  , fvmTofGdpbHitsInTs()
102  , fhMcbmHitsNbPerMs()
103  , fvhMcbmTimeDiffToSelDpb()
104  , fvhMcbmTimeDiffToSelDpbWide()
105  , fvhMcbmTimeDiffToSelDpbTs()
106  , fvhMcbmTimeDiffToDiamondEvoDpb()
107  , fvhMcbmTimeDiffToDiamondWideEvoDpb()
108  , fvhMcbmTimeDiffToDiamondTsEvoDpb()
109  , fvhMcbmTimeDiffToTofEvoDpb()
110  , fvhMcbmTimeDiffToTofWideEvoDpb()
111  , fvhMcbmTimeDiffToTofTsEvoDpb() {}
112 
114 
116  LOG(info) << "Initializing flib StsXyter unpacker for STS";
117 
118  FairRootManager* ioman = FairRootManager::Instance();
119  if (ioman == nullptr) { LOG(fatal) << "No FairRootManager instance"; }
120 
121  return kTRUE;
122 }
123 
125  LOG(info) << "Setting parameter containers for " << GetName();
126  fUnpackParSts =
127  (CbmMcbm2018StsPar*) (FairRun::Instance()->GetRuntimeDb()->getContainer(
128  "CbmMcbm2018StsPar"));
129  fUnpackParTof =
130  (CbmMcbm2018TofPar*) (FairRun::Instance()->GetRuntimeDb()->getContainer(
131  "CbmMcbm2018TofPar"));
132 }
133 
134 
136  LOG(info) << "Init parameter containers for " << GetName();
137 
138  Bool_t bReInit = ReInitContainers();
142 
143  return bReInit;
144 }
145 
147  LOG(info) << "ReInit parameter containers for " << GetName();
148 
149  /***************** STS parameters *************************************/
151  LOG(info) << "Nr. of STS DPBs: " << fuStsNrOfDpbs;
152 
153  fmStsDpbIdIndexMap.clear();
154  for (UInt_t uDpb = 0; uDpb < fuStsNrOfDpbs; ++uDpb) {
156  LOG(info) << "Eq. ID for DPB #" << std::setw(2) << uDpb << " = 0x"
157  << std::setw(4) << std::hex << fUnpackParSts->GetDpbId(uDpb)
158  << std::dec << " => "
160  } // for( UInt_t uDpb = 0; uDpb < fuStsNrOfDpbs; ++uDpb )
161 
166  /***************** STS parameters *************************************/
167 
168  /***************** TOF parameters *************************************/
170  LOG(info) << "Nr. of Tof GDPBs: " << fuTofNrOfDpbs;
171 
172  fmTofDpbIdIndexMap.clear();
173  for (UInt_t i = 0; i < fuTofNrOfDpbs; ++i) {
175  LOG(info) << "GDPB Id of TOF " << i << " : " << std::hex
176  << fUnpackParTof->GetGdpbId(i) << std::dec;
177  } // for( UInt_t i = 0; i < fuTofNrOfDpbs; ++i )
178 
186  /***************** TOF parameters *************************************/
187 
188  return kTRUE;
189 }
190 
192  UShort_t usDetectorId) {
193  switch (usDetectorId) {
194  case 0x10: //fles::SubsystemIdentifier::STS:
195  {
196  AddMsComponentToListSts(component);
197  break;
198  } // case 0x10:
199  case 0x60: //fles::SubsystemIdentifier::RPC:
200  {
201  AddMsComponentToListTof(component);
202  break;
203  } // case 0x60:
204  default: {
205  LOG(warning) << "CbmMcbm2018MonitorStsSync::AddMsComponentToList => "
206  << "Ignore component " << component << " as detector id "
207  << usDetectorId << " is not supported by this unpacker.";
208  break;
209  } // default:
210  } // switch( iDetectorId )
211 }
214  for (UInt_t uCompIdx = 0; uCompIdx < fvMsComponentsListSts.size(); ++uCompIdx)
215  if (component == fvMsComponentsListSts[uCompIdx]) return;
216 
218  fvMsComponentsListSts.push_back(component);
219 }
222  for (UInt_t uCompIdx = 0; uCompIdx < fvMsComponentsListTof.size(); ++uCompIdx)
223  if (component == fvMsComponentsListTof[uCompIdx]) return;
224 
226  fvMsComponentsListTof.push_back(component);
227 }
229  size_t uOverlapMsNb) {
230  fuNbCoreMsPerTs = uCoreMsNb;
231  fuNbOverMsPerTs = uOverlapMsNb;
232 
233  // UInt_t uNbMsTotal = fuNbCoreMsPerTs + fuNbOverMsPerTs;
234 }
235 
236 /***************** STS Histograms *************************************/
238  TString sHistName {""};
239  TString title {""};
240  /*
241  sHistName = "hPulserMessageType";
242  title = "Nb of message for each type; Type";
243  fhStsMessType = new TH1I(sHistName, title, 5, 0., 5.);
244  fhStsMessType->GetXaxis()->SetBinLabel( 1, "Dummy");
245  fhStsMessType->GetXaxis()->SetBinLabel( 2, "Hit");
246  fhStsMessType->GetXaxis()->SetBinLabel( 3, "TsMsb");
247  fhStsMessType->GetXaxis()->SetBinLabel( 4, "Epoch");
248  fhStsMessType->GetXaxis()->SetBinLabel( 5, "Empty");
249 
250  // Online histo browser commands
251 #ifdef USE_HTTP_SERVER
252  THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
253  if( server )
254  {
255  server->Register("/StsRaw", fhStsMessType );
256 
257  server->RegisterCommand("/Reset_All_Pulser", "bMcbm2018ResetPulser=kTRUE");
258  server->RegisterCommand("/Write_All_Pulser", "bMcbm2018WritePulser=kTRUE");
259 
260  server->Restrict("/Reset_All_Pulser", "allow=admin");
261  server->Restrict("/Write_All_Pulser", "allow=admin");
262  } // if( server )
263 #endif
264 */
266  /*
267  Double_t w = 10;
268  Double_t h = 10;
269 
270  // Summary per StsXyter
271  for( UInt_t uXyterIdx = 0; uXyterIdx < fuStsNbStsXyters; ++uXyterIdx )
272  {
273  TCanvas* cStsSumm = new TCanvas( Form("cStsSum_%03u", uXyterIdx ),
274  Form("Summary plots for StsXyter %03u", uXyterIdx ),
275  w, h);
276  cStsSumm->Divide( 2, 2 );
277 
278  cStsSumm->cd(1);
279  gPad->SetLogy();
280  fhStsChanCntRaw[ uXyterIdx ]->Draw();
281 
282  cStsSumm->cd(2);
283  gPad->SetLogz();
284  fhStsChanAdcRaw[ uXyterIdx ]->Draw( "colz" );
285 
286  cStsSumm->cd(3);
287  gPad->SetLogz();
288  fhStsChanHitRateEvo[ uXyterIdx ]->Draw( "colz" );
289 
290  cStsSumm->cd(4);
291 // gPad->SetLogy();
292  fhStsChanAdcRawProf[ uXyterIdx ]->Draw();
293  } // for( UInt_t uXyterIdx = 0; uXyterIdx < fuStsNbStsXyters; ++uXyterIdx )
294 
295 //====================================================================//
296 */
297  /*****************************/
298  LOG(info) << "Done Creating STS Histograms";
299 }
300 /***************** STS Histograms *************************************/
301 
302 /***************** TOF Histograms *************************************/
304  TString sHistName {""};
305  TString title {""};
306 
307  /*******************************************************************/
308  /*
309 
310  sHistName = "hMessageType";
311  title = "Nb of message for each type; Type";
312  // Test Big Data readout with plotting
313  fhTofMessType = new TH1I(sHistName, title, 1 + gdpbv100::MSG_STAR_TRI_A, 0., 1 + gdpbv100::MSG_STAR_TRI_A);
314  fhTofMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_HIT, "HIT");
315  fhTofMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_EPOCH, "EPOCH");
316  fhTofMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_SLOWC, "SLOWC");
317  fhTofMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_SYST, "SYST");
318  fhTofMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_STAR_TRI_A, "MSG_STAR_TRI");
319 */
320  /*******************************************************************/
321  /*
322 #ifdef USE_HTTP_SERVER
323  THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
324  if( server )
325  {
326  server->Register("/TofRaw", fhTofMessType );
327 
328  server->RegisterCommand("/Reset_All_TOF", "bMcbm2018SyncResetHistosTof=kTRUE");
329  server->RegisterCommand("/Save_All_Tof", "bMcbm2018SyncSaveHistosTof=kTRUE");
330  server->RegisterCommand("/Update_PulsFit", "bMcbm2018SyncUpdateZoomedFit=kTRUE");
331 
332  server->Restrict("/Reset_All_Tof", "allow=admin");
333  server->Restrict("/Save_All_Tof", "allow=admin");
334  server->Restrict("/Update_PulsFit", "allow=admin");
335  } // if( server )
336 #endif
337 */
339  /*
340  Double_t w = 10;
341  Double_t h = 10;
342  TCanvas* cSummary = new TCanvas("cSummary", "gDPB Monitoring Summary", w, h);
343  cSummary->Divide(2, 3);
344 
345  // 1st Column: Messages types
346  cSummary->cd(1);
347  gPad->SetLogy();
348  fhTofMessType->Draw();
349 
350  cSummary->cd(2);
351  gPad->SetLogy();
352  fhTofSysMessType->Draw();
353 
354  cSummary->cd(3);
355  gPad->SetLogz();
356  fhTofGet4MessType->Draw("colz");
357 
358  // 2nd Column: GET4 Errors + Epoch flags + SCm
359  cSummary->cd(4);
360  gPad->SetLogz();
361  fhTofGet4ChanErrors->Draw("colz");
362 
363  cSummary->cd(5);
364  gPad->SetLogz();
365  fhTofGet4EpochFlags->Draw("colz");
366 
367  cSummary->cd(6);
368  fhTofGet4ChanScm->Draw("colz");
369 */
370  /*****************************/
371 
372  LOG(info) << "Done Creating TOF Histograms";
373 }
374 /***************** TOF Histograms *************************************/
375 
376 /***************** mCBM Histograms ************************************/
378  TString sHistName {""};
379  TString sHistTitle {""};
380 
382 
383  sHistName = "hMcbmHitsNbPerMs";
384  sHistTitle = "Nb of hits per DPB; Nb of hits []; DPB []";
385  fhMcbmHitsNbPerMs = new TH2D(sHistName,
386  sHistTitle,
387  1000.0,
388  0.,
389  1000.,
391  0.,
393 
394  for (UInt_t uDpb = 0; uDpb < fuTotalNrOfDpb; ++uDpb) {
395  sHistName = Form("hMcbmTimeDiffToDpb%02u", uDpb);
396  sHistTitle = Form("Time difference for STS and TOF hits, per DPB, against "
397  "any hits in DPB %02u; <tn - tRef> [ns]; DPB []",
398  uDpb);
399  fvhMcbmTimeDiffToSelDpb.push_back(
400  new TH2D(sHistName,
401  sHistTitle,
402  1001,
403  -500.5 * stsxyter::kdClockCycleNs,
404  500.5 * stsxyter::kdClockCycleNs,
406  0.,
407  fuTotalNrOfDpb));
408  sHistName = Form("hMcbmTimeDiffToDpb%02uWide", uDpb);
409  sHistTitle =
410  Form("Time difference for STS and TOF hits, per DPB, against any hits in "
411  "DPB %02u, wide range; <tn - tRef> [us]; DPB []",
412  uDpb);
413  fvhMcbmTimeDiffToSelDpbWide.push_back(new TH2D(sHistName,
414  sHistTitle,
415  6000.0,
416  -300.,
417  300.,
419  0.,
420  fuTotalNrOfDpb));
421  sHistName = Form("hMcbmTimeDiffToDpb%02uTs", uDpb);
422  sHistTitle =
423  Form("Time difference for STS and TOF hits, per DPB, against any hits in "
424  "DPB %02u, TS range; <tn - tRef> [ms]; DPB []",
425  uDpb);
426  fvhMcbmTimeDiffToSelDpbTs.push_back(new TH2D(sHistName,
427  sHistTitle,
428  2000.0,
429  -10.,
430  10.,
432  0.,
433  fuTotalNrOfDpb));
434 
435  sHistName = Form("hMcbmTimeDiffToDiamondEvoDpb%02u", uDpb);
436  sHistTitle =
437  Form("Evolution of time difference for STS or TOF hits from DPB %02u "
438  "against any Diamond hit; TS []; <tn - tDia> [ns]",
439  uDpb);
441  new TH2D(sHistName,
442  sHistTitle,
443  2000.0,
444  0.,
445  200000.,
446  1001,
447  -500.5 * stsxyter::kdClockCycleNs,
448  500.5 * stsxyter::kdClockCycleNs));
449 
450  sHistName = Form("hMcbmTimeDiffToDiamondWideEvoDpb%02u", uDpb);
451  sHistTitle =
452  Form("Evolution of time difference for STS or TOF hits from DPB %02u "
453  "against any Diamond hit, wide range; TS []; <tn - tDia> [us]",
454  uDpb);
455  fvhMcbmTimeDiffToDiamondWideEvoDpb.push_back(new TH2D(
456  sHistName, sHistTitle, 2000.0, 0., 200000., 4000.0, -200., 200.));
457 
458  sHistName = Form("hMcbmTimeDiffToDiamondTsEvoDpb%02u", uDpb);
459  sHistTitle =
460  Form("Evolution of time difference for STS or TOF hits from DPB %02u "
461  "against any Diamond hit, TS range; TS []; <tn - tDia> [ms]",
462  uDpb);
464  new TH2D(sHistName, sHistTitle, 2000.0, 0., 200000., 200.0, -10., 10.));
465 
466  sHistName = Form("hMcbmTimeDiffToTofEvoDpb%02u", uDpb);
467  sHistTitle = Form("Evolution of time difference for STS or TOF hits from "
468  "DPB %02u against any Tof hit; TS []; <tn - tTof> [ns]",
469  uDpb);
470  fvhMcbmTimeDiffToTofEvoDpb.push_back(
471  new TH2D(sHistName,
472  sHistTitle,
473  2000.0,
474  0.,
475  200000.,
476  1001,
477  -500.5 * stsxyter::kdClockCycleNs,
478  500.5 * stsxyter::kdClockCycleNs));
479 
480  sHistName = Form("hMcbmTimeDiffToTofWideEvoDpb%02u", uDpb);
481  sHistTitle =
482  Form("Evolution of time difference for STS or TOF hits from DPB %02u "
483  "against any Tof hit, wide range; TS []; <tn - tTof> [us]",
484  uDpb);
485  fvhMcbmTimeDiffToTofWideEvoDpb.push_back(new TH2D(
486  sHistName, sHistTitle, 2000.0, 0., 200000., 4000.0, -200., 200.));
487 
488  sHistName = Form("hMcbmTimeDiffToTofTsEvoDpb%02u", uDpb);
489  sHistTitle =
490  Form("Evolution of time difference for STS or TOF hits from DPB %02u "
491  "against any Tof hit, TS range; TS []; <tn - tTof> [ms]",
492  uDpb);
494  new TH2D(sHistName, sHistTitle, 2000.0, 0., 200000., 200.0, -10., 10.));
495  } // for( UInt_t uDpb = 0; uDpb < fuTotalNrOfDpb; ++uDpb )
496 #ifdef USE_HTTP_SERVER
497  THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
498  if (server) {
499  server->Register("/mCbmDt", fhMcbmHitsNbPerMs);
500 
501  for (UInt_t uDpb = 0; uDpb < fuTotalNrOfDpb; ++uDpb) {
502  server->Register("/mCbmDt", fvhMcbmTimeDiffToSelDpb[uDpb]);
503  server->Register("/mCbmDt", fvhMcbmTimeDiffToSelDpbWide[uDpb]);
504  server->Register("/mCbmDt", fvhMcbmTimeDiffToSelDpbTs[uDpb]);
505 
506  server->Register("/mCbmDt", fvhMcbmTimeDiffToDiamondEvoDpb[uDpb]);
507  server->Register("/mCbmDt", fvhMcbmTimeDiffToDiamondWideEvoDpb[uDpb]);
508  server->Register("/mCbmDt", fvhMcbmTimeDiffToDiamondTsEvoDpb[uDpb]);
509 
510  server->Register("/mCbmDt", fvhMcbmTimeDiffToTofEvoDpb[uDpb]);
511  server->Register("/mCbmDt", fvhMcbmTimeDiffToTofWideEvoDpb[uDpb]);
512  server->Register("/mCbmDt", fvhMcbmTimeDiffToTofTsEvoDpb[uDpb]);
513  } // for( UInt_t uDpb = 0; uDpb < fuTotalNrOfDpb; ++uDpb )
514 
515  server->RegisterCommand("/Reset_All", "bMcbm2018ResetPulser=kTRUE");
516  server->RegisterCommand("/Save_All", "bMcbm2018WritePulser=kTRUE");
517 
518  server->Restrict("/Reset_All", "allow=admin");
519  server->Restrict("/Save_All", "allow=admin");
520  } // if( server )
521 #endif
522 
523  Double_t w = 10;
524  Double_t h = 10;
526  for (UInt_t uDpb = 0; uDpb < fuTotalNrOfDpb; ++uDpb) {
527  TCanvas* cSyncMcbmDpb =
528  new TCanvas(Form("cSyncMcbmDpb%02u", uDpb),
529  Form("Time difference for STS and TOF hits, per DPB, against "
530  "any DPB %02u hit",
531  uDpb),
532  w,
533  h);
534  cSyncMcbmDpb->Divide(3);
535 
536  cSyncMcbmDpb->cd(1);
537  gPad->SetGridx();
538  gPad->SetGridy();
539  gPad->SetLogz();
540  fvhMcbmTimeDiffToSelDpb[uDpb]->Draw("colz");
541 
542  cSyncMcbmDpb->cd(2);
543  gPad->SetGridx();
544  gPad->SetGridy();
545  gPad->SetLogz();
546  fvhMcbmTimeDiffToSelDpbWide[uDpb]->Draw("colz");
547 
548  cSyncMcbmDpb->cd(3);
549  gPad->SetGridx();
550  gPad->SetGridy();
551  gPad->SetLogz();
552  fvhMcbmTimeDiffToSelDpbTs[uDpb]->Draw("colz");
553  } // for( UInt_t uDpb = 0; uDpb < fuTotalNrOfDpb; ++uDpb )
554  /*****************************/
555 
556  LOG(info) << "Done Creating mCBM Histograms";
557 }
558 /***************** mCBM Histograms ************************************/
559 
560 Bool_t CbmMcbm2018MonitorMcbmPulser::DoUnpack(const fles::Timeslice& ts,
561  size_t component) {
563  if (bMcbm2018ResetPulser) {
564  ResetAllHistos();
565  bMcbm2018ResetPulser = kFALSE;
566  } // if( bMcbm2018ResetPulser )
567  if (bMcbm2018WritePulser) {
569  bMcbm2018WritePulser = kFALSE;
570  } // if( bMcbm2018WritePulser )
571 
572  LOG(debug) << "Timeslice contains " << ts.num_microslices(component)
573  << "microslices.";
574  fulCurrentTsIdx = ts.index();
575 
577  if (0 == fulCurrentTsIdx) return kTRUE;
578 
579  if (fulCurrentTsIdx < 30) LOG(info) << Form("TS %2llu", fulCurrentTsIdx);
580 
581  // Ignore overlap ms if flag set by user
582  UInt_t uNbMsLoop = fuNbCoreMsPerTs;
583  if (kFALSE == fbIgnoreOverlapMs) uNbMsLoop += fuNbOverMsPerTs;
584 
585  // Loop over core microslices (and overlap ones if chosen)
586  for (UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx++) {
587  // Loop over registered STS components
588  for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsListSts.size();
589  ++uMsCompIdx) {
590  UInt_t uMsComp = fvMsComponentsListSts[uMsCompIdx];
591 
592  if (kFALSE == ProcessStsMs(ts, uMsComp, uMsIdx)) return kFALSE;
593  } // for( UInt_t uMsComp = 0; uMsComp < fvMsComponentsListSts.size(); ++uMsComp )
594 
595  // Loop over registered TOF components
596  for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsListTof.size();
597  ++uMsCompIdx) {
598  UInt_t uMsComp = fvMsComponentsListTof[uMsCompIdx];
599 
600  if (kFALSE == ProcessTofMs(ts, uMsComp, uMsIdx)) return kFALSE;
601  } // for( UInt_t uMsComp = 0; uMsComp < fvMsComponentsListSts.size(); ++uMsComp )
602 
603 
604  /****************** STS Sync ******************************************/
606  for (UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb)
607  std::sort(fvmStsSdpbHitsInMs[uSdpb].begin(),
608  fvmStsSdpbHitsInMs[uSdpb].end());
609  /****************** STS Sync ******************************************/
610 
611  /****************** TOF Sync ******************************************/
613  for (UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb)
614  std::sort(fvmTofGdpbHitsInMs[uGdpb].begin(),
615  fvmTofGdpbHitsInMs[uGdpb].end());
616  /****************** TOF Sync ******************************************/
617 
618  /****************** mCBM Sync *****************************************/
620  for (UInt_t uRefSdpb = 0; uRefSdpb < fuStsNrOfDpbs; ++uRefSdpb) {
621  UInt_t uNbRefHits = fvmStsSdpbHitsInMs[uRefSdpb].size();
622  for (UInt_t uHitRef = 0; uHitRef < uNbRefHits; uHitRef++) {
623  Double_t dRefTime = stsxyter::kdClockCycleNs
624  * fvmStsSdpbHitsInMs[uRefSdpb][uHitRef].GetTs();
625  if (fuMuchDpbIdx == uRefSdpb)
626  dRefTime -= fdMuchTofOffsetNs;
627  else
628  dRefTime -= fdStsTofOffsetNs;
629 
630  for (UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb) {
631  UInt_t uNbHits = fvmStsSdpbHitsInMs[uSdpb].size();
632  Double_t dBestDt = 1e9;
633  // UInt_t uBestAdc = 0;
634  UInt_t uNbIncrDt = 0;
635 
636  for (UInt_t uHit = 0; uHit < uNbHits; ++uHit) {
637  if (uRefSdpb == uSdpb && uHitRef == uHit) continue;
638 
639  Double_t dHitTime = stsxyter::kdClockCycleNs
640  * fvmStsSdpbHitsInMs[uSdpb][uHit].GetTs();
641  if (fuMuchDpbIdx == uSdpb)
642  dHitTime -= fdMuchTofOffsetNs;
643  else
644  dHitTime -= fdStsTofOffsetNs;
645 
646  Double_t dDt = dHitTime - dRefTime;
647 
648  if (kTRUE == fbUseBestPair) {
650  if (TMath::Abs(dDt) < TMath::Abs(dBestDt)) {
651  dBestDt = dDt;
652  // uBestAdc = fvmStsSdpbHitsInMs[ uSdpb ][ uHit ].GetAdc();
653  } // if( TMath::Abs( dDt ) < TMath::Abs( dBestDt ) )
654  else if (dBestDt < dDt)
655  uNbIncrDt++;
656 
658  if (5 == dBestDt) break;
659  } // if( kTRUE == fbUseBestPair )
660  else {
661  fvhMcbmTimeDiffToSelDpb[uRefSdpb]->Fill(dDt, uSdpb);
662  fvhMcbmTimeDiffToSelDpbWide[uRefSdpb]->Fill(dDt / 1000.0, uSdpb);
663  } // else of if( kTRUE == fbUseBestPair )
664  } // for( UInt_t uHit = 0; uHit < uNbHits; ++uHit )
665 
666  if (kTRUE == fbUseBestPair) {
667  fvhMcbmTimeDiffToSelDpb[uRefSdpb]->Fill(dBestDt, uSdpb);
668  fvhMcbmTimeDiffToSelDpbWide[uRefSdpb]->Fill(dBestDt / 1000.0,
669  uSdpb);
670  } // if( kTRUE == fbUseBestPair )
671  } // for( UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb )
672 
673  for (UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb) {
674  UInt_t uNbHits = fvmTofGdpbHitsInMs[uGdpb].size();
675  Double_t dBestDt = 1e9;
676  UInt_t uNbIncrDt = 0;
677 
678  for (UInt_t uHit = 0; uHit < uNbHits; ++uHit) {
679  Double_t dHitTime = fvmTofGdpbHitsInMs[uGdpb][uHit].GetFullTimeNs();
680 
681  Double_t dDt = dHitTime - dRefTime;
682 
683  if (kTRUE == fbUseBestPair) {
685  if (TMath::Abs(dDt) < TMath::Abs(dBestDt))
686  dBestDt = dDt;
687  else if (dBestDt < dDt)
688  uNbIncrDt++;
689 
691  if (5 == dBestDt) break;
692  } // if( kTRUE == fbUseBestPair )
693  else {
694  fvhMcbmTimeDiffToSelDpb[uRefSdpb]->Fill(dDt,
695  uGdpb + fuStsNrOfDpbs);
696  fvhMcbmTimeDiffToSelDpbWide[uRefSdpb]->Fill(
697  dDt / 1000.0, uGdpb + fuStsNrOfDpbs);
698  } // else of if( kTRUE == fbUseBestPair )
699  } // for( UInt_t uHit = 0; uHit < uNbHits; ++uHit )
700 
701  if (kTRUE == fbUseBestPair) {
702  fvhMcbmTimeDiffToSelDpb[uRefSdpb]->Fill(dBestDt,
703  uGdpb + fuStsNrOfDpbs);
704  fvhMcbmTimeDiffToSelDpbWide[uRefSdpb]->Fill(dBestDt / 1000.0,
705  uGdpb + fuStsNrOfDpbs);
706  } // if( kTRUE == fbUseBestPair )
707  } // for( UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb )
708  } // for( UInt_t uHitRef = 0; uHitRef < uNbRefHits; uHitRef++)
709  } // for( UInt_t uRefSdpb = 0; uRefSdpb < fuStsNrOfDpbs; ++uRefSdpb )
710 
712  for (UInt_t uRefGdpb = 0; uRefGdpb < fuTofNrOfDpbs; ++uRefGdpb) {
713  UInt_t uNbRefHits = fvmTofGdpbHitsInMs[uRefGdpb].size();
714  for (UInt_t uHitRef = 0; uHitRef < uNbRefHits; uHitRef++) {
715  Double_t dRefTime =
716  fvmTofGdpbHitsInMs[uRefGdpb][uHitRef].GetFullTimeNs();
717 
718  for (UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb) {
719  UInt_t uNbHits = fvmStsSdpbHitsInMs[uSdpb].size();
720  Double_t dBestDt = 1e9;
721  UInt_t uNbIncrDt = 0;
722 
723  for (UInt_t uHit = 0; uHit < uNbHits; ++uHit) {
724  Double_t dHitTime = stsxyter::kdClockCycleNs
725  * fvmStsSdpbHitsInMs[uSdpb][uHit].GetTs();
726  if (fuMuchDpbIdx == uSdpb)
727  dHitTime -= fdMuchTofOffsetNs;
728  else
729  dHitTime -= fdStsTofOffsetNs;
730 
731  Double_t dDt = dHitTime - dRefTime;
732 
733  if (kTRUE == fbUseBestPair) {
735  if (TMath::Abs(dDt) < TMath::Abs(dBestDt))
736  dBestDt = dDt;
737  else if (dBestDt < dDt)
738  uNbIncrDt++;
739 
741  if (5 == dBestDt) break;
742  } // if( kTRUE == fbUseBestPair )
743  else {
744  fvhMcbmTimeDiffToSelDpb[uRefGdpb + fuStsNrOfDpbs]->Fill(dDt,
745  uSdpb);
746  fvhMcbmTimeDiffToSelDpbWide[uRefGdpb + fuStsNrOfDpbs]->Fill(
747  dDt / 1000.0, uSdpb);
748 
749  if (fuDiamondDpbIdx == uRefGdpb) {
751  dDt);
753  dDt / 1000.0);
754  } // if( fuDiamondDpbIdx == uRefGdpb )
755  else {
756  fvhMcbmTimeDiffToTofEvoDpb[uSdpb]->Fill(fulCurrentTsIdx, dDt);
758  dDt / 1000.0);
759  } // else of if( fuDiamondDpbIdx == uRefGdpb )
760 
761  } // else of if( kTRUE == fbUseBestPair )
762  } // for( UInt_t uHit = 0; uHit < uNbHits; ++uHit )
763 
764  if (kTRUE == fbUseBestPair) {
765  fvhMcbmTimeDiffToSelDpb[uRefGdpb + fuStsNrOfDpbs]->Fill(dBestDt,
766  uSdpb);
767  fvhMcbmTimeDiffToSelDpbWide[uRefGdpb + fuStsNrOfDpbs]->Fill(
768  dBestDt / 1000.0, uSdpb);
769 
770  if (fuDiamondDpbIdx == uRefGdpb) {
772  dBestDt);
774  dBestDt / 1000.0);
775  } // if( fuDiamondDpbIdx == uRefGdpb )
776  else {
777  fvhMcbmTimeDiffToTofEvoDpb[uSdpb]->Fill(fulCurrentTsIdx, dBestDt);
779  dBestDt / 1000.0);
780  } // else of if( fuDiamondDpbIdx == uRefGdpb )
781  } // if( kTRUE == fbUseBestPair )
782  } // for( UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb )
783 
784  for (UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb) {
785  UInt_t uNbHits = fvmTofGdpbHitsInMs[uGdpb].size();
786  Double_t dBestDt = 1e9;
787  UInt_t uNbIncrDt = 0;
788 
789  for (UInt_t uHit = 0; uHit < uNbHits; ++uHit) {
790 
791  if (uRefGdpb == uGdpb && uHitRef == uHit) continue;
792 
793  Double_t dHitTime = fvmTofGdpbHitsInMs[uGdpb][uHit].GetFullTimeNs();
794 
795  Double_t dDt = dHitTime - dRefTime;
796 
797  if (kTRUE == fbUseBestPair) {
799  if (TMath::Abs(dDt) < TMath::Abs(dBestDt))
800  dBestDt = dDt;
801  else if (dBestDt < dDt)
802  uNbIncrDt++;
803 
805  if (5 == dBestDt) break;
806  } // if( kTRUE == fbUseBestPair )
807  else {
808  fvhMcbmTimeDiffToSelDpb[uRefGdpb + fuStsNrOfDpbs]->Fill(
809  dDt, uGdpb + fuStsNrOfDpbs);
810  fvhMcbmTimeDiffToSelDpbWide[uRefGdpb + fuStsNrOfDpbs]->Fill(
811  dDt / 1000.0, uGdpb + fuStsNrOfDpbs);
812 
813  if (fuDiamondDpbIdx == uRefGdpb) {
815  fulCurrentTsIdx, dDt);
817  fulCurrentTsIdx, dDt / 1000.0);
818  } // if( fuDiamondDpbIdx == uRefGdpb )
819  else {
821  fulCurrentTsIdx, dDt);
823  fulCurrentTsIdx, dDt / 1000.0);
824  } // else of if( fuDiamondDpbIdx == uRefGdpb )
825  } // else of if( kTRUE == fbUseBestPair )
826  } // for( UInt_t uHit = 0; uHit < uNbHits; ++uHit )
827 
828  if (kTRUE == fbUseBestPair) {
829  fvhMcbmTimeDiffToSelDpb[uRefGdpb + fuStsNrOfDpbs]->Fill(
830  dBestDt, uGdpb + fuStsNrOfDpbs);
831  fvhMcbmTimeDiffToSelDpbWide[uRefGdpb + fuStsNrOfDpbs]->Fill(
832  dBestDt / 1000.0, uGdpb + fuStsNrOfDpbs);
833 
834  if (fuDiamondDpbIdx == uRefGdpb) {
836  fulCurrentTsIdx, dBestDt);
838  fulCurrentTsIdx, dBestDt / 1000.0);
839  } // if( fuDiamondDpbIdx == uRefGdpb )
840  else {
842  fulCurrentTsIdx, dBestDt);
844  fulCurrentTsIdx, dBestDt / 1000.0);
845  } // else of if( fuDiamondDpbIdx == uRefGdpb )
846  } // if( kTRUE == fbUseBestPair )
847  } // for( UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb )
848  } // for( UInt_t uHitDia = 0; uHitDia < uNbRefHits; uHitDia++)
849  } // for( UInt_t uRefGdpb = 0; uRefGdpb < fuTofNrOfDpbs; ++uRefGdpb )
850 
852  for (UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb) {
853  fhMcbmHitsNbPerMs->Fill(fvmStsSdpbHitsInMs[uSdpb].size(), uSdpb);
854 
855  if (fbTsLevelAna)
856  fvmStsSdpbHitsInTs[uSdpb].insert(fvmStsSdpbHitsInTs[uSdpb].end(),
857  fvmStsSdpbHitsInMs[uSdpb].begin(),
858  fvmStsSdpbHitsInMs[uSdpb].end());
859 
860  fvmStsSdpbHitsInMs[uSdpb].clear();
861  } // for( UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb )
862  for (UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb) {
863  fhMcbmHitsNbPerMs->Fill(fvmTofGdpbHitsInMs[uGdpb].size(),
864  uGdpb + fuStsNrOfDpbs);
865 
866  if (fbTsLevelAna)
867  fvmTofGdpbHitsInTs[uGdpb].insert(fvmTofGdpbHitsInTs[uGdpb].end(),
868  fvmTofGdpbHitsInMs[uGdpb].begin(),
869  fvmTofGdpbHitsInMs[uGdpb].end());
870 
871  fvmTofGdpbHitsInMs[uGdpb].clear();
872  } // for( UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb )
873  /****************** mCBM Sync *****************************************/
874 
875  } // for( UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx ++ )
876 
877  /****************** mCBM Sync *****************************************/
879  for (UInt_t uRefSdpb = 0; uRefSdpb < fuStsNrOfDpbs; ++uRefSdpb) {
880  UInt_t uNbRefHits = fvmStsSdpbHitsInTs[uRefSdpb].size();
881  for (UInt_t uHitRef = 0; uHitRef < uNbRefHits; uHitRef++) {
882  Double_t dRefTime = stsxyter::kdClockCycleNs
883  * fvmStsSdpbHitsInTs[fuMuchDpbIdx][uHitRef].GetTs();
884  if (fuMuchDpbIdx == uRefSdpb)
885  dRefTime -= fdMuchTofOffsetNs;
886  else
887  dRefTime -= fdStsTofOffsetNs;
888 
889  for (UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb) {
890  UInt_t uNbHits = fvmStsSdpbHitsInTs[uSdpb].size();
891  // Double_t dBestDt = 1e9;
892  // UInt_t uBestAdc = 0;
893  // UInt_t uNbIncrDt = 0;
894 
895  for (UInt_t uHit = 0; uHit < uNbHits; ++uHit) {
896  if (uRefSdpb == uSdpb && uHitRef == uHit) continue;
897 
898  Double_t dHitTime =
899  stsxyter::kdClockCycleNs * fvmStsSdpbHitsInTs[uSdpb][uHit].GetTs();
900  if (fuMuchDpbIdx == uSdpb)
901  dHitTime -= fdMuchTofOffsetNs;
902  else
903  dHitTime -= fdStsTofOffsetNs;
904 
905  Double_t dDt = dHitTime - dRefTime;
906 
908  if (300e3 < dDt) break;
909 
910  fvhMcbmTimeDiffToSelDpbTs[uRefSdpb]->Fill(dDt / 1e6, uSdpb);
911  } // for( UInt_t uHit = 0; uHit < uNbHits; ++uHit )
912  } // for( UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb )
913 
914  for (UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb) {
915  UInt_t uNbHits = fvmTofGdpbHitsInTs[uGdpb].size();
916  // Double_t dBestDt = 1e9;
917  // UInt_t uNbIncrDt = 0;
918 
919  for (UInt_t uHit = 0; uHit < uNbHits; ++uHit) {
920  Double_t dHitTime = fvmTofGdpbHitsInTs[uGdpb][uHit].GetFullTimeNs();
921 
922  Double_t dDt = dHitTime - dRefTime;
923 
925  if (300e3 < dDt) break;
926 
927  fvhMcbmTimeDiffToSelDpbTs[uRefSdpb]->Fill(dDt / 1e6,
928  uGdpb + fuStsNrOfDpbs);
929  } // for( UInt_t uHit = 0; uHit < uNbHits; ++uHit )
930  } // for( UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb )
931  } // for( UInt_t uHitRef = 0; uHitRef < uNbRefHits; uHitRef++)
932  } // for( UInt_t uRefSdpb = 0; uRefSdpb < fuStsNrOfDpbs; ++uRefSdpb )
933 
935  for (UInt_t uRefGdpb = 0; uRefGdpb < fuTofNrOfDpbs; ++uRefGdpb) {
936  UInt_t uNbRefHits = fvmTofGdpbHitsInTs[uRefGdpb].size();
937  for (UInt_t uHitRef = 0; uHitRef < uNbRefHits; uHitRef++) {
938  Double_t dRefTime = fvmTofGdpbHitsInTs[uRefGdpb][uHitRef].GetFullTimeNs();
939 
940  for (UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb) {
941  UInt_t uNbHits = fvmStsSdpbHitsInTs[uSdpb].size();
942  for (UInt_t uHit = 0; uHit < uNbHits; ++uHit) {
943  Double_t dHitTime =
944  stsxyter::kdClockCycleNs * fvmStsSdpbHitsInTs[uSdpb][uHit].GetTs();
945 
946  Double_t dDt = dHitTime - dRefTime;
947 
949  if (300e3 < dDt) break;
950 
951  fvhMcbmTimeDiffToSelDpbTs[uRefGdpb + fuStsNrOfDpbs]->Fill(dDt / 1e6,
952  uSdpb);
953 
954  if (fuDiamondDpbIdx == uRefGdpb)
956  dDt / 1e6);
957  else
959  dDt / 1e6);
960  } // for( UInt_t uHit = 0; uHit < uNbHits; ++uHit )
961  } // for( UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb )
962 
963  for (UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb) {
964  UInt_t uNbHits = fvmTofGdpbHitsInTs[uGdpb].size();
965  for (UInt_t uHit = 0; uHit < uNbHits; ++uHit) {
966  if (uRefGdpb == uGdpb && uHitRef == uHit) continue;
967 
968  Double_t dHitTime = fvmTofGdpbHitsInTs[uGdpb][uHit].GetFullTimeNs();
969 
970  Double_t dDt = dHitTime - dRefTime;
971 
973  if (300e3 < dDt) break;
974 
975  fvhMcbmTimeDiffToSelDpbTs[uRefGdpb + fuStsNrOfDpbs]->Fill(
976  dDt / 1e6, uGdpb + fuStsNrOfDpbs);
977 
978  if (fuDiamondDpbIdx == uRefGdpb)
980  fulCurrentTsIdx, dDt / 1e6);
981  else
983  fulCurrentTsIdx, dDt / 1e6);
984  } // for( UInt_t uHit = 0; uHit < uNbHits; ++uHit )
985  } // for( UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb )
986  } // for( UInt_t uHitRef = 0; uHitRef < uNbRefHits; uHitRef++)
987  } // for( UInt_t uRefGdpb = 0; uRefGdpb < fuTofNrOfDpbs; ++uRefGdpb )
988 
990  for (UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb) {
991  fvmStsSdpbHitsInTs[uSdpb].clear();
992  } // for( UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb )
993  for (UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb) {
994  fvmTofGdpbHitsInTs[uGdpb].clear();
995  } // for( UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb )
996 
997  /****************** mCBM Sync *****************************************/
998 
999  if (0 == ts.index() % 1000) {
1000  LOG(info) << "End of TS " << std::setw(7) << ts.index();
1001  } // if( 0 == ts.index() % 1000 )
1002 
1003  return kTRUE;
1004 }
1005 
1006 /****************** STS Sync ******************************************/
1007 Bool_t CbmMcbm2018MonitorMcbmPulser::ProcessStsMs(const fles::Timeslice& ts,
1008  size_t uMsComp,
1009  UInt_t uMsIdx) {
1010  auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
1011  fuCurrentEquipmentId = msDescriptor.eq_id;
1012  const uint8_t* msContent =
1013  reinterpret_cast<const uint8_t*>(ts.content(uMsComp, uMsIdx));
1014 
1015  uint32_t uSize = msDescriptor.size;
1016  fulCurrentMsIdx = msDescriptor.idx;
1017  // Double_t dMsTime = (1e-9) * static_cast<double>(fulCurrentMsIdx);
1018  LOG(debug) << "Microslice: " << fulCurrentMsIdx << " from EqId " << std::hex
1019  << fuCurrentEquipmentId << std::dec << " has size: " << uSize;
1020 
1021  fuCurrDpbId = static_cast<uint32_t>(fuCurrentEquipmentId & 0xFFFF);
1023 
1025  UInt_t uTsMsbCycleHeader = std::floor(
1027 
1028  if (0 == uMsIdx) {
1029  fvuStsCurrentTsMsbCycle[fuCurrDpbIdx] = uTsMsbCycleHeader;
1031  } // if( 0 == uMsIdx )
1032  else if (uTsMsbCycleHeader != fvuStsCurrentTsMsbCycle[fuCurrDpbIdx]
1033  && 4194303 != fvulStsCurrentTsMsb[fuCurrDpbIdx]) {
1034  LOG(warning)
1035  << "TS MSB cycle from MS header does not match current cycle from data "
1036  << "for TS " << std::setw(12) << fulCurrentTsIdx << " MS "
1037  << std::setw(12) << fulCurrentMsIdx << " MsInTs " << std::setw(3)
1038  << uMsIdx << " ====> " << fvuStsCurrentTsMsbCycle[fuCurrDpbIdx] << " VS "
1039  << uTsMsbCycleHeader;
1040  fvuStsCurrentTsMsbCycle[fuCurrDpbIdx] = uTsMsbCycleHeader;
1041  }
1042 
1043  // If not integer number of message in input buffer, print warning/error
1044  if (0 != (uSize % kuStsBytesPerMessage))
1045  LOG(error) << "The input microslice buffer does NOT "
1046  << "contain only complete nDPB messages!";
1047 
1048  // Compute the number of complete messages in the input microslice buffer
1049  uint32_t uNbMessages =
1050  (uSize - (uSize % kuStsBytesPerMessage)) / kuStsBytesPerMessage;
1051 
1052  // Prepare variables for the loop on contents
1053  const uint32_t* pInBuff = reinterpret_cast<const uint32_t*>(msContent);
1054 
1055  for (uint32_t uIdx = 0; uIdx < uNbMessages; ++uIdx) {
1056  // Fill message
1057  uint32_t ulData = static_cast<uint32_t>(pInBuff[uIdx]);
1058 
1059  stsxyter::Message mess(static_cast<uint32_t>(ulData & 0xFFFFFFFF));
1060 
1061  // Print message if requested
1062  if (fbPrintMessages) mess.PrintMess(std::cout, fPrintMessCtrlSts);
1063 
1064  stsxyter::MessType typeMess = mess.GetMessType();
1065  fmMsgCounter[typeMess]++;
1066 
1067  switch (typeMess) {
1068  case stsxyter::MessType::Hit: {
1069 
1070  FillStsHitInfo(mess, uMsIdx);
1071  break;
1072  } // case stsxyter::MessType::Hit :
1074  FillStsTsMsbInfo(mess, uIdx, uMsIdx);
1075  break;
1076  } // case stsxyter::MessType::TsMsb :
1078  // The first message in the TS is a special ones: EPOCH
1079  FillStsEpochInfo(mess);
1080 
1081  if (0 < uIdx)
1082  LOG(info) << "CbmMcbm2018MonitorMcbmPulser::DoUnpack => "
1083  << "EPOCH message at unexpected position in MS: message "
1084  << uIdx << " VS message 0 expected!";
1085  break;
1086  } // case stsxyter::MessType::TsMsb :
1090  break;
1091  } // case stsxyter::MessType::Dummy / ReadDataAck / Ack :
1092  default: {
1093  LOG(fatal)
1094  << "CbmMcbm2018MonitorMcbmPulser::DoUnpack => "
1095  << "Unknown message type, should never happen, stopping here!";
1096  }
1097  } // switch( mess.GetMessType() )
1098  } // for( uint32_t uIdx = 0; uIdx < uNbMessages; ++uIdx )
1099  return kTRUE;
1100 }
1101 
1103  const UInt_t& /*uMsIdx*/) {
1104  UShort_t usChan = mess.GetHitChannel();
1105  UShort_t usRawAdc = mess.GetHitAdc();
1106  // UShort_t usFullTs = mess.GetHitTimeFull();
1107  // UShort_t usTsOver = mess.GetHitTimeOver();
1108  UShort_t usRawTs = mess.GetHitTime();
1109 
1110  UInt_t uAsicIdx =
1111  0;
1112 
1113  if (fuCurrDpbIdx == fuMuchDpbIdx) {
1115  switch (usChan) {
1116  case 101:
1117  case 99:
1118  case 91:
1119  case 89:
1120  case 88:
1121  case 86:
1122  case 84:
1123  case 83:
1124  case 80:
1125  case 78:
1126  case 76:
1127  case 50:
1128  case 39:
1129  case 37:
1130  case 35:
1131  case 20: {
1132  return;
1133  break;
1134  } // if bad channel
1135  default: break;
1136  } // switch( usChan )
1137  } // if( fuCurrDpbIdx == fuMuchDpbIdx )
1138  else {
1140  if (usRawAdc < 15) return;
1141 
1143  uAsicIdx = fUnpackParSts->ElinkIdxToAsicIdx(kFALSE, mess.GetLinkIndex());
1144  UInt_t uChanIdx = usChan + fUnpackParSts->GetNbChanPerAsic() * uAsicIdx;
1145  switch (uChanIdx) {
1146  case 781:
1147  case 270:
1148  case 411:
1149  case 518: {
1150  return;
1151  break;
1152  } // if bad channel
1153  default: break;
1154  } // switch( mess.GetLinkIndex() )
1155  if ((0 == uChanIdx % 2) && (543 < uChanIdx) && (uChanIdx < 633)) {
1156  return;
1157  } // if bad channel
1158  } // else of if( fuCurrDpbIdx == fuMuchDpbIdx )
1159 
1160  // Compute the Full time stamp
1161  // Use TS w/o overlap bits as they will anyway come from the TS_MSB
1162  Long64_t ulStsHitTime = usRawTs;
1163 
1164  ulStsHitTime +=
1165  static_cast<ULong64_t>(stsxyter::kuHitNbTsBins)
1166  * static_cast<ULong64_t>(fvulStsCurrentTsMsb[fuCurrDpbIdx])
1167  + static_cast<ULong64_t>(stsxyter::kulTsCycleNbBins)
1168  * static_cast<ULong64_t>(fvuStsCurrentTsMsbCycle[fuCurrDpbIdx]);
1169 
1170  // Convert the Hit time in bins to Hit time in ns
1171  // Double_t dHitTimeNs = ulStsHitTime * stsxyter::kdClockCycleNs;
1172 
1173 
1174  // Pulser and MS
1175  fvmStsSdpbHitsInMs[fuCurrDpbIdx].push_back(
1176  stsxyter::FinalHit(ulStsHitTime, usRawAdc, uAsicIdx, usChan));
1177 }
1178 
1180  UInt_t uMessIdx,
1181  UInt_t uMsIdx) {
1182  UInt_t uVal = mess.GetTsMsbVal();
1183 
1184  // Update Status counters
1185  if (uVal < fvulStsCurrentTsMsb[fuCurrDpbIdx]) {
1186 
1187  LOG(info) << " TS " << std::setw(12) << fulCurrentTsIdx << " MS "
1188  << std::setw(12) << fulCurrentMsIdx << " DPB " << std::setw(2)
1189  << fuCurrDpbIdx << " Old TsMsb " << std::setw(5)
1190  << fvulStsCurrentTsMsb[fuCurrDpbIdx] << " Old MsbCy "
1191  << std::setw(5) << fvuStsCurrentTsMsbCycle[fuCurrDpbIdx]
1192  << " new TsMsb " << std::setw(5) << uVal;
1193 
1195  } // if( uVal < fvulStsCurrentTsMsb[fuCurrDpbIdx] )
1196  if (uVal != fvulStsCurrentTsMsb[fuCurrDpbIdx] + 1 && 0 != uVal
1197  && 4194303 != fvulStsCurrentTsMsb[fuCurrDpbIdx] && 1 != uMessIdx) {
1198  LOG(info) << "TS MSb Jump in "
1199  << " TS " << std::setw(12) << fulCurrentTsIdx << " MS "
1200  << std::setw(12) << fulCurrentMsIdx << " MS Idx " << std::setw(4)
1201  << uMsIdx << " Msg Idx " << std::setw(5) << uMessIdx << " DPB "
1202  << std::setw(2) << fuCurrDpbIdx << " => Old TsMsb "
1203  << std::setw(5) << fvulStsCurrentTsMsb[fuCurrDpbIdx]
1204  << " new TsMsb " << std::setw(5) << uVal;
1205  } // if( uVal + 1 != fvulStsCurrentTsMsb[fuCurrDpbIdx] && 4194303 != uVal && 0 != fvulStsCurrentTsMsb[fuCurrDpbIdx] )
1207  /*
1208  ULong64_t ulNewTsMsbTime = static_cast< ULong64_t >( stsxyter::kuHitNbTsBins )
1209  * static_cast< ULong64_t >( fvulStsCurrentTsMsb[fuCurrDpbIdx])
1210  + static_cast< ULong64_t >( stsxyter::kulTsCycleNbBins )
1211  * static_cast< ULong64_t >( fvuStsCurrentTsMsbCycle[fuCurrDpbIdx] );
1212 */
1213 }
1214 
1216  stsxyter::Message /*mess*/) {
1217  // UInt_t uVal = mess.GetTsMsbVal();
1218 }
1219 /****************** STS Sync ******************************************/
1220 
1221 /****************** TOF Sync ******************************************/
1222 
1223 Bool_t CbmMcbm2018MonitorMcbmPulser::ProcessTofMs(const fles::Timeslice& ts,
1224  size_t uMsComp,
1225  UInt_t uMsIdx) {
1226  auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
1227  fuCurrentEquipmentId = msDescriptor.eq_id;
1228  fdTofMsIndex = static_cast<double>(msDescriptor.idx);
1229  const uint8_t* msContent =
1230  reinterpret_cast<const uint8_t*>(ts.content(uMsComp, uMsIdx));
1231 
1232  uint32_t size = msDescriptor.size;
1233  // fulLastMsIdx = msDescriptor.idx;
1234  if (size > 0)
1235  LOG(debug) << "Microslice: " << msDescriptor.idx << " has size: " << size;
1236 
1237  Int_t messageType = -111;
1238 
1239  // If not integer number of message in input buffer, print warning/error
1240  if (0 != (size % kuTofBytesPerMessage))
1241  LOG(error) << "The input microslice buffer does NOT "
1242  << "contain only complete nDPB messages!";
1243 
1244  // Compute the number of complete messages in the input microslice buffer
1245  uint32_t uNbMessages =
1246  (size - (size % kuTofBytesPerMessage)) / kuTofBytesPerMessage;
1247 
1248  // Get the gDPB ID from the MS header
1251 
1252  // Prepare variables for the loop on contents
1253  const uint64_t* pInBuff = reinterpret_cast<const uint64_t*>(msContent);
1254  for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx++) {
1255  // Fill message
1256  uint64_t ulData = static_cast<uint64_t>(pInBuff[uIdx]);
1257  gdpbv100::Message mess(ulData);
1258 
1260  if (0 == uIdx) {
1261  FillTofEpochCycle(ulData);
1262  continue;
1263  } // if( 0 == uIdx )
1264 
1265  if (gLogger->IsLogNeeded(fair::Severity::debug2)) {
1266  mess.printDataCout();
1267  } // if (gLogger->IsLogNeeded( fair::Severity::debug2 ))
1268 
1269  // Increment counter for different message types
1270  // and fill the corresponding histogram
1271  messageType = mess.getMessageType();
1272  fviTofMsgCounter[messageType]++;
1273 
1274  switch (messageType) {
1275  case gdpbv100::MSG_HIT: {
1276  if (!mess.getGdpbHitIs24b()) {
1277  fvmTofEpSupprBuffer[fuTofGdpbNr].push_back(mess);
1278  } // if( !getGdpbHitIs24b() )
1279  break;
1280  } // case gdpbv100::MSG_HIT:
1281  case gdpbv100::MSG_EPOCH: {
1283  FillTofEpochInfo(mess);
1284  } // if this epoch message is a merged one valiud for all chips
1285  else
1286  LOG(fatal) << "Bad epoch: " << mess.getGdpbGenChipId();
1287  break;
1288  } // case gdpbv100::MSG_EPOCH:
1289  case gdpbv100::MSG_SLOWC:
1290  case gdpbv100::MSG_SYST:
1294  case gdpbv100::MSG_STAR_TRI_D: break;
1295  default:
1296  LOG(error) << "Message type " << std::hex << std::setw(2)
1297  << static_cast<uint16_t>(messageType)
1298  << " not included in Get4 unpacker.";
1299  } // switch( mess.getMessageType() )
1300  } // for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx ++)
1301 
1302  return kTRUE;
1303 }
1304 
1306  uint64_t ulEpochCycleVal = ulCycleData & gdpbv100::kulEpochCycleFieldSz;
1307  fvulTofCurrentEpochCycle[fuTofGdpbNr] = ulEpochCycleVal;
1308 
1309  return;
1310 }
1311 
1313  // UInt_t uChannel = mess.getGdpbHitChanId();
1314  // UInt_t uTot = mess.getGdpbHit32Tot();
1315  // UInt_t uFts = mess.getGdpbHitFineTs();
1316 
1317  ULong64_t ulCurEpochGdpbGet4 = fvulTofCurrentEpochFull[fuTofGdpbNr];
1318 
1319  // In Ep. Suppr. Mode, receive following epoch instead of previous
1320  if (0 < ulCurEpochGdpbGet4)
1321  ulCurEpochGdpbGet4--;
1322  else
1323  ulCurEpochGdpbGet4 = gdpbv100::kuEpochCounterSz; // Catch epoch cycle!
1324 
1325  // ULong_t ulHitTime = mess.getMsgFullTime(ulCurEpochGdpbGet4);
1326  // Double_t dHitTime = mess.getMsgFullTimeD(ulCurEpochGdpbGet4);
1327 
1328  // In 32b mode the coarse counter is already computed back to 112 FTS bins
1329  // => need to hide its contribution from the Finetime
1330  // => FTS = Fullt TS modulo 112
1331  // uFts = mess.getGdpbHitFullTs() % 112;
1332 
1334  fvmTofGdpbHitsInMs[fuTofGdpbNr].push_back(
1335  gdpbv100::FullMessage(mess, ulCurEpochGdpbGet4));
1336 }
1337 
1339  ULong64_t ulEpochNr = mess.getGdpbEpEpochNb();
1340 
1341  fvulTofCurrentEpoch[fuTofGdpbNr] = ulEpochNr;
1343  ulEpochNr
1345 
1346  fulTofCurrentEpochTime = mess.getMsgFullTime(ulEpochNr);
1347 
1350  if (0 < ulEpochNr)
1351  mess.setGdpbEpEpochNb(ulEpochNr - 1);
1352  else
1354 
1355  Int_t iBufferSize = fvmTofEpSupprBuffer[fuTofGdpbNr].size();
1356  if (0 < iBufferSize) {
1357  LOG(debug) << "Now processing stored messages for for gDPB " << fuTofGdpbNr
1358  << " with epoch number "
1359  << (fvulTofCurrentEpoch[fuTofGdpbNr] - 1);
1360 
1363  std::stable_sort(fvmTofEpSupprBuffer[fuTofGdpbNr].begin(),
1364  fvmTofEpSupprBuffer[fuTofGdpbNr].begin());
1365 
1366  for (Int_t iMsgIdx = 0; iMsgIdx < iBufferSize; iMsgIdx++) {
1368  } // for( Int_t iMsgIdx = 0; iMsgIdx < iBufferSize; iMsgIdx++ )
1369 
1371  } // if( 0 < fvmTofEpSupprBuffer[fuTofGdpbNr] )
1372 }
1373 /****************** TOF Sync ******************************************/
1374 
1375 /****************** STS histos ****************************************/
1376 /****************** STS histos ****************************************/
1377 
1378 /****************** TOF histos ****************************************/
1379 /****************** TOF Histos ****************************************/
1380 
1382 
1384  /*
1385  LOG(info) << "-------------------------------------";
1386  LOG(info) << "CbmMcbm2018MonitorMcbmPulser statistics are ";
1387  LOG(info) << " Hit messages: " << fmMsgCounter[ stsxyter::MessType::Hit ] << "\n"
1388  << " Ts MSB messages: " << fmMsgCounter[ stsxyter::MessType::TsMsb ] << "\n"
1389  << " Dummy messages: " << fmMsgCounter[ stsxyter::MessType::Dummy ] << "\n"
1390  << " Epoch messages: " << fmMsgCounter[ stsxyter::MessType::Epoch ] << "\n"
1391  << " Empty messages: " << fmMsgCounter[ stsxyter::MessType::Empty ];
1392 */
1393  LOG(info) << "-------------------------------------";
1394 
1396  SaveAllHistos();
1397 }
1398 
1399 
1401  TDirectory* oldDir = nullptr;
1402  TFile* histoFile = nullptr;
1403  if ("" != sFileName) {
1404  // Store current directory position to allow restore later
1405  oldDir = gDirectory;
1406  // open separate histo file in recreate mode
1407  histoFile = new TFile(sFileName, "RECREATE");
1408  histoFile->cd();
1409  } // if( "" != sFileName )
1410 
1411  /****************** STS Sync ******************************************/
1412  /****************** STS Sync ******************************************/
1413 
1414  /****************** MUCH Sync *****************************************/
1415  /****************** MUCH Sync *****************************************/
1416 
1417  /****************** TOF Sync ******************************************/
1418  /****************** TOF Sync ******************************************/
1419 
1420  /****************** mCBM Sync *****************************************/
1421  gDirectory->mkdir("mcbmDt");
1422  gDirectory->cd("mcbmDt");
1423 
1424  for (UInt_t uDpb = 0; uDpb < fuTotalNrOfDpb; ++uDpb) {
1425  fvhMcbmTimeDiffToSelDpb[uDpb]->Reset();
1426  fvhMcbmTimeDiffToSelDpbWide[uDpb]->Reset();
1427  fvhMcbmTimeDiffToSelDpbTs[uDpb]->Reset();
1428 
1429  fvhMcbmTimeDiffToDiamondEvoDpb[uDpb]->Write();
1430  fvhMcbmTimeDiffToDiamondWideEvoDpb[uDpb]->Write();
1431  fvhMcbmTimeDiffToDiamondTsEvoDpb[uDpb]->Write();
1432 
1433  fvhMcbmTimeDiffToTofEvoDpb[uDpb]->Write();
1434  fvhMcbmTimeDiffToTofWideEvoDpb[uDpb]->Write();
1435  fvhMcbmTimeDiffToTofTsEvoDpb[uDpb]->Write();
1436  } // for( UInt_t uDpb = 0; uDpb < fuTotalNrOfDpb; ++uDpb )
1437 
1438  gDirectory->cd("..");
1439  /****************** mCBM Sync *****************************************/
1440 
1441  if ("" != sFileName) {
1442  // Restore original directory position
1443  histoFile->Close();
1444  oldDir->cd();
1445  } // if( "" != sFileName )
1446 }
1448  /****************** STS Sync ******************************************/
1449  /****************** STS Sync ******************************************/
1450 
1451  /****************** MUCH Sync *****************************************/
1452  /****************** MUCH Sync *****************************************/
1453 
1454  /****************** TOF Sync ******************************************/
1455  /****************** TOF Sync ******************************************/
1456 
1457 
1458  /****************** mCBM Sync *****************************************/
1459  for (UInt_t uDpb = 0; uDpb < fuTotalNrOfDpb; ++uDpb) {
1460  fvhMcbmTimeDiffToSelDpb[uDpb]->Reset();
1461  fvhMcbmTimeDiffToSelDpbWide[uDpb]->Reset();
1462  fvhMcbmTimeDiffToSelDpbTs[uDpb]->Reset();
1463 
1464  fvhMcbmTimeDiffToDiamondEvoDpb[uDpb]->Reset();
1465  fvhMcbmTimeDiffToDiamondWideEvoDpb[uDpb]->Reset();
1466  fvhMcbmTimeDiffToDiamondTsEvoDpb[uDpb]->Reset();
1467 
1468  fvhMcbmTimeDiffToTofEvoDpb[uDpb]->Reset();
1469  fvhMcbmTimeDiffToTofWideEvoDpb[uDpb]->Reset();
1470  fvhMcbmTimeDiffToTofTsEvoDpb[uDpb]->Reset();
1471  } // for( UInt_t uDpb = 0; uDpb < fuTotalNrOfDpb; ++uDpb )
1472  /****************** mCBM Sync *****************************************/
1473 }
1474 
gdpbv100::MSG_STAR_TRI_A
@ MSG_STAR_TRI_A
Definition: gDpbMessv100.h:63
gdpbv100::Message
Definition: gDpbMessv100.h:133
CbmMcbm2018MonitorMcbmPulser::fvulTofCurrentEpochCycle
std::vector< ULong64_t > fvulTofCurrentEpochCycle
Definition: CbmMcbm2018MonitorMcbmPulser.h:183
CbmMcbm2018MonitorMcbmPulser::fvhMcbmTimeDiffToSelDpb
std::vector< TH2 * > fvhMcbmTimeDiffToSelDpb
Definition: CbmMcbm2018MonitorMcbmPulser.h:208
CbmMcbm2018MonitorMcbmPulser::DoUnpack
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:560
CbmMcbm2018MonitorMcbmPulser::fvulStsCurrentTsMsb
std::vector< ULong64_t > fvulStsCurrentTsMsb
Bin size in s for the plots with date as X axis.
Definition: CbmMcbm2018MonitorMcbmPulser.h:143
gdpbv100::Message::getGdpbEpEpochNb
uint32_t getGdpbEpEpochNb() const
Definition: gDpbMessv100.h:231
CbmMcbm2018MonitorMcbmPulser::FillStsEpochInfo
void FillStsEpochInfo(stsxyter::Message mess)
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:1215
CbmMcbm2018MonitorMcbmPulser::FillTofEpochInfo
void FillTofEpochInfo(gdpbv100::Message)
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:1338
CbmMcbm2018MonitorMcbmPulser::fUnpackParSts
CbmMcbm2018StsPar * fUnpackParSts
Definition: CbmMcbm2018MonitorMcbmPulser.h:98
CbmMcbm2018MonitorMcbmPulser::ProcessTofMs
Bool_t ProcessTofMs(const fles::Timeslice &ts, size_t uMsComp, UInt_t uMsIdx)
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:1223
CbmMcbm2018MonitorMcbmPulser::ReInitContainers
Bool_t ReInitContainers()
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:146
CbmMcbm2018TofPar::GetGdpbId
Int_t GetGdpbId(Int_t i)
Definition: CbmMcbm2018TofPar.h:67
CbmMcbm2018MonitorMcbmPulser::fdStsTofOffsetNs
Double_t fdStsTofOffsetNs
Definition: CbmMcbm2018MonitorMcbmPulser.h:110
CbmMcbm2018MonitorMcbmPulser::fUnpackParTof
CbmMcbm2018TofPar * fUnpackParTof
Unpacking and mapping parameters for TOF.
Definition: CbmMcbm2018MonitorMcbmPulser.h:104
CbmMcbm2018MonitorMcbmPulser::fuTofGdpbId
UInt_t fuTofGdpbId
Definition: CbmMcbm2018MonitorMcbmPulser.h:170
CbmMcbm2018TofPar.h
CbmMcbm2018MonitorMcbmPulser::fvhMcbmTimeDiffToTofTsEvoDpb
std::vector< TH2 * > fvhMcbmTimeDiffToTofTsEvoDpb
Definition: CbmMcbm2018MonitorMcbmPulser.h:218
stsxyter::Message
Definition: StsXyterMessage.h:165
gdpbv100::msg_print_Human
@ msg_print_Human
Definition: gDpbMessv100.h:91
stsxyter::MessType::Status
@ Status
CbmMcbm2018StsPar::GetDpbId
UInt_t GetDpbId(UInt_t uDpbIdx)
Definition: CbmMcbm2018StsPar.cxx:206
CbmMcbm2018MonitorMcbmPulser::fvmStsSdpbHitsInTs
std::vector< std::vector< stsxyter::FinalHit > > fvmStsSdpbHitsInTs
All hits (time in bins, ADC in bins, asic, channel) in last TS, sorted with "<" operator.
Definition: CbmMcbm2018MonitorMcbmPulser.h:150
gdpbv100::MSG_HIT
@ MSG_HIT
Definition: gDpbMessv100.h:59
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmMcbm2018MonitorMcbmPulser::CreateMcbmHistograms
void CreateMcbmHistograms()
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:377
gdpbv100::MSG_SLOWC
@ MSG_SLOWC
Definition: gDpbMessv100.h:61
CbmMcbm2018MonitorMcbmPulser::fuCurrDpbId
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
Definition: CbmMcbm2018MonitorMcbmPulser.h:134
CbmMcbm2018MonitorMcbmPulser::fsHistoFileFullname
TString fsHistoFileFullname
Definition: CbmMcbm2018MonitorMcbmPulser.h:122
CbmMcbm2018MonitorMcbmPulser::AddMsComponentToList
virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:191
CbmMcbm2018MonitorMcbmPulser::fviTofMsgCounter
std::vector< int > fviTofMsgCounter
Definition: CbmMcbm2018MonitorMcbmPulser.h:174
CbmMcbm2018MonitorMcbmPulser::kuTofBytesPerMessage
static const UInt_t kuTofBytesPerMessage
TODO => move to the message class!!
Definition: CbmMcbm2018MonitorMcbmPulser.h:118
CbmMcbm2018MonitorMcbmPulser::fvhMcbmTimeDiffToDiamondEvoDpb
std::vector< TH2 * > fvhMcbmTimeDiffToDiamondEvoDpb
Definition: CbmMcbm2018MonitorMcbmPulser.h:212
gdpbv100::Message::getMessageType
uint8_t getMessageType() const
Returns the message type. Valid for all message types. 4 bit.
Definition: gDpbMessv100.h:206
gdpbv100::Message::printDataCout
void printDataCout(unsigned kind=msg_print_Prefix|msg_print_Data, uint32_t epoch=0) const
Print message in human readable format to cout.
Definition: gDpbMessv100.cxx:172
gdpbv100::MSG_STAR_TRI_D
@ MSG_STAR_TRI_D
Definition: gDpbMessv100.h:66
stsxyter::Message::GetTsMsbVal
uint32_t GetTsMsbVal() const
For TS MSB data: Returns the TS MSB 22 bit field)
Definition: StsXyterMessage.h:334
CbmMcbm2018MonitorMcbmPulser::Finish
virtual void Finish()
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:1383
stsxyter::Message::GetLinkIndex
uint16_t GetLinkIndex() const
For all data: Returns the (global) index of the eLink on which the message was received (n bit field)
Definition: StsXyterMessage.h:249
CbmMcbm2018MonitorMcbmPulser::fhMcbmHitsNbPerMs
TH2 * fhMcbmHitsNbPerMs
Definition: CbmMcbm2018MonitorMcbmPulser.h:206
stsxyter::MessType
MessType
Message types.
Definition: StsXyterMessage.h:27
gdpbv100::Message::setGdpbEpEpochNb
void setGdpbEpEpochNb(uint32_t v)
Definition: gDpbMessv100.h:283
CbmMcbm2018MonitorMcbmPulser::fuCurrDpbIdx
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
Definition: CbmMcbm2018MonitorMcbmPulser.h:136
CbmMcbm2018MonitorMcbmPulser::fuTofGdpbNr
UInt_t fuTofGdpbNr
Definition: CbmMcbm2018MonitorMcbmPulser.h:172
CbmMcbm2018MonitorMcbmPulser::Reset
virtual void Reset()
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:1381
stsxyter::kulTsCycleNbBins
static const uint64_t kulTsCycleNbBins
Definition: StsXyterMessage.h:152
gdpbv100::kuEpochCounterSz
const uint32_t kuEpochCounterSz
Definition: gDpbMessv100.h:40
CbmMcbm2018MonitorMcbmPulser::fvhMcbmTimeDiffToTofWideEvoDpb
std::vector< TH2 * > fvhMcbmTimeDiffToTofWideEvoDpb
Definition: CbmMcbm2018MonitorMcbmPulser.h:217
CbmMcbm2018MonitorMcbmPulser::fuDiamondDpbIdx
UInt_t fuDiamondDpbIdx
Definition: CbmMcbm2018MonitorMcbmPulser.h:107
CbmMcbm2018MonitorMcbmPulser::ProcessStsMs
Bool_t ProcessStsMs(const fles::Timeslice &ts, size_t uMsComp, UInt_t uMsIdx)
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:1007
CbmMcbm2018MonitorMcbmPulser::fvmStsSdpbHitsInMs
std::vector< std::vector< stsxyter::FinalHit > > fvmStsSdpbHitsInMs
Current TS MSB cycle for DPB.
Definition: CbmMcbm2018MonitorMcbmPulser.h:148
CbmMcbm2018MonitorMcbmPulser::~CbmMcbm2018MonitorMcbmPulser
virtual ~CbmMcbm2018MonitorMcbmPulser()
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:113
CbmMcbm2018StsPar::GetNrOfDpbs
UInt_t GetNrOfDpbs()
Definition: CbmMcbm2018StsPar.h:83
CbmMcbm2018MonitorMcbmPulser::fmTofDpbIdIndexMap
std::map< UInt_t, UInt_t > fmTofDpbIdIndexMap
Total number of GDPBs in the system.
Definition: CbmMcbm2018MonitorMcbmPulser.h:106
CbmMcbm2018MonitorMcbmPulser::fbIgnoreOverlapMs
Bool_t fbIgnoreOverlapMs
Definition: CbmMcbm2018MonitorMcbmPulser.h:96
CbmMcbm2018MonitorMcbmPulser::Init
virtual Bool_t Init()
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:115
CbmMcbm2018MonitorMcbmPulser::SetNbMsInTs
virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:228
CbmMcbm2018MonitorMcbmPulser::ResetAllHistos
void ResetAllHistos()
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:1447
CbmMcbm2018MonitorMcbmPulser::SetParContainers
void SetParContainers()
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:124
CbmMcbm2018MonitorMcbmPulser.h
CbmMcbm2018MonitorMcbmPulser::fvMsComponentsListTof
std::vector< size_t > fvMsComponentsListTof
Definition: CbmMcbm2018MonitorMcbmPulser.h:92
CbmMcbm2018MonitorMcbmPulser::fbUseBestPair
Bool_t fbUseBestPair
Definition: CbmMcbm2018MonitorMcbmPulser.h:112
CbmMcbm2018MonitorMcbmPulser::AddMsComponentToListTof
void AddMsComponentToListTof(size_t component)
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:220
stsxyter::Message::GetHitAdc
uint16_t GetHitAdc() const
For Hit data: Returns ADC value (5 bit field)
Definition: StsXyterMessage.h:277
CbmMcbm2018MonitorMcbmPulser::CreateTofHistograms
void CreateTofHistograms()
Processing methods.
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:303
CbmMcbm2018TofPar::GetNrOfGdpbs
Int_t GetNrOfGdpbs()
FIXME: replace with method returning the correspondign constants! see Star2019 parameter.
Definition: CbmMcbm2018TofPar.h:66
CbmMcbm2018MonitorMcbmPulser::fuMuchDpbIdx
UInt_t fuMuchDpbIdx
Map of DPB Identifier to DPB index.
Definition: CbmMcbm2018MonitorMcbmPulser.h:102
CbmMcbm2018MonitorMcbmPulser::fulCurrentTsIdx
ULong64_t fulCurrentTsIdx
Definition: CbmMcbm2018MonitorMcbmPulser.h:127
gdpbv100::MSG_STAR_TRI_C
@ MSG_STAR_TRI_C
Definition: gDpbMessv100.h:65
stsxyter::MessType::Empty
@ Empty
CbmMcbm2018MonitorMcbmPulser::fbPrintMessages
Bool_t fbPrintMessages
Definition: CbmMcbm2018MonitorMcbmPulser.h:124
CbmMcbm2018MonitorMcbmPulser::fmStsDpbIdIndexMap
std::map< UInt_t, UInt_t > fmStsDpbIdIndexMap
Total number of Sts DPBs in system.
Definition: CbmMcbm2018MonitorMcbmPulser.h:101
h
Data class with information on a STS local track.
CbmMcbm2018MonitorMcbmPulser::fulCurrentMsIdx
ULong64_t fulCurrentMsIdx
Definition: CbmMcbm2018MonitorMcbmPulser.h:128
CbmMcbm2018MonitorMcbmPulser::fPrintMessCtrlSts
stsxyter::MessagePrintMask fPrintMessCtrlSts
Definition: CbmMcbm2018MonitorMcbmPulser.h:125
CbmMcbm2018MonitorMcbmPulser::fulTofCurrentEpochTime
ULong64_t fulTofCurrentEpochTime
Definition: CbmMcbm2018MonitorMcbmPulser.h:186
stsxyter::FinalHit
Definition: StsXyterFinalHit.h:16
stsxyter::MessType::Hit
@ Hit
CbmMcbm2018MonitorMcbmPulser::fvuStsCurrentTsMsbCycle
std::vector< UInt_t > fvuStsCurrentTsMsbCycle
Current TS MSB for each DPB.
Definition: CbmMcbm2018MonitorMcbmPulser.h:144
stsxyter::kuHitNbTsBins
static const uint32_t kuHitNbTsBins
Definition: StsXyterMessage.h:146
CbmMcbm2018MonitorMcbmPulser
Definition: CbmMcbm2018MonitorMcbmPulser.h:36
CbmMcbm2018StsPar::ElinkIdxToAsicIdx
UInt_t ElinkIdxToAsicIdx(Bool_t bFebType, UInt_t uElink)
Definition: CbmMcbm2018StsPar.h:69
CbmMcbm2018MonitorMcbmPulser::fvmTofEpSupprBuffer
std::vector< std::vector< gdpbv100::Message > > fvmTofEpSupprBuffer
Buffer for suppressed epoch processing.
Definition: CbmMcbm2018MonitorMcbmPulser.h:189
gdpbv100::kuChipIdMergedEpoch
const uint32_t kuChipIdMergedEpoch
Definition: gDpbMessv100.h:51
CbmMcbm2018MonitorMcbmPulser::fuTofNrOfDpbs
UInt_t fuTofNrOfDpbs
Definition: CbmMcbm2018MonitorMcbmPulser.h:105
CbmMcbm2018MonitorMcbmPulser::fmMsgCounter
std::map< stsxyter::MessType, UInt_t > fmMsgCounter
Definition: CbmMcbm2018MonitorMcbmPulser.h:130
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
gdpbv100::MSG_SYST
@ MSG_SYST
Definition: gDpbMessv100.h:62
CbmMcbm2018MonitorMcbmPulser::CbmMcbm2018MonitorMcbmPulser
CbmMcbm2018MonitorMcbmPulser()
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:53
CbmMcbm2018MonitorMcbmPulser::fvhMcbmTimeDiffToSelDpbWide
std::vector< TH2 * > fvhMcbmTimeDiffToSelDpbWide
Definition: CbmMcbm2018MonitorMcbmPulser.h:209
stsxyter::kdClockCycleNs
static const double kdClockCycleNs
Definition: StsXyterMessage.h:156
CbmMcbm2018StsPar
Definition: CbmMcbm2018StsPar.h:18
stsxyter::Message::GetMessType
MessType GetMessType() const
Returns the message type, see enum MessType.
Definition: StsXyterMessage.h:259
CbmMcbm2018MonitorMcbmPulser::FillTofEpochCycle
void FillTofEpochCycle(uint64_t ulCycleData)
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:1305
gdpbv100::MessagePrintMask
MessagePrintMask
Definition: gDpbMessv100.h:87
CbmMcbm2018MonitorMcbmPulser::fvhMcbmTimeDiffToDiamondWideEvoDpb
std::vector< TH2 * > fvhMcbmTimeDiffToDiamondWideEvoDpb
Definition: CbmMcbm2018MonitorMcbmPulser.h:213
CbmMcbm2018TofPar
Definition: CbmMcbm2018TofPar.h:18
CbmMcbm2018MonitorMcbmPulser::fdMuchTofOffsetNs
Double_t fdMuchTofOffsetNs
Definition: CbmMcbm2018MonitorMcbmPulser.h:111
CbmMcbm2018MonitorMcbmPulser::fdTofMsIndex
Double_t fdTofMsIndex
Definition: CbmMcbm2018MonitorMcbmPulser.h:169
CbmMcbm2018MonitorMcbmPulser::fvhMcbmTimeDiffToSelDpbTs
std::vector< TH2 * > fvhMcbmTimeDiffToSelDpbTs
Definition: CbmMcbm2018MonitorMcbmPulser.h:210
gdpbv100::MSG_EPOCH
@ MSG_EPOCH
Definition: gDpbMessv100.h:60
gdpbv100
Definition: gDpbMessv100.cxx:29
CbmMcbm2018MonitorMcbmPulser::kuStsBytesPerMessage
static const UInt_t kuStsBytesPerMessage
Definition: CbmMcbm2018MonitorMcbmPulser.h:116
stsxyter::Message::GetHitChannel
uint16_t GetHitChannel() const
For Hit data: Returns StsXYTER channel number (7 bit field)
Definition: StsXyterMessage.h:274
stsxyter::Message::PrintMess
bool PrintMess(std::ostream &os, MessagePrintMask ctrl=MessagePrintMask::msg_print_Human) const
Definition: StsXyterMessage.cxx:29
CbmMcbm2018MonitorMcbmPulser::fuTotalNrOfDpb
UInt_t fuTotalNrOfDpb
Global parameters.
Definition: CbmMcbm2018MonitorMcbmPulser.h:109
CbmMcbm2018MonitorMcbmPulser::fvulTofCurrentEpoch
std::vector< ULong64_t > fvulTofCurrentEpoch
Definition: CbmMcbm2018MonitorMcbmPulser.h:182
gdpbv100::kulEpochCycleFieldSz
const uint64_t kulEpochCycleFieldSz
Definition: gDpbMessv100.h:49
gdpbv100::Message::getGdpbHitIs24b
uint16_t getGdpbHitIs24b() const
Definition: gDpbMessv100.h:218
gdpbv100::Message::getGdpbGenChipId
uint16_t getGdpbGenChipId() const
Definition: gDpbMessv100.h:214
CbmMcbm2018MonitorMcbmPulser::fuNbCoreMsPerTs
size_t fuNbCoreMsPerTs
Definition: CbmMcbm2018MonitorMcbmPulser.h:93
CbmMcbm2018MonitorMcbmPulser::FillStsHitInfo
void FillStsHitInfo(stsxyter::Message mess, const UInt_t &uMsIdx)
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:1102
gdpbv100::MSG_STAR_TRI_B
@ MSG_STAR_TRI_B
Definition: gDpbMessv100.h:64
gdpbv100::kulEpochCycleBins
const uint64_t kulEpochCycleBins
Definition: gDpbMessv100.h:42
CbmMcbm2018MonitorMcbmPulser::fvhMcbmTimeDiffToTofEvoDpb
std::vector< TH2 * > fvhMcbmTimeDiffToTofEvoDpb
Definition: CbmMcbm2018MonitorMcbmPulser.h:216
bMcbm2018ResetPulser
Bool_t bMcbm2018ResetPulser
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:41
CbmMcbm2018MonitorMcbmPulser::SaveAllHistos
void SaveAllHistos(TString sFileName="")
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:1400
stsxyter::MessType::TsMsb
@ TsMsb
gdpbv100::FullMessage
Definition: gDpbMessv100.h:362
stsxyter::Message::GetHitTime
uint16_t GetHitTime() const
For Hit data: Returns timestamp (8 bit field, 2 MSB bits overlap removed)
Definition: StsXyterMessage.h:286
stsxyter::MessType::Dummy
@ Dummy
CbmMcbm2018StsPar.h
stsxyter::MessType::Epoch
@ Epoch
CbmMcbm2018MonitorMcbmPulser::CreateStsHistograms
void CreateStsHistograms()
All hits (time in bins, ADC in bins, asic, channel) in last TS, sorted with "<" operator.
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:237
CbmMcbm2018MonitorMcbmPulser::fuStsNrOfDpbs
UInt_t fuStsNrOfDpbs
Definition: CbmMcbm2018MonitorMcbmPulser.h:99
CbmMcbm2018MonitorMcbmPulser::fvmTofGdpbHitsInMs
std::vector< std::vector< gdpbv100::FullMessage > > fvmTofGdpbHitsInMs
Buffer for system sync check.
Definition: CbmMcbm2018MonitorMcbmPulser.h:192
CbmMcbm2018MonitorMcbmPulser::fvmTofGdpbHitsInTs
std::vector< std::vector< gdpbv100::FullMessage > > fvmTofGdpbHitsInTs
Definition: CbmMcbm2018MonitorMcbmPulser.h:193
gdpbv100::Message::getMsgFullTime
uint64_t getMsgFullTime(uint64_t epoch) const
Returns expanded and adjusted time of message (in ns)
Definition: gDpbMessv100.cxx:98
CbmMcbm2018MonitorMcbmPulser::fvMsComponentsListSts
std::vector< size_t > fvMsComponentsListSts
Definition: CbmMcbm2018MonitorMcbmPulser.h:86
bMcbm2018WritePulser
Bool_t bMcbm2018WritePulser
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:42
CbmMcbmUnpack
Definition: CbmMcbmUnpack.h:15
CbmMcbm2018MonitorMcbmPulser::AddMsComponentToListSts
void AddMsComponentToListSts(size_t component)
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:212
CbmMcbm2018MonitorMcbmPulser::fuNbOverMsPerTs
size_t fuNbOverMsPerTs
Definition: CbmMcbm2018MonitorMcbmPulser.h:94
CbmMcbm2018MonitorMcbmPulser::fvulTofCurrentEpochFull
std::vector< ULong64_t > fvulTofCurrentEpochFull
Definition: CbmMcbm2018MonitorMcbmPulser.h:184
CbmMcbm2018MonitorMcbmPulser::InitContainers
Bool_t InitContainers()
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:135
stsxyter
Definition: StsXyterFinalHit.h:12
CbmMcbm2018MonitorMcbmPulser::fbTsLevelAna
Bool_t fbTsLevelAna
Definition: CbmMcbm2018MonitorMcbmPulser.h:113
CbmMcbm2018MonitorMcbmPulser::FillTofHitInfo
void FillTofHitInfo(gdpbv100::Message)
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:1312
CbmMcbm2018StsPar::GetNbChanPerAsic
static constexpr UInt_t GetNbChanPerAsic()
Definition: CbmMcbm2018StsPar.h:52
CbmMcbm2018MonitorMcbmPulser::FillStsTsMsbInfo
void FillStsTsMsbInfo(stsxyter::Message mess, UInt_t uMessIdx=0, UInt_t uMsIdx=0)
Definition: CbmMcbm2018MonitorMcbmPulser.cxx:1179
CbmMcbm2018MonitorMcbmPulser::fuCurrentEquipmentId
UInt_t fuCurrentEquipmentId
Definition: CbmMcbm2018MonitorMcbmPulser.h:132
CbmMcbm2018MonitorMcbmPulser::fvhMcbmTimeDiffToDiamondTsEvoDpb
std::vector< TH2 * > fvhMcbmTimeDiffToDiamondTsEvoDpb
Definition: CbmMcbm2018MonitorMcbmPulser.h:214