CbmRoot
CbmMcbm2018MonitorMcbmRate.cxx
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 // ----- -----
3 // ----- CbmMcbm2018MonitorMcbmRate -----
4 // ----- Created 11/05/18 by P.-A. Loizeau -----
5 // ----- -----
6 // -----------------------------------------------------------------------------
7 
9 
11 
12 // Data
13 
14 // CbmRoot
15 #include "CbmMcbm2018StsPar.h"
16 #include "CbmMcbm2018TofPar.h"
17 
18 // FairRoot
19 #include "FairLogger.h"
20 #include "FairRootManager.h"
21 #include "FairRun.h"
22 #include "FairRunOnline.h"
23 #include "FairRuntimeDb.h"
24 
25 // Root
26 #include "TClonesArray.h"
27 #include "TF1.h"
28 #include "THttpServer.h"
29 #include "TMath.h"
30 #include "TROOT.h"
31 #include "TRandom.h"
32 #include "TString.h"
33 #include "TStyle.h"
34 #include <TFile.h>
35 
36 // C++11
37 
38 // C/C++
39 #include <iomanip>
40 #include <iostream>
41 #include <stdint.h>
42 /*
43 Bool_t bMcbm2018ResetSync = kFALSE;
44 Bool_t bMcbm2018WriteSync = kFALSE;
45 */
46 /*
47 Bool_t bMcbm2018ResetSync = kFALSE;
48 Bool_t bMcbm2018WriteSync = kFALSE;
49 */
50 /*
51 Bool_t bMcbm2018SyncResetHistosTof = kFALSE;
52 Bool_t bMcbm2018SyncSaveHistosTof = kFALSE;
53 Bool_t bMcbm2018SyncUpdateZoomedFit = kFALSE;
54 */
55 
57  : CbmMcbmUnpack()
58  , fvMsComponentsListSts()
59  , fvMsComponentsListTof()
60  , fuNbCoreMsPerTs(0)
61  , fuNbOverMsPerTs(0)
62  , fbIgnoreOverlapMs(kFALSE)
63  , fUnpackParSts(nullptr)
64  , fuStsNrOfDpbs(0)
65  , fmStsDpbIdIndexMap()
66  , fuMuchDpbIdx(1)
67  , fUnpackParTof(nullptr)
68  , fuTofNrOfDpbs(0)
69  , fmTofDpbIdIndexMap()
70  , fuDiamondDpbIdx(2)
71  , fuTotalNrOfDpb(0)
72  , fdStsTofOffsetNs(0.0)
73  , fdMuchTofOffsetNs(0.0)
74  , fsHistoFileFullname("data/mCBMsyncHistos.root")
75  , fbPrintMessages(kFALSE)
76  , fPrintMessCtrlSts(stsxyter::MessagePrintMask::msg_print_Human)
77  , fulCurrentTsIdx(0)
78  , fulCurrentMsIdx(0)
79  , fmMsgCounter()
80  , fuCurrentEquipmentId(0)
81  , fuCurrDpbId(0)
82  , fuCurrDpbIdx(0)
83  , fiRunStartDateTimeSec(-1)
84  , fiBinSizeDatePlots(-1)
85  , fvulStsCurrentTsMsb()
86  , fvuStsCurrentTsMsbCycle()
87  , fvmStsSdpbHitsInMs()
88  , fvmStsSdpbHitsInTs()
89  , fulTofCurrentTsIndex(0)
90  , fuTofCurrentMs(0)
91  , fdTofMsIndex(0)
92  , fuTofGdpbId(0)
93  , fuTofGdpbNr(0)
94  , fiTofEquipmentId(0)
95  , fviTofMsgCounter(1 + gdpbv100::MSG_STAR_TRI_D, 0)
96  , fvulTofCurrentEpoch()
97  , fvulTofCurrentEpochCycle()
98  , fvulTofCurrentEpochFull()
99  , fulTofCurrentEpochTime(0)
100  , fvmTofEpSupprBuffer()
101  , fvmTofGdpbHitsInMs()
102  , fvmTofGdpbHitsInTs()
103  , fvuHitsNbInTimeBinSts(kuNbTimeBins, 0)
104  , fvuHitsNbInTimeBinMuch(kuNbTimeBins, 0)
105  , fvuHitsNbInTimeBinTof(kuNbTimeBins, 0)
106  , fvuHitsNbInTimeBinDiam(kuNbTimeBins, 0)
107  , fhMcbmHitsNbPerTsEvo()
108  , fhMcbmHitsNbFineEvo()
109  , fhMcbmHitsRateEvo()
110  , fhDiamondHitsRateMapEvo()
111  , fhDiamondHitsRateDerivative()
112  , fhMuchVsStsHitsNbPerTimeBin()
113  , fhTofVsStsHitsNbPerTimeBin()
114  , fhDiamVsStsHitsNbPerTimeBin()
115  , fhStsVsMuchHitsNbPerTimeBin()
116  , fhTofVsMuchHitsNbPerTimeBin()
117  , fhDiamVsMuchHitsNbPerTimeBin()
118  , fhStsVsTofHitsNbPerTimeBin()
119  , fhMuchVsTofHitsNbPerTimeBin()
120  , fhDiamVsTofHitsNbPerTimeBin()
121  , fhStsVsDiamHitsNbPerTimeBin()
122  , fhTofVsDiamHitsNbPerTimeBin()
123  , fhMuchVsDiamHitsNbPerTimeBin() {}
124 
126 
128  LOG(info) << "Initializing flib StsXyter unpacker for STS";
129 
130  FairRootManager* ioman = FairRootManager::Instance();
131  if (ioman == nullptr) { LOG(fatal) << "No FairRootManager instance"; }
132 
133  return kTRUE;
134 }
135 
137  LOG(info) << "Setting parameter containers for " << GetName();
138  fUnpackParSts =
139  (CbmMcbm2018StsPar*) (FairRun::Instance()->GetRuntimeDb()->getContainer(
140  "CbmMcbm2018StsPar"));
141  fUnpackParTof =
142  (CbmMcbm2018TofPar*) (FairRun::Instance()->GetRuntimeDb()->getContainer(
143  "CbmMcbm2018TofPar"));
144 }
145 
146 
148  LOG(info) << "Init parameter containers for " << GetName();
149 
150  Bool_t bReInit = ReInitContainers();
154 
155  return bReInit;
156 }
157 
159  LOG(info) << "ReInit parameter containers for " << GetName();
160 
161  /***************** STS parameters *************************************/
163  LOG(info) << "Nr. of STS DPBs: " << fuStsNrOfDpbs;
164 
165  fmStsDpbIdIndexMap.clear();
166  for (UInt_t uDpb = 0; uDpb < fuStsNrOfDpbs; ++uDpb) {
168  LOG(info) << "Eq. ID for DPB #" << std::setw(2) << uDpb << " = 0x"
169  << std::setw(4) << std::hex << fUnpackParSts->GetDpbId(uDpb)
170  << std::dec << " => "
172  } // for( UInt_t uDpb = 0; uDpb < fuStsNrOfDpbs; ++uDpb )
173 
178  /***************** STS parameters *************************************/
179 
180  /***************** TOF parameters *************************************/
182  LOG(info) << "Nr. of Tof GDPBs: " << fuTofNrOfDpbs;
183 
184  fmTofDpbIdIndexMap.clear();
185  for (UInt_t i = 0; i < fuTofNrOfDpbs; ++i) {
187  LOG(info) << "GDPB Id of TOF " << i << " : " << std::hex
188  << fUnpackParTof->GetGdpbId(i) << std::dec;
189  } // for( UInt_t i = 0; i < fuTofNrOfDpbs; ++i )
190 
198  /***************** TOF parameters *************************************/
199 
200  return kTRUE;
201 }
202 
204  UShort_t usDetectorId) {
205  switch (usDetectorId) {
206  case 0x10: //fles::SubsystemIdentifier::STS:
207  {
208  AddMsComponentToListSts(component);
209  break;
210  } // case 0x10:
211  case 0x60: //fles::SubsystemIdentifier::RPC:
212  {
213  AddMsComponentToListTof(component);
214  break;
215  } // case 0x60:
216  default: {
217  LOG(warning) << "CbmMcbm2018MonitorStsSync::AddMsComponentToList => "
218  << "Ignore component " << component << " as detector id "
219  << usDetectorId << " is not supported by this unpacker.";
220  break;
221  } // default:
222  } // switch( iDetectorId )
223 }
226  for (UInt_t uCompIdx = 0; uCompIdx < fvMsComponentsListSts.size(); ++uCompIdx)
227  if (component == fvMsComponentsListSts[uCompIdx]) return;
228 
230  fvMsComponentsListSts.push_back(component);
231 }
234  for (UInt_t uCompIdx = 0; uCompIdx < fvMsComponentsListTof.size(); ++uCompIdx)
235  if (component == fvMsComponentsListTof[uCompIdx]) return;
236 
238  fvMsComponentsListTof.push_back(component);
239 }
241  size_t uOverlapMsNb) {
242  fuNbCoreMsPerTs = uCoreMsNb;
243  fuNbOverMsPerTs = uOverlapMsNb;
244 
245  // UInt_t uNbMsTotal = fuNbCoreMsPerTs + fuNbOverMsPerTs;
246 }
247 
248 /***************** STS Histograms *************************************/
250  TString sHistName {""};
251  TString title {""};
252  /*
253  sHistName = "hPulserMessageType";
254  title = "Nb of message for each type; Type";
255  fhStsMessType = new TH1I(sHistName, title, 5, 0., 5.);
256  fhStsMessType->GetXaxis()->SetBinLabel( 1, "Dummy");
257  fhStsMessType->GetXaxis()->SetBinLabel( 2, "Hit");
258  fhStsMessType->GetXaxis()->SetBinLabel( 3, "TsMsb");
259  fhStsMessType->GetXaxis()->SetBinLabel( 4, "Epoch");
260  fhStsMessType->GetXaxis()->SetBinLabel( 5, "Empty");
261 
262  // Online histo browser commands
263  THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
264  if( server )
265  {
266  server->Register("/StsRaw", fhStsMessType );
267 
268  server->RegisterCommand("/Reset_All_Pulser", "bMcbm2018ResetSync=kTRUE");
269  server->RegisterCommand("/Write_All_Pulser", "bMcbm2018WriteSync=kTRUE");
270 
271  server->Restrict("/Reset_All_Pulser", "allow=admin");
272  server->Restrict("/Write_All_Pulser", "allow=admin");
273  } // if( server )
274 */
276  /*
277  Double_t w = 10;
278  Double_t h = 10;
279 
280  // Summary per StsXyter
281  for( UInt_t uXyterIdx = 0; uXyterIdx < fuStsNbStsXyters; ++uXyterIdx )
282  {
283  TCanvas* cStsSumm = new TCanvas( Form("cStsSum_%03u", uXyterIdx ),
284  Form("Summary plots for StsXyter %03u", uXyterIdx ),
285  w, h);
286  cStsSumm->Divide( 2, 2 );
287 
288  cStsSumm->cd(1);
289  gPad->SetLogy();
290  fhStsChanCntRaw[ uXyterIdx ]->Draw();
291 
292  cStsSumm->cd(2);
293  gPad->SetLogz();
294  fhStsChanAdcRaw[ uXyterIdx ]->Draw( "colz" );
295 
296  cStsSumm->cd(3);
297  gPad->SetLogz();
298  fhStsChanHitRateEvo[ uXyterIdx ]->Draw( "colz" );
299 
300  cStsSumm->cd(4);
301 // gPad->SetLogy();
302  fhStsChanAdcRawProf[ uXyterIdx ]->Draw();
303  } // for( UInt_t uXyterIdx = 0; uXyterIdx < fuStsNbStsXyters; ++uXyterIdx )
304 
305 //====================================================================//
306 */
307  /*****************************/
308  LOG(info) << "Done Creating STS Histograms";
309 }
310 /***************** STS Histograms *************************************/
311 
312 /***************** TOF Histograms *************************************/
314  TString sHistName {""};
315  TString title {""};
316 
317  /*******************************************************************/
318  /*
319 
320  sHistName = "hMessageType";
321  title = "Nb of message for each type; Type";
322  // Test Big Data readout with plotting
323  fhTofMessType = new TH1I(sHistName, title, 1 + gdpbv100::MSG_STAR_TRI_A, 0., 1 + gdpbv100::MSG_STAR_TRI_A);
324  fhTofMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_HIT, "HIT");
325  fhTofMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_EPOCH, "EPOCH");
326  fhTofMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_SLOWC, "SLOWC");
327  fhTofMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_SYST, "SYST");
328  fhTofMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_STAR_TRI_A, "MSG_STAR_TRI");
329 */
330  /*******************************************************************/
331  /*
332  THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
333  if( server )
334  {
335  server->Register("/TofRaw", fhTofMessType );
336 
337  server->RegisterCommand("/Reset_All_TOF", "bMcbm2018SyncResetHistosTof=kTRUE");
338  server->RegisterCommand("/Save_All_Tof", "bMcbm2018SyncSaveHistosTof=kTRUE");
339  server->RegisterCommand("/Update_PulsFit", "bMcbm2018SyncUpdateZoomedFit=kTRUE");
340 
341  server->Restrict("/Reset_All_Tof", "allow=admin");
342  server->Restrict("/Save_All_Tof", "allow=admin");
343  server->Restrict("/Update_PulsFit", "allow=admin");
344  } // if( server )
345 */
347  /*
348  Double_t w = 10;
349  Double_t h = 10;
350  TCanvas* cSummary = new TCanvas("cSummary", "gDPB Monitoring Summary", w, h);
351  cSummary->Divide(2, 3);
352 
353  // 1st Column: Messages types
354  cSummary->cd(1);
355  gPad->SetLogy();
356  fhTofMessType->Draw();
357 
358  cSummary->cd(2);
359  gPad->SetLogy();
360  fhTofSysMessType->Draw();
361 
362  cSummary->cd(3);
363  gPad->SetLogz();
364  fhTofGet4MessType->Draw("colz");
365 
366  // 2nd Column: GET4 Errors + Epoch flags + SCm
367  cSummary->cd(4);
368  gPad->SetLogz();
369  fhTofGet4ChanErrors->Draw("colz");
370 
371  cSummary->cd(5);
372  gPad->SetLogz();
373  fhTofGet4EpochFlags->Draw("colz");
374 
375  cSummary->cd(6);
376  fhTofGet4ChanScm->Draw("colz");
377 */
378  /*****************************/
379 
380  LOG(info) << "Done Creating TOF Histograms";
381 }
382 /***************** TOF Histograms *************************************/
383 
384 /***************** mCBM Histograms ************************************/
386  TString sHistName {""};
387  TString sHistTitle {""};
388 
390 
391  sHistName = "hMcbmHitsNbPerTsEvo";
392  sHistTitle =
393  "Nb STS or TOF hits, per DPB and per TS; TS index []; DPB []; Nb Hits []";
394  fhMcbmHitsNbPerTsEvo = new TH2D(sHistName,
395  sHistTitle,
396  400001,
397  -0.5,
398  400000.5,
400  0.,
402 
403  sHistName = "hMcbmHitsNbFineEvo";
404  sHistTitle =
405  "Nb STS or TOF hits, per DPB and per 100 ms; t [s]; DPB []; Hit rate [1/s]";
406  fhMcbmHitsNbFineEvo = new TH2D(sHistName,
407  sHistTitle,
408  40001,
409  -0.05,
410  4000.05,
412  0.,
414 
415  sHistName = "hMcbmHitsRateEvo";
416  sHistTitle = "STS or TOF hits rate per DPB as function of time in run; t "
417  "[s]; DPB []; Hit rate [1/s]";
418  fhMcbmHitsRateEvo = new TH2D(sHistName,
419  sHistTitle,
420  4001,
421  -0.5,
422  4000.5,
424  0.,
426 
427  sHistName = "hDiamondHitsRateMapEvo";
428  sHistTitle = "Counts per diamond strip and 100 ms as function of time in "
429  "run; t [s]; strip []; Counts []";
431  new TH2D(sHistName, sHistTitle, 40001, -0.05, 4000.05, 8, 0., 8.);
432 
433  sHistName = "hDiamondHitsRateDerivative";
434  sHistTitle = "Variation of the diamond counts per s in 100 ms bins as "
435  "function of time in run; t [s]; Delta(Counts/s) []";
437  new TH1D(sHistName, sHistTitle, 40000, 0., 4000.);
438 
439  sHistName = "hMuchVsStsHitsNbPerTimeBin";
440  sHistTitle = Form("Nb Hits in MUCH vs Sts in time bins of %5u ns; Nb Hits "
441  "STS []; Nb Hits TOF []; Time bins []",
444  new TH2D(sHistName, sHistTitle, 2000, 0., 2000., 2000, 0., 2000.);
445  sHistName = "hTofVsStsHitsNbPerTimeBin";
446  sHistTitle = Form("Nb Hits in TOF vs Sts in time bins of %5u ns; Nb Hits STS "
447  "[]; Nb Hits MUCH []; Time bins []",
450  new TH2D(sHistName, sHistTitle, 2000, 0., 2000., 2000, 0., 2000.);
451  sHistName = "hDiamVsStsHitsNbPerTimeBin";
452  sHistTitle = Form("Nb Hits in Diam vs Sts in time bins of %5u ns; Nb Hits "
453  "STS []; Nb Hits Diam []; Time bins []",
456  new TH2D(sHistName, sHistTitle, 2000, 0., 2000., 2000, 0., 2000.);
457 
458  sHistName = "hStsVsMuchHitsNbPerTimeBin";
459  sHistTitle = Form("Nb Hits in STS vs MUCH in time bins of %5u ns; Nb Hits "
460  "MUCH []; Nb Hits STS []; Time bins []",
463  new TH2D(sHistName, sHistTitle, 2000, 0., 2000., 2000, 0., 2000.);
464  sHistName = "hTofVsMuchHitsNbPerTimeBin";
465  sHistTitle = Form("Nb Hits in TOF vs MUCH in time bins of %5u ns; Nb Hits "
466  "MUCH []; Nb Hits TOF []; Time bins []",
469  new TH2D(sHistName, sHistTitle, 2000, 0., 2000., 2000, 0., 2000.);
470  sHistName = "hDiamVsMuchHitsNbPerTimeBin";
471  sHistTitle = Form("Nb Hits in Diam vs MUCH in time bins of %5u ns; Nb Hits "
472  "MUCH []; Nb Hits Diam []; Time bins []",
475  new TH2D(sHistName, sHistTitle, 2000, 0., 2000., 2000, 0., 2000.);
476 
477  sHistName = "hStsVsTofHitsNbPerTimeBin";
478  sHistTitle = Form("Nb Hits in STS vs TOF in time bins of %5u ns; Nb Hits TOF "
479  "[]; Nb Hits STS []; Time bins []",
482  new TH2D(sHistName, sHistTitle, 2000, 0., 2000., 2000, 0., 2000.);
483  sHistName = "hMuchVsTofHitsNbPerTimeBin";
484  sHistTitle = Form("Nb Hits in MUCH vs TOF in time bins of %5u ns; Nb Hits "
485  "TOF []; Nb Hits MUCH []; Time bins []",
488  new TH2D(sHistName, sHistTitle, 2000, 0., 2000., 2000, 0., 2000.);
489  sHistName = "hDiamVsTofHitsNbPerTimeBin";
490  sHistTitle = Form("Nb Hits in Diam vs TOF in time bins of %5u ns; Nb Hits "
491  "TOF []; Nb Hits Diam []; Time bins []",
494  new TH2D(sHistName, sHistTitle, 2000, 0., 2000., 2000, 0., 2000.);
495 
496  sHistName = "hStsVsDiamHitsNbPerTimeBin";
497  sHistTitle = Form("Nb Hits in STS vs Diam in time bins of %5u ns; Nb Hits "
498  "Diam []; Nb Hits STS []; Time bins []",
501  new TH2D(sHistName, sHistTitle, 2000, 0., 2000., 2000, 0., 2000.);
502  sHistName = "hTofVsDiamHitsNbPerTimeBin";
503  sHistTitle = Form("Nb Hits in TOF vs Diam in time bins of %5u ns; Nb Hits "
504  "Diam []; Nb Hits TOF []; Time bins []",
507  new TH2D(sHistName, sHistTitle, 2000, 0., 2000., 2000, 0., 2000.);
508  sHistName = "hMuchVsDiamHitsNbPerTimeBin";
509  sHistTitle = Form("Nb Hits in MUCH vs Diam in time bins of %5u ns; Nb Hits "
510  "Diam []; Nb Hits MUCH []; Time bins []",
513  new TH2D(sHistName, sHistTitle, 2000, 0., 2000., 2000, 0., 2000.);
514 
515  THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
516  if (server) {
517  server->Register("/mCbmRate", fhMcbmHitsNbPerTsEvo);
518  server->Register("/mCbmRate", fhMcbmHitsNbFineEvo);
519  server->Register("/mCbmRate", fhMcbmHitsRateEvo);
520  /*
521  server->RegisterCommand("/Reset_All", "bMcbm2018ResetSync=kTRUE");
522  server->RegisterCommand("/Save_All", "bMcbm2018WriteSync=kTRUE");
523 
524  server->Restrict("/Reset_All", "allow=admin");
525  server->Restrict("/Save_All", "allow=admin");
526 */
527  } // if( server )
528 
529  // Double_t w = 10;
530  // Double_t h = 10;
532  /*
533  TCanvas* cSyncMcbm = new TCanvas("cSyncMcbm", "Time difference for STS and TOF hits, per DPB, against any Diamond hit", w, h);
534  cSyncMcbm->Divide( 2);
535 
536  cSyncMcbm->cd(1);
537  gPad->SetGridx();
538  gPad->SetGridy();
539  gPad->SetLogz();
540  fhMcbmTimeDiffToDiamond->Draw( "colz" );
541 
542  cSyncMcbm->cd(2);
543  gPad->SetGridx();
544  gPad->SetGridy();
545  gPad->SetLogz();
546  fhMcbmTimeDiffToDiamondWide->Draw( "colz" );
547 */
548  /*****************************/
549  LOG(info) << "Done Creating mCBM Histograms";
550 }
551 /***************** mCBM Histograms ************************************/
552 
553 Bool_t CbmMcbm2018MonitorMcbmRate::DoUnpack(const fles::Timeslice& ts,
554  size_t component) {
556  /*
557  if( bMcbm2018ResetSync )
558  {
559  ResetAllHistos();
560  bMcbm2018ResetSync = kFALSE;
561  } // if( bMcbm2018ResetSync )
562  if( bMcbm2018WriteSync )
563  {
564  SaveAllHistos( fsHistoFileFullname );
565  bMcbm2018WriteSync = kFALSE;
566  } // if( bMcbm2018WriteSync )
567 */
568 
569  LOG(debug) << "Timeslice contains " << ts.num_microslices(component)
570  << "microslices.";
571  fulCurrentTsIdx = ts.index();
572  fulCurrentTsStartTime = ts.descriptor(0, 0).idx;
573 
575  if (0 == fulCurrentTsIdx) return kTRUE;
576 
577  if (fulCurrentTsIdx < 30) LOG(info) << Form("TS %2llu", fulCurrentTsIdx);
578 
579  // Ignore overlap ms if flag set by user
580  UInt_t uNbMsLoop = fuNbCoreMsPerTs;
581  if (kFALSE == fbIgnoreOverlapMs) uNbMsLoop += fuNbOverMsPerTs;
582 
583  // Loop over core microslices (and overlap ones if chosen)
584  for (UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx++) {
585  // Loop over registered STS components
586  for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsListSts.size();
587  ++uMsCompIdx) {
588  UInt_t uMsComp = fvMsComponentsListSts[uMsCompIdx];
589 
590  if (kFALSE == ProcessStsMs(ts, uMsComp, uMsIdx)) return kFALSE;
591  } // for( UInt_t uMsComp = 0; uMsComp < fvMsComponentsListSts.size(); ++uMsComp )
592 
593  // Loop over registered TOF components
594  for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsListTof.size();
595  ++uMsCompIdx) {
596  UInt_t uMsComp = fvMsComponentsListTof[uMsCompIdx];
597 
598  if (kFALSE == ProcessTofMs(ts, uMsComp, uMsIdx)) return kFALSE;
599  } // for( UInt_t uMsComp = 0; uMsComp < fvMsComponentsListSts.size(); ++uMsComp )
600 
601  /****************** STS Sync ******************************************/
602  /*
604  for( UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb )
605  std::sort( fvmStsSdpbHitsInMs[ uSdpb ].begin(), fvmStsSdpbHitsInMs[ uSdpb ].end() );
606 */
607  /****************** STS Sync ******************************************/
608 
609  /****************** TOF Sync ******************************************/
610  /*
612  for( UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb )
613  std::sort( fvmTofGdpbHitsInMs[ uGdpb ].begin(), fvmTofGdpbHitsInMs[ uGdpb ].end() );
614 */
615  UInt_t uNbDiaHits = fvmTofGdpbHitsInMs[fuDiamondDpbIdx].size();
616  for (UInt_t uHitDia = 0; uHitDia < uNbDiaHits; uHitDia++) {
617  // Double_t dDiaTime = fvmTofGdpbHitsInMs[ fuDiamondDpbIdx ][ uHitDia ].GetFullTimeNs() / 1e-9;
618  UInt_t uChan = 8;
619 
620  switch (fvmTofGdpbHitsInMs[fuDiamondDpbIdx][uHitDia].getGdpbHitChanId()) {
621  case 0: uChan = 0; break;
622  case 32: uChan = 1; break;
623  case 64: uChan = 2; break;
624  case 96: uChan = 3; break;
625  case 160: uChan = 4; break;
626  case 192: uChan = 5; break;
627  case 224: uChan = 6; break;
628  case 256: uChan = 7; break;
629  } // switch( fvmTofGdpbHitsInMs[ fuDiamondDpbIdx ][ uHitDia ].GetHitChannel() )
630 
631  if (uChan < 8)
632  // fhDiamondHitsRateMapEvo->Fill( dDiaTime, uChan, 0.1 );
634  (1e-9) * static_cast<double>(fulCurrentMsIdx), uChan, 0.1);
635  } // for( UInt_t uHitDia = 0; uHitDia < uNbDiaHits; uHitDia++)
636  /****************** TOF Sync ******************************************/
637 
638  /****************** mCBM Sync *****************************************/
640  for (UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb) {
641  UInt_t uNbHitsInMs = fvmStsSdpbHitsInMs[uSdpb].size();
642  fhMcbmHitsNbPerTsEvo->Fill(fulCurrentTsIdx, uSdpb, uNbHitsInMs);
643  fhMcbmHitsNbFineEvo->Fill((1e-9) * static_cast<double>(fulCurrentMsIdx),
644  uSdpb,
645  uNbHitsInMs / 0.1);
646  fhMcbmHitsRateEvo->Fill(
647  (1e-9) * static_cast<double>(fulCurrentMsIdx), uSdpb, uNbHitsInMs);
648 
649  for (UInt_t uHit = 0; uHit < uNbHitsInMs; ++uHit) {
650  Double_t dHitTimeInTs =
651  stsxyter::kdClockCycleNs * fvmStsSdpbHitsInMs[uSdpb][uHit].GetTs()
653 
655  if (fuMuchDpbIdx == uSdpb)
656  dHitTimeInTs -= fdMuchTofOffsetNs;
657  else
658  dHitTimeInTs -= fdStsTofOffsetNs;
659 
660  Int_t iTimeBin = static_cast<Int_t>(dHitTimeInTs / kuTimeBinSizeNs);
661  if (iTimeBin < 0 || kuNbTimeBins <= static_cast<UInt_t>(iTimeBin)) {
662  LOG(debug) << "sDPB hits with time out of the TS!! " << dHitTimeInTs
663  << " " << iTimeBin;
664  continue;
665  } // if( iTimeBin < 0 || kuNbTimeBins <= iTimeBin )
666 
667  if (fuMuchDpbIdx == uSdpb)
668  fvuHitsNbInTimeBinMuch[iTimeBin]++;
669  else
670  fvuHitsNbInTimeBinSts[iTimeBin]++;
671  } // for( UInt_t uHit = 0; uHit < uNbHitsInMs; ++uHit )
672  /*
674  if( 0 < uSdpb )
675  fvmStsSdpbHitsInTs[ uSdpb ].insert( fvmStsSdpbHitsInTs[ uSdpb ].end(),
676  fvmStsSdpbHitsInMs[ uSdpb ].begin(),
677  fvmStsSdpbHitsInMs[ uSdpb ].end() );
678 */
679  fvmStsSdpbHitsInMs[uSdpb].clear();
680  } // for( UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb )
681  for (UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb) {
682  UInt_t uNbHitsInMs = fvmTofGdpbHitsInMs[uGdpb].size();
683  fhMcbmHitsNbPerTsEvo->Fill(
684  fulCurrentTsIdx, uGdpb + fuStsNrOfDpbs, uNbHitsInMs);
685  fhMcbmHitsNbFineEvo->Fill((1e-9) * static_cast<double>(fulCurrentMsIdx),
686  uGdpb + fuStsNrOfDpbs,
687  uNbHitsInMs / 0.1);
688  fhMcbmHitsRateEvo->Fill((1e-9) * static_cast<double>(fulCurrentMsIdx),
689  uGdpb + fuStsNrOfDpbs,
690  uNbHitsInMs);
691 
692  if (fuDiamondDpbIdx == uGdpb) {
695  (1e-9) * static_cast<double>(fulCurrentMsIdx) - 0.05,
696  fvmTofGdpbHitsInMs[uGdpb].size() / 0.1);
699  (1e-9) * static_cast<double>(fulCurrentMsIdx) + 0.05,
700  fvmTofGdpbHitsInMs[uGdpb].size() / -0.1);
701  } // if( fuDiamondDpbIdx == uGdpb )
702 
703  for (UInt_t uHit = 0; uHit < uNbHitsInMs; ++uHit) {
704  Double_t dHitTimeInTs = fvmTofGdpbHitsInMs[uGdpb][uHit].GetFullTimeNs()
706 
707  Int_t iTimeBin = static_cast<Int_t>(dHitTimeInTs / kuTimeBinSizeNs);
708  if (iTimeBin < 0 || kuNbTimeBins <= static_cast<UInt_t>(iTimeBin)) {
709  LOG(debug) << "gDPB hits with time out of the TS!! "
710  << fvmTofGdpbHitsInMs[uGdpb][uHit].GetFullTimeNs() << " "
711  << fulCurrentTsStartTime << " " << iTimeBin;
712  continue;
713  } // if( iTimeBin < 0 || kuNbTimeBins <= iTimeBin )
714 
715  if (fuDiamondDpbIdx == uGdpb)
716  fvuHitsNbInTimeBinDiam[iTimeBin]++;
717  else
718  fvuHitsNbInTimeBinTof[iTimeBin]++;
719  } // for( UInt_t uHit = 0; uHit < uNbHitsInMs; ++uHit )
720 
721  /*
722  fvmTofGdpbHitsInTs[ uGdpb ].insert( fvmTofGdpbHitsInTs[ uGdpb ].end(),
723  fvmTofGdpbHitsInMs[ uGdpb ].begin(),
724  fvmTofGdpbHitsInMs[ uGdpb ].end() );
725 */
726  fvmTofGdpbHitsInMs[uGdpb].clear();
727  } // for( UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb )
728  /****************** mCBM Sync *****************************************/
729  } // for( UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx ++ )
730 
731  /****************** mCBM Sync *****************************************/
732  /*
734  UInt_t uNbDiaHits = fvmTofGdpbHitsInTs[ fuDiamondDpbIdx ].size();
735  for( UInt_t uHitDia = 0; uHitDia < uNbDiaHits; uHitDia++)
736  {
737  Double_t dDiaTime = fvmTofGdpbHitsInTs[ fuDiamondDpbIdx ][ uHitDia ].GetFullTimeNs();
738 
740  for( UInt_t uSdpb = 1; uSdpb < fuStsNrOfDpbs; ++uSdpb )
741  {
742  UInt_t uNbHits = fvmStsSdpbHitsInTs[ uSdpb ].size();
743  for( UInt_t uHit = 0; uHit < uNbHits; ++uHit )
744  {
745  Double_t dHitTime = stsxyter::kdClockCycleNs * fvmStsSdpbHitsInTs[ uSdpb ][ uHit ].GetTs();
746 
747  Double_t dDt = dHitTime - dDiaTime;
748  fhMcbmTimeDiffToDiamondTs->Fill( dDt / 1e6, uSdpb );
749 
750  fvhMcbmTimeDiffToDiamondTsEvoDpb[ uSdpb ]->Fill( fulCurrentTsIdx, dDt / 1e6 );
751  } // for( UInt_t uHit = 0; uHit < uNbHits; ++uHit )
752  } // for( UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb )
753 
754  for( UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb )
755  {
756  if( fuDiamondDpbIdx == uGdpb )
757  continue;
758 
759  UInt_t uNbHits = fvmTofGdpbHitsInTs[ uGdpb ].size();
760  for( UInt_t uHit = 0; uHit < uNbHits; ++uHit )
761  {
762  Double_t dHitTime = fvmTofGdpbHitsInTs[ uGdpb ][ uHit ].GetFullTimeNs();
763 
764  Double_t dDt = dHitTime - dDiaTime;
765  fhMcbmTimeDiffToDiamondTs->Fill( dDt / 1e6, uGdpb + fuStsNrOfDpbs );
766 
767  fvhMcbmTimeDiffToDiamondTsEvoDpb[ uGdpb + fuStsNrOfDpbs ]->Fill( fulCurrentTsIdx, dDt / 1e6 );
768  } // for( UInt_t uHit = 0; uHit < uNbHits; ++uHit )
769  } // for( UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb )
770  } // for( UInt_t uHitDia = 0; uHitDia < uNbDiaHits; uHitDia++)
771 
773  for( UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb )
774  {
775  fvmStsSdpbHitsInTs[ uSdpb ].clear();
776  } // for( UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb )
777  for( UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb )
778  {
779  fvmTofGdpbHitsInTs[ uGdpb ].clear();
780  } // for( UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb )
781 */
782 
783  for (UInt_t uTimeBin = 0; uTimeBin < kuNbTimeBins; ++uTimeBin) {
784  if (0 < fvuHitsNbInTimeBinSts[uTimeBin]) {
785  if (0 < fvuHitsNbInTimeBinMuch[uTimeBin])
787  fvuHitsNbInTimeBinMuch[uTimeBin]);
788  if (0 < fvuHitsNbInTimeBinTof[uTimeBin])
790  fvuHitsNbInTimeBinTof[uTimeBin]);
791  if (0 < fvuHitsNbInTimeBinDiam[uTimeBin])
793  fvuHitsNbInTimeBinDiam[uTimeBin]);
794  } // if( 0 < fvuHitsNbInTimeBinSts[ uTimeBin ] )
795 
796  if (0 < fvuHitsNbInTimeBinMuch[uTimeBin]) {
797  if (0 < fvuHitsNbInTimeBinSts[uTimeBin])
799  fvuHitsNbInTimeBinSts[uTimeBin]);
800  if (0 < fvuHitsNbInTimeBinTof[uTimeBin])
802  fvuHitsNbInTimeBinTof[uTimeBin]);
803  if (0 < fvuHitsNbInTimeBinDiam[uTimeBin])
805  fvuHitsNbInTimeBinDiam[uTimeBin]);
806  } // if( 0 < fvuHitsNbInTimeBinMuch[ uTimeBin ] )
807 
808  if (0 < fvuHitsNbInTimeBinTof[uTimeBin]) {
809  if (0 < fvuHitsNbInTimeBinSts[uTimeBin])
811  fvuHitsNbInTimeBinSts[uTimeBin]);
812  if (0 < fvuHitsNbInTimeBinMuch[uTimeBin])
814  fvuHitsNbInTimeBinMuch[uTimeBin]);
815  if (0 < fvuHitsNbInTimeBinDiam[uTimeBin])
817  fvuHitsNbInTimeBinDiam[uTimeBin]);
818  } // if( 0 < fvuHitsNbInTimeBinTof[ uTimeBin ] )
819 
820  if (0 < fvuHitsNbInTimeBinDiam[uTimeBin]) {
821  if (0 < fvuHitsNbInTimeBinSts[uTimeBin])
823  fvuHitsNbInTimeBinSts[uTimeBin]);
824  if (0 < fvuHitsNbInTimeBinMuch[uTimeBin])
826  fvuHitsNbInTimeBinMuch[uTimeBin]);
827  if (0 < fvuHitsNbInTimeBinTof[uTimeBin])
829  fvuHitsNbInTimeBinTof[uTimeBin]);
830  } // if( 0 < fvuHitsNbInTimeBinDiam[ uTimeBin ] )
831 
832  fvuHitsNbInTimeBinSts[uTimeBin] = 0;
833  fvuHitsNbInTimeBinMuch[uTimeBin] = 0;
834  fvuHitsNbInTimeBinTof[uTimeBin] = 0;
835  fvuHitsNbInTimeBinDiam[uTimeBin] = 0;
836  } // for( UInt_t uTimeBin = 0; uTimeBin < kuNbTimeBins; ++uTimeBin )
837  /****************** mCBM Sync *****************************************/
838 
839  if (0 == ts.index() % 1000) {
840  LOG(info) << "End of TS " << std::setw(7) << ts.index();
841  } // if( 0 == ts.index() % 1000 )
842 
843  return kTRUE;
844 }
845 
846 /****************** STS Sync ******************************************/
847 Bool_t CbmMcbm2018MonitorMcbmRate::ProcessStsMs(const fles::Timeslice& ts,
848  size_t uMsComp,
849  UInt_t uMsIdx) {
850  auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
851  fuCurrentEquipmentId = msDescriptor.eq_id;
852  const uint8_t* msContent =
853  reinterpret_cast<const uint8_t*>(ts.content(uMsComp, uMsIdx));
854 
855  uint32_t uSize = msDescriptor.size;
856  fulCurrentMsIdx = msDescriptor.idx;
857  // Double_t dMsTime = (1e-9) * static_cast<double>(fulCurrentMsIdx);
858  LOG(debug) << "Microslice: " << fulCurrentMsIdx << " from EqId " << std::hex
859  << fuCurrentEquipmentId << std::dec << " has size: " << uSize;
860 
861  fuCurrDpbId = static_cast<uint32_t>(fuCurrentEquipmentId & 0xFFFF);
862  // fuCurrDpbIdx = fmStsDpbIdIndexMap[ fuCurrDpbId ];
863 
865  auto it = fmStsDpbIdIndexMap.find(fuCurrDpbId);
866  if (it == fmStsDpbIdIndexMap.end()) {
867  LOG(info)
868  << "---------------------------------------------------------------";
869  /*
870  LOG(info) << "hi hv eqid flag si sv idx/start crc size offset";
871  LOG(info) << Form( "%02x %02x %04x %04x %02x %02x %016llx %08x %08x %016llx",
872  static_cast<unsigned int>(msDescriptor.hdr_id),
873  static_cast<unsigned int>(msDescriptor.hdr_ver), msDescriptor.eq_id, msDescriptor.flags,
874  static_cast<unsigned int>(msDescriptor.sys_id),
875  static_cast<unsigned int>(msDescriptor.sys_ver), msDescriptor.idx, msDescriptor.crc,
876  msDescriptor.size, msDescriptor.offset );
877 */
878  LOG(info) << FormatMsHeaderPrintout(msDescriptor);
879  LOG(warning) << "Could not find the sDPB index for AFCK id 0x" << std::hex
880  << fuCurrDpbId << std::dec << " in timeslice "
881  << fulCurrentTsIdx << " in microslice " << uMsIdx
882  << " component " << uMsComp << "\n"
883  << "If valid this index has to be added in the STS/MUCH "
884  "parameter file in the RocIdArray field";
885  return kFALSE;
886  } // if( it == fmStsDpbIdIndexMap.end() )
887  else
889 
891  UInt_t uTsMsbCycleHeader = std::floor(
893 
894  if (0 == uMsIdx) {
895  fvuStsCurrentTsMsbCycle[fuCurrDpbIdx] = uTsMsbCycleHeader;
897  } // if( 0 == uMsIdx )
898  else if (uTsMsbCycleHeader != fvuStsCurrentTsMsbCycle[fuCurrDpbIdx]
899  && 4194303 != fvulStsCurrentTsMsb[fuCurrDpbIdx]) {
900  LOG(warning)
901  << "TS MSB cycle from MS header does not match current cycle from data "
902  << "for TS " << std::setw(12) << fulCurrentTsIdx << " MS "
903  << std::setw(12) << fulCurrentMsIdx << " MsInTs " << std::setw(3)
904  << uMsIdx << " ====> " << fvuStsCurrentTsMsbCycle[fuCurrDpbIdx] << " VS "
905  << uTsMsbCycleHeader;
906  fvuStsCurrentTsMsbCycle[fuCurrDpbIdx] = uTsMsbCycleHeader;
907  }
908 
909  // If not integer number of message in input buffer, print warning/error
910  if (0 != (uSize % kuStsBytesPerMessage))
911  LOG(error) << "The input microslice buffer does NOT "
912  << "contain only complete nDPB messages!";
913 
914  // Compute the number of complete messages in the input microslice buffer
915  uint32_t uNbMessages =
916  (uSize - (uSize % kuStsBytesPerMessage)) / kuStsBytesPerMessage;
917 
918  // Prepare variables for the loop on contents
919  const uint32_t* pInBuff = reinterpret_cast<const uint32_t*>(msContent);
920 
921  for (uint32_t uIdx = 0; uIdx < uNbMessages; ++uIdx) {
922  // Fill message
923  uint32_t ulData = static_cast<uint32_t>(pInBuff[uIdx]);
924 
925  stsxyter::Message mess(static_cast<uint32_t>(ulData & 0xFFFFFFFF));
926 
927  // Print message if requested
928  if (fbPrintMessages) mess.PrintMess(std::cout, fPrintMessCtrlSts);
929 
930  stsxyter::MessType typeMess = mess.GetMessType();
931  fmMsgCounter[typeMess]++;
932 
933  switch (typeMess) {
935 
936  FillStsHitInfo(mess, uMsIdx);
937  break;
938  } // case stsxyter::MessType::Hit :
940  FillStsTsMsbInfo(mess, uIdx, uMsIdx);
941  break;
942  } // case stsxyter::MessType::TsMsb :
944  // The first message in the TS is a special ones: EPOCH
945  FillStsEpochInfo(mess);
946 
947  if (0 < uIdx)
948  LOG(info) << "CbmMcbm2018MonitorMcbmRate::DoUnpack => "
949  << "EPOCH message at unexpected position in MS: message "
950  << uIdx << " VS message 0 expected!";
951  break;
952  } // case stsxyter::MessType::TsMsb :
956  break;
957  } // case stsxyter::MessType::Dummy / ReadDataAck / Ack :
958  default: {
959  LOG(fatal)
960  << "CbmMcbm2018MonitorMcbmRate::DoUnpack => "
961  << "Unknown message type, should never happen, stopping here!";
962  }
963  } // switch( mess.GetMessType() )
964  } // for( uint32_t uIdx = 0; uIdx < uNbMessages; ++uIdx )
965  return kTRUE;
966 }
967 
969  const UInt_t& /*uMsIdx*/) {
970  UShort_t usChan = mess.GetHitChannel();
971  UShort_t usRawAdc = mess.GetHitAdc();
972  // UShort_t usFullTs = mess.GetHitTimeFull();
973  // UShort_t usTsOver = mess.GetHitTimeOver();
974  UShort_t usRawTs = mess.GetHitTime();
975 
976  UInt_t uAsicIdx =
977  0;
978 
979  if (fuCurrDpbIdx == fuMuchDpbIdx) {
981  switch (usChan) {
982  case 101:
983  case 99:
984  case 91:
985  case 89:
986  case 88:
987  case 86:
988  case 84:
989  case 83:
990  case 80:
991  case 78:
992  case 76:
993  case 50:
994  case 39:
995  case 37:
996  case 35:
997  case 20: {
998  return;
999  break;
1000  } // if bad channel
1001  default: break;
1002  } // switch( usChan )
1003  } // if( fuCurrDpbIdx == fuMuchDpbIdx )
1004  else {
1006  uAsicIdx = fUnpackParSts->ElinkIdxToAsicIdx(kFALSE, mess.GetLinkIndex());
1007  UInt_t uChanIdx = usChan + fUnpackParSts->GetNbChanPerAsic() * uAsicIdx;
1008  switch (uChanIdx) {
1009  case 781:
1010  case 270:
1011  case 411:
1012  case 518: {
1013  return;
1014  break;
1015  } // if bad channel
1016  default: break;
1017  } // switch( mess.GetLinkIndex() )
1018  if ((0 == uChanIdx % 2) && (543 < uChanIdx) && (uChanIdx < 633)) {
1019  return;
1020  } // if bad channel
1021  } // else of if( fuCurrDpbIdx == fuMuchDpbIdx )
1022 
1023  // Compute the Full time stamp
1024  // Use TS w/o overlap bits as they will anyway come from the TS_MSB
1025  Long64_t ulStsHitTime = usRawTs;
1026 
1027  ulStsHitTime +=
1028  static_cast<ULong64_t>(stsxyter::kuHitNbTsBins)
1029  * static_cast<ULong64_t>(fvulStsCurrentTsMsb[fuCurrDpbIdx])
1030  + static_cast<ULong64_t>(stsxyter::kulTsCycleNbBins)
1031  * static_cast<ULong64_t>(fvuStsCurrentTsMsbCycle[fuCurrDpbIdx]);
1032 
1033  // Convert the Hit time in bins to Hit time in ns
1034  // Double_t dHitTimeNs = ulStsHitTime * stsxyter::kdClockCycleNs;
1035 
1036  // Pulser and MS
1037  fvmStsSdpbHitsInMs[fuCurrDpbIdx].push_back(
1038  stsxyter::FinalHit(ulStsHitTime, usRawAdc, uAsicIdx, usChan));
1039 }
1040 
1042  UInt_t uMessIdx,
1043  UInt_t uMsIdx) {
1044  UInt_t uVal = mess.GetTsMsbVal();
1045 
1046  // Update Status counters
1047  if (uVal < fvulStsCurrentTsMsb[fuCurrDpbIdx]) {
1048 
1049  LOG(info) << " TS " << std::setw(12) << fulCurrentTsIdx << " MS "
1050  << std::setw(12) << fulCurrentMsIdx << " DPB " << std::setw(2)
1051  << fuCurrDpbIdx << " Old TsMsb " << std::setw(5)
1052  << fvulStsCurrentTsMsb[fuCurrDpbIdx] << " Old MsbCy "
1053  << std::setw(5) << fvuStsCurrentTsMsbCycle[fuCurrDpbIdx]
1054  << " new TsMsb " << std::setw(5) << uVal;
1055 
1057  } // if( uVal < fvulStsCurrentTsMsb[fuCurrDpbIdx] )
1058  if (uVal != fvulStsCurrentTsMsb[fuCurrDpbIdx] + 1 && 0 != uVal
1059  && 4194303 != fvulStsCurrentTsMsb[fuCurrDpbIdx] && 1 != uMessIdx) {
1060  LOG(info) << "TS MSb Jump in "
1061  << " TS " << std::setw(12) << fulCurrentTsIdx << " MS "
1062  << std::setw(12) << fulCurrentMsIdx << " MS Idx " << std::setw(4)
1063  << uMsIdx << " Msg Idx " << std::setw(5) << uMessIdx << " DPB "
1064  << std::setw(2) << fuCurrDpbIdx << " => Old TsMsb "
1065  << std::setw(5) << fvulStsCurrentTsMsb[fuCurrDpbIdx]
1066  << " new TsMsb " << std::setw(5) << uVal;
1067  } // if( uVal + 1 != fvulStsCurrentTsMsb[fuCurrDpbIdx] && 4194303 != uVal && 0 != fvulStsCurrentTsMsb[fuCurrDpbIdx] )
1069  /*
1070  ULong64_t ulNewTsMsbTime = static_cast< ULong64_t >( stsxyter::kuHitNbTsBins )
1071  * static_cast< ULong64_t >( fvulStsCurrentTsMsb[fuCurrDpbIdx])
1072  + static_cast< ULong64_t >( stsxyter::kulTsCycleNbBins )
1073  * static_cast< ULong64_t >( fvuStsCurrentTsMsbCycle[fuCurrDpbIdx] );
1074 */
1075 }
1076 
1078  // UInt_t uVal = mess.GetTsMsbVal();
1079 }
1080 /****************** STS Sync ******************************************/
1081 
1082 /****************** TOF Sync ******************************************/
1083 
1084 Bool_t CbmMcbm2018MonitorMcbmRate::ProcessTofMs(const fles::Timeslice& ts,
1085  size_t uMsComp,
1086  UInt_t uMsIdx) {
1087  auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
1088  fuCurrentEquipmentId = msDescriptor.eq_id;
1089  fdTofMsIndex = static_cast<double>(msDescriptor.idx);
1090  const uint8_t* msContent =
1091  reinterpret_cast<const uint8_t*>(ts.content(uMsComp, uMsIdx));
1092 
1093  uint32_t size = msDescriptor.size;
1094  // fulLastMsIdx = msDescriptor.idx;
1095  if (size > 0)
1096  LOG(debug) << "Microslice: " << msDescriptor.idx << " has size: " << size;
1097 
1098  Int_t messageType = -111;
1099 
1100  // If not integer number of message in input buffer, print warning/error
1101  if (0 != (size % kuTofBytesPerMessage))
1102  LOG(error) << "The input microslice buffer does NOT "
1103  << "contain only complete nDPB messages!";
1104 
1105  // Compute the number of complete messages in the input microslice buffer
1106  uint32_t uNbMessages =
1107  (size - (size % kuTofBytesPerMessage)) / kuTofBytesPerMessage;
1108 
1109  // Get the gDPB ID from the MS header
1111  // fuTofGdpbNr = fmTofDpbIdIndexMap[fuTofGdpbId];
1112 
1114  auto it = fmTofDpbIdIndexMap.find(fuTofGdpbId);
1115  if (it == fmTofDpbIdIndexMap.end()) {
1116  LOG(info)
1117  << "---------------------------------------------------------------";
1118  /*
1119  LOG(info) << "hi hv eqid flag si sv idx/start crc size offset";
1120  LOG(info) << Form( "%02x %02x %04x %04x %02x %02x %016llx %08x %08x %016llx",
1121  static_cast<unsigned int>(msDescriptor.hdr_id),
1122  static_cast<unsigned int>(msDescriptor.hdr_ver), msDescriptor.eq_id, msDescriptor.flags,
1123  static_cast<unsigned int>(msDescriptor.sys_id),
1124  static_cast<unsigned int>(msDescriptor.sys_ver), msDescriptor.idx, msDescriptor.crc,
1125  msDescriptor.size, msDescriptor.offset );
1126 */
1127  LOG(info) << FormatMsHeaderPrintout(msDescriptor);
1128  LOG(warning) << "Could not find the gDPB index for AFCK id 0x" << std::hex
1129  << fuTofGdpbId << std::dec << " in timeslice "
1130  << fulCurrentTsIdx << " in microslice " << uMsIdx
1131  << " component " << uMsComp << "\n"
1132  << "If valid this index has to be added in the TOF parameter "
1133  "file in the RocIdArray field";
1134  return kFALSE;
1135  } // if( it == fmTofDpbIdIndexMap.end() )
1136  else
1138 
1139  // Prepare variables for the loop on contents
1140  const uint64_t* pInBuff = reinterpret_cast<const uint64_t*>(msContent);
1141  for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx++) {
1142  // Fill message
1143  uint64_t ulData = static_cast<uint64_t>(pInBuff[uIdx]);
1144  gdpbv100::Message mess(ulData);
1145 
1147  if (0 == uIdx) {
1148  FillTofEpochCycle(ulData);
1149  continue;
1150  } // if( 0 == uIdx )
1151 
1152  if (gLogger->IsLogNeeded(fair::Severity::debug2)) {
1153  mess.printDataCout();
1154  } // if (gLogger->IsLogNeeded( fair::Severity::debug2 ))
1155 
1156  // Increment counter for different message types
1157  // and fill the corresponding histogram
1158  messageType = mess.getMessageType();
1159  fviTofMsgCounter[messageType]++;
1160 
1161  switch (messageType) {
1162  case gdpbv100::MSG_HIT: {
1163  if (!mess.getGdpbHitIs24b()) {
1164  fvmTofEpSupprBuffer[fuTofGdpbNr].push_back(mess);
1165  } // if( !getGdpbHitIs24b() )
1166  break;
1167  } // case gdpbv100::MSG_HIT:
1168  case gdpbv100::MSG_EPOCH: {
1170  FillTofEpochInfo(mess);
1171  } // if this epoch message is a merged one valiud for all chips
1172  else
1173  LOG(fatal) << "Bad epoch: " << mess.getGdpbGenChipId();
1174  break;
1175  } // case gdpbv100::MSG_EPOCH:
1176  case gdpbv100::MSG_SLOWC:
1177  case gdpbv100::MSG_SYST:
1181  case gdpbv100::MSG_STAR_TRI_D: break;
1182  default:
1183  LOG(error) << "Message type " << std::hex << std::setw(2)
1184  << static_cast<uint16_t>(messageType)
1185  << " not included in Get4 unpacker.";
1186  } // switch( mess.getMessageType() )
1187  } // for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx ++)
1188 
1189  return kTRUE;
1190 }
1191 
1193  uint64_t ulEpochCycleVal = ulCycleData & gdpbv100::kulEpochCycleFieldSz;
1194  fvulTofCurrentEpochCycle[fuTofGdpbNr] = ulEpochCycleVal;
1195 
1196  return;
1197 }
1198 
1200  // UInt_t uChannel = mess.getGdpbHitChanId();
1201  // UInt_t uTot = mess.getGdpbHit32Tot();
1202  // UInt_t uFts = mess.getGdpbHitFineTs();
1203 
1204  ULong64_t ulCurEpochGdpbGet4 = fvulTofCurrentEpochFull[fuTofGdpbNr];
1205 
1206  // In Ep. Suppr. Mode, receive following epoch instead of previous
1207  if (0 < ulCurEpochGdpbGet4)
1208  ulCurEpochGdpbGet4--;
1209  else
1210  ulCurEpochGdpbGet4 = gdpbv100::kuEpochCounterSz; // Catch epoch cycle!
1211 
1212  // ULong_t ulHitTime = mess.getMsgFullTime(ulCurEpochGdpbGet4);
1213  // Double_t dHitTime = mess.getMsgFullTimeD(ulCurEpochGdpbGet4);
1214 
1215  // In 32b mode the coarse counter is already computed back to 112 FTS bins
1216  // => need to hide its contribution from the Finetime
1217  // => FTS = Fullt TS modulo 112
1218  // uFts = mess.getGdpbHitFullTs() % 112;
1219 
1221  fvmTofGdpbHitsInMs[fuTofGdpbNr].push_back(
1222  gdpbv100::FullMessage(mess, ulCurEpochGdpbGet4));
1223 }
1224 
1226  ULong64_t ulEpochNr = mess.getGdpbEpEpochNb();
1227 
1228  fvulTofCurrentEpoch[fuTofGdpbNr] = ulEpochNr;
1230  ulEpochNr
1232 
1233  fulTofCurrentEpochTime = mess.getMsgFullTime(ulEpochNr);
1234 
1237  if (0 < ulEpochNr)
1238  mess.setGdpbEpEpochNb(ulEpochNr - 1);
1239  else
1241 
1242  Int_t iBufferSize = fvmTofEpSupprBuffer[fuTofGdpbNr].size();
1243  if (0 < iBufferSize) {
1244  LOG(debug) << "Now processing stored messages for for gDPB " << fuTofGdpbNr
1245  << " with epoch number "
1246  << (fvulTofCurrentEpoch[fuTofGdpbNr] - 1);
1247 
1250  std::stable_sort(fvmTofEpSupprBuffer[fuTofGdpbNr].begin(),
1251  fvmTofEpSupprBuffer[fuTofGdpbNr].begin());
1252 
1253  for (Int_t iMsgIdx = 0; iMsgIdx < iBufferSize; iMsgIdx++) {
1255  } // for( Int_t iMsgIdx = 0; iMsgIdx < iBufferSize; iMsgIdx++ )
1256 
1258  } // if( 0 < fvmTofEpSupprBuffer[fuTofGdpbNr] )
1259 }
1260 /****************** TOF Sync ******************************************/
1261 
1262 /****************** STS histos ****************************************/
1263 /****************** STS histos ****************************************/
1264 
1265 /****************** TOF histos ****************************************/
1266 /****************** TOF Histos ****************************************/
1267 
1269 
1271  /*
1272  LOG(info) << "-------------------------------------";
1273  LOG(info) << "CbmMcbm2018MonitorMcbmRate statistics are ";
1274  LOG(info) << " Hit messages: " << fmMsgCounter[ stsxyter::MessType::Hit ] << "\n"
1275  << " Ts MSB messages: " << fmMsgCounter[ stsxyter::MessType::TsMsb ] << "\n"
1276  << " Dummy messages: " << fmMsgCounter[ stsxyter::MessType::Dummy ] << "\n"
1277  << " Epoch messages: " << fmMsgCounter[ stsxyter::MessType::Epoch ] << "\n"
1278  << " Empty messages: " << fmMsgCounter[ stsxyter::MessType::Empty ];
1279 */
1280  LOG(info) << "-------------------------------------";
1281 
1283  SaveAllHistos();
1284 }
1285 
1286 
1288  TDirectory* oldDir = nullptr;
1289  TFile* histoFile = nullptr;
1290  if ("" != sFileName) {
1291  // Store current directory position to allow restore later
1292  oldDir = gDirectory;
1293  // open separate histo file in recreate mode
1294  histoFile = new TFile(sFileName, "RECREATE");
1295  histoFile->cd();
1296  } // if( "" != sFileName )
1297 
1298  /****************** STS Sync ******************************************/
1299  /****************** STS Sync ******************************************/
1300 
1301  /****************** TOF Sync ******************************************/
1302  /****************** TOF Sync ******************************************/
1303 
1304  /****************** mCBM Sync *****************************************/
1305  gDirectory->mkdir("mCbmRate");
1306  gDirectory->cd("mCbmRate");
1307  fhMcbmHitsNbPerTsEvo->Write();
1308  fhMcbmHitsNbFineEvo->Write();
1309  fhMcbmHitsRateEvo->Write();
1310  fhDiamondHitsRateMapEvo->Write();
1311  fhDiamondHitsRateDerivative->Write();
1312  gDirectory->cd("..");
1313 
1314  gDirectory->mkdir("mCbmCounts");
1315  gDirectory->cd("mCbmCounts");
1316  fhMuchVsStsHitsNbPerTimeBin->Write();
1317  fhTofVsStsHitsNbPerTimeBin->Write();
1318  fhDiamVsStsHitsNbPerTimeBin->Write();
1319  fhStsVsMuchHitsNbPerTimeBin->Write();
1320  fhTofVsMuchHitsNbPerTimeBin->Write();
1322  fhStsVsTofHitsNbPerTimeBin->Write();
1323  fhMuchVsTofHitsNbPerTimeBin->Write();
1324  fhDiamVsTofHitsNbPerTimeBin->Write();
1325  fhStsVsDiamHitsNbPerTimeBin->Write();
1326  fhTofVsDiamHitsNbPerTimeBin->Write();
1328  gDirectory->cd("..");
1329  /****************** mCBM Sync *****************************************/
1330 
1331  if ("" != sFileName) {
1332  // Restore original directory position
1333  histoFile->Close();
1334  oldDir->cd();
1335  } // if( "" != sFileName )
1336 }
1338  /****************** STS Sync ******************************************/
1339  /****************** STS Sync ******************************************/
1340 
1341  /****************** TOF Sync ******************************************/
1342 
1343  /****************** TOF Sync ******************************************/
1344 
1345  /****************** mCBM Sync *****************************************/
1346  fhMcbmHitsNbPerTsEvo->Reset();
1347  fhMcbmHitsNbFineEvo->Reset();
1348  fhMcbmHitsRateEvo->Reset();
1349  fhDiamondHitsRateMapEvo->Reset();
1350  fhDiamondHitsRateDerivative->Reset();
1351 
1352  fhMuchVsStsHitsNbPerTimeBin->Reset();
1353  fhTofVsStsHitsNbPerTimeBin->Reset();
1354  fhDiamVsStsHitsNbPerTimeBin->Reset();
1355  fhStsVsMuchHitsNbPerTimeBin->Reset();
1356  fhTofVsMuchHitsNbPerTimeBin->Reset();
1358  fhStsVsTofHitsNbPerTimeBin->Reset();
1359  fhMuchVsTofHitsNbPerTimeBin->Reset();
1360  fhDiamVsTofHitsNbPerTimeBin->Reset();
1361  fhStsVsDiamHitsNbPerTimeBin->Reset();
1362  fhTofVsDiamHitsNbPerTimeBin->Reset();
1364  /****************** mCBM Sync *****************************************/
1365 }
1366 
CbmMcbm2018MonitorMcbmRate::CreateTofHistograms
void CreateTofHistograms()
Processing methods.
Definition: CbmMcbm2018MonitorMcbmRate.cxx:313
CbmMcbm2018MonitorMcbmRate::fvuHitsNbInTimeBinTof
std::vector< UInt_t > fvuHitsNbInTimeBinTof
Definition: CbmMcbm2018MonitorMcbmRate.h:193
gdpbv100::MSG_STAR_TRI_A
@ MSG_STAR_TRI_A
Definition: gDpbMessv100.h:63
gdpbv100::Message
Definition: gDpbMessv100.h:133
CbmMcbm2018MonitorMcbmRate::ProcessTofMs
Bool_t ProcessTofMs(const fles::Timeslice &ts, size_t uMsComp, UInt_t uMsIdx)
Definition: CbmMcbm2018MonitorMcbmRate.cxx:1084
CbmMcbm2018MonitorMcbmRate::Finish
virtual void Finish()
Definition: CbmMcbm2018MonitorMcbmRate.cxx:1270
CbmMcbm2018MonitorMcbmRate::fPrintMessCtrlSts
stsxyter::MessagePrintMask fPrintMessCtrlSts
Definition: CbmMcbm2018MonitorMcbmRate.h:120
CbmMcbm2018MonitorMcbmRate::fuStsNrOfDpbs
UInt_t fuStsNrOfDpbs
Definition: CbmMcbm2018MonitorMcbmRate.h:93
CbmMcbm2018MonitorMcbmRate::kuStsBytesPerMessage
static const UInt_t kuStsBytesPerMessage
Definition: CbmMcbm2018MonitorMcbmRate.h:108
CbmMcbm2018MonitorMcbmRate::~CbmMcbm2018MonitorMcbmRate
virtual ~CbmMcbm2018MonitorMcbmRate()
Definition: CbmMcbm2018MonitorMcbmRate.cxx:125
gdpbv100::Message::getGdpbEpEpochNb
uint32_t getGdpbEpEpochNb() const
Definition: gDpbMessv100.h:231
CbmMcbm2018MonitorMcbmRate::fulCurrentTsStartTime
ULong64_t fulCurrentTsStartTime
Definition: CbmMcbm2018MonitorMcbmRate.h:124
CbmMcbm2018MonitorMcbmRate::fuDiamondDpbIdx
UInt_t fuDiamondDpbIdx
Definition: CbmMcbm2018MonitorMcbmRate.h:101
CbmMcbm2018MonitorMcbmRate::fulCurrentMsIdx
ULong64_t fulCurrentMsIdx
Definition: CbmMcbm2018MonitorMcbmRate.h:123
CbmMcbm2018MonitorMcbmRate::fvulTofCurrentEpochFull
std::vector< ULong64_t > fvulTofCurrentEpochFull
Definition: CbmMcbm2018MonitorMcbmRate.h:180
CbmMcbm2018MonitorMcbmRate::fmTofDpbIdIndexMap
std::map< UInt_t, UInt_t > fmTofDpbIdIndexMap
Total number of GDPBs in the system.
Definition: CbmMcbm2018MonitorMcbmRate.h:100
CbmMcbm2018MonitorMcbmRate::CreateStsHistograms
void CreateStsHistograms()
All hits (time in bins, ADC in bins, asic, channel) in last TS, sorted with "<" operator.
Definition: CbmMcbm2018MonitorMcbmRate.cxx:249
CbmMcbm2018MonitorMcbmRate::AddMsComponentToListTof
void AddMsComponentToListTof(size_t component)
Definition: CbmMcbm2018MonitorMcbmRate.cxx:232
CbmMcbm2018TofPar::GetGdpbId
Int_t GetGdpbId(Int_t i)
Definition: CbmMcbm2018TofPar.h:67
CbmMcbm2018MonitorMcbmRate.h
CbmMcbm2018MonitorMcbmRate::SetNbMsInTs
virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
Definition: CbmMcbm2018MonitorMcbmRate.cxx:240
CbmMcbm2018MonitorMcbmRate::SaveAllHistos
void SaveAllHistos(TString sFileName="")
Definition: CbmMcbm2018MonitorMcbmRate.cxx:1287
CbmMcbm2018MonitorMcbmRate::kuTimeBinSizeNs
static const UInt_t kuTimeBinSizeNs
Definition: CbmMcbm2018MonitorMcbmRate.h:111
CbmMcbm2018MonitorMcbmRate::fmMsgCounter
std::map< stsxyter::MessType, UInt_t > fmMsgCounter
Definition: CbmMcbm2018MonitorMcbmRate.h:126
CbmMcbm2018TofPar.h
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
gdpbv100::MSG_HIT
@ MSG_HIT
Definition: gDpbMessv100.h:59
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmMcbm2018MonitorMcbmRate::fvuHitsNbInTimeBinSts
std::vector< UInt_t > fvuHitsNbInTimeBinSts
Definition: CbmMcbm2018MonitorMcbmRate.h:191
gdpbv100::MSG_SLOWC
@ MSG_SLOWC
Definition: gDpbMessv100.h:61
CbmMcbm2018MonitorMcbmRate::fvuHitsNbInTimeBinDiam
std::vector< UInt_t > fvuHitsNbInTimeBinDiam
Definition: CbmMcbm2018MonitorMcbmRate.h:194
CbmMcbm2018MonitorMcbmRate::FillTofEpochInfo
void FillTofEpochInfo(gdpbv100::Message)
Definition: CbmMcbm2018MonitorMcbmRate.cxx:1225
CbmMcbm2018MonitorMcbmRate::FillTofHitInfo
void FillTofHitInfo(gdpbv100::Message)
Definition: CbmMcbm2018MonitorMcbmRate.cxx:1199
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
CbmMcbm2018MonitorMcbmRate::fUnpackParTof
CbmMcbm2018TofPar * fUnpackParTof
Unpacking and mapping parameters for TOF.
Definition: CbmMcbm2018MonitorMcbmRate.h:98
stsxyter::Message::GetTsMsbVal
uint32_t GetTsMsbVal() const
For TS MSB data: Returns the TS MSB 22 bit field)
Definition: StsXyterMessage.h:334
CbmMcbm2018MonitorMcbmRate::fdStsTofOffsetNs
Double_t fdStsTofOffsetNs
Definition: CbmMcbm2018MonitorMcbmRate.h:104
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
stsxyter::MessType
MessType
Message types.
Definition: StsXyterMessage.h:27
gdpbv100::Message::setGdpbEpEpochNb
void setGdpbEpEpochNb(uint32_t v)
Definition: gDpbMessv100.h:283
CbmMcbm2018MonitorMcbmRate::Init
virtual Bool_t Init()
Definition: CbmMcbm2018MonitorMcbmRate.cxx:127
CbmMcbm2018MonitorMcbmRate::FillTofEpochCycle
void FillTofEpochCycle(uint64_t ulCycleData)
Definition: CbmMcbm2018MonitorMcbmRate.cxx:1192
CbmMcbm2018MonitorMcbmRate::fulTofCurrentEpochTime
ULong64_t fulTofCurrentEpochTime
Definition: CbmMcbm2018MonitorMcbmRate.h:182
stsxyter::kulTsCycleNbBins
static const uint64_t kulTsCycleNbBins
Definition: StsXyterMessage.h:152
gdpbv100::kuEpochCounterSz
const uint32_t kuEpochCounterSz
Definition: gDpbMessv100.h:40
CbmMcbm2018MonitorMcbmRate::fuCurrentEquipmentId
UInt_t fuCurrentEquipmentId
Definition: CbmMcbm2018MonitorMcbmRate.h:128
CbmMcbm2018MonitorMcbmRate::fUnpackParSts
CbmMcbm2018StsPar * fUnpackParSts
Definition: CbmMcbm2018MonitorMcbmRate.h:92
CbmMcbm2018MonitorMcbmRate::fuTofGdpbId
UInt_t fuTofGdpbId
Definition: CbmMcbm2018MonitorMcbmRate.h:166
CbmMcbm2018MonitorMcbmRate::SetParContainers
void SetParContainers()
Definition: CbmMcbm2018MonitorMcbmRate.cxx:136
CbmMcbm2018MonitorMcbmRate::fvuHitsNbInTimeBinMuch
std::vector< UInt_t > fvuHitsNbInTimeBinMuch
Definition: CbmMcbm2018MonitorMcbmRate.h:192
CbmMcbm2018MonitorMcbmRate
Definition: CbmMcbm2018MonitorMcbmRate.h:34
CbmMcbm2018StsPar::GetNrOfDpbs
UInt_t GetNrOfDpbs()
Definition: CbmMcbm2018StsPar.h:83
CbmMcbm2018MonitorMcbmRate::fuTofGdpbNr
UInt_t fuTofGdpbNr
Definition: CbmMcbm2018MonitorMcbmRate.h:168
stsxyter::Message::GetHitAdc
uint16_t GetHitAdc() const
For Hit data: Returns ADC value (5 bit field)
Definition: StsXyterMessage.h:277
CbmMcbm2018MonitorMcbmRate::InitContainers
Bool_t InitContainers()
Definition: CbmMcbm2018MonitorMcbmRate.cxx:147
CbmMcbm2018MonitorMcbmRate::fvmStsSdpbHitsInMs
std::vector< std::vector< stsxyter::FinalHit > > fvmStsSdpbHitsInMs
Current TS MSB cycle for DPB.
Definition: CbmMcbm2018MonitorMcbmRate.h:144
CbmMcbm2018TofPar::GetNrOfGdpbs
Int_t GetNrOfGdpbs()
FIXME: replace with method returning the correspondign constants! see Star2019 parameter.
Definition: CbmMcbm2018TofPar.h:66
gdpbv100::MSG_STAR_TRI_C
@ MSG_STAR_TRI_C
Definition: gDpbMessv100.h:65
stsxyter::MessType::Empty
@ Empty
CbmMcbm2018MonitorMcbmRate::fdTofMsIndex
Double_t fdTofMsIndex
Definition: CbmMcbm2018MonitorMcbmRate.h:165
CbmMcbm2018MonitorMcbmRate::fhDiamVsTofHitsNbPerTimeBin
TH2 * fhDiamVsTofHitsNbPerTimeBin
Definition: CbmMcbm2018MonitorMcbmRate.h:224
CbmMcbm2018MonitorMcbmRate::Reset
virtual void Reset()
Definition: CbmMcbm2018MonitorMcbmRate.cxx:1268
CbmMcbm2018MonitorMcbmRate::fhDiamondHitsRateDerivative
TH1 * fhDiamondHitsRateDerivative
Definition: CbmMcbm2018MonitorMcbmRate.h:212
CbmMcbm2018MonitorMcbmRate::fhDiamondHitsRateMapEvo
TH2 * fhDiamondHitsRateMapEvo
Definition: CbmMcbm2018MonitorMcbmRate.h:211
CbmMcbm2018MonitorMcbmRate::fhTofVsDiamHitsNbPerTimeBin
TH2 * fhTofVsDiamHitsNbPerTimeBin
Definition: CbmMcbm2018MonitorMcbmRate.h:227
CbmMcbm2018MonitorMcbmRate::ResetAllHistos
void ResetAllHistos()
Definition: CbmMcbm2018MonitorMcbmRate.cxx:1337
CbmMcbm2018MonitorMcbmRate::fbIgnoreOverlapMs
Bool_t fbIgnoreOverlapMs
Definition: CbmMcbm2018MonitorMcbmRate.h:90
CbmMcbm2018MonitorMcbmRate::fhDiamVsMuchHitsNbPerTimeBin
TH2 * fhDiamVsMuchHitsNbPerTimeBin
Definition: CbmMcbm2018MonitorMcbmRate.h:220
CbmMcbm2018MonitorMcbmRate::fuMuchDpbIdx
UInt_t fuMuchDpbIdx
Map of DPB Identifier to DPB index.
Definition: CbmMcbm2018MonitorMcbmRate.h:96
stsxyter::FinalHit
Definition: StsXyterFinalHit.h:16
stsxyter::MessType::Hit
@ Hit
CbmMcbm2018MonitorMcbmRate::kuTofBytesPerMessage
static const UInt_t kuTofBytesPerMessage
TODO => move to the message class!!
Definition: CbmMcbm2018MonitorMcbmRate.h:110
CbmMcbm2018MonitorMcbmRate::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: CbmMcbm2018MonitorMcbmRate.h:146
CbmMcbm2018MonitorMcbmRate::fhMuchVsTofHitsNbPerTimeBin
TH2 * fhMuchVsTofHitsNbPerTimeBin
Definition: CbmMcbm2018MonitorMcbmRate.h:223
stsxyter::kuHitNbTsBins
static const uint32_t kuHitNbTsBins
Definition: StsXyterMessage.h:146
CbmMcbm2018StsPar::ElinkIdxToAsicIdx
UInt_t ElinkIdxToAsicIdx(Bool_t bFebType, UInt_t uElink)
Definition: CbmMcbm2018StsPar.h:69
gdpbv100::kuChipIdMergedEpoch
const uint32_t kuChipIdMergedEpoch
Definition: gDpbMessv100.h:51
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmMcbm2018MonitorMcbmRate::fvulStsCurrentTsMsb
std::vector< ULong64_t > fvulStsCurrentTsMsb
Bin size in s for the plots with date as X axis.
Definition: CbmMcbm2018MonitorMcbmRate.h:139
CbmMcbm2018MonitorMcbmRate::fhStsVsMuchHitsNbPerTimeBin
TH2 * fhStsVsMuchHitsNbPerTimeBin
Definition: CbmMcbm2018MonitorMcbmRate.h:218
gdpbv100::MSG_SYST
@ MSG_SYST
Definition: gDpbMessv100.h:62
CbmMcbm2018MonitorMcbmRate::fviTofMsgCounter
std::vector< int > fviTofMsgCounter
Definition: CbmMcbm2018MonitorMcbmRate.h:170
stsxyter::kdClockCycleNs
static const double kdClockCycleNs
Definition: StsXyterMessage.h:156
CbmMcbm2018MonitorMcbmRate::fmStsDpbIdIndexMap
std::map< UInt_t, UInt_t > fmStsDpbIdIndexMap
Total number of Sts DPBs in system.
Definition: CbmMcbm2018MonitorMcbmRate.h:95
CbmMcbm2018MonitorMcbmRate::fuNbOverMsPerTs
size_t fuNbOverMsPerTs
Definition: CbmMcbm2018MonitorMcbmRate.h:88
CbmMcbm2018StsPar
Definition: CbmMcbm2018StsPar.h:18
stsxyter::Message::GetMessType
MessType GetMessType() const
Returns the message type, see enum MessType.
Definition: StsXyterMessage.h:259
CbmMcbm2018MonitorMcbmRate::fhDiamVsStsHitsNbPerTimeBin
TH2 * fhDiamVsStsHitsNbPerTimeBin
Definition: CbmMcbm2018MonitorMcbmRate.h:216
CbmMcbm2018MonitorMcbmRate::fuCurrDpbId
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
Definition: CbmMcbm2018MonitorMcbmRate.h:130
CbmMcbm2018MonitorMcbmRate::ProcessStsMs
Bool_t ProcessStsMs(const fles::Timeslice &ts, size_t uMsComp, UInt_t uMsIdx)
Definition: CbmMcbm2018MonitorMcbmRate.cxx:847
CbmMcbm2018MonitorMcbmRate::fvMsComponentsListSts
std::vector< size_t > fvMsComponentsListSts
Definition: CbmMcbm2018MonitorMcbmRate.h:80
CbmMcbm2018MonitorMcbmRate::fhStsVsTofHitsNbPerTimeBin
TH2 * fhStsVsTofHitsNbPerTimeBin
Definition: CbmMcbm2018MonitorMcbmRate.h:222
CbmMcbm2018MonitorMcbmRate::FillStsTsMsbInfo
void FillStsTsMsbInfo(stsxyter::Message mess, UInt_t uMessIdx=0, UInt_t uMsIdx=0)
Definition: CbmMcbm2018MonitorMcbmRate.cxx:1041
FormatMsHeaderPrintout
std::string FormatMsHeaderPrintout(const fles::MicrosliceDescriptor &msDescriptor)
Definition: CbmFormatMsHeaderPrintout.cxx:5
CbmMcbm2018MonitorMcbmRate::fhMuchVsDiamHitsNbPerTimeBin
TH2 * fhMuchVsDiamHitsNbPerTimeBin
Definition: CbmMcbm2018MonitorMcbmRate.h:228
gdpbv100::MessagePrintMask
MessagePrintMask
Definition: gDpbMessv100.h:87
CbmMcbm2018MonitorMcbmRate::fvulTofCurrentEpochCycle
std::vector< ULong64_t > fvulTofCurrentEpochCycle
Definition: CbmMcbm2018MonitorMcbmRate.h:179
CbmMcbm2018MonitorMcbmRate::fuTofNrOfDpbs
UInt_t fuTofNrOfDpbs
Definition: CbmMcbm2018MonitorMcbmRate.h:99
CbmMcbm2018TofPar
Definition: CbmMcbm2018TofPar.h:18
gdpbv100::MSG_EPOCH
@ MSG_EPOCH
Definition: gDpbMessv100.h:60
gdpbv100
Definition: gDpbMessv100.cxx:29
CbmMcbm2018MonitorMcbmRate::fvulTofCurrentEpoch
std::vector< ULong64_t > fvulTofCurrentEpoch
Definition: CbmMcbm2018MonitorMcbmRate.h:178
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
CbmMcbm2018MonitorMcbmRate::fhMcbmHitsRateEvo
TH2 * fhMcbmHitsRateEvo
Definition: CbmMcbm2018MonitorMcbmRate.h:209
CbmMcbm2018MonitorMcbmRate::fuNbCoreMsPerTs
size_t fuNbCoreMsPerTs
Definition: CbmMcbm2018MonitorMcbmRate.h:87
CbmMcbm2018MonitorMcbmRate::fdMuchTofOffsetNs
Double_t fdMuchTofOffsetNs
Definition: CbmMcbm2018MonitorMcbmRate.h:105
gdpbv100::kulEpochCycleFieldSz
const uint64_t kulEpochCycleFieldSz
Definition: gDpbMessv100.h:49
gdpbv100::Message::getGdpbHitIs24b
uint16_t getGdpbHitIs24b() const
Definition: gDpbMessv100.h:218
CbmMcbm2018MonitorMcbmRate::CreateMcbmHistograms
void CreateMcbmHistograms()
Definition: CbmMcbm2018MonitorMcbmRate.cxx:385
CbmMcbm2018MonitorMcbmRate::fulCurrentTsIdx
ULong64_t fulCurrentTsIdx
Definition: CbmMcbm2018MonitorMcbmRate.h:122
gdpbv100::Message::getGdpbGenChipId
uint16_t getGdpbGenChipId() const
Definition: gDpbMessv100.h:214
CbmMcbm2018MonitorMcbmRate::AddMsComponentToListSts
void AddMsComponentToListSts(size_t component)
Definition: CbmMcbm2018MonitorMcbmRate.cxx:224
CbmMcbm2018MonitorMcbmRate::fhMcbmHitsNbPerTsEvo
TH2 * fhMcbmHitsNbPerTsEvo
Definition: CbmMcbm2018MonitorMcbmRate.h:207
CbmMcbm2018MonitorMcbmRate::fbPrintMessages
Bool_t fbPrintMessages
Definition: CbmMcbm2018MonitorMcbmRate.h:119
CbmMcbm2018MonitorMcbmRate::fhTofVsMuchHitsNbPerTimeBin
TH2 * fhTofVsMuchHitsNbPerTimeBin
Definition: CbmMcbm2018MonitorMcbmRate.h:219
CbmMcbm2018MonitorMcbmRate::CbmMcbm2018MonitorMcbmRate
CbmMcbm2018MonitorMcbmRate()
Definition: CbmMcbm2018MonitorMcbmRate.cxx:56
CbmMcbm2018MonitorMcbmRate::ReInitContainers
Bool_t ReInitContainers()
Definition: CbmMcbm2018MonitorMcbmRate.cxx:158
CbmMcbm2018MonitorMcbmRate::fvmTofEpSupprBuffer
std::vector< std::vector< gdpbv100::Message > > fvmTofEpSupprBuffer
Buffer for suppressed epoch processing.
Definition: CbmMcbm2018MonitorMcbmRate.h:185
gdpbv100::MSG_STAR_TRI_B
@ MSG_STAR_TRI_B
Definition: gDpbMessv100.h:64
gdpbv100::kulEpochCycleBins
const uint64_t kulEpochCycleBins
Definition: gDpbMessv100.h:42
CbmMcbm2018MonitorMcbmRate::AddMsComponentToList
virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Definition: CbmMcbm2018MonitorMcbmRate.cxx:203
CbmMcbm2018MonitorMcbmRate::fhMuchVsStsHitsNbPerTimeBin
TH2 * fhMuchVsStsHitsNbPerTimeBin
Definition: CbmMcbm2018MonitorMcbmRate.h:214
CbmMcbm2018MonitorMcbmRate::fsHistoFileFullname
TString fsHistoFileFullname
Definition: CbmMcbm2018MonitorMcbmRate.h:117
stsxyter::MessType::TsMsb
@ TsMsb
gdpbv100::FullMessage
Definition: gDpbMessv100.h:362
CbmMcbm2018MonitorMcbmRate::DoUnpack
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
Definition: CbmMcbm2018MonitorMcbmRate.cxx:553
CbmMcbm2018MonitorMcbmRate::fhStsVsDiamHitsNbPerTimeBin
TH2 * fhStsVsDiamHitsNbPerTimeBin
Definition: CbmMcbm2018MonitorMcbmRate.h:226
stsxyter::Message::GetHitTime
uint16_t GetHitTime() const
For Hit data: Returns timestamp (8 bit field, 2 MSB bits overlap removed)
Definition: StsXyterMessage.h:286
CbmMcbm2018MonitorMcbmRate::fvmTofGdpbHitsInMs
std::vector< std::vector< gdpbv100::FullMessage > > fvmTofGdpbHitsInMs
Buffer for system sync check.
Definition: CbmMcbm2018MonitorMcbmRate.h:188
stsxyter::MessType::Dummy
@ Dummy
CbmMcbm2018StsPar.h
stsxyter::MessType::Epoch
@ Epoch
CbmMcbm2018MonitorMcbmRate::fhMcbmHitsNbFineEvo
TH2 * fhMcbmHitsNbFineEvo
Definition: CbmMcbm2018MonitorMcbmRate.h:208
CbmMcbm2018MonitorMcbmRate::fhTofVsStsHitsNbPerTimeBin
TH2 * fhTofVsStsHitsNbPerTimeBin
Definition: CbmMcbm2018MonitorMcbmRate.h:215
gdpbv100::Message::getMsgFullTime
uint64_t getMsgFullTime(uint64_t epoch) const
Returns expanded and adjusted time of message (in ns)
Definition: gDpbMessv100.cxx:98
CbmMcbm2018MonitorMcbmRate::fvMsComponentsListTof
std::vector< size_t > fvMsComponentsListTof
Definition: CbmMcbm2018MonitorMcbmRate.h:86
CbmMcbmUnpack
Definition: CbmMcbmUnpack.h:15
CbmMcbm2018MonitorMcbmRate::fvmTofGdpbHitsInTs
std::vector< std::vector< gdpbv100::FullMessage > > fvmTofGdpbHitsInTs
Definition: CbmMcbm2018MonitorMcbmRate.h:189
CbmMcbm2018MonitorMcbmRate::FillStsEpochInfo
void FillStsEpochInfo(stsxyter::Message mess)
Definition: CbmMcbm2018MonitorMcbmRate.cxx:1077
CbmMcbm2018MonitorMcbmRate::fvuStsCurrentTsMsbCycle
std::vector< UInt_t > fvuStsCurrentTsMsbCycle
Current TS MSB for each DPB.
Definition: CbmMcbm2018MonitorMcbmRate.h:140
CbmMcbm2018MonitorMcbmRate::fuTotalNrOfDpb
UInt_t fuTotalNrOfDpb
Global parameters.
Definition: CbmMcbm2018MonitorMcbmRate.h:103
stsxyter
Definition: StsXyterFinalHit.h:12
CbmMcbm2018MonitorMcbmRate::fuCurrDpbIdx
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
Definition: CbmMcbm2018MonitorMcbmRate.h:132
CbmMcbm2018StsPar::GetNbChanPerAsic
static constexpr UInt_t GetNbChanPerAsic()
Definition: CbmMcbm2018StsPar.h:52
CbmMcbm2018MonitorMcbmRate::kuNbTimeBins
static const UInt_t kuNbTimeBins
Definition: CbmMcbm2018MonitorMcbmRate.h:113
CbmFormatMsHeaderPrintout.h
CbmMcbm2018MonitorMcbmRate::FillStsHitInfo
void FillStsHitInfo(stsxyter::Message mess, const UInt_t &uMsIdx)
Definition: CbmMcbm2018MonitorMcbmRate.cxx:968