CbmRoot
CbmMcbm2018MonitorDataRates.cxx
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 // ----- -----
3 // ----- CbmMcbm2018MonitorDataRates -----
4 // ----- Created 26.03.2019 by P.-A. Loizeau -----
5 // ----- -----
6 // -----------------------------------------------------------------------------
7 
9 
10 #include "CbmFlesHistosTools.h"
12 
13 #include "FairLogger.h"
14 #include "FairRootManager.h"
15 #include "FairRun.h"
16 #include "FairRunOnline.h"
17 #include "FairRuntimeDb.h"
18 
19 #include "Rtypes.h"
20 #include "TCanvas.h"
21 #include "TClonesArray.h"
22 #include "TF1.h"
23 #include "TH1.h"
24 #include "TH2.h"
25 #include "THStack.h"
26 #include "THttpServer.h"
27 #include "TMath.h"
28 #include "TPaveStats.h"
29 #include "TProfile.h"
30 #include "TProfile2D.h"
31 #include "TROOT.h"
32 #include "TString.h"
33 #include "TStyle.h"
34 #include <TFile.h>
35 
36 #include <algorithm>
37 #include <ctime>
38 #include <iomanip>
39 #include <iostream>
40 #include <stdint.h>
41 
44 
46  : CbmMcbmUnpack()
47  , fvMsComponentsList()
48  , fuNbCoreMsPerTs(0)
49  , fuNbOverMsPerTs(0)
50  , fbIgnoreOverlapMs(kFALSE)
51  , fuMsAcceptsPercent(100)
52  , fuTotalMsNb(0)
53  , fuOverlapMsNb(0)
54  , fuCoreMs(0)
55  , fdMsSizeInNs(0.0)
56  , fdTsCoreSizeInNs(0.0)
57  , fsHistoFilename("data/HistosMonitorDataRate.root")
58  , fuNbFlimLinks(16)
59  , fulCurrentTsIndex(0)
60  , fuCurrentMs(0)
61  , fuCurrentMsSysId(0)
62  , fdMsIndex(0)
63  , fiEquipmentId(0)
64  , fdStartTimeMsSz(-1.)
65  , fuHistoryHistoSize(1800)
66  , fvuTsSzLink(fuNbFlimLinks, 0)
67  , fcMsSizeAll(nullptr)
68  , fhDataRateTimeAllLinks(nullptr)
69  , fvhDataRateTimePerLink(fuNbFlimLinks, nullptr)
70  , fvhTsSzPerLink(fuNbFlimLinks, nullptr)
71  , fvhTsSzTimePerLink(fuNbFlimLinks, nullptr)
72  , fvhMsSzPerLink(fuNbFlimLinks, nullptr)
73  , fvhMsSzTimePerLink(fuNbFlimLinks, nullptr)
74  , fvhMsMessPerLink(fuNbFlimLinks, nullptr)
75  , fvhMsMessTimePerLink(fuNbFlimLinks, nullptr)
76  , fvhMsMeanChDataPerLink(fuNbFlimLinks, nullptr)
77  , fvhMsMeanChDataTimePerLink(fuNbFlimLinks, nullptr) {}
78 
80 
82  LOG(info) << "Initializing Get4 monitor";
83 
84  FairRootManager* ioman = FairRootManager::Instance();
85  if (ioman == NULL) {
86  LOG(fatal) << "No FairRootManager instance";
87  } // if( ioman == NULL )
88 
89  return kTRUE;
90 }
91 
93  LOG(info) << "Setting parameter containers for " << GetName();
94 }
95 
97  LOG(info) << "Init parameter containers for " << GetName();
98  Bool_t initOK = ReInitContainers();
99 
101 
102  return initOK;
103 }
104 
106  LOG(info) << "ReInit parameter containers for " << GetName();
107  return kTRUE;
108 }
109 
110 
112  size_t component,
113  UShort_t /*usDetectorId*/) {
115  for (UInt_t uCompIdx = 0; uCompIdx < fvMsComponentsList.size(); ++uCompIdx)
116  if (component == fvMsComponentsList[uCompIdx]) return;
117 
119  fvMsComponentsList.push_back(component);
120 
121  UInt_t uComp = component;
122  if (fuNbFlimLinks <= uComp) {
123  fuNbFlimLinks = uComp + 1;
124  fvhDataRateTimePerLink.resize(fuNbFlimLinks, nullptr);
125  fvhTsSzPerLink.resize(fuNbFlimLinks, nullptr);
126  fvhTsSzTimePerLink.resize(fuNbFlimLinks, nullptr);
127  fvhMsSzPerLink.resize(fuNbFlimLinks, nullptr);
128  fvhMsSzTimePerLink.resize(fuNbFlimLinks, nullptr);
129  fvhMsMessPerLink.resize(fuNbFlimLinks, nullptr);
130  fvhMsMessTimePerLink.resize(fuNbFlimLinks, nullptr);
131  fvhMsMeanChDataPerLink.resize(fuNbFlimLinks, nullptr);
132  fvhMsMeanChDataTimePerLink.resize(fuNbFlimLinks, nullptr);
133 
135  uint32_t iNbBinsLog = 0;
137  std::vector<double> dBinsLogVector =
138  GenerateLogBinArray(9, 9, 10, iNbBinsLog);
139  double* dBinsLog = dBinsLogVector.data();
140  // double * dBinsLog = GenerateLogBinArray( 9, 9, 10, iNbBinsLog );
141 
143  fvhDataRateTimePerLink[uComp] = new TH1D(
144  Form("DataRateTime_link_%02u", uComp),
145  Form(
146  "Data Rate vs time for DPB of link %02u; Time[s] ; DataRate [bytes/s]",
147  uComp),
149  0.,
151 
153  fvhTsSzPerLink[uComp] =
154  new TH1F(Form("TsSz_link_%02u", uComp),
155  Form("Size of TS from link %02u; Ts Size [bytes]", uComp),
156  iNbBinsLog,
157  dBinsLog);
158 
159  fvhTsSzTimePerLink[uComp] = new TProfile(
160  Form("TsSzTime_link_%02u", uComp),
161  Form("Size of TS vs time for DPB of link %02u; Time[s] ; Ts Size [bytes]",
162  uComp),
163  100 * fuHistoryHistoSize,
164  0.,
166 
167  TString sMsSzName = Form("MsSz_link_%02u", uComp);
168  TString sMsSzTitle =
169  Form("Size of MS from link %02u; Ms Size [bytes]", uComp);
170  fvhMsSzPerLink[uComp] =
171  new TH1F(sMsSzName.Data(), sMsSzTitle.Data(), 160000, 0., 20000.);
172 
173  sMsSzName = Form("MsSzTime_link_%02u", uComp);
174  sMsSzTitle =
175  Form("Size of MS vs time for DPB of link %02u; Time[s] ; Ms Size [bytes]",
176  uComp);
177  fvhMsSzTimePerLink[uComp] = new TProfile(sMsSzName.Data(),
178  sMsSzTitle.Data(),
179  100 * fuHistoryHistoSize,
180  0.,
182 
183  sMsSzName = Form("MsMess_link_%02u", uComp);
184  sMsSzTitle =
185  Form("Messages Number of MS from link %02u; Mess Nb []", uComp);
186  fvhMsMessPerLink[uComp] =
187  new TH1F(sMsSzName.Data(), sMsSzTitle.Data(), 5000, 0., 5000.);
188 
189  sMsSzName = Form("MsMessTime_link_%02u", uComp);
190  sMsSzTitle = Form("Messages Number of MS vs time for DPB of link %02u; "
191  "Time[s] ; Mess Nb []",
192  uComp);
193  fvhMsMessTimePerLink[uComp] = new TProfile(sMsSzName.Data(),
194  sMsSzTitle.Data(),
195  100 * fuHistoryHistoSize,
196  0.,
198 
199  sMsSzName = Form("MsMeanChData_link_%02u", uComp);
200  sMsSzTitle = Form(
201  "Mean data size per channels of MS from link %02u; Mean Ch Data [bytes]",
202  uComp);
203  fvhMsMeanChDataPerLink[uComp] =
204  new TH1F(sMsSzName.Data(), sMsSzTitle.Data(), 5000, 0., 5000.);
205 
206  sMsSzName = Form("MsMeanChDataTime_link_%02u", uComp);
207  sMsSzTitle = Form("Mean data size per channel of MS vs time for DPB of "
208  "link %02u; Time[s] ; Mean Ch Data[bytes]",
209  uComp);
210  fvhMsMeanChDataTimePerLink[uComp] = new TH1D(sMsSzName.Data(),
211  sMsSzTitle.Data(),
213  0.,
215 
217  // delete dBinsLog;
218 
219  } // if( fuNbFlimLinks <= uComp )
220 
221  LOG(info) << "Added MS size histo for component (link): " << component;
222 }
224  size_t uOverlapMsNb) {
225  fuNbCoreMsPerTs = uCoreMsNb;
226  fuNbOverMsPerTs = uOverlapMsNb;
227 
228  // UInt_t uNbMsTotal = fuNbCoreMsPerTs + fuNbOverMsPerTs;
229 }
230 
232  LOG(info) << "create Histos ";
233 
234  THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
235 
237  uint32_t iNbBinsLog = 0;
239  std::vector<double> dBinsLogVector =
240  GenerateLogBinArray(9, 9, 10, iNbBinsLog);
241  double* dBinsLog = dBinsLogVector.data();
242  // double * dBinsLog = GenerateLogBinArray( 9, 9, 10, iNbBinsLog );
243 
245  new TH1D("DataRateTime_all",
246  "Data Rate vs time for all DPBs; Time[s] ; DataRate [MB/s]",
248  0.,
250 
251  for (UInt_t uComp = 0; uComp < fuNbFlimLinks; ++uComp) {
253  fvhDataRateTimePerLink[uComp] = new TH1D(
254  Form("DataRateTime_link_%02u", uComp),
255  Form("Data Rate vs time for DPB of link %02u; Time[s] ; DataRate [MB/s]",
256  uComp),
258  0.,
260 
262  fvhTsSzPerLink[uComp] =
263  new TH1F(Form("TsSz_link_%02u", uComp),
264  Form("Size of TS from link %02u; Ts Size [bytes]", uComp),
265  iNbBinsLog,
266  dBinsLog);
267 
268  fvhTsSzTimePerLink[uComp] = new TProfile(
269  Form("TsSzTime_link_%02u", uComp),
270  Form("Size of TS vs time for DPB of link %02u; Time[s] ; Ts Size [bytes]",
271  uComp),
272  100 * fuHistoryHistoSize,
273  0.,
275 
277  TString sMsSzName = Form("MsSz_link_%02u", uComp);
278  TString sMsSzTitle =
279  Form("Size of MS from link %02u; Ms Size [bytes]", uComp);
280  fvhMsSzPerLink[uComp] =
281  new TH1F(sMsSzName.Data(), sMsSzTitle.Data(), iNbBinsLog, dBinsLog);
282 
283  sMsSzName = Form("MsSzTime_link_%02u", uComp);
284  sMsSzTitle =
285  Form("Size of MS vs time for DPB of link %02u; Time[s] ; Ms Size [bytes]",
286  uComp);
287  fvhMsSzTimePerLink[uComp] = new TProfile(sMsSzName.Data(),
288  sMsSzTitle.Data(),
289  100 * fuHistoryHistoSize,
290  0.,
292 
293  sMsSzName = Form("MsMess_link_%02u", uComp);
294  sMsSzTitle =
295  Form("Messages Number of MS from link %02u; Mess Nb []", uComp);
296  fvhMsMessPerLink[uComp] =
297  new TH1F(sMsSzName.Data(), sMsSzTitle.Data(), 5000, 0., 5000.);
298 
299  sMsSzName = Form("MsMessTime_link_%02u", uComp);
300  sMsSzTitle = Form("Messages Number of MS vs time for DPB of link %02u; "
301  "Time[s] ; Mess Nb []",
302  uComp);
303  fvhMsMessTimePerLink[uComp] = new TProfile(sMsSzName.Data(),
304  sMsSzTitle.Data(),
305  100 * fuHistoryHistoSize,
306  0.,
308 
309  sMsSzName = Form("MsMeanChData_link_%02u", uComp);
310  sMsSzTitle = Form(
311  "Mean data size per channels of MS from link %02u; Mean Ch Data [bytes]",
312  uComp);
313  fvhMsMeanChDataPerLink[uComp] =
314  new TH1F(sMsSzName.Data(), sMsSzTitle.Data(), 5000, 0., 5000.);
315 
316  sMsSzName = Form("MsMeanChDataTime_link_%02u", uComp);
317  sMsSzTitle = Form("Mean data size per channel of MS vs time for DPB of "
318  "link %02u; Time[s] ; Mean Ch Data[bytes]",
319  uComp);
320  fvhMsMeanChDataTimePerLink[uComp] = new TH1D(sMsSzName.Data(),
321  sMsSzTitle.Data(),
323  0.,
325 
327  // delete dBinsLog;
328  } // for( UInt_t uComp = 0; uComp < fuNbFlimLinks; ++uComp )
329 
331  Double_t w = 10;
332  Double_t h = 10;
333 
335  new TCanvas("cDataRateTimeAll", "Data Rate per link", w, h);
336  fcDataRateTimeAll->Divide(4, 4);
337 
338  fcTsSizeAll = new TCanvas("cTsSizeAll", "TS size per link", w, h);
339  fcTsSizeAll->Divide(4, 4);
341  new TCanvas("cTsSizeTimeAll", "Evolution of TS size per link", w, h);
342  fcTsSizeTimeAll->Divide(4, 4);
343 
344  fcMsSizeAll = new TCanvas("cMsSizeAll", "MS size per link", w, h);
345  fcMsSizeAll->Divide(4, 4);
347  new TCanvas("cMsSizeTimeAll", "Evolution of MS size per link", w, h);
348  fcMsSizeTimeAll->Divide(4, 4);
349 
350  fcMsMessAll = new TCanvas("cMsMessAll", "MS message number per link", w, h);
351  fcMsMessAll->Divide(4, 4);
352  fcMsMessTimeAll = new TCanvas(
353  "cMsMessTimeAll", "Evolution of MS message number per link", w, h);
354  fcMsMessTimeAll->Divide(4, 4);
355 
356  fcMsDataChAll = new TCanvas(
357  "fcMsDataChAll", "Mean data per channel in each MS, per link", w, h);
358  fcMsDataChAll->Divide(4, 4);
359  fcMsDataChTimeAll = new TCanvas(
360  "fcMsDataChTimeAll", "Evolution of Mean data per channel per link", w, h);
361  fcMsDataChTimeAll->Divide(4, 4);
362 
363  for (UInt_t uComp = 0; uComp < fuNbFlimLinks; ++uComp)
364  if (nullptr != fvhMsSzTimePerLink[uComp]) {
365  fcDataRateTimeAll->cd(1 + uComp);
366  gPad->SetGridx();
367  gPad->SetGridy();
368  gPad->SetLogy();
369  fvhDataRateTimePerLink[uComp]->Draw("hist");
370 
371  fcTsSizeAll->cd(1 + uComp);
372  gPad->SetGridx();
373  gPad->SetGridy();
374  gPad->SetLogy();
375  fvhTsSzPerLink[uComp]->Draw("hist");
376 
377  fcTsSizeTimeAll->cd(1 + uComp);
378  gPad->SetGridx();
379  gPad->SetGridy();
380  gPad->SetLogy();
381  fvhTsSzTimePerLink[uComp]->Draw("hist");
382 
383  fcMsSizeAll->cd(1 + uComp);
384  gPad->SetGridx();
385  gPad->SetGridy();
386  gPad->SetLogy();
387  fvhMsSzPerLink[uComp]->Draw("hist");
388 
389  fcMsSizeTimeAll->cd(1 + uComp);
390  gPad->SetGridx();
391  gPad->SetGridy();
392  gPad->SetLogy();
393  fvhMsSzTimePerLink[uComp]->Draw("hist");
394 
395  fcMsMessAll->cd(1 + uComp);
396  gPad->SetGridx();
397  gPad->SetGridy();
398  gPad->SetLogy();
399  fvhMsMessPerLink[uComp]->Draw("hist");
400 
401  fcMsMessTimeAll->cd(1 + uComp);
402  gPad->SetGridx();
403  gPad->SetGridy();
404  gPad->SetLogy();
405  fvhMsMessTimePerLink[uComp]->Draw("hist");
406 
407  fcMsDataChAll->cd(1 + uComp);
408  gPad->SetGridx();
409  gPad->SetGridy();
410  gPad->SetLogy();
411  fvhMsMeanChDataPerLink[uComp]->Draw("hist");
412 
413  fcMsDataChTimeAll->cd(1 + uComp);
414  gPad->SetGridx();
415  gPad->SetGridy();
416  gPad->SetLogy();
417  fvhMsMeanChDataTimePerLink[uComp]->Draw("hist");
418  } // if( nullptr != fvhMsSzTimePerLink[ uComp ] )
419 
420  LOG(info) << "Created MS size canvas";
421 
422  if (server) {
423  server->Register("/FlibRaw", fhDataRateTimeAllLinks);
424  for (UInt_t uComp = 0; uComp < fuNbFlimLinks; ++uComp) {
425  server->Register("/FlibRaw", fvhDataRateTimePerLink[uComp]);
426  server->Register("/FlibRaw", fvhTsSzPerLink[uComp]);
427  server->Register("/FlibRaw", fvhTsSzTimePerLink[uComp]);
428  server->Register("/FlibRaw", fvhMsSzPerLink[uComp]);
429  server->Register("/FlibRaw", fvhMsSzTimePerLink[uComp]);
430  server->Register("/FlibRaw", fvhMsMessPerLink[uComp]);
431  server->Register("/FlibRaw", fvhMsMessTimePerLink[uComp]);
432  server->Register("/FlibRaw", fvhMsMeanChDataPerLink[uComp]);
433  server->Register("/FlibRaw", fvhMsMeanChDataTimePerLink[uComp]);
434  } // for( UInt_t uComp = 0; uComp < fuNbFlimLinks; ++uComp )
435 
436  server->Register("/canvases", fcDataRateTimeAll);
437  server->Register("/canvases", fcTsSizeAll);
438  server->Register("/canvases", fcTsSizeTimeAll);
439  server->Register("/canvases", fcMsSizeAll);
440  server->Register("/canvases", fcMsSizeTimeAll);
441  server->Register("/canvases", fcMsMessAll);
442  server->Register("/canvases", fcMsMessTimeAll);
443  server->Register("/canvases", fcMsDataChAll);
444  server->Register("/canvases", fcMsDataChTimeAll);
445 
446  server->RegisterCommand("/Reset_All_Hist",
447  "bMcbmMoniDataRateResetHistos=kTRUE");
448  server->RegisterCommand("/Save_All_Hist",
449  "bMcbmMoniDataRateSaveHistos=kTRUE");
450 
451  server->Restrict("/Reset_All_Hist", "allow=admin");
452  server->Restrict("/Save_All_Hist", "allow=admin");
453  } // if( server )
454 
455  LOG(info) << "Leaving CreateHistograms";
456 }
457 
458 Bool_t CbmMcbm2018MonitorDataRates::DoUnpack(const fles::Timeslice& ts,
459  size_t /*component*/) {
461  LOG(info) << "Reset eTOF STAR histos ";
462  ResetAllHistos();
464  } // if( bMcbmMoniDataRateResetHistos )
466  LOG(info) << "Start saving Data Rates Moni histos ";
467  SaveAllHistos("data/Histos_Shift_DataRates.root");
469  } // if( bSaveStsHistos )
470 
472  if (0 == ts.index()) return kTRUE;
473 
475  UInt_t uNbMsLoop = fuNbCoreMsPerTs;
476  if (kFALSE == fbIgnoreOverlapMs) uNbMsLoop += fuNbOverMsPerTs;
477 
478  // Int_t messageType = -111;
479  // Double_t dTsStartTime = -1;
480 
482  for (UInt_t uComp = 0; uComp < fuNbFlimLinks; ++uComp)
483  fvuTsSzLink[uComp] = 0;
484 
486  for (UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx++) {
487  if (fuMsAcceptsPercent < uMsIdx) continue;
488 
489  fuCurrentMs = uMsIdx;
490 
491  if (0 == fulCurrentTsIndex && 0 == uMsIdx) {
492  for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size();
493  ++uMsCompIdx) {
494  UInt_t uMsComp = fvMsComponentsList[uMsCompIdx];
495  auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
496  /*
497  LOG(info) << "hi hv eqid flag si sv idx/start crc size offset";
498  LOG(info) << Form( "%02x %02x %04x %04x %02x %02x %016llx %08x %08x %016llx",
499  static_cast<unsigned int>(msDescriptor.hdr_id),
500  static_cast<unsigned int>(msDescriptor.hdr_ver), msDescriptor.eq_id, msDescriptor.flags,
501  static_cast<unsigned int>(msDescriptor.sys_id),
502  static_cast<unsigned int>(msDescriptor.sys_ver), msDescriptor.idx, msDescriptor.crc,
503  msDescriptor.size, msDescriptor.offset );
504 */
505  LOG(info) << FormatMsHeaderPrintout(msDescriptor);
506  } // for( UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx )
507  } // if( 0 == fulCurrentTsIndex && 0 == uMsIdx )
508 
510  for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size();
511  ++uMsCompIdx) {
512  // constexpr uint32_t kuBytesPerMessage = 8;
513 
514  UInt_t uMsComp = fvMsComponentsList[uMsCompIdx];
515  auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
516  UInt_t uSysId = msDescriptor.sys_id;
517  fiEquipmentId = msDescriptor.eq_id;
518  fdMsIndex = static_cast<double>(msDescriptor.idx) * (1e-9);
519  fuCurrentMsSysId = static_cast<unsigned int>(msDescriptor.sys_id);
520  // const uint8_t* msContent = reinterpret_cast<const uint8_t*>( ts.content( uMsComp, uMsIdx ) );
521 
522  uint32_t size = msDescriptor.size;
523  Double_t dSizeMb = size;
524  dSizeMb = dSizeMb / 1024 / 1024;
525  fvuTsSzLink[uMsComp] += size;
526 
527  // if( 0 == uMsIdx && 0 == uMsCompIdx )
528  // dTsStartTime = fdMsIndex;
529 
531  fvhMsSzPerLink[uMsComp]->Fill(size);
533  // Reset the evolution Histogram and the start time when we reach the end of the range
534  fvhMsSzTimePerLink[uMsComp]->Reset();
535  fvhMsMessTimePerLink[uMsComp]->Reset();
536  fvhMsMeanChDataTimePerLink[uMsComp]->Reset();
538  } // if( fuHistoryHistoSize < fdMsIndex - fdStartTimeMsSz )
541  dSizeMb);
542  fvhMsSzTimePerLink[uMsComp]->Fill(fdMsIndex - fdStartTimeMsSz, size);
543 
544  // Compute the number of complete messages in the input microslice buffer, depending on sysid
545  uint32_t uNbMessages = 0;
546  switch (uSysId) {
547  case kuSysIdSts:
548  uNbMessages =
549  (size - (size % kuBytesPerMessageSts)) / kuBytesPerMessageSts;
550  break;
551  case kuSysIdRich:
552  uNbMessages =
553  (size - (size % kuBytesPerMessageRich)) / kuBytesPerMessageRich;
554  break;
555  case kuSysIdMuch:
556  uNbMessages =
557  (size - (size % kuBytesPerMessageMuch)) / kuBytesPerMessageMuch;
558  break;
559  case kuSysIdTof:
560  uNbMessages =
561  (size - (size % kuBytesPerMessageTof)) / kuBytesPerMessageTof;
562  break;
563  case kuSysIdT0:
564  uNbMessages =
565  (size - (size % kuBytesPerMessageT0)) / kuBytesPerMessageT0;
566  break;
567  default: uNbMessages = (size - (size % 4)) / 4;
568  } // switch( uSysId )
569  fvhMsMessPerLink[uMsComp]->Fill(uNbMessages);
571  uNbMessages);
572 
575  Double_t dMeanDataPerChan = size;
576  dMeanDataPerChan /= fmChannelsPerEqId[fiEquipmentId];
577  fvhMsMeanChDataPerLink[uMsComp]->Fill(dMeanDataPerChan);
579  dMeanDataPerChan);
580  } // if( fDpbIdIndexMap.end() != fmChannelsPerEqId.find( fiEquipmentId ) )
581  } // for( UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx )
582  } // for( UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx ++ )
583 
585  for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size();
586  ++uMsCompIdx) {
587  UInt_t uMsComp = fvMsComponentsList[uMsCompIdx];
588  fvhTsSzPerLink[uMsComp]->Fill(fvuTsSzLink[uMsComp]);
590  fvuTsSzLink[uMsComp]);
591  } // for( UInt_t uComp = 0; uComp < fuNbFlimLinks; ++uComp )
592 
594 
595  return kTRUE;
596 }
597 
599 
601 
603  TDirectory* oldDir = NULL;
604  TFile* histoFile = NULL;
605  if ("" != sFileName) {
606  // Store current directory position to allow restore later
607  oldDir = gDirectory;
608  // open separate histo file in recreate mode
609  histoFile = new TFile(sFileName, "RECREATE");
610  histoFile->cd();
611  } // if( "" != sFileName )
612 
613  gDirectory->mkdir("Flib_Raw");
614  gDirectory->cd("Flib_Raw");
615  fhDataRateTimeAllLinks->Write();
616  for (UInt_t uLinks = 0; uLinks < fuNbFlimLinks; uLinks++)
617  if (nullptr != fvhMsSzTimePerLink[uLinks]) {
618  fvhDataRateTimePerLink[uLinks]->Write();
619  fvhTsSzPerLink[uLinks]->Write();
620  fvhTsSzTimePerLink[uLinks]->Write();
621  fvhMsSzPerLink[uLinks]->Write();
622  fvhMsSzTimePerLink[uLinks]->Write();
623  fvhMsMessPerLink[uLinks]->Write();
624  fvhMsMessTimePerLink[uLinks]->Write();
625  fvhMsMeanChDataPerLink[uLinks]->Write();
626  fvhMsMeanChDataTimePerLink[uLinks]->Write();
627  } // if( nullptr != fvhMsSzTimePerLink[ uComp ] )
628  fcMsSizeAll->Write();
629  fcMsSizeTimeAll->Write();
630  fcMsMessAll->Write();
631  fcMsMessTimeAll->Write();
632  fcMsDataChAll->Write();
633  fcMsDataChTimeAll->Write();
634 
635  TH1* pMissedTsH1 = dynamic_cast<TH1*>(gROOT->FindObjectAny("Missed_TS"));
636  if (NULL != pMissedTsH1) pMissedTsH1->Write();
637 
638  TProfile* pMissedTsEvoP =
639  dynamic_cast<TProfile*>(gROOT->FindObjectAny("Missed_TS_Evo"));
640  if (NULL != pMissedTsEvoP) pMissedTsEvoP->Write();
641 
642  gDirectory->cd("..");
643 
644 
645  if ("" != sFileName) {
646  // Restore original directory position
647  histoFile->Close();
648  oldDir->cd();
649  } // if( "" != sFileName )
650 }
651 
653  LOG(info) << "Reseting all histograms.";
654 
655  fhDataRateTimeAllLinks->Reset();
656  for (UInt_t uLinks = 0; uLinks < fuNbFlimLinks; uLinks++)
657  if (nullptr != fvhMsSzTimePerLink[uLinks]) {
658  fvhDataRateTimePerLink[uLinks]->Reset();
659  fvhTsSzPerLink[uLinks]->Reset();
660  fvhTsSzTimePerLink[uLinks]->Reset();
661  fvhMsSzPerLink[uLinks]->Reset();
662  fvhMsSzTimePerLink[uLinks]->Reset();
663  fvhMsMessPerLink[uLinks]->Reset();
664  fvhMsMessTimePerLink[uLinks]->Reset();
665  fvhMsMeanChDataPerLink[uLinks]->Reset();
666  fvhMsMeanChDataTimePerLink[uLinks]->Reset();
667  } // if( nullptr != fvhMsSzTimePerLink[ uComp ] )
668 
669  fdStartTimeMsSz = -1;
670 }
CbmMcbm2018MonitorDataRates::fvhMsSzPerLink
std::vector< TH1 * > fvhMsSzPerLink
Definition: CbmMcbm2018MonitorDataRates.h:141
CbmMcbm2018MonitorDataRates::fvMsComponentsList
std::vector< size_t > fvMsComponentsList
FLES containers.
Definition: CbmMcbm2018MonitorDataRates.h:74
CbmMcbm2018MonitorDataRates::fvhMsMessTimePerLink
std::vector< TProfile * > fvhMsMessTimePerLink
Definition: CbmMcbm2018MonitorDataRates.h:144
CbmMcbm2018MonitorDataRates::fuMsAcceptsPercent
size_t fuMsAcceptsPercent
/‍** Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice **‍/
Definition: CbmMcbm2018MonitorDataRates.h:86
CbmMcbm2018MonitorDataRates::kuSysIdT0
static const UInt_t kuSysIdT0
Definition: CbmMcbm2018MonitorDataRates.h:113
CbmMcbm2018MonitorDataRates::ResetAllHistos
void ResetAllHistos()
Definition: CbmMcbm2018MonitorDataRates.cxx:652
bMcbmMoniDataRateResetHistos
Bool_t bMcbmMoniDataRateResetHistos
Definition: CbmMcbm2018MonitorDataRates.cxx:42
CbmMcbm2018MonitorDataRates::fvhMsMessPerLink
std::vector< TH1 * > fvhMsMessPerLink
Definition: CbmMcbm2018MonitorDataRates.h:143
CbmMcbm2018MonitorDataRates::SaveAllHistos
void SaveAllHistos(TString sFileName="")
Definition: CbmMcbm2018MonitorDataRates.cxx:602
CbmMcbm2018MonitorDataRates::fmChannelsPerEqId
std::map< UInt_t, UInt_t > fmChannelsPerEqId
Parameters.
Definition: CbmMcbm2018MonitorDataRates.h:99
CbmMcbm2018MonitorDataRates::CbmMcbm2018MonitorDataRates
CbmMcbm2018MonitorDataRates()
Definition: CbmMcbm2018MonitorDataRates.cxx:45
CbmMcbm2018MonitorDataRates::SetNbMsInTs
virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
Definition: CbmMcbm2018MonitorDataRates.cxx:223
CbmMcbm2018MonitorDataRates::~CbmMcbm2018MonitorDataRates
virtual ~CbmMcbm2018MonitorDataRates()
Definition: CbmMcbm2018MonitorDataRates.cxx:79
bMcbmMoniDataRateSaveHistos
Bool_t bMcbmMoniDataRateSaveHistos
Definition: CbmMcbm2018MonitorDataRates.cxx:43
CbmMcbm2018MonitorDataRates::fbIgnoreOverlapMs
Bool_t fbIgnoreOverlapMs
Definition: CbmMcbm2018MonitorDataRates.h:82
CbmMcbm2018MonitorDataRates::fhDataRateTimeAllLinks
TH1 * fhDataRateTimeAllLinks
Definition: CbmMcbm2018MonitorDataRates.h:137
CbmMcbm2018MonitorDataRates::fcMsDataChTimeAll
TCanvas * fcMsDataChTimeAll
Definition: CbmMcbm2018MonitorDataRates.h:136
CbmMcbm2018MonitorDataRates::fcTsSizeTimeAll
TCanvas * fcTsSizeTimeAll
Definition: CbmMcbm2018MonitorDataRates.h:130
CbmMcbm2018MonitorDataRates::fuCurrentMsSysId
size_t fuCurrentMsSysId
Definition: CbmMcbm2018MonitorDataRates.h:104
CbmMcbm2018MonitorDataRates::fuNbCoreMsPerTs
size_t fuNbCoreMsPerTs
Definition: CbmMcbm2018MonitorDataRates.h:79
CbmMcbm2018MonitorDataRates::Init
virtual Bool_t Init()
Definition: CbmMcbm2018MonitorDataRates.cxx:81
CbmMcbm2018MonitorDataRates::fcDataRateTimeAll
TCanvas * fcDataRateTimeAll
Definition: CbmMcbm2018MonitorDataRates.h:128
CbmMcbm2018MonitorDataRates::fulCurrentTsIndex
uint64_t fulCurrentTsIndex
Definition: CbmMcbm2018MonitorDataRates.h:102
CbmMcbm2018MonitorDataRates::ReInitContainers
Bool_t ReInitContainers()
Definition: CbmMcbm2018MonitorDataRates.cxx:105
CbmMcbm2018MonitorDataRates::fuNbFlimLinks
UInt_t fuNbFlimLinks
Definition: CbmMcbm2018MonitorDataRates.h:96
h
Data class with information on a STS local track.
CbmMcbm2018MonitorDataRates::fvhTsSzPerLink
std::vector< TH1 * > fvhTsSzPerLink
Definition: CbmMcbm2018MonitorDataRates.h:139
CbmMcbm2018MonitorDataRates::kuBytesPerMessageSts
static const UInt_t kuBytesPerMessageSts
Definition: CbmMcbm2018MonitorDataRates.h:114
CbmMcbm2018MonitorDataRates::fsHistoFilename
TString fsHistoFilename
Definition: CbmMcbm2018MonitorDataRates.h:95
CbmMcbm2018MonitorDataRates::kuBytesPerMessageT0
static const UInt_t kuBytesPerMessageT0
Definition: CbmMcbm2018MonitorDataRates.h:118
CbmMcbm2018MonitorDataRates::kuBytesPerMessageMuch
static const UInt_t kuBytesPerMessageMuch
Definition: CbmMcbm2018MonitorDataRates.h:116
CbmMcbm2018MonitorDataRates::fcMsDataChAll
TCanvas * fcMsDataChAll
Definition: CbmMcbm2018MonitorDataRates.h:135
CbmMcbm2018MonitorDataRates::fvhMsMeanChDataPerLink
std::vector< TH1 * > fvhMsMeanChDataPerLink
Definition: CbmMcbm2018MonitorDataRates.h:145
CbmMcbm2018MonitorDataRates::kuSysIdRich
static const UInt_t kuSysIdRich
Definition: CbmMcbm2018MonitorDataRates.h:110
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmMcbm2018MonitorDataRates::kuSysIdTof
static const UInt_t kuSysIdTof
Definition: CbmMcbm2018MonitorDataRates.h:112
CbmMcbm2018MonitorDataRates::Reset
virtual void Reset()
Definition: CbmMcbm2018MonitorDataRates.cxx:598
CbmMcbm2018MonitorDataRates::fvuTsSzLink
std::vector< UInt_t > fvuTsSzLink
Definition: CbmMcbm2018MonitorDataRates.h:126
CbmMcbm2018MonitorDataRates::fcMsSizeTimeAll
TCanvas * fcMsSizeTimeAll
Definition: CbmMcbm2018MonitorDataRates.h:132
CbmMcbm2018MonitorDataRates::SetParContainers
void SetParContainers()
Definition: CbmMcbm2018MonitorDataRates.cxx:92
CbmMcbm2018MonitorDataRates::fvhDataRateTimePerLink
std::vector< TH1 * > fvhDataRateTimePerLink
Definition: CbmMcbm2018MonitorDataRates.h:138
CbmMcbm2018MonitorDataRates::fiEquipmentId
Int_t fiEquipmentId
Definition: CbmMcbm2018MonitorDataRates.h:106
CbmMcbm2018MonitorDataRates
Definition: CbmMcbm2018MonitorDataRates.h:30
CbmMcbm2018MonitorDataRates::fdStartTimeMsSz
Double_t fdStartTimeMsSz
Histograms and histogram control variables.
Definition: CbmMcbm2018MonitorDataRates.h:123
FormatMsHeaderPrintout
std::string FormatMsHeaderPrintout(const fles::MicrosliceDescriptor &msDescriptor)
Definition: CbmFormatMsHeaderPrintout.cxx:5
CbmMcbm2018MonitorDataRates::fcMsSizeAll
TCanvas * fcMsSizeAll
Definition: CbmMcbm2018MonitorDataRates.h:131
CbmMcbm2018MonitorDataRates::fuNbOverMsPerTs
size_t fuNbOverMsPerTs
Definition: CbmMcbm2018MonitorDataRates.h:80
CbmMcbm2018MonitorDataRates::fcMsMessAll
TCanvas * fcMsMessAll
Definition: CbmMcbm2018MonitorDataRates.h:133
GenerateLogBinArray
std::vector< double > GenerateLogBinArray(uint32_t uNbDecadesLog, uint32_t uNbStepsDecade, uint32_t uNbSubStepsInStep, uint32_t &uNbBinsLog)
Definition: CbmFlesHistosTools.cxx:6
CbmMcbm2018MonitorDataRates::fuCurrentMs
size_t fuCurrentMs
Definition: CbmMcbm2018MonitorDataRates.h:103
CbmMcbm2018MonitorDataRates::kuBytesPerMessageRich
static const UInt_t kuBytesPerMessageRich
Definition: CbmMcbm2018MonitorDataRates.h:115
CbmMcbm2018MonitorDataRates::AddMsComponentToList
virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Definition: CbmMcbm2018MonitorDataRates.cxx:111
CbmMcbm2018MonitorDataRates::fvhTsSzTimePerLink
std::vector< TProfile * > fvhTsSzTimePerLink
Definition: CbmMcbm2018MonitorDataRates.h:140
CbmMcbm2018MonitorDataRates::fuHistoryHistoSize
UInt_t fuHistoryHistoSize
Definition: CbmMcbm2018MonitorDataRates.h:124
CbmMcbm2018MonitorDataRates.h
CbmMcbm2018MonitorDataRates::Finish
virtual void Finish()
Definition: CbmMcbm2018MonitorDataRates.cxx:600
CbmFlesHistosTools.h
CbmMcbm2018MonitorDataRates::InitContainers
Bool_t InitContainers()
Definition: CbmMcbm2018MonitorDataRates.cxx:96
CbmMcbm2018MonitorDataRates::fcMsMessTimeAll
TCanvas * fcMsMessTimeAll
Definition: CbmMcbm2018MonitorDataRates.h:134
CbmMcbm2018MonitorDataRates::DoUnpack
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
Definition: CbmMcbm2018MonitorDataRates.cxx:458
CbmMcbm2018MonitorDataRates::fcTsSizeAll
TCanvas * fcTsSizeAll
Definition: CbmMcbm2018MonitorDataRates.h:129
CbmMcbm2018MonitorDataRates::fvhMsSzTimePerLink
std::vector< TProfile * > fvhMsSzTimePerLink
Definition: CbmMcbm2018MonitorDataRates.h:142
CbmMcbm2018MonitorDataRates::fvhMsMeanChDataTimePerLink
std::vector< TH1 * > fvhMsMeanChDataTimePerLink
Definition: CbmMcbm2018MonitorDataRates.h:146
CbmMcbmUnpack
Definition: CbmMcbmUnpack.h:15
CbmMcbm2018MonitorDataRates::kuBytesPerMessageTof
static const UInt_t kuBytesPerMessageTof
Definition: CbmMcbm2018MonitorDataRates.h:117
CbmMcbm2018MonitorDataRates::fdMsIndex
Double_t fdMsIndex
Definition: CbmMcbm2018MonitorDataRates.h:105
CbmMcbm2018MonitorDataRates::CreateHistograms
void CreateHistograms()
Definition: CbmMcbm2018MonitorDataRates.cxx:231
CbmMcbm2018MonitorDataRates::kuSysIdSts
static const UInt_t kuSysIdSts
Constants.
Definition: CbmMcbm2018MonitorDataRates.h:109
CbmFormatMsHeaderPrintout.h
CbmMcbm2018MonitorDataRates::kuSysIdMuch
static const UInt_t kuSysIdMuch
Definition: CbmMcbm2018MonitorDataRates.h:111