CbmRoot
CbmMcbm2018MonitorSts.cxx
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 // ----- -----
3 // ----- CbmMcbm2018MonitorSts -----
4 // ----- Created 11/05/18 by P.-A. Loizeau -----
5 // ----- -----
6 // -----------------------------------------------------------------------------
7 
9 
11 
12 // Data
13 
14 // CbmRoot
15 #include "CbmHistManager.h"
16 #include "CbmMcbm2018StsPar.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 "THttpServer.h"
28 #include "TMath.h"
29 #include "TROOT.h"
30 #include "TRandom.h"
31 #include "TString.h"
32 #include "TStyle.h"
33 #include <TFile.h>
34 
35 // C++11
36 #include <bitset>
37 
38 // C/C++
39 #include <iomanip>
40 #include <iostream>
41 #include <stdint.h>
42 
43 Bool_t bMcbm2018ResetSts = kFALSE;
44 Bool_t bMcbm2018WriteSts = kFALSE;
45 Bool_t bMcbm2018ScanNoisySts = kFALSE;
46 
48  : CbmMcbmUnpack()
49  , fvbMaskedComponents()
50  , fvMsComponentsList()
51  , fuNbCoreMsPerTs(0)
52  , fuNbOverMsPerTs(0)
53  , fbIgnoreOverlapMs(kFALSE)
54  , fUnpackParSts(NULL)
55  , fuNbModules(0)
56  , fviModuleType()
57  , fviModAddress()
58  , fuNrOfDpbs(0)
59  , fDpbIdIndexMap()
60  , fvbCrobActiveFlag()
61  , fuNbFebs(0)
62  , fuNbStsXyters(0)
63  , fviFebModuleIdx()
64  , fviFebModuleSide()
65  , fviFebType()
66  , fvdFebAdcGain()
67  , fvdFebAdcOffs()
68  ,
69  /*
70  fuNrOfDpbs(0),
71  fDpbIdIndexMap(),
72  fuNbStsXyters(0),
73  fUnpackParSts->GetNbChanPerAsic()(0),
74  fuNbFebs(0),
75 */
76  fsHistoFileFullname("data/SetupHistos.root")
77  , fbPrintMessages(kFALSE)
78  , fPrintMessCtrl(stsxyter::MessagePrintMask::msg_print_Human)
79  ,
80  // fbEnableCoincidenceMaps( kFALSE ),
81  fbEnableCheckBugSmx20(kFALSE)
82  , fulCurrentTsIdx(0)
83  , fulCurrentMsIdx(0)
84  , fmMsgCounter()
85  , fuCurrentEquipmentId(0)
86  , fuCurrDpbId(0)
87  , fuCurrDpbIdx(0)
88  , fiRunStartDateTimeSec(-1)
89  , fiBinSizeDatePlots(-1)
90  , fvulCurrentTsMsb()
91  , fvuCurrentTsMsbCycle()
92  , fvuInitialHeaderDone()
93  , fvuInitialTsMsbCycleHeader()
94  , fvuElinkLastTsHit()
95  , fvulChanLastHitTime()
96  , fvdChanLastHitTime()
97  , fvdPrevMsTime()
98  , fvdMsTime()
99  , fvuChanNbHitsInMs()
100  , fvdChanLastHitTimeInMs()
101  , fvusChanLastHitAdcInMs()
102  ,
103  // fvmChanHitsInTs(),
104  fdStartTime(-1.0)
105  , fdStartTimeMsSz(-1.0)
106  , ftStartTimeUnix(std::chrono::steady_clock::now())
107  , fvmHitsInMs()
108  , fvmAsicHitsInMs()
109  , fvmFebHitsInMs()
110  , fuMaxNbMicroslices(100)
111  , fiTimeIntervalRateUpdate(10)
112  , fvdFebTimeSecLastRateUpdate()
113  , fviFebCountsSinceLastRateUpdate()
114  , fvdFebChanCountsSinceLastRateUpdate()
115  , fbLongHistoEnable(kFALSE)
116  , fuLongHistoNbSeconds(0)
117  , fuLongHistoBinSizeSec(0)
118  , fuLongHistoBinNb(0)
119  , fdCoincCenter(0.0)
120  , fdCoincBorder(50.0)
121  , fdCoincMin(fdCoincCenter - fdCoincBorder)
122  , fdCoincMax(fdCoincCenter + fdCoincBorder)
123  , fHM(new CbmHistManager())
124  , fhStsMessType(NULL)
125  , fhStsSysMessType(NULL)
126  , fhStsMessTypePerDpb(NULL)
127  , fhStsSysMessTypePerDpb(NULL)
128  , fhStsStatusMessType(NULL)
129  , fhStsMsStatusFieldType(NULL)
130  , fhStsMessTypePerElink(NULL)
131  , fhStsHitsElinkPerDpb(NULL)
132  , fhStsAllFebsHitRateEvo(nullptr)
133  , fhStsAllAsicsHitRateEvo(nullptr)
134  , fhStsFebAsicHitCounts(nullptr)
135  , fdFebChanCoincidenceLimit(100.0)
136  , fhStsFebChanCntRaw()
137  , fhStsFebChanCntRawGood()
138  , fhStsFebChanAdcRaw()
139  , fhStsFebChanAdcRawProf()
140  ,
141  // fhStsFebChanAdcCal(),
142  // fhStsFebChanAdcCalProf(),
143  fhStsFebChanRawTs()
144  , fhStsFebChanMissEvt()
145  , fhStsFebChanMissEvtEvo()
146  , fhStsFebAsicMissEvtEvo()
147  , fhStsFebMissEvtEvo()
148  , fhStsFebChanHitRateEvo()
149  , fhStsFebChanHitRateProf()
150  , fhStsFebAsicHitRateEvo()
151  , fhStsFebHitRateEvo()
152  , fhStsFebChanHitRateEvoLong()
153  , fhStsFebAsicHitRateEvoLong()
154  , fhStsFebHitRateEvoLong()
155  , fdStsFebChanLastTimeForDist()
156  , fhStsFebChanDistT()
157  , fhStsFebChanCloseHitsCounts()
158  , fhStsFebChanCloseHitsRatio()
159  ,
160  /*
161  fhStsFebChanDtCoinc(),
162  fhStsFebChanCoinc(),
163  fhStsModulePNCoincDt(),
164  fhStsModulePNCoincDtAsicP(),
165  fhStsModulePNCoincDtAsicN(),
166  fhStsModulePNCoincChan(),
167  fhStsModulePNCoincAdc(),
168  fhStsModuleCoincAdcChanP(),
169  fhStsModuleCoincAdcChanN(),
170  fhStsModuleCoincMap(),
171 */
172  fbSmx2ErrorUseNoiseLevels(kFALSE)
173  , fdSmxErrCoincWinM07(kdSmxErrCoincWinMainM07)
174  , fdSmxErrCoincWinM08(kdSmxErrCoincWinMainM08)
175  , fdSmxErrCoincWinM09(kdSmxErrCoincWinMainM09)
176  , fdSmxErrCoincWinM10(kdSmxErrCoincWinMainM10)
177  , fdSmxErrCoincWinM11(kdSmxErrCoincWinMainM11)
178  , fvdSmxErrTimeLastHits()
179  , fvuSmxErrIdxFirstHitM07()
180  , fvuSmxErrIdxFirstHitM08()
181  , fvuSmxErrIdxFirstHitM09()
182  , fvuSmxErrIdxFirstHitM10()
183  , fvuSmxErrIdxFirstHitM11()
184  , fvuSmxErrIdxLastHit()
185  , fhStsFebSmxErrRatioEvo()
186  , fhStsFebSmxErrRatioEvoAsic()
187  , fhStsFebSmxErrRatioCopyEvo()
188  , fhStsFebSmxErrRatioCopyEvoAsic()
189  , fhStsFebSmxErrRatioCopySameAdcEvo()
190  , fhStsFebSmxErrRatioCopySameAdcEvoAsic()
191  , fcMsSizeAll(NULL) {}
192 
194 
196  LOG(info) << "Initializing flib StsXyter unpacker for STS";
197 
198  FairRootManager* ioman = FairRootManager::Instance();
199  if (ioman == NULL) { LOG(fatal) << "No FairRootManager instance"; }
200 
201  return kTRUE;
202 }
203 
205  LOG(info) << "Setting parameter containers for " << GetName();
206  fUnpackParSts =
207  (CbmMcbm2018StsPar*) (FairRun::Instance()->GetRuntimeDb()->getContainer(
208  "CbmMcbm2018StsPar"));
209 }
210 
211 
213  LOG(info) << "Init parameter containers for " << GetName();
214 
215  Bool_t bInit = InitStsParameters();
216  if (kTRUE == bInit) CreateHistograms();
217 
218  return bInit;
219 }
220 
222  LOG(info) << "ReInit parameter containers for " << GetName();
223 
224  return InitStsParameters();
225 }
226 
228 
229 
231  LOG(info) << "Nr. of STS Modules: " << fuNbModules;
232 
233  fviModuleType.resize(fuNbModules);
234  fviModAddress.resize(fuNbModules);
235  for (UInt_t uModIdx = 0; uModIdx < fuNbModules; ++uModIdx) {
236  fviModuleType[uModIdx] = fUnpackParSts->GetModuleType(uModIdx);
237  fviModAddress[uModIdx] = fUnpackParSts->GetModuleAddress(uModIdx);
238  LOG(info) << "Module #" << std::setw(2) << uModIdx << " Type "
239  << std::setw(4) << fviModuleType[uModIdx] << " Address 0x"
240  << std::setw(8) << std::hex << fviModAddress[uModIdx] << std::dec;
241  } // for( UInt_t uModIdx = 0; uModIdx < fuNbModules; ++uModIdx)
242 
244  LOG(info) << "Nr. of STS DPBs: " << fuNrOfDpbs;
245 
246  fDpbIdIndexMap.clear();
247  for (UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb) {
248  fDpbIdIndexMap[fUnpackParSts->GetDpbId(uDpb)] = uDpb;
249  LOG(info) << "Eq. ID for DPB #" << std::setw(2) << uDpb << " = 0x"
250  << std::setw(4) << std::hex << fUnpackParSts->GetDpbId(uDpb)
251  << std::dec << " => "
253  } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
254 
256  LOG(info) << "Nr. of FEBs: " << fuNbFebs;
257 
259  LOG(info) << "Nr. of StsXyter ASICs: " << fuNbStsXyters;
260 
262  fviFebModuleIdx.resize(fuNrOfDpbs);
264  fviFebType.resize(fuNrOfDpbs);
265  fvdFebAdcGain.resize(fuNrOfDpbs);
266  fvdFebAdcOffs.resize(fuNrOfDpbs);
267  for (UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb) {
271  fviFebType[uDpb].resize(fUnpackParSts->GetNbCrobsPerDpb());
274  for (UInt_t uCrobIdx = 0; uCrobIdx < fUnpackParSts->GetNbCrobsPerDpb();
275  ++uCrobIdx) {
276  fvbCrobActiveFlag[uDpb][uCrobIdx] =
277  fUnpackParSts->IsCrobActive(uDpb, uCrobIdx);
278 
279  fviFebModuleIdx[uDpb][uCrobIdx].resize(fUnpackParSts->GetNbFebsPerCrob());
280  fviFebModuleSide[uDpb][uCrobIdx].resize(
282  fviFebType[uDpb][uCrobIdx].resize(fUnpackParSts->GetNbFebsPerCrob(), -1);
283  fvdFebAdcGain[uDpb][uCrobIdx].resize(fUnpackParSts->GetNbFebsPerCrob(),
284  0.0);
285  fvdFebAdcOffs[uDpb][uCrobIdx].resize(fUnpackParSts->GetNbFebsPerCrob(),
286  0.0);
287  for (UInt_t uFebIdx = 0; uFebIdx < fUnpackParSts->GetNbFebsPerCrob();
288  ++uFebIdx) {
289  fviFebModuleIdx[uDpb][uCrobIdx][uFebIdx] =
290  fUnpackParSts->GetFebModuleIdx(uDpb, uCrobIdx, uFebIdx);
291  fviFebModuleSide[uDpb][uCrobIdx][uFebIdx] =
292  fUnpackParSts->GetFebModuleSide(uDpb, uCrobIdx, uFebIdx);
293  fvdFebAdcGain[uDpb][uCrobIdx][uFebIdx] =
294  fUnpackParSts->GetFebAdcGain(uDpb, uCrobIdx, uFebIdx);
295  fvdFebAdcOffs[uDpb][uCrobIdx][uFebIdx] =
296  fUnpackParSts->GetFebAdcOffset(uDpb, uCrobIdx, uFebIdx);
297 
298  if (0 <= fviFebModuleSide[uDpb][uCrobIdx][uFebIdx]
299  && static_cast<UInt_t>(fviFebModuleIdx[uDpb][uCrobIdx][uFebIdx])
300  < fuNbModules) {
301  switch (fviModuleType[fviFebModuleIdx[uDpb][uCrobIdx][uFebIdx]]) {
302  case 0: // FEB-8-1 with ZIF connector on the right
303  {
304  // P side (0) has type A (0)
305  // N side (1) has type B (1)
306  fviFebType[uDpb][uCrobIdx][uFebIdx] =
307  fviFebModuleSide[uDpb][uCrobIdx][uFebIdx];
308  break;
309  } // case 0: // FEB-8-1 with ZIF connector on the right
310  case 1: // FEB-8-1 with ZIF connector on the left
311  {
312  // P side (0) has type B (1)
313  // N side (1) has type A (0)
314  fviFebType[uDpb][uCrobIdx][uFebIdx] =
315  !(fviFebModuleSide[uDpb][uCrobIdx][uFebIdx]);
316  break;
317  } // case 1: // FEB-8-1 with ZIF connector on the left
318  default: break;
319  } // switch( fviModuleType[ fviFebModuleIdx[ uDpb ][ uCrobIdx ][ uFebIdx ] ] )
320  } // FEB active and module index OK
321  } // for( UInt_t uFebIdx = 0; uFebIdx < fUnpackParSts->GetNbFebsPerCrob(); ++ uFebIdx )
322  } // for( UInt_t uCrobIdx = 0; uCrobIdx < fUnpackParSts->GetNbCrobsPerDpb(); ++uCrobIdx )
323  } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
324 
325  for (UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb) {
326  for (UInt_t uCrobIdx = 0; uCrobIdx < fUnpackParSts->GetNbCrobsPerDpb();
327  ++uCrobIdx) {
328  LOG(info) << Form("DPB #%02u CROB #%02u Active: ", uDpb, uCrobIdx)
329  << fvbCrobActiveFlag[uDpb][uCrobIdx];
330  } // for( UInt_t uCrobIdx = 0; uCrobIdx < fUnpackParSts->GetNbCrobsPerDpb(); ++uCrobIdx )
331  } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
332 
333  for (UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb) {
334  for (UInt_t uCrobIdx = 0; uCrobIdx < fUnpackParSts->GetNbCrobsPerDpb();
335  ++uCrobIdx) {
336  LOG(info) << Form("DPB #%02u CROB #%u: ", uDpb, uCrobIdx);
337  for (UInt_t uFebIdx = 0; uFebIdx < fUnpackParSts->GetNbFebsPerCrob();
338  ++uFebIdx)
339  if (0 <= fviFebModuleIdx[uDpb][uCrobIdx][uFebIdx]) {
340  LOG(info) << Form(
341  " FEB #%02u: Mod. Idx = %03d Side %c (%2d) Type %c (%2d) ADC "
342  "gain %4.0f e- ADC Offs %5.0f e-",
343  uFebIdx,
344  fviFebModuleIdx[uDpb][uCrobIdx][uFebIdx],
345  1 == fviFebModuleSide[uDpb][uCrobIdx][uFebIdx] ? 'N' : 'P',
346  fviFebModuleSide[uDpb][uCrobIdx][uFebIdx],
347  1 == fviFebType[uDpb][uCrobIdx][uFebIdx] ? 'B' : 'A',
348  fviFebType[uDpb][uCrobIdx][uFebIdx],
349  fvdFebAdcGain[uDpb][uCrobIdx][uFebIdx],
350  fvdFebAdcOffs[uDpb][uCrobIdx][uFebIdx]);
351  } // for( UInt_t uFebIdx = 0; uFebIdx < fUnpackParSts->GetNbFebsPerCrob(); ++ uFebIdx )
352  } // for( UInt_t uCrobIdx = 0; uCrobIdx < fUnpackParSts->GetNbCrobsPerDpb(); ++uCrobIdx )
353  } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
354 
355  if (fbBinningFw)
356  LOG(info) << "Unpacking data in bin sorter FW mode";
357  else
358  LOG(info) << "Unpacking data in full time sorter FW mode (legacy)";
359 
360  // Internal status initialization
366  for (UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb) {
367  fvulCurrentTsMsb[uDpb] = 0;
368  fvuCurrentTsMsbCycle[uDpb] = 0;
369  fvuInitialHeaderDone[uDpb] = kFALSE;
370  fvuInitialTsMsbCycleHeader[uDpb] = 0;
371  } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
372 
374 
382 
383  for (UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx) {
384  fvulChanLastHitTime[uXyterIdx].resize(fUnpackParSts->GetNbChanPerAsic());
385  fvdChanLastHitTime[uXyterIdx].resize(fUnpackParSts->GetNbChanPerAsic());
386  fvuChanNbHitsInMs[uXyterIdx].resize(fUnpackParSts->GetNbChanPerAsic());
389  fvmAsicHitsInMs[uXyterIdx].clear();
390 
391  for (UInt_t uChan = 0; uChan < fUnpackParSts->GetNbChanPerAsic(); ++uChan) {
392  fvulChanLastHitTime[uXyterIdx][uChan] = 0;
393  fvdChanLastHitTime[uXyterIdx][uChan] = -1.0;
394 
395  fvuChanNbHitsInMs[uXyterIdx][uChan].resize(fuMaxNbMicroslices);
396  fvdChanLastHitTimeInMs[uXyterIdx][uChan].resize(fuMaxNbMicroslices);
397  fvusChanLastHitAdcInMs[uXyterIdx][uChan].resize(fuMaxNbMicroslices);
398  for (UInt_t uMsIdx = 0; uMsIdx < fuMaxNbMicroslices; ++uMsIdx) {
399  fvuChanNbHitsInMs[uXyterIdx][uChan][uMsIdx] = 0;
400  fvdChanLastHitTimeInMs[uXyterIdx][uChan][uMsIdx] = -1.0;
401  fvusChanLastHitAdcInMs[uXyterIdx][uChan][uMsIdx] = 0;
402  } // for( UInt_t uMsIdx = 0; uMsIdx < fuMaxNbMicroslices; ++uMsIdx )
403  } // for( UInt_t uChan = 0; uChan < fUnpackParSts->GetNbChanPerAsic(); ++uChan )
404  } // for( UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx )
405 
406  LOG(info) << "CbmMcbm2018MonitorSts::ReInitContainers => Changed "
407  "fvuChanNbHitsInMs size "
408  << fvuChanNbHitsInMs.size() << " VS " << fuNbStsXyters;
409  LOG(info) << "CbmMcbm2018MonitorSts::ReInitContainers => Changed "
410  "fvuChanNbHitsInMs size "
411  << fvuChanNbHitsInMs[0].size() << " VS "
413  LOG(info) << "CbmMcbm2018MonitorSts::ReInitContainers => Changed "
414  "fvuChanNbHitsInMs size "
415  << fvuChanNbHitsInMs[0][0].size() << " VS " << fuMaxNbMicroslices;
416 
417  fvmFebHitsInMs.resize(fuNbFebs);
422  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
423  fvmFebHitsInMs[uFebIdx].clear();
424  fvdFebChanCountsSinceLastRateUpdate[uFebIdx].resize(
426  fdStsFebChanLastTimeForDist[uFebIdx].resize(
427  fUnpackParSts->GetNbChanPerFeb(), -1.0);
428  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
429 
433 
434  return kTRUE;
435 }
436 
438  UShort_t /*usDetectorId*/) {
440  for (UInt_t uCompIdx = 0; uCompIdx < fvMsComponentsList.size(); ++uCompIdx)
441  if (component == fvMsComponentsList[uCompIdx]) return;
442 
444  if (kiMaxNbFlibLinks <= component) {
445  LOG(error) << "CbmMcbm2018MonitorSts::AddMsComponentToList => "
446  << "Ignored the addition of component " << component
447  << " as it is above the hadcoded limit of "
448  << static_cast<const Int_t>(kiMaxNbFlibLinks) << " !!!!!!!!! "
449  << "\n"
450  << " To change this behavior check kiMaxNbFlibLinks in "
451  "CbmMcbm2018MonitorSts.cxx";
452  return;
453  } // if( kiMaxNbFlibLinks <= component )
454 
455 
457  fvMsComponentsList.push_back(component);
458  LOG(info)
459  << "CbmMcbm2018MonitorSts::AddMsComponentToList => Added component: "
460  << component;
461 
463  if (NULL == fhMsSz[component]) {
464  TString sMsSzName = Form("MsSz_link_%02lu", component);
465  TString sMsSzTitle =
466  Form("Size of MS for nDPB of link %02lu; Ms Size [bytes]", component);
467  fhMsSz[component] =
468  new TH1F(sMsSzName.Data(), sMsSzTitle.Data(), 30000, 0., 30000.);
469  fHM->Add(sMsSzName.Data(), fhMsSz[component]);
470 
471  sMsSzName = Form("MsSzTime_link_%02lu", component);
472  sMsSzTitle = Form(
473  "Size of MS vs time for gDPB of link %02lu; Time[s] ; Ms Size [bytes]",
474  component);
475  fhMsSzTime[component] =
476  new TProfile(sMsSzName.Data(), sMsSzTitle.Data(), 15000, 0., 300.);
477  fHM->Add(sMsSzName.Data(), fhMsSzTime[component]);
478 
479  if (NULL != fcMsSizeAll) {
480  fcMsSizeAll->cd(1 + component);
481  gPad->SetLogy();
482  fhMsSzTime[component]->Draw("hist le0");
483  } // if( NULL != fcMsSizeAll )
484  LOG(info) << "Added MS size histo for component: " << component << " (DPB)";
485 
486  THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
487  if (server) {
488  server->Register("/FlibRaw", fhMsSz[component]);
489  server->Register("/FlibRaw", fhMsSzTime[component]);
490  } // if( server )
491  } // if( NULL == fhMsSz[ component ] )
492 }
493 void CbmMcbm2018MonitorSts::SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb) {
494  fuNbCoreMsPerTs = uCoreMsNb;
495  fuNbOverMsPerTs = uOverlapMsNb;
496 
497  UInt_t uNbMsTotal = fuNbCoreMsPerTs + fuNbOverMsPerTs;
498 
499  if (fuMaxNbMicroslices < uNbMsTotal) {
500  fuMaxNbMicroslices = uNbMsTotal;
501 
506  for (UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx) {
507  fvuChanNbHitsInMs[uXyterIdx].resize(fUnpackParSts->GetNbChanPerAsic());
508  fvdChanLastHitTimeInMs[uXyterIdx].resize(
510  fvusChanLastHitAdcInMs[uXyterIdx].resize(
512  for (UInt_t uChan = 0; uChan < fUnpackParSts->GetNbChanPerAsic();
513  ++uChan) {
514  fvuChanNbHitsInMs[uXyterIdx][uChan].resize(fuMaxNbMicroslices);
515  fvdChanLastHitTimeInMs[uXyterIdx][uChan].resize(fuMaxNbMicroslices);
516  fvusChanLastHitAdcInMs[uXyterIdx][uChan].resize(fuMaxNbMicroslices);
517  for (UInt_t uMsIdx = 0; uMsIdx < fuMaxNbMicroslices; ++uMsIdx) {
518  fvuChanNbHitsInMs[uXyterIdx][uChan][uMsIdx] = 0;
519  fvdChanLastHitTimeInMs[uXyterIdx][uChan][uMsIdx] = -1.0;
520  fvusChanLastHitAdcInMs[uXyterIdx][uChan][uMsIdx] = 0;
521  } // for( UInt_t uMsIdx = 0; uMsIdx < fuMaxNbMicroslices; ++uMsIdx )
522  } // for( UInt_t uChan = 0; uChan < fUnpackParSts->GetNbChanPerAsic(); ++uChan )
523  } // for( UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx )
524  LOG(info)
525  << "CbmMcbm2018MonitorSts::DoUnpack => Changed fvuChanNbHitsInMs size "
526  << fvuChanNbHitsInMs.size() << " VS " << fuNbStsXyters;
527  LOG(info)
528  << "CbmMcbm2018MonitorSts::DoUnpack => Changed fvuChanNbHitsInMs size "
529  << fvuChanNbHitsInMs[0].size() << " VS "
531  LOG(info)
532  << "CbmMcbm2018MonitorSts::DoUnpack => Changed fvuChanNbHitsInMs size "
533  << fvuChanNbHitsInMs[0][0].size() << " VS " << fuMaxNbMicroslices;
534  } // if( fuMaxNbMicroslices < uNbMsTotal )
535 }
536 /*
537 void CbmMcbm2018MonitorSts::SetCoincidenceBorder( Double_t dCenterPos, Double_t dBorderVal )
538 {
539  fdCoincCenter = dCenterPos;
540  fdCoincBorder = dBorderVal;
541  fdCoincMin = dCenterPos - dBorderVal;
542  fdCoincMax = dCenterPos + dBorderVal;
543 }
544 */
546  TString sHistName {""};
547  TString title {""};
548 
549  sHistName = "hPulserMessageType";
550  title = "Nb of message for each type; Type";
551  fhStsMessType = new TH1I(sHistName, title, 6, 0., 6.);
552  fhStsMessType->GetXaxis()->SetBinLabel(1, "Dummy");
553  fhStsMessType->GetXaxis()->SetBinLabel(2, "Hit");
554  fhStsMessType->GetXaxis()->SetBinLabel(3, "TsMsb");
555  fhStsMessType->GetXaxis()->SetBinLabel(4, "Epoch");
556  fhStsMessType->GetXaxis()->SetBinLabel(5, "Status");
557  fhStsMessType->GetXaxis()->SetBinLabel(6, "Empty");
558 
559  /* *** Missing int + MessType OP!!!! ****
560  fhStsMessType->GetXaxis()->SetBinLabel(1 + stsxyter::MessType::Dummy, "Dummy");
561  fhStsMessType->GetXaxis()->SetBinLabel(1 + stsxyter::MessType::Hit, "Hit");
562  fhStsMessType->GetXaxis()->SetBinLabel(1 + stsxyter::MessType::TsMsb, "TsMsb");
563  fhStsMessType->GetXaxis()->SetBinLabel(1 + stsxyter::MessType::ReadDataAck, "ReadDataAck");
564  fhStsMessType->GetXaxis()->SetBinLabel(1 + stsxyter::MessType::Ack, "Ack");
565 */
566 
567  sHistName = "hPulserSysMessType";
568  title = "Nb of system message for each type; System Type";
569  fhStsSysMessType = new TH1I(sHistName, title, 17, 0., 17.);
570  /*
571  hSysMessType->GetXaxis()->SetBinLabel(1 + ngdpb::SYSMSG_DAQ_START, "DAQ START");
572  hSysMessType->GetXaxis()->SetBinLabel(1 + ngdpb::SYSMSG_DAQ_FINISH, "DAQ FINISH");
573  hSysMessType->GetXaxis()->SetBinLabel(1 + 16, "GET4 Hack 32B");
574 */
575 
576  sHistName = "hPulserMessageTypePerDpb";
577  title = "Nb of message of each type for each DPB; DPB; Type";
579  new TH2I(sHistName, title, fuNrOfDpbs, 0, fuNrOfDpbs, 6, 0., 6.);
580  fhStsMessTypePerDpb->GetYaxis()->SetBinLabel(1, "Dummy");
581  fhStsMessTypePerDpb->GetYaxis()->SetBinLabel(2, "Hit");
582  fhStsMessTypePerDpb->GetYaxis()->SetBinLabel(3, "TsMsb");
583  fhStsMessTypePerDpb->GetYaxis()->SetBinLabel(4, "Epoch");
584  fhStsMessTypePerDpb->GetYaxis()->SetBinLabel(5, "Status");
585  fhStsMessTypePerDpb->GetYaxis()->SetBinLabel(6, "Empty");
586  /* *** Missing int + MessType OP!!!! ****
587  fhStsMessType->GetYaxis()->SetBinLabel(1 + stsxyter::MessType::Dummy, "Dummy");
588  fhStsMessType->GetYaxis()->SetBinLabel(1 + stsxyter::MessType::Hit, "Hit");
589  fhStsMessType->GetYaxis()->SetBinLabel(1 + stsxyter::MessType::TsMsb, "TsMsb");
590  fhStsMessType->GetYaxis()->SetBinLabel(1 + stsxyter::MessType::ReadDataAck, "ReadDataAck");
591  fhStsMessType->GetYaxis()->SetBinLabel(1 + stsxyter::MessType::Ack, "Ack");
592 */
593 
594  sHistName = "hPulserSysMessTypePerDpb";
595  title = "Nb of system message of each type for each DPB; DPB; System Type";
597  new TH2I(sHistName, title, fuNrOfDpbs, 0, fuNrOfDpbs, 17, 0., 17.);
598  /*
599  hSysMessType->GetYaxis()->SetBinLabel(1 + ngdpb::SYSMSG_DAQ_START, "DAQ START");
600  hSysMessType->GetYaxis()->SetBinLabel(1 + ngdpb::SYSMSG_DAQ_FINISH, "DAQ FINISH");
601  hSysMessType->GetYaxis()->SetBinLabel(1 + 16, "GET4 Hack 32B");
602 */
603 
604  sHistName = "hStsStatusMessType";
605  title = "Nb of status message of each type for each DPB; ASIC; Status Type";
607  new TH2I(sHistName, title, fuNbStsXyters, 0, fuNbStsXyters, 16, 0., 16.);
608  /*
609  fhStsStatusMessType->GetYaxis()->SetBinLabel( 1, "Dummy");
610  fhStsStatusMessType->GetYaxis()->SetBinLabel( 2, "Hit");
611  fhStsStatusMessType->GetYaxis()->SetBinLabel( 3, "TsMsb");
612  fhStsStatusMessType->GetYaxis()->SetBinLabel( 4, "Epoch");
613 */
614 
615  sHistName = "hStsMsStatusFieldType";
616  title =
617  "For each flag in the MS header, ON/OFF counts; Flag bit []; ON/OFF; MS []";
619  new TH2I(sHistName, title, 16, -0.5, 15.5, 2, -0.5, 1.5);
620  /*
621  fhStsMsStatusFieldType->GetYaxis()->SetBinLabel( 1, "Dummy");
622  fhStsMsStatusFieldType->GetYaxis()->SetBinLabel( 2, "Hit");
623  fhStsMsStatusFieldType->GetYaxis()->SetBinLabel( 3, "TsMsb");
624  fhStsMsStatusFieldType->GetYaxis()->SetBinLabel( 4, "Epoch");
625 */
626 
627  sHistName = "hStsMessTypePerElink";
628  title = "Nb of message of each type for each DPB; DPB; Type";
630  new TH2I(sHistName,
631  title,
633  0,
635  6,
636  0.,
637  6.);
638  fhStsMessTypePerElink->GetYaxis()->SetBinLabel(1, "Dummy");
639  fhStsMessTypePerElink->GetYaxis()->SetBinLabel(2, "Hit");
640  fhStsMessTypePerElink->GetYaxis()->SetBinLabel(3, "TsMsb");
641  fhStsMessTypePerElink->GetYaxis()->SetBinLabel(4, "Epoch");
642  fhStsMessTypePerElink->GetYaxis()->SetBinLabel(5, "Status");
643  fhStsMessTypePerElink->GetYaxis()->SetBinLabel(6, "Empty");
644 
645  sHistName = "hStsHitsElinkPerDpb";
646  title = "Nb of hit messages per eLink for each DPB; DPB; eLink; Hits nb []";
648  new TH2I(sHistName, title, fuNrOfDpbs, 0, fuNrOfDpbs, 42, 0., 42.);
649 
651  sHistName = "hStsAllFebsHitRateEvo";
652  title = "Hits per second & FEB; Time [s]; FEB []; Hits []";
654  new TH2I(sHistName, title, 1800, 0, 1800, fuNbFebs, -0.5, fuNbFebs - 0.5);
655 
657  sHistName = "hStsAllAsicsHitRateEvo";
658  title = "Hits per second & ASIC; Time [s]; ASIC []; Hits []";
659  fhStsAllAsicsHitRateEvo = new TH2I(
660  sHistName, title, 1800, 0, 1800, fuNbStsXyters, -0.5, fuNbStsXyters - 0.5);
661 
663  sHistName = "hStsFebAsicHitCounts";
664  title = "Hits per FEB & ASIC; FEB []; ASIC in FEB[]; Hits []";
665  fhStsFebAsicHitCounts = new TH2I(sHistName,
666  title,
667  fuNbFebs,
668  -0.5,
669  fuNbFebs - 0.5,
671  -0.5,
673  /*
674  // Number of rate bins =
675  // 9 for the sub-unit decade
676  // + 9 for each unit of each decade * 10 for the subdecade range
677  // + 1 for the closing bin top edge
678  const Int_t iNbDecadesRate = 9;
679  const Int_t iNbStepsDecade = 9;
680  const Int_t iNbSubStepsInStep = 10;
681  const Int_t iNbBinsRate = iNbStepsDecade
682  + iNbStepsDecade * iNbSubStepsInStep * iNbDecadesRate
683  + 1;
684  Double_t dBinsRate[iNbBinsRate];
685  // First fill sub-unit decade
686  for( Int_t iSubU = 0; iSubU < iNbStepsDecade; iSubU ++ )
687  dBinsRate[ iSubU ] = 0.1 * ( 1 + iSubU );
688  std::cout << std::endl;
689  // Then fill the main decades
690  Double_t dSubstepSize = 1.0 / iNbSubStepsInStep;
691  for( Int_t iDecade = 0; iDecade < iNbDecadesRate; iDecade ++)
692  {
693  Double_t dBase = std::pow( 10, iDecade );
694  Int_t iDecadeIdx = iNbStepsDecade
695  + iDecade * iNbStepsDecade * iNbSubStepsInStep;
696  for( Int_t iStep = 0; iStep < iNbStepsDecade; iStep++ )
697  {
698  Int_t iStepIdx = iDecadeIdx + iStep * iNbSubStepsInStep;
699  for( Int_t iSubStep = 0; iSubStep < iNbSubStepsInStep; iSubStep++ )
700  {
701  dBinsRate[ iStepIdx + iSubStep ] = dBase * (1 + iStep)
702  + dBase * dSubstepSize * iSubStep;
703  } // for( Int_t iSubStep = 0; iSubStep < iNbSubStepsInStep; iSubStep++ )
704  } // for( Int_t iStep = 0; iStep < iNbStepsDecade; iStep++ )
705  } // for( Int_t iDecade = 0; iDecade < iNbDecadesRate; iDecade ++)
706  dBinsRate[ iNbBinsRate - 1 ] = std::pow( 10, iNbDecadesRate );
707 */
709  UInt_t uAlignedLimit =
711  fuLongHistoBinNb = uAlignedLimit / fuLongHistoBinSizeSec;
712 
713  // UInt_t uNbBinEvo = (32768 + 1) * 2;
714  // Double_t dMaxEdgeEvo = stsxyter::kdClockCycleNs
715  // * static_cast< Double_t >( uNbBinEvo ) / 2.0;
716  // Double_t dMinEdgeEvo = dMaxEdgeEvo * -1.0;
717 
718  // UInt_t uNbBinDt = static_cast<UInt_t>( (fdCoincMax - fdCoincMin )/stsxyter::kdClockCycleNs );
719 
723  // fhStsFebChanDtCoinc.resize( fuNbFebs );
724  // fhStsFebChanCoinc.resize( fuNbFebs );
725  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
727  sHistName = Form("hStsFebChanCntRaw_%03u", uFebIdx);
728  title =
729  Form("Hits Count per channel, FEB #%03u; Channel; Hits []", uFebIdx);
730  fhStsFebChanCntRaw.push_back(
731  new TH1I(sHistName,
732  title,
734  -0.5,
735  fUnpackParSts->GetNbChanPerFeb() - 0.5));
736 
737  sHistName = Form("hStsFebChanCntRawGood_%03u", uFebIdx);
738  title = Form("Hits Count per channel in good MS (SX2 bug flag off), FEB "
739  "#%03u; Channel; Hits []",
740  uFebIdx);
741  fhStsFebChanCntRawGood.push_back(
742  new TH1I(sHistName,
743  title,
745  -0.5,
746  fUnpackParSts->GetNbChanPerFeb() - 0.5));
747 
749  sHistName = Form("hStsFebChanAdcRaw_%03u", uFebIdx);
750  title = Form("Raw Adc distribution per channel, FEB #%03u; Channel []; Adc "
751  "[]; Hits []",
752  uFebIdx);
753  fhStsFebChanAdcRaw.push_back(
754  new TH2I(sHistName,
755  title,
757  -0.5,
760  -0.5,
761  stsxyter::kuHitNbAdcBins - 0.5));
762 
764  sHistName = Form("hStsFebChanAdcRawProfc_%03u", uFebIdx);
765  title = Form("Raw Adc prodile per channel, FEB #%03u; Channel []; Adc []",
766  uFebIdx);
767  fhStsFebChanAdcRawProf.push_back(
768  new TProfile(sHistName,
769  title,
771  -0.5,
772  fUnpackParSts->GetNbChanPerFeb() - 0.5));
773  /*
775  sHistName = Form( "hStsFebChanAdcCal_%03u", uFebIdx );
776  title = Form( "Cal. Adc distribution per channel, FEB #%03u; Channel []; Adc [e-]; Hits []", uFebIdx );
777  fhStsFebChanAdcCal.push_back( new TH2I(sHistName, title,
778  fUnpackParSts->GetNbChanPerFeb(), -0.5, fUnpackParSts->GetNbChanPerFeb() - 0.5,
779  50, 0., 100000. ) );
780 
782  sHistName = Form( "hStsFebChanAdcCalProfc_%03u", uFebIdx );
783  title = Form( "Cal. Adc prodile per channel, FEB #%03u; Channel []; Adc [e-]", uFebIdx );
784  fhStsFebChanAdcCalProf.push_back( new TProfile(sHistName, title,
785  fUnpackParSts->GetNbChanPerFeb(), -0.5, fUnpackParSts->GetNbChanPerFeb() - 0.5 ) );
786 */
788  sHistName = Form("hStsFebChanRawTs_%03u", uFebIdx);
789  title = Form("Raw Timestamp distribution per channel, FEB #%03u; Channel "
790  "[]; Ts []; Hits []",
791  uFebIdx);
792  fhStsFebChanRawTs.push_back(new TH2I(sHistName,
793  title,
795  -0.5,
798  -0.5,
799  stsxyter::kuHitNbTsBins - 0.5));
800 
802  sHistName = Form("hStsFebChanMissEvt_%03u", uFebIdx);
803  title = Form("Missed Event flags per channel, FEB #%03u; Channel []; Miss "
804  "Evt []; Hits []",
805  uFebIdx);
806  fhStsFebChanMissEvt.push_back(
807  new TH2I(sHistName,
808  title,
810  -0.5,
812  2,
813  -0.5,
814  1.5));
815 
817  sHistName = Form("hStsFebChanMissEvtEvo_%03u", uFebIdx);
818  title = Form("Missed Evt flags per second & channel in FEB #%03u; Time "
819  "[s]; Channel []; Missed Evt flags []",
820  uFebIdx);
821  fhStsFebChanMissEvtEvo.push_back(
822  new TH2I(sHistName,
823  title,
824  1800,
825  0,
826  1800,
828  -0.5,
829  fUnpackParSts->GetNbChanPerFeb() - 0.5));
830 
832  sHistName = Form("hStsFebAsicMissEvtEvo_%03u", uFebIdx);
833  title = Form("Missed Evt flags per second & StsXyter in FEB #%03u; Time "
834  "[s]; Asic []; Missed Evt flags []",
835  uFebIdx);
836  fhStsFebAsicMissEvtEvo.push_back(
837  new TH2I(sHistName,
838  title,
839  1800,
840  0,
841  1800,
843  -0.5,
844  fUnpackParSts->GetNbAsicsPerFeb() - 0.5));
845 
847  sHistName = Form("hStsFebMissEvtEvo_%03u", uFebIdx);
848  title = Form("Missed Evt flags per second & channel in FEB #%03u; Time "
849  "[s]; Missed Evt flags []",
850  uFebIdx);
851  fhStsFebMissEvtEvo.push_back(new TH1I(sHistName, title, 1800, 0, 1800));
852 
854  sHistName = Form("hStsFebChanRateEvo_%03u", uFebIdx);
855  title = Form(
856  "Hits per second & channel in FEB #%03u; Time [s]; Channel []; Hits []",
857  uFebIdx);
858  fhStsFebChanHitRateEvo.push_back(
859  new TH2I(sHistName,
860  title,
861  1800,
862  0,
863  1800,
865  -0.5,
866  fUnpackParSts->GetNbChanPerFeb() - 0.5));
867 
869  sHistName = Form("hStsFebChanRateProf_%03u", uFebIdx);
870  title = Form(
871  "Hits per second for each channel in FEB #%03u; Channel []; Hits/s []",
872  uFebIdx);
873  fhStsFebChanHitRateProf.push_back(
874  new TProfile(sHistName,
875  title,
877  -0.5,
878  fUnpackParSts->GetNbChanPerFeb() - 0.5));
879 
881  sHistName = Form("hStsFebAsicRateEvo_%03u", uFebIdx);
882  title = Form(
883  "Hits per second & StsXyter in FEB #%03u; Time [s]; Asic []; Hits []",
884  uFebIdx);
885  fhStsFebAsicHitRateEvo.push_back(
886  new TH2I(sHistName,
887  title,
888  1800,
889  0,
890  1800,
892  -0.5,
893  fUnpackParSts->GetNbAsicsPerFeb() - 0.5));
894 
896  sHistName = Form("hStsFebRateEvo_%03u", uFebIdx);
897  title = Form("Hits per second in FEB #%03u; Time [s]; Hits []", uFebIdx);
898  fhStsFebHitRateEvo.push_back(new TH1I(sHistName, title, 1800, 0, 1800));
899 
901  sHistName = Form("hStsFebChanRateEvoLong_%03u", uFebIdx);
902  title = Form(
903  "Hits per second & channel in FEB #%03u; Time [min]; Channel []; Hits []",
904  uFebIdx);
905  fhStsFebChanHitRateEvoLong.push_back(
906  new TH2D(sHistName,
907  title,
909  -0.5,
910  uAlignedLimit - 0.5,
912  -0.5,
913  fUnpackParSts->GetNbChanPerFeb() - 0.5));
914 
916  sHistName = Form("hStsFebAsicRateEvoLong_%03u", uFebIdx);
917  title = Form(
918  "Hits per second & StsXyter in FEB #%03u; Time [min]; Asic []; Hits []",
919  uFebIdx);
920  fhStsFebAsicHitRateEvoLong.push_back(
921  new TH2D(sHistName,
922  title,
924  -0.5,
925  uAlignedLimit - 0.5,
927  -0.5,
928  fUnpackParSts->GetNbAsicsPerFeb() - 0.5));
929 
931  sHistName = Form("hStsFebRateEvoLong_%03u", uFebIdx);
932  title = Form("Hits per second in FEB #%03u; Time [min]; Hits []", uFebIdx);
933  fhStsFebHitRateEvoLong.push_back(
934  new TH1D(sHistName, title, fuLongHistoBinNb, -0.5, uAlignedLimit - 0.5));
935 
937  sHistName = Form("hStsFebChanDistT_%03u", uFebIdx);
938  title = Form("Time distance between hits on same channel in FEB #%03u; "
939  "Time difference [ns]; Channel []; ",
940  uFebIdx);
941  fhStsFebChanDistT.push_back(
942  new TH2I(sHistName,
943  title,
944  1000,
945  -0.5,
946  6250.0 - 0.5,
948  -0.5,
949  fUnpackParSts->GetNbChanPerFeb() - 0.5));
950 
952  sHistName = Form("hStsFebChanCloseHitsCounts_%03u", uFebIdx);
953  title = Form("Hits with too small dt on same channel in FEB #%03u; Channel "
954  "counts []; ",
955  uFebIdx);
956  fhStsFebChanCloseHitsCounts.push_back(
957  new TH2I(sHistName,
958  title,
960  -0.5,
962  2,
963  -0.5,
964  1.5));
965  sHistName = Form("hStsFebChanCloseHitsRatio_%03u", uFebIdx);
966  title = Form("Ratio of Hits with too small dt on same channel in FEB "
967  "#%03u; Ratio []; ",
968  uFebIdx);
969  fhStsFebChanCloseHitsRatio.push_back(
970  new TProfile(sHistName,
971  title,
973  -0.5,
974  fUnpackParSts->GetNbChanPerFeb() - 0.5));
975 
976  /*
978  fhStsFebChanDtCoinc[ uFebIdx ].resize( fuNbFebs, nullptr );
979  fhStsFebChanCoinc[ uFebIdx ].resize( fuNbFebs, nullptr );
980  for( UInt_t uFebIdxB = uFebIdx; uFebIdxB < fuNbFebs; ++uFebIdxB )
981  {
982  sHistName = Form( "hStsFebChanDtCoinc_%03u_%03u", uFebIdx, uFebIdxB );
983  title = Form( "Channel coincidences Time diff between FEB #%03u and FEB #%03u; Time difference [ns]",
984  uFebIdx, uFebIdxB );
985  fhStsFebChanDtCoinc[ uFebIdx ][ uFebIdxB ] = new TH1I( sHistName, title, 400, -1250., 1250.);
986 
987  sHistName = Form( "hStsFebChanCoinc_%03u_%03u", uFebIdx, uFebIdxB );
988  title = Form( "Channel coincidences between FEB #%03u and FEB #%03u; Channel FEB #%03u []; Channel FEB #%03u []; Coinc. []",
989  uFebIdx, uFebIdxB, uFebIdx, uFebIdxB );
990  fhStsFebChanCoinc[ uFebIdx ][ uFebIdxB ] = new TH2I( sHistName, title,
991  fUnpackParSts->GetNbChanPerFeb(), -0.5, fUnpackParSts->GetNbChanPerFeb() - 0.5,
992  fUnpackParSts->GetNbChanPerFeb(), -0.5, fUnpackParSts->GetNbChanPerFeb() - 0.5 );
993  } // for( UInt_t uFebIdxB = uFebIdx; uFebIdxB < fuNbFebs; ++uFebIdxB )
994 */
995  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
996 
998  /*
1000  Double_t dSensorMinX = - fUnpackParSts->GetSensorSzX() / 2.0;
1001  Double_t dSensorMaxX = fUnpackParSts->GetSensorSzX() / 2.0;
1002  Double_t dSensorMinY = - fUnpackParSts->GetSensorSzY() / 2.0;
1003  Double_t dSensorMaxY = fUnpackParSts->GetSensorSzY() / 2.0;
1004  for( UInt_t uModIdx = 0; uModIdx < fuNbModules; ++ uModIdx )
1005  {
1007  sHistName = Form( "hStsModulePNCoincDt_%03u", uModIdx );
1008  title = Form( "Channel coincidences Time diff between P and N sides on module #%03u; Time difference [ns]",
1009  uModIdx );
1010  fhStsModulePNCoincDt.push_back( new TH1I( sHistName, title, 400, -1250., 1250.) );
1011 
1012  sHistName = Form( "hStsModulePNCoincDtAsicP_%03u", uModIdx );
1013  title = Form( "Channel coincidences Time diff between P and N sides on module #%03u; Time difference [ns]; Asic on P FEB []",
1014  uModIdx );
1015  fhStsModulePNCoincDtAsicP.push_back( new TH2I( sHistName, title,
1016  400, -1250., 1250.,
1017  fUnpackParSts->GetNbAsicsPerFeb(), -0.5, fUnpackParSts->GetNbAsicsPerFeb() - 0.5) );
1018 
1019  sHistName = Form( "hStsModulePNCoincDtAsicN_%03u", uModIdx );
1020  title = Form( "Channel coincidences Time diff between P and N sides on module #%03u; Time difference [ns]; Asic on P FEB []",
1021  uModIdx );
1022  fhStsModulePNCoincDtAsicN.push_back( new TH2I( sHistName, title,
1023  400, -1250., 1250.,
1024  fUnpackParSts->GetNbAsicsPerFeb(), -0.5, fUnpackParSts->GetNbAsicsPerFeb() - 0.5) );
1025 
1026 
1028  sHistName = Form( "hStsModulePNCoincChan_%03u", uModIdx );
1029  title = Form( "P-N channel coincidences in module #%03u; Channel P []; Channel N []; Cnt []", uModIdx );
1030  fhStsModulePNCoincChan.push_back( new TH2D( sHistName, title,
1031  fUnpackParSts->GetNbChanPerFeb(), -0.5, fUnpackParSts->GetNbChanPerFeb() - 0.5,
1032  fUnpackParSts->GetNbChanPerFeb(), -0.5, fUnpackParSts->GetNbChanPerFeb() - 0.5 ) );
1033 
1035  sHistName = Form( "hStsModulePNCoincAdc_%03u", uModIdx );
1036  title = Form( "Adc values of P-N coincidences in module #%03u; ADC Channel P [bin]; ADC Channel N [bin]; Cnt []", uModIdx );
1037  fhStsModulePNCoincAdc.push_back( new TH2D( sHistName, title,
1038  stsxyter::kuHitNbAdcBins, -0.5, stsxyter::kuHitNbAdcBins - 0.5,
1039  stsxyter::kuHitNbAdcBins, -0.5, stsxyter::kuHitNbAdcBins - 0.5 ) );
1041  sHistName = Form( "hStsModuleCoincAdcChanP_%03u", uModIdx );
1042  title = Form( "Adc values of P chan in P-N coincidences in module #%03u; Channel P [bin]; ADC val. [bin]; Cnt []", uModIdx );
1043  fhStsModuleCoincAdcChanP.push_back( new TH2D( sHistName, title,
1044  fUnpackParSts->GetNbChanPerFeb(), -0.5, fUnpackParSts->GetNbChanPerFeb() - 0.5,
1045  stsxyter::kuHitNbAdcBins, -0.5, stsxyter::kuHitNbAdcBins - 0.5 ) );
1047  sHistName = Form( "hStsModuleCoincAdcChanN_%03u", uModIdx );
1048  title = Form( "Adc values of N chan in P-N coincidences in module #%03u; Channel N [bin]; ADC val. [bin]; Cnt []", uModIdx );
1049  fhStsModuleCoincAdcChanN.push_back( new TH2D( sHistName, title,
1050  fUnpackParSts->GetNbChanPerFeb(), -0.5, fUnpackParSts->GetNbChanPerFeb() - 0.5,
1051  stsxyter::kuHitNbAdcBins, -0.5, stsxyter::kuHitNbAdcBins - 0.5 ) );
1052 
1054  sHistName = Form( "hStsModuleCoincMap_%03u", uModIdx );
1055  title = Form( "X-Y map of P-N coincidences in module #%03u; Pos. X [mm]; Pos. Y [mm]; Cnt []", uModIdx );
1056  fhStsModuleCoincMap.push_back( new TH2D( sHistName, title,
1057  2*fUnpackParSts->GetSensorSzX(), 2*dSensorMinX, 2*dSensorMaxX,
1058  2*fUnpackParSts->GetSensorSzY(), 2*dSensorMinY, 2*dSensorMaxY ) );
1059  } // for( UInt_t uModIdx = 0; uModIdx < fuNbModules; ++ uModIdx )
1060 */
1062 
1065  if (kTRUE == fbEnableCheckBugSmx20) {
1066  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
1068  sHistName = Form("hStsFebSmxErrRatioEvo_%03u", uFebIdx);
1069  title = Form("Proportion of uS with SMX logic error in FEB #%03u; Time "
1070  "[s]; Error MS fract. []",
1071  uFebIdx);
1072  fhStsFebSmxErrRatioEvo.push_back(
1073  new TProfile(sHistName, title, 1800, 0, 1800));
1074 
1076  sHistName = Form("hStsFebSmxErrRatioEvoAsic_%03u", uFebIdx);
1077  title = Form("Proportion of uS with SMX logic error per ASIC in FEB "
1078  "#%03u; Time [s]; ASIC []; Error MS fract. []",
1079  uFebIdx);
1080  fhStsFebSmxErrRatioEvoAsic.push_back(
1081  new TProfile2D(sHistName,
1082  title,
1083  1800,
1084  0,
1085  1800,
1087  -0.5,
1088  fUnpackParSts->GetNbAsicsPerFeb() - 0.5));
1089 
1091  sHistName = Form("hStsFebSmxErrRatioCopyEvo_%03u", uFebIdx);
1092  title = Form("Proportion of uS with hit copies in FEB #%03u; Time [s]; "
1093  "Copies MS fract. []",
1094  uFebIdx);
1095  fhStsFebSmxErrRatioCopyEvo.push_back(
1096  new TProfile(sHistName, title, 1800, 0, 1800));
1097 
1099  sHistName = Form("hStsFebSmxErrRatioCopyEvoAsic_%03u", uFebIdx);
1100  title = Form("Proportion of uS with hit copies per ASIC in FEB #%03u; "
1101  "Time [s]; ASIC []; Copies MS fract. []",
1102  uFebIdx);
1104  new TProfile2D(sHistName,
1105  title,
1106  1800,
1107  0,
1108  1800,
1110  -0.5,
1111  fUnpackParSts->GetNbAsicsPerFeb() - 0.5));
1112 
1114  sHistName = Form("hStsFebSmxErrRatioCopySameAdcEvo_%03u", uFebIdx);
1115  title = Form("Proportion of uS with hit full copies in FEB #%03u; Time "
1116  "[s]; Copies MS fract. []",
1117  uFebIdx);
1119  new TProfile(sHistName, title, 1800, 0, 1800));
1120 
1122  sHistName = Form("hStsFebSmxErrRatioCopySameAdcEvoAsic_%03u", uFebIdx);
1123  title = Form("Proportion of uS with hit full copies per ASIC in FEB "
1124  "#%03u; Time [s]; ASIC []; Copies MS fract. []",
1125  uFebIdx);
1127  new TProfile2D(sHistName,
1128  title,
1129  1800,
1130  0,
1131  1800,
1133  -0.5,
1134  fUnpackParSts->GetNbAsicsPerFeb() - 0.5));
1135  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
1136  } // if( kTRUE == fbEnableCheckBugSmx20 )
1138 
1139  fhMsErrorsEvo = new TH2I("fhMsErrorsEvo",
1140  "; MS index [s]; Error type []; Counts []",
1141  600,
1142  0.0,
1143  600.0,
1144  4,
1145  -0.5,
1146  3.5);
1148 
1149  // Miscroslice properties histos
1150  for (Int_t component = 0; component < kiMaxNbFlibLinks; component++) {
1151  fhMsSz[component] = NULL;
1152  fhMsSzTime[component] = NULL;
1153  } // for( Int_t component = 0; component < kiMaxNbFlibLinks; component ++ )
1154 
1155  // Online histo browser commands
1156  THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
1157  if (server) {
1158  server->Register("/StsRaw", fhStsMessType);
1159  server->Register("/StsRaw", fhStsSysMessType);
1160  server->Register("/StsRaw", fhStsMessTypePerDpb);
1161  server->Register("/StsRaw", fhStsSysMessTypePerDpb);
1162  server->Register("/StsRaw", fhStsStatusMessType);
1163  server->Register("/StsRaw", fhStsMsStatusFieldType);
1164  server->Register("/StsRaw", fhStsMessTypePerElink);
1165  server->Register("/StsRaw", fhStsHitsElinkPerDpb);
1166  server->Register("/StsRaw", fhStsAllFebsHitRateEvo);
1167  server->Register("/StsRaw", fhStsAllAsicsHitRateEvo);
1168  server->Register("/StsRaw", fhStsFebAsicHitCounts);
1169 
1170  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
1171  if (kTRUE == fUnpackParSts->IsFebActive(uFebIdx)) {
1172  server->Register("/StsFeb", fhStsFebChanCntRaw[uFebIdx]);
1173  server->Register("/StsFeb", fhStsFebChanCntRawGood[uFebIdx]);
1174  server->Register("/StsFeb", fhStsFebChanAdcRaw[uFebIdx]);
1175  server->Register("/StsFeb", fhStsFebChanAdcRawProf[uFebIdx]);
1176  // server->Register("/StsFeb", fhStsFebChanAdcCal[ uFebIdx ] );
1177  // server->Register("/StsFeb", fhStsFebChanAdcCalProf[ uFebIdx ] );
1178  server->Register("/StsFeb", fhStsFebChanRawTs[uFebIdx]);
1179  server->Register("/StsFeb", fhStsFebChanMissEvt[uFebIdx]);
1180  server->Register("/StsFeb", fhStsFebChanMissEvtEvo[uFebIdx]);
1181  server->Register("/StsFeb", fhStsFebAsicMissEvtEvo[uFebIdx]);
1182  server->Register("/StsFeb", fhStsFebMissEvtEvo[uFebIdx]);
1183  server->Register("/StsFeb", fhStsFebChanHitRateEvo[uFebIdx]);
1184  server->Register("/StsFeb", fhStsFebChanHitRateProf[uFebIdx]);
1185  server->Register("/StsFeb", fhStsFebAsicHitRateEvo[uFebIdx]);
1186  server->Register("/StsFeb", fhStsFebHitRateEvo[uFebIdx]);
1187  server->Register("/StsFeb", fhStsFebChanHitRateEvoLong[uFebIdx]);
1188  server->Register("/StsFeb", fhStsFebAsicHitRateEvoLong[uFebIdx]);
1189  server->Register("/StsFeb", fhStsFebHitRateEvoLong[uFebIdx]);
1190  server->Register("/StsFeb", fhStsFebChanDistT[uFebIdx]);
1191  server->Register("/StsFeb", fhStsFebChanCloseHitsCounts[uFebIdx]);
1192  server->Register("/StsFeb", fhStsFebChanCloseHitsRatio[uFebIdx]);
1193  /*
1194  for( UInt_t uFebIdxB = uFebIdx; uFebIdxB < fuNbFebs; ++uFebIdxB )
1195  {
1196  server->Register("/StsFeb", fhStsFebChanDtCoinc[ uFebIdx ][ uFebIdxB ] );
1197  server->Register("/StsFeb", fhStsFebChanCoinc[ uFebIdx ][ uFebIdxB ] );
1198  } // for( UInt_t uFebIdxB = uFebIdx; uFebIdxB < fuNbFebs; ++uFebIdxB )
1199 */
1200  if (kTRUE == fbEnableCheckBugSmx20) {
1201  server->Register("/StsSmxErr", fhStsFebSmxErrRatioEvo[uFebIdx]);
1202  server->Register("/StsSmxErr", fhStsFebSmxErrRatioEvoAsic[uFebIdx]);
1203  server->Register("/StsSmxErr", fhStsFebSmxErrRatioCopyEvo[uFebIdx]);
1204  server->Register("/StsSmxErr",
1206  server->Register("/StsSmxErr",
1208  server->Register("/StsSmxErr",
1210  } // if( kTRUE == fbEnableCheckBugSmx20 )
1211  } // if( kTRUE == fUnpackParSts->IsFebActive( uFebIdx ) )
1212  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
1213 
1214  server->Register("/StsRaw", fhMsErrorsEvo);
1215  /*
1216  for( UInt_t uModIdx = 0; uModIdx < fuNbModules; ++ uModIdx )
1217  {
1218  server->Register("/StsMod", fhStsModulePNCoincDt[ uModIdx ] );
1219  server->Register("/StsMod", fhStsModulePNCoincDtAsicP[ uModIdx ] );
1220  server->Register("/StsMod", fhStsModulePNCoincDtAsicN[ uModIdx ] );
1221  server->Register("/StsMod", fhStsModulePNCoincChan[ uModIdx ] );
1222  server->Register("/StsMod", fhStsModulePNCoincAdc[ uModIdx ] );
1223  server->Register("/StsMod", fhStsModuleCoincAdcChanP[ uModIdx ] );
1224  server->Register("/StsMod", fhStsModuleCoincAdcChanN[ uModIdx ] );
1225  server->Register("/StsMod", fhStsModuleCoincMap[ uModIdx ] );
1226  } // for( UInt_t uModIdx = 0; uModIdx < fuNbModules; ++ uModIdx )
1227 */
1228 
1229  server->RegisterCommand("/Reset_All", "bMcbm2018ResetSts=kTRUE");
1230  server->RegisterCommand("/Write_All", "bMcbm2018WriteSts=kTRUE");
1231  server->RegisterCommand("/ScanNoisyCh", "bMcbm2018ScanNoisySts=kTRUE");
1232 
1233 
1234  server->Restrict("/Reset_All", "allow=admin");
1235  server->Restrict("/Write_All", "allow=admin");
1236  server->Restrict("/ScanNoisyCh", "allow=admin");
1237  } // if( server )
1238 
1240  Double_t w = 10;
1241  Double_t h = 10;
1242 
1243  // Summary per FEB
1244  fvcStsSumm.resize(fuNbFebs);
1245  fvcStsSmxErr.resize(fuNbFebs);
1246  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
1247  if (kTRUE == fUnpackParSts->IsFebActive(uFebIdx)) {
1248  fvcStsSumm[uFebIdx] =
1249  new TCanvas(Form("cStsSum_%03u", uFebIdx),
1250  Form("Summary plots for FEB %03u", uFebIdx),
1251  w,
1252  h);
1253  fvcStsSumm[uFebIdx]->Divide(2, 3);
1254 
1255  fvcStsSumm[uFebIdx]->cd(1);
1256  gPad->SetGridx();
1257  gPad->SetGridy();
1258  gPad->SetLogy();
1259  fhStsFebChanCntRaw[uFebIdx]->Draw();
1260 
1261  fvcStsSumm[uFebIdx]->cd(2);
1262  gPad->SetGridx();
1263  gPad->SetGridy();
1264  gPad->SetLogy();
1265  fhStsFebChanHitRateProf[uFebIdx]->Draw("e0");
1266 
1267  fvcStsSumm[uFebIdx]->cd(3);
1268  gPad->SetGridx();
1269  gPad->SetGridy();
1270  gPad->SetLogz();
1271  fhStsFebChanAdcRaw[uFebIdx]->Draw("colz");
1272 
1273  fvcStsSumm[uFebIdx]->cd(4);
1274  gPad->SetGridx();
1275  gPad->SetGridy();
1276  // gPad->SetLogy();
1277  fhStsFebChanAdcRawProf[uFebIdx]->Draw();
1278 
1279  fvcStsSumm[uFebIdx]->cd(5);
1280  gPad->SetGridx();
1281  gPad->SetGridy();
1282  gPad->SetLogz();
1283  fhStsFebChanHitRateEvo[uFebIdx]->Draw("colz");
1284 
1285  fvcStsSumm[uFebIdx]->cd(6);
1286  gPad->SetGridx();
1287  gPad->SetGridy();
1288  // gPad->SetLogy();
1289  fhStsFebChanMissEvt[uFebIdx]->Draw("colz");
1290  /*
1291  fvcStsSumm[ uFebIdx ]->cd(5);
1292  gPad->SetGridx();
1293  gPad->SetGridy();
1294  gPad->SetLogz();
1295  fhStsFebChanAdcCal[ uFebIdx ]->Draw( "colz" );
1296 
1297  fvcStsSumm[ uFebIdx ]->cd(6);
1298  gPad->SetGridx();
1299  gPad->SetGridy();
1300  // gPad->SetLogy();
1301  fhStsFebChanAdcCalProf[ uFebIdx ]->Draw();
1302 */
1303  server->Register("/canvases", fvcStsSumm[uFebIdx]);
1304 
1305  if (kTRUE == fbEnableCheckBugSmx20) {
1306  fvcStsSmxErr[uFebIdx] =
1307  new TCanvas(Form("cStsSmxErr_%03u", uFebIdx),
1308  Form("SMX logic error plots for FEB %03u", uFebIdx),
1309  w,
1310  h);
1311  fvcStsSmxErr[uFebIdx]->Divide(2, 3);
1312 
1313  fvcStsSmxErr[uFebIdx]->cd(1);
1314  gPad->SetGridx();
1315  gPad->SetGridy();
1316  gPad->SetLogy();
1317  fhStsFebSmxErrRatioEvo[uFebIdx]->Draw();
1318 
1319  fvcStsSmxErr[uFebIdx]->cd(2);
1320  gPad->SetGridx();
1321  gPad->SetGridy();
1322  gPad->SetLogz();
1323  fhStsFebSmxErrRatioEvoAsic[uFebIdx]->Draw("colz");
1324 
1325  fvcStsSmxErr[uFebIdx]->cd(3);
1326  gPad->SetGridx();
1327  gPad->SetGridy();
1328  gPad->SetLogy();
1329  fhStsFebSmxErrRatioCopyEvo[uFebIdx]->Draw();
1330 
1331  fvcStsSmxErr[uFebIdx]->cd(4);
1332  gPad->SetGridx();
1333  gPad->SetGridy();
1334  gPad->SetLogz();
1335  fhStsFebSmxErrRatioCopyEvoAsic[uFebIdx]->Draw("colz");
1336 
1337  fvcStsSmxErr[uFebIdx]->cd(5);
1338  gPad->SetGridx();
1339  gPad->SetGridy();
1340  gPad->SetLogy();
1341  fhStsFebSmxErrRatioCopySameAdcEvo[uFebIdx]->Draw();
1342 
1343  fvcStsSmxErr[uFebIdx]->cd(6);
1344  gPad->SetGridx();
1345  gPad->SetGridy();
1346  gPad->SetLogz();
1347  fhStsFebSmxErrRatioCopySameAdcEvoAsic[uFebIdx]->Draw("colz");
1348 
1349  server->Register("/canvases", fvcStsSmxErr[uFebIdx]);
1350  } // if( kTRUE == fbEnableCheckBugSmx20 )
1351  } // if( kTRUE == fUnpackParSts->IsFebActive( uFebIdx ) )
1352  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
1353 
1354  //====================================================================//
1355 
1356  //====================================================================//
1358  // Try to recover canvas in case it was created already by another monitor
1359  // If not existing, create it
1360  fcMsSizeAll = dynamic_cast<TCanvas*>(gROOT->FindObject("cMsSizeAll"));
1361  if (NULL == fcMsSizeAll) {
1362  fcMsSizeAll =
1363  new TCanvas("cMsSizeAll", "Evolution of MS size in last 300 s", w, h);
1364  fcMsSizeAll->Divide(4, 4);
1365  LOG(info) << "Created MS size canvas in STS monitor";
1366  } // if( NULL == fcMsSizeAll )
1367  else
1368  LOG(info) << "Recovered MS size canvas in STS monitor";
1369  server->Register("/canvases", fcMsSizeAll);
1370  //====================================================================//
1371 
1372  /*****************************/
1373 }
1374 
1375 Bool_t CbmMcbm2018MonitorSts::DoUnpack(const fles::Timeslice& ts,
1376  size_t component) {
1377  if (bMcbm2018ResetSts) {
1378  ResetAllHistos();
1379  bMcbm2018ResetSts = kFALSE;
1380  } // if( bMcbm2018ResetSts )
1381  if (bMcbm2018WriteSts) {
1383  bMcbm2018WriteSts = kFALSE;
1384  } // if( bMcbm2018WriteSts )
1385  if (bMcbm2018ScanNoisySts) {
1387  bMcbm2018ScanNoisySts = kFALSE;
1388  } // if( bMcbm2018WriteSts )
1389 
1390  LOG(debug) << "Timeslice contains " << ts.num_microslices(component)
1391  << "microslices.";
1392  fulCurrentTsIdx = ts.index();
1393 
1395  if (0 == fulCurrentTsIdx) return kTRUE;
1396 
1397  // Ignore overlap ms if flag set by user
1398  UInt_t uNbMsLoop = fuNbCoreMsPerTs;
1399  if (kFALSE == fbIgnoreOverlapMs) uNbMsLoop += fuNbOverMsPerTs;
1400 
1401  // Loop over core microslices (and overlap ones if chosen)
1402  for (UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx++) {
1403  Double_t dMsTime =
1404  (1e-9)
1405  * static_cast<double>(ts.descriptor(fvMsComponentsList[0], uMsIdx).idx);
1406 
1407  if (0 == fulCurrentTsIdx && 0 == uMsIdx) {
1408  for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size();
1409  ++uMsCompIdx) {
1410  UInt_t uMsComp = fvMsComponentsList[uMsCompIdx];
1411  auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
1412  /*
1413  LOG(info) << "hi hv eqid flag si sv idx/start crc size offset";
1414  LOG(info) << Form( "%02x %02x %04x %04x %02x %02x %016llx %08x %08x %016llx",
1415  static_cast<unsigned int>(msDescriptor.hdr_id),
1416  static_cast<unsigned int>(msDescriptor.hdr_ver), msDescriptor.eq_id, msDescriptor.flags,
1417  static_cast<unsigned int>(msDescriptor.sys_id),
1418  static_cast<unsigned int>(msDescriptor.sys_ver), msDescriptor.idx, msDescriptor.crc,
1419  msDescriptor.size, msDescriptor.offset );
1420 */
1421  LOG(info) << FormatMsHeaderPrintout(msDescriptor);
1422  uint32_t uEqId = static_cast<uint32_t>(msDescriptor.eq_id & 0xFFFF);
1423  auto it = fDpbIdIndexMap.find(uEqId);
1424  if (fDpbIdIndexMap.end() == it) {
1425  LOG(warning)
1426  << "Could not find the sDPB index for AFCK id 0x" << std::hex
1427  << uEqId << std::dec << " component " << uMsCompIdx << "\n"
1428  << "If valid this index has to be added in the TOF parameter file "
1429  "in the RocIdArray field"
1430  << "\n"
1431  << "For now we remove it from the list of components analyzed";
1432  } // if( fDpbIdIndexMap.end() == it )
1433  } // for( UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx )
1434  } // if( 0 == fulCurrentTsIndex && 0 == uMsIdx )
1435 
1436  // Loop over registered components
1437  for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size();
1438  ++uMsCompIdx) {
1439  UInt_t uMsComp = fvMsComponentsList[uMsCompIdx];
1440 
1441  if (kFALSE == ProcessStsMs(ts, uMsComp, uMsIdx)) return kFALSE;
1442  /*
1443  auto msDescriptor = ts.descriptor( uMsComp, uMsIdx );
1444  fuCurrentEquipmentId = msDescriptor.eq_id;
1445  const uint8_t* msContent = reinterpret_cast<const uint8_t*>( ts.content( uMsComp, uMsIdx ) );
1446 
1447  uint32_t uSize = msDescriptor.size;
1448  fulCurrentMsIdx = msDescriptor.idx;
1449  dMsTime = (1e-9) * static_cast<double>(fulCurrentMsIdx);
1450  LOG(debug) << "Microslice: " << fulCurrentMsIdx
1451  << " from EqId " << std::hex << fuCurrentEquipmentId << std::dec
1452  << " has size: " << uSize;
1453 
1454  fuCurrDpbId = static_cast< uint32_t >( fuCurrentEquipmentId & 0xFFFF );
1455  fuCurrDpbIdx = fDpbIdIndexMap[ fuCurrDpbId ];
1456 
1457  if( uMsComp < kiMaxNbFlibLinks )
1458  {
1459  if( fdStartTimeMsSz < 0 )
1460  fdStartTimeMsSz = dMsTime;
1461  fhMsSz[ uMsComp ]->Fill( uSize );
1462  fhMsSzTime[ uMsComp ]->Fill( dMsTime - fdStartTimeMsSz, uSize);
1463  } // if( uMsComp < kiMaxNbFlibLinks )
1464 
1466  if( static_cast<Int_t>( fvdMsTime[ uMsCompIdx ] ) < static_cast<Int_t>( dMsTime ) )
1467  {
1469  UInt_t uFebIdxOffset = fUnpackParSts->GetNbFebsPerDpb() * fuCurrDpbIdx;
1470  for( UInt_t uFebIdx = 0; uFebIdx < fUnpackParSts->GetNbFebsPerDpb(); ++uFebIdx )
1471  {
1472  UInt_t uFebIdxInSyst = uFebIdxOffset + uFebIdx;
1473 
1475  if( 0 == fviFebTimeSecLastRateUpdate[uFebIdxInSyst] )
1476  {
1477  fviFebTimeSecLastRateUpdate[uFebIdxInSyst] = static_cast<Int_t>( dMsTime );
1478  fviFebCountsSinceLastRateUpdate[uFebIdxInSyst] = 0;
1479  for( UInt_t uChan = 0; uChan < fUnpackParSts->GetNbChanPerFeb(); ++uChan )
1480  fvdFebChanCountsSinceLastRateUpdate[uFebIdxInSyst][uChan] = 0.0;
1481  continue;
1482  } // if( 0 == fviFebTimeSecLastRateUpdate[uFebIdxInSyst] )
1483 
1484  Int_t iTimeInt = static_cast<Int_t>( dMsTime ) - fviFebTimeSecLastRateUpdate[uFebIdxInSyst];
1485  if( fiTimeIntervalRateUpdate <= iTimeInt )
1486  {
1488  if( 0 == fviFebCountsSinceLastRateUpdate[uFebIdxInSyst] )
1489  {
1490  fviFebTimeSecLastRateUpdate[uFebIdxInSyst] = dMsTime;
1491  continue;
1492  } // if( 0 == fviFebCountsSinceLastRateUpdate[uFebIdxInSyst] )
1493 
1494  for( UInt_t uChan = 0; uChan < fUnpackParSts->GetNbChanPerFeb(); ++uChan )
1495  {
1496  fhStsFebChanHitRateProf[uFebIdxInSyst]->Fill( uChan,
1497  fvdFebChanCountsSinceLastRateUpdate[uFebIdxInSyst][uChan] / iTimeInt );
1498  fvdFebChanCountsSinceLastRateUpdate[uFebIdxInSyst][uChan] = 0.0;
1499  } // for( UInt_t uChan = 0; uChan < fUnpackParSts->GetNbChanPerFeb(); ++uChan )
1500 
1501  fviFebTimeSecLastRateUpdate[uFebIdxInSyst] = dMsTime;
1502  fviFebCountsSinceLastRateUpdate[uFebIdxInSyst] = 0;
1503  } // if( fiTimeIntervalRateUpdate <= iTimeInt )
1504  } // for( UInt_t uFebIdx = 0; uFebIdx < fUnpackParSts->GetNbFebsPerDpb(); ++uFebIdx )
1505  } // if( static_cast<Int_t>( fvdMsTime[ uMsCompIdx ] ) < static_cast<Int_t>( dMsTime ) )
1506 
1507  // Store MS time for coincidence plots
1508  fvdMsTime[ uMsCompIdx ] = dMsTime;
1509 
1511  UInt_t uTsMsbCycleHeader = std::floor( fulCurrentMsIdx /
1512  ( stsxyter::kulTsCycleNbBins * stsxyter::kdClockCycleNs ) )
1513  - fvuInitialTsMsbCycleHeader[ fuCurrDpbIdx ];
1514  if( kFALSE == fvuInitialHeaderDone[ fuCurrDpbIdx ] )
1515  {
1516  fvuInitialTsMsbCycleHeader[ fuCurrDpbIdx ] = uTsMsbCycleHeader;
1517  fvuInitialHeaderDone[ fuCurrDpbIdx ] = kTRUE;
1518  } // if( kFALSE == fvuInitialHeaderDone[ fuCurrDpbIdx ] )
1519  else if( uTsMsbCycleHeader != fvuCurrentTsMsbCycle[ fuCurrDpbIdx ] &&
1520  4194303 != fvulCurrentTsMsb[fuCurrDpbIdx] )
1521  {
1522  LOG(warning) << "TS MSB cycle from MS header does not match current cycle from data "
1523  << "for TS " << std::setw( 12 ) << fulCurrentTsIdx
1524  << " MS " << std::setw( 12 ) << fulCurrentMsIdx
1525  << " MsInTs " << std::setw( 3 ) << uMsIdx
1526  << " ====> " << fvuCurrentTsMsbCycle[ fuCurrDpbIdx ]
1527  << " VS " << uTsMsbCycleHeader;
1528  fvuCurrentTsMsbCycle[ fuCurrDpbIdx ] = uTsMsbCycleHeader;
1529  }
1530 
1531  // If not integer number of message in input buffer, print warning/error
1532  if( 0 != ( uSize % kuBytesPerMessage ) )
1533  LOG(error) << "The input microslice buffer does NOT "
1534  << "contain only complete nDPB messages!";
1535 
1536  // Compute the number of complete messages in the input microslice buffer
1537  uint32_t uNbMessages = ( uSize - ( uSize % kuBytesPerMessage ) )
1538  / kuBytesPerMessage;
1539 
1540  // Prepare variables for the loop on contents
1541  const uint32_t* pInBuff = reinterpret_cast<const uint32_t*>( msContent );
1542 
1543  for( uint32_t uIdx = 0; uIdx < uNbMessages; ++uIdx )
1544  {
1545  // Fill message
1546  uint32_t ulData = static_cast<uint32_t>( pInBuff[uIdx] );
1547 
1548  stsxyter::Message mess( static_cast< uint32_t >( ulData & 0xFFFFFFFF ) );
1549 
1550  // Print message if requested
1551  if( fbPrintMessages )
1552  mess.PrintMess( std::cout, fPrintMessCtrl );
1553 
1554  if( 1000 == fulCurrentTsIdx )
1555  {
1556  mess.PrintMess( std::cout, fPrintMessCtrl );
1557  } // if( 0 == fulCurrentTsIdx )
1558 
1559  stsxyter::MessType typeMess = mess.GetMessType();
1560  fmMsgCounter[ typeMess ] ++;
1561  fhStsMessType->Fill( static_cast< uint16_t > (typeMess) );
1562  fhStsMessTypePerDpb->Fill( fuCurrDpbIdx, static_cast< uint16_t > (typeMess) );
1563 
1564  switch( typeMess )
1565  {
1566  case stsxyter::MessType::Hit :
1567  {
1568  // Extract the eLink and Asic indices => Should GO IN the fill method now that obly hits are link/asic specific!
1569  UShort_t usElinkIdx = mess.GetLinkIndex();
1570  UInt_t uCrobIdx = usElinkIdx / fUnpackParSts->GetNbElinkPerCrob();
1571  Int_t uFebIdx = fUnpackParSts->ElinkIdxToFebIdx( usElinkIdx );
1572  if( -1 == uFebIdx )
1573  {
1574  LOG(warning) << "CbmMcbm2018MonitorSts::DoUnpack => "
1575  << "Wrong elink Idx!";
1576  continue;
1577  } // if( -1 == uFebIdx )
1578 
1579  UInt_t uAsicIdx = ( fuCurrDpbIdx * fUnpackParSts->GetNbCrobsPerDpb() + uCrobIdx
1580  ) * fUnpackParSts->GetNbAsicsPerCrob()
1581  + fUnpackParSts->ElinkIdxToAsicIdx( 1 == fviFebType[ fuCurrDpbIdx ][ uCrobIdx ][ uFebIdx ],
1582  usElinkIdx );
1583 
1584  FillHitInfo( mess, usElinkIdx, uAsicIdx, uMsIdx );
1585  break;
1586  } // case stsxyter::MessType::Hit :
1587  case stsxyter::MessType::TsMsb :
1588  {
1589  FillTsMsbInfo( mess, uIdx, uMsIdx );
1590  break;
1591  } // case stsxyter::MessType::TsMsb :
1592  case stsxyter::MessType::Epoch :
1593  {
1594  // The first message in the TS is a special ones: EPOCH
1595  FillEpochInfo( mess );
1596 
1597  if( 0 < uIdx )
1598  LOG(info) << "CbmMcbm2018MonitorSts::DoUnpack => "
1599  << "EPOCH message at unexpected position in MS: message "
1600  << uIdx << " VS message 0 expected!";
1601  break;
1602  } // case stsxyter::MessType::TsMsb :
1603  case stsxyter::MessType::Empty :
1604  {
1605 // FillTsMsbInfo( mess );
1606  break;
1607  } // case stsxyter::MessType::Empty :
1608  case stsxyter::MessType::Dummy :
1609  {
1610  break;
1611  } // case stsxyter::MessType::Dummy / ReadDataAck / Ack :
1612  default:
1613  {
1614  LOG(fatal) << "CbmMcbm2018MonitorSts::DoUnpack => "
1615  << "Unknown message type, should never happen, stopping here!";
1616  }
1617  } // switch( mess.GetMessType() )
1618  } // for( uint32_t uIdx = 0; uIdx < uNbMessages; ++uIdx )
1619 */
1620  } // for( UInt_t uMsComp = 0; uMsComp < fvMsComponentsList.size(); ++uMsComp )
1621 
1623  // Sort the buffer of hits
1624  std::sort(fvmHitsInMs.begin(), fvmHitsInMs.end());
1625 
1626  // Time differences plotting using the fully time sorted hits
1627  if (0 < fvmHitsInMs.size()) {
1628  // ULong64_t ulLastHitTime = ( *( fvmHitsInMs.rbegin() ) ).GetTs();
1629  std::vector<stsxyter::FinalHit>::iterator itA;
1630  std::vector<stsxyter::FinalHit>::iterator itB;
1631 
1632  // std::chrono::steady_clock::time_point tNow = std::chrono::steady_clock::now();
1633  // Double_t dUnixTimeInRun = std::chrono::duration_cast< std::chrono::seconds >(tNow - ftStartTimeUnix).count();
1634 
1635  for (
1636  itA = fvmHitsInMs.begin(); itA != fvmHitsInMs.end();
1637  // itA != fvmHitsInMs.end() && (*itA).GetTs() < ulLastHitTime - 320; // 320 * 3.125 ns = 1000 ns
1638  ++itA) {
1639  UShort_t usAsicIdx = (*itA).GetAsic();
1640  // UShort_t usChanIdx = (*itA).GetChan();
1641  // ULong64_t ulHitTs = (*itA).GetTs();
1642  // UShort_t usHitAdc = (*itA).GetAdc();
1643  UShort_t usFebIdx = usAsicIdx / fUnpackParSts->GetNbAsicsPerFeb();
1644  // UShort_t usAsicInFeb = usAsicIdx % fUnpackParSts->GetNbAsicsPerFeb();
1645 
1646  // Double_t dTimeSinceStartSec = (ulHitTs * stsxyter::kdClockCycleNs - fdStartTime)* 1e-9;
1647 
1648  fvmAsicHitsInMs[usAsicIdx].push_back((*itA));
1649  fvmFebHitsInMs[usFebIdx].push_back((*itA));
1650  /*
1651  if( 1000 == fulCurrentTsIdx )
1652  {
1653  LOG(info) << Form( "FEB %02u ASIC %u Chan %03u TS %12u ADC %2u Time %8.3f",
1654  usFebIdx, usAsicInFeb, usChanIdx, ulHitTs, usHitAdc,
1655  ulHitTs* stsxyter::kdClockCycleNs );
1656  } // if( 0 == fulCurrentTsIdx )
1657 */
1658  } // loop on time sorted hits and split per asic/feb
1659 
1660  // Remove all hits which were already used
1661  fvmHitsInMs.erase(fvmHitsInMs.begin(), itA);
1662 
1664  Bool_t bHitCopyInThisMs[fuNbStsXyters];
1665  Bool_t bHitCopySameAdcInThisMs[fuNbStsXyters];
1666  Bool_t bFlagOnInThisMs[fuNbStsXyters];
1667  if (kTRUE == fbEnableCheckBugSmx20)
1668  for (UInt_t uAsic = 0; uAsic < fuNbStsXyters; uAsic++) {
1669  bHitCopyInThisMs[uAsic] = kFALSE;
1670  bHitCopySameAdcInThisMs[uAsic] = kFALSE;
1671  bFlagOnInThisMs[uAsic] = kFALSE;
1672  } // for( UInt_t uAsic = 0; uAsic < fuNbStsXyters; uAsic++)
1674 
1675  for (UInt_t uAsic = 0; uAsic < fuNbStsXyters; uAsic++) {
1676  UInt_t uFebIdx = uAsic / fUnpackParSts->GetNbAsicsPerFeb();
1677  UInt_t uAsicInFeb = uAsic % fUnpackParSts->GetNbAsicsPerFeb();
1678 
1679  std::vector<ULong64_t> vulLastHitTs(fUnpackParSts->GetNbChanPerAsic(),
1680  0);
1681  std::vector<UShort_t> vusLastHitAdc(fUnpackParSts->GetNbChanPerAsic(),
1682  0);
1683 
1684  for (itA = fvmAsicHitsInMs[uAsic].begin();
1685  itA != fvmAsicHitsInMs[uAsic].end();
1686  ++itA) {
1687  // UShort_t usAsicIdx = (*itA).GetAsic();
1688  UShort_t usChanIdx = (*itA).GetChan();
1689  ULong64_t ulHitTs = (*itA).GetTs();
1690  UShort_t usHitAdc = (*itA).GetAdc();
1691 
1692  UInt_t uChanInFeb =
1693  usChanIdx + fUnpackParSts->GetNbChanPerAsic() * uAsicInFeb;
1694 
1696  if (kTRUE == fbEnableCheckBugSmx20) {
1698  Bool_t bIsNotCopy = kTRUE;
1699  if (vulLastHitTs[usChanIdx] == ulHitTs) {
1700  bIsNotCopy = kFALSE;
1701  bHitCopyInThisMs[uAsic] = kTRUE;
1702  if (vusLastHitAdc[usChanIdx] == usHitAdc)
1703  bHitCopySameAdcInThisMs[uAsic] = kTRUE;
1704  } // if( vulLastHitTs[ usChanIdx ] == ulHitTs)
1705 
1706  vulLastHitTs[usChanIdx] = ulHitTs;
1707  vusLastHitAdc[usChanIdx] = usHitAdc;
1708 
1709  if (bIsNotCopy) {
1710  fhStsFebChanCntRawGood[uFebIdx]->Fill(uChanInFeb);
1711  bFlagOnInThisMs[uAsic] |= SmxErrCheckCoinc(
1712  uFebIdx, uAsicInFeb, ulHitTs * stsxyter::kdClockCycleNs);
1713  } // if( bIsNotCopy )
1714  } // if( kTRUE == fbEnableCheckBugSmx20 )
1716  } // for( it = fvmAsicHitsInMs[ uAsic ].begin(); it != fvmAsicHitsInMs[ uAsic ].end(); ++it )
1717 
1719  fvmAsicHitsInMs[uAsic].clear();
1720  } // for( UInt_t uAsic = 0; uAsic < fuNbStsXyters; uAsic++)
1721 
1723  if (kTRUE == fbEnableCheckBugSmx20) {
1724  std::vector<Bool_t> vbCopyOnAnyAsicMs(fuNbFebs, kFALSE);
1725  std::vector<Bool_t> vbCopySameAdcOnAnyAsicMs(fuNbFebs, kFALSE);
1726  std::vector<Bool_t> vbFlagOnAnyAsicMs(fuNbFebs, kFALSE);
1727  Bool_t bCopyOnAnyMs = kFALSE;
1728  Bool_t bCopySameAdcOnAnyMs = kFALSE;
1729  Bool_t bFlagOnAnyMs = kFALSE;
1730  for (UInt_t uAsic = 0; uAsic < fuNbStsXyters; uAsic++) {
1731  UInt_t uFebIdx = uAsic / fUnpackParSts->GetNbAsicsPerFeb();
1732  UInt_t uAsicInFeb = uAsic % fUnpackParSts->GetNbAsicsPerFeb();
1733 
1734  fhStsFebSmxErrRatioCopyEvoAsic[uFebIdx]->Fill(
1735  dMsTime - fdStartTimeMsSz,
1736  uAsicInFeb,
1737  bHitCopyInThisMs[uAsic] ? 1.0 : 0.0);
1738 
1740  dMsTime - fdStartTimeMsSz,
1741  uAsicInFeb,
1742  bHitCopySameAdcInThisMs[uAsic] ? 1.0 : 0.0);
1743 
1744  fhStsFebSmxErrRatioEvoAsic[uFebIdx]->Fill(
1745  dMsTime - fdStartTimeMsSz,
1746  uAsicInFeb,
1747  bFlagOnInThisMs[uAsic] ? 1.0 : 0.0);
1748 
1749  vbCopyOnAnyAsicMs[uFebIdx] =
1750  vbCopyOnAnyAsicMs[uFebIdx] || bHitCopyInThisMs[uAsic];
1751  vbCopySameAdcOnAnyAsicMs[uFebIdx] =
1752  vbCopySameAdcOnAnyAsicMs[uFebIdx] || bHitCopySameAdcInThisMs[uAsic];
1753  vbFlagOnAnyAsicMs[uFebIdx] =
1754  vbFlagOnAnyAsicMs[uFebIdx] || bFlagOnInThisMs[uAsic];
1755 
1756  bCopyOnAnyMs |= bHitCopyInThisMs[uAsic];
1757  bCopySameAdcOnAnyMs |= bHitCopySameAdcInThisMs[uAsic];
1758  bFlagOnAnyMs |= bFlagOnInThisMs[uAsic];
1759  } // for( UInt_t uAsic = 0; uAsic < fuNbStsXyters; uAsic++)
1760 
1761  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
1762  fhStsFebSmxErrRatioCopyEvo[uFebIdx]->Fill(
1763  dMsTime - fdStartTimeMsSz, vbCopyOnAnyAsicMs[uFebIdx] ? 1.0 : 0.0);
1764  fhStsFebSmxErrRatioCopySameAdcEvo[uFebIdx]->Fill(
1765  dMsTime - fdStartTimeMsSz,
1766  vbCopySameAdcOnAnyAsicMs[uFebIdx] ? 1.0 : 0.0);
1767  fhStsFebSmxErrRatioEvo[uFebIdx]->Fill(
1768  dMsTime - fdStartTimeMsSz, vbFlagOnAnyAsicMs[uFebIdx] ? 1.0 : 0.0);
1769  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
1770  } // if( kTRUE == fbEnableCheckBugSmx20 )
1772 
1773  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
1774  /*
1775  if( kTRUE == fbEnableCoincidenceMaps )
1776  {
1777  UInt_t uFebA = uFebIdx % fUnpackParSts->GetNbFebsPerCrob();
1778  UInt_t uCrobIdxA = ( uFebIdx / fUnpackParSts->GetNbFebsPerCrob() ) % fUnpackParSts->GetNbCrobsPerDpb();
1779  UInt_t uDpbIdxA = ( uFebIdx / fUnpackParSts->GetNbFebsPerCrob() ) / fUnpackParSts->GetNbCrobsPerDpb();
1780 
1781  for( itA = fvmFebHitsInMs[ uFebIdx ].begin(); itA != fvmFebHitsInMs[ uFebIdx ].end(); ++itA )
1782  {
1783  UShort_t usAsicIdxA = (*itA).GetAsic();
1784  UShort_t usAsicInFebA = usAsicIdxA % fUnpackParSts->GetNbAsicsPerFeb();
1785  UShort_t usChanIdxA = (*itA).GetChan();
1786  UInt_t uChanInFebA = usChanIdxA + fUnpackParSts->GetNbChanPerAsic() * usAsicInFebA;
1787  ULong64_t ulHitTsA = (*itA).GetTs();
1788  Double_t dHitTsA = ulHitTsA * stsxyter::kdClockCycleNs;
1789 
1791  if( -1 < fdStsFebChanLastTimeForDist[ uFebIdx ][ uChanInFebA ] )
1792  {
1793  fhStsFebChanDistT[ uFebIdx ]->Fill( dHitTsA - fdStsFebChanLastTimeForDist[ uFebIdx ][ uChanInFebA ],
1794  uChanInFebA );
1795  } // if( -1 < fdStsFebChanLastTimeForDist[ uFebIdx ][ uChanInFebA ] )
1796  fdStsFebChanLastTimeForDist[ uFebIdx ][ uChanInFebA ] = dHitTsA;
1797 
1798  for( UInt_t uFebIdxB = uFebIdx; uFebIdxB < fuNbFebs; ++uFebIdxB )
1799  {
1801  Bool_t bSameModulePNsides = kFALSE;
1802  Double_t dBestDtMatch = 1e9; // ns
1803  std::vector< stsxyter::FinalHit >::iterator itBestMatch;
1804  UInt_t uFebB = uFebIdxB % fUnpackParSts->GetNbFebsPerCrob();
1805  UInt_t uCrobIdxB = ( uFebIdxB / fUnpackParSts->GetNbFebsPerCrob() ) % fUnpackParSts->GetNbCrobsPerDpb();
1806  UInt_t uDpbIdxB = ( uFebIdxB / fUnpackParSts->GetNbFebsPerCrob() ) / fUnpackParSts->GetNbCrobsPerDpb();
1807  if( fviFebModuleIdx[ uDpbIdxA ][ uCrobIdxA ][ uFebA ] == fviFebModuleIdx[ uDpbIdxB ][ uCrobIdxB ][ uFebB ] &&
1808  fviFebModuleSide[ uDpbIdxA ][ uCrobIdxA ][ uFebA ] != fviFebModuleSide[ uDpbIdxB ][ uCrobIdxB ][ uFebB ] )
1809  bSameModulePNsides = kTRUE;
1810 
1811  for( itB = fvmFebHitsInMs[ uFebIdxB ].begin(); itB != fvmFebHitsInMs[ uFebIdxB ].end(); ++itB )
1812  {
1813  UShort_t usAsicIdxB = (*itB).GetAsic();
1814  UShort_t usChanIdxB = (*itB).GetChan();
1815  UInt_t uChanInFebB = usChanIdxB + fUnpackParSts->GetNbChanPerAsic() * (usAsicIdxB % fUnpackParSts->GetNbAsicsPerFeb());
1816 
1817  if( uFebIdx == uFebIdxB && uChanInFebA == uChanInFebB )
1818  continue;
1819 
1820  ULong64_t ulHitTsB = (*itB).GetTs();
1821  Double_t dHitTsB = ulHitTsB * stsxyter::kdClockCycleNs;
1822  Double_t dDtClk = static_cast< Double_t >( ulHitTsB ) - static_cast< Double_t >( ulHitTsA );
1823  Double_t dDt = dDtClk * stsxyter::kdClockCycleNs;
1824 
1825  fhStsFebChanDtCoinc[ uFebIdx ][ uFebIdxB ]->Fill( dDt );
1826 
1828  if( -1.0 * fdFebChanCoincidenceLimit < dDt )
1829  {
1831  if( fdFebChanCoincidenceLimit < dDt )
1832  break;
1833 
1834  fhStsFebChanCoinc[ uFebIdx ][ uFebIdxB ]->Fill( uChanInFebA, uChanInFebB );
1835 
1837  if( kTRUE == bSameModulePNsides )
1838  {
1840  if( TMath::Abs( dDt ) < TMath::Abs( dBestDtMatch ) )
1841  {
1842  itBestMatch = itB;
1843  dBestDtMatch = dDt;
1844  } // if( dDt < dBestDtMatch )
1845  } // if same module and opposite sides
1846  } // if( -1.0 * fdFebChanCoincidenceLimit < dDt )
1847  } // for( itB = fvmFebHitsInMs[ uFebIdxB ].begin(); itB != fvmFebHitsInMs[ uFebIdxB ].end(); ++itB )
1848 
1850  if( kTRUE == bSameModulePNsides && dBestDtMatch < fdFebChanCoincidenceLimit )
1851  {
1852  UInt_t uModIdx = fviFebModuleIdx[ uDpbIdxA ][ uCrobIdxA ][ uFebA ];
1853 
1854  UShort_t usAsicIdxB = (*itB).GetAsic();
1855  UShort_t usAsicInFebB = usAsicIdxB % fUnpackParSts->GetNbAsicsPerFeb();
1856  UShort_t usChanIdxB = (*itB).GetChan();
1857  UInt_t uChanInFebB = usChanIdxB + fUnpackParSts->GetNbChanPerAsic() * usAsicInFebB;
1858 
1859  UShort_t usAdcA = (*itA).GetAdc();
1860  UShort_t usAdcB = (*itBestMatch).GetAdc();
1861  Double_t dPosX = 0.0;
1862  Double_t dPosY = 0.0;
1863 
1864  fhStsModulePNCoincDt[ uModIdx ]->Fill( dBestDtMatch );
1865  if( 0 == fviFebModuleSide[ uDpbIdxA ][ uCrobIdxA ][ uFebA ] )
1866  {
1868  fUnpackParSts->ComputeModuleCoordinates( uModIdx, uChanInFebB, uChanInFebA, dPosX, dPosY );
1869 
1871  fhStsModulePNCoincChan[ uModIdx ]->Fill( uChanInFebA, uChanInFebB );
1872  fhStsModulePNCoincAdc[ uModIdx ]->Fill( usAdcA, usAdcB );
1873  fhStsModuleCoincAdcChanP[ uModIdx ]->Fill( uChanInFebA, usAdcA );
1874  fhStsModuleCoincAdcChanN[ uModIdx ]->Fill( uChanInFebB, usAdcB );
1875  fhStsModulePNCoincDtAsicP[ uModIdx ]->Fill( dBestDtMatch, usAsicInFebA );
1876  fhStsModulePNCoincDtAsicN[ uModIdx ]->Fill( dBestDtMatch, usAsicInFebB );
1877  fhStsModuleCoincMap[ uModIdx ]->Fill( dPosX, dPosY );
1878  } // if( 0 == fviFebModuleSide[ uDpbIdxA ][ uCrobIdxA ][ uFebA ] )
1879  else
1880  {
1882  fUnpackParSts->ComputeModuleCoordinates( uModIdx, uChanInFebA, uChanInFebB, dPosX, dPosY );
1883 
1885  fhStsModulePNCoincChan[ uModIdx ]->Fill( uChanInFebB, uChanInFebA );
1886  fhStsModulePNCoincAdc[ uModIdx ]->Fill( usAdcB, usAdcA );
1887  fhStsModuleCoincAdcChanP[ uModIdx ]->Fill( uChanInFebB, usAdcB );
1888  fhStsModuleCoincAdcChanN[ uModIdx ]->Fill( uChanInFebA, usAdcA );
1889  fhStsModulePNCoincDtAsicP[ uModIdx ]->Fill( dBestDtMatch, usAsicInFebB );
1890  fhStsModulePNCoincDtAsicN[ uModIdx ]->Fill( dBestDtMatch, usAsicInFebA );
1891  fhStsModuleCoincMap[ uModIdx ]->Fill( dPosX, dPosY );
1892  } // else of if( 0 == fviFebModuleSide[ uDpbIdxA ][ uCrobIdxA ][ uFebA ] )
1893 
1895  fhStsModuleCoincMap[ uModIdx ]->Fill( dPosX, dPosY );
1896  } // if same module and opposite sides
1897  } // for( UInt_t uFebIdxB = uFebIdx; uFebIdxB < fuNbFebs; ++uFebIdxB )
1898  } // for( itA = fvmFebHitsInMs[ uFebIdx ].begin(); itA != fvmFebHitsInMs[ uFebIdx ].end(); ++itA )
1899  } // if( kTRUE == fbEnableCoincidenceMaps )
1900 */
1902  fvmFebHitsInMs[uFebIdx].clear();
1903  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
1904  } // if( 0 < fvmHitsInMs.size() )
1905  } // for( UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx ++ )
1906 
1907  for (UInt_t uMsIdx = 0; uMsIdx < fuMaxNbMicroslices; ++uMsIdx) {
1908  fvdMsTime[uMsIdx] = 0.0;
1909  } // for( UInt_t uMsIdx = 0; uMsIdx < fuMaxNbMicroslices; ++uMsIdx )
1910 
1911  if (0 == ts.index() % 1000) {
1912  for (UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb) {
1913  Double_t dTsMsbTime =
1914  static_cast<ULong64_t>(stsxyter::kuHitNbTsBins)
1915  * static_cast<ULong64_t>(fvulCurrentTsMsb[fuCurrDpbIdx])
1916  + static_cast<ULong64_t>(stsxyter::kulTsCycleNbBins)
1917  * static_cast<ULong64_t>(fvuCurrentTsMsbCycle[fuCurrDpbIdx]);
1918  dTsMsbTime *= stsxyter::kdClockCycleNs * 1e-9;
1919 
1920  LOG(info) << "End of TS " << std::setw(7) << ts.index() << " eDPB "
1921  << std::setw(2) << uDpb << " current TS MSB counter is "
1922  << std::setw(12) << fvulCurrentTsMsb[uDpb]
1923  << " current TS MSB cycle counter is " << std::setw(12)
1924  << fvuCurrentTsMsbCycle[uDpb] << " current TS MSB time is "
1925  << std::setw(12) << dTsMsbTime << " s";
1926  }
1927  } // if( 0 == ts.index() % 1000 )
1928 
1929  if (0 == ts.index() % 10000)
1930  SaveAllHistos("data/PulserPeriodicHistosSave.root");
1931 
1932  return kTRUE;
1933 }
1934 
1935 Bool_t CbmMcbm2018MonitorSts::ProcessStsMs(const fles::Timeslice& ts,
1936  size_t uMsComp,
1937  UInt_t uMsIdx) {
1938  auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
1939  fuCurrentEquipmentId = msDescriptor.eq_id;
1940  const uint8_t* msContent =
1941  reinterpret_cast<const uint8_t*>(ts.content(uMsComp, uMsIdx));
1942 
1943  fulCurrentTsIdx = ts.index();
1944  if (0 == fvbMaskedComponents.size())
1945  fvbMaskedComponents.resize(ts.num_components(), kFALSE);
1946 
1947  if (0 == fulCurrentTsIdx && 0 == uMsIdx) {
1948  /*
1949  LOG(info) << "hi hv eqid flag si sv idx/start crc size offset";
1950  LOG(info) << Form( "%02x %02x %04x %04x %02x %02x %016llx %08x %08x %016llx",
1951  static_cast<unsigned int>(msDescriptor.hdr_id),
1952  static_cast<unsigned int>(msDescriptor.hdr_ver), msDescriptor.eq_id, msDescriptor.flags,
1953  static_cast<unsigned int>(msDescriptor.sys_id),
1954  static_cast<unsigned int>(msDescriptor.sys_ver), msDescriptor.idx, msDescriptor.crc,
1955  msDescriptor.size, msDescriptor.offset );
1956 */
1957  LOG(info) << FormatMsHeaderPrintout(msDescriptor);
1958  } // if( 0 == fulCurrentTsIndex && 0 == uMsIdx )
1959  if (kFALSE == fvbMaskedComponents[uMsComp] && 0 == uMsIdx) {
1960  auto it = fDpbIdIndexMap.find(fuCurrentEquipmentId);
1961  if (fDpbIdIndexMap.end() == it) {
1962  LOG(warning)
1963  << "Could not find the sDPB index for AFCK id 0x" << std::hex
1964  << fuCurrentEquipmentId << std::dec << " component " << uMsComp << "\n"
1965  << "If valid this index has to be added in the TOF parameter file in "
1966  "the RocIdArray field"
1967  << "\n"
1968  << "For now we remove it from the list of components analyzed";
1969  fvbMaskedComponents[uMsComp] = kTRUE;
1970  } // if( fDpbIdIndexMap.end() == it )
1971 
1972  } // if( kFALSE == fvbMaskedComponents[ uMsComp ] && 0 == uMsIdx )
1973 
1974  if (kTRUE == fvbMaskedComponents[uMsComp]) return kTRUE;
1975 
1976  uint32_t uSize = msDescriptor.size;
1977  fulCurrentMsIdx = msDescriptor.idx;
1978  Double_t dMsTime = (1e-9) * static_cast<double>(fulCurrentMsIdx);
1979  LOG(debug) << "Microslice: " << fulCurrentMsIdx << " from EqId " << std::hex
1980  << fuCurrentEquipmentId << std::dec << " has size: " << uSize;
1981 
1982  fuCurrDpbId = static_cast<uint32_t>(fuCurrentEquipmentId & 0xFFFF);
1984 
1985  if (uMsComp < kiMaxNbFlibLinks) {
1986  if (fdStartTimeMsSz < 0) fdStartTimeMsSz = dMsTime;
1987  fhMsSz[uMsComp]->Fill(uSize);
1988  fhMsSzTime[uMsComp]->Fill(dMsTime - fdStartTimeMsSz, uSize);
1989  } // if( uMsComp < kiMaxNbFlibLinks )
1990 
1992  if (static_cast<Int_t>(fvdPrevMsTime[uMsComp])
1993  < static_cast<Int_t>(dMsTime)) {
1995  UInt_t uFebIdxOffset = fUnpackParSts->GetNbFebsPerDpb() * fuCurrDpbIdx;
1996  for (UInt_t uFebIdx = 0; uFebIdx < fUnpackParSts->GetNbFebsPerDpb();
1997  ++uFebIdx) {
1998  UInt_t uFebIdxInSyst = uFebIdxOffset + uFebIdx;
1999 
2001  if (fvdFebTimeSecLastRateUpdate[uFebIdxInSyst] < 0.0) {
2002  fvdFebTimeSecLastRateUpdate[uFebIdxInSyst] = dMsTime;
2003  fviFebCountsSinceLastRateUpdate[uFebIdxInSyst] = 0;
2004  for (UInt_t uChan = 0; uChan < fUnpackParSts->GetNbChanPerFeb();
2005  ++uChan)
2006  fvdFebChanCountsSinceLastRateUpdate[uFebIdxInSyst][uChan] = 0.0;
2007  continue;
2008  } // if( fvdFebTimeSecLastRateUpdate[uFebIdxInSyst] < 0.0 )
2009 
2010  Double_t dTimeInt = dMsTime - fvdFebTimeSecLastRateUpdate[uFebIdxInSyst];
2011  if (fiTimeIntervalRateUpdate <= dTimeInt) {
2013  if (0 == fviFebCountsSinceLastRateUpdate[uFebIdxInSyst]) {
2014  fvdFebTimeSecLastRateUpdate[uFebIdxInSyst] = dMsTime;
2015  continue;
2016  } // if( 0 == fviFebCountsSinceLastRateUpdate[uFebIdxInSyst] )
2017 
2018  for (UInt_t uChan = 0; uChan < fUnpackParSts->GetNbChanPerFeb();
2019  ++uChan) {
2020  fhStsFebChanHitRateProf[uFebIdxInSyst]->Fill(
2021  uChan,
2022  fvdFebChanCountsSinceLastRateUpdate[uFebIdxInSyst][uChan]
2023  / dTimeInt);
2024  fvdFebChanCountsSinceLastRateUpdate[uFebIdxInSyst][uChan] = 0.0;
2025  } // for( UInt_t uChan = 0; uChan < fUnpackParSts->GetNbChanPerFeb(); ++uChan )
2026 
2027  fvdFebTimeSecLastRateUpdate[uFebIdxInSyst] = dMsTime;
2028  fviFebCountsSinceLastRateUpdate[uFebIdxInSyst] = 0;
2029  } // if( fiTimeIntervalRateUpdate <= dTimeInt )
2030  } // for( UInt_t uFebIdx = 0; uFebIdx < fUnpackParSts->GetNbFebsPerDpb(); ++uFebIdx )
2031  } // if( static_cast<Int_t>( fvdMsTime[ uMsCompIdx ] ) < static_cast<Int_t>( dMsTime ) )
2032 
2033  // Store MS time for coincidence plots
2034  fvdPrevMsTime[uMsComp] = dMsTime;
2035  /*
2037 // if( 0 == fuCurrDpbIdx && fulCurrentTsIdx < 100 )
2038  if( fulCurrentTsIdx < 100 )
2039  LOG(info) << "TS " << std::setw( 12 ) << fulCurrentTsIdx
2040  << " MS " << std::setw( 12 ) << fulCurrentMsIdx
2041  << " MsInTs " << std::setw( 3 ) << uMsIdx
2042  << " DPB " << fuCurrDpbIdx;
2043 */
2044 
2046  uint16_t uMsHeaderFlags = msDescriptor.flags;
2047  for (UInt_t uBit = 0; uBit < 16; ++uBit)
2048  fhStsMsStatusFieldType->Fill(uBit, (uMsHeaderFlags >> uBit) & 0x1);
2049 
2051  UInt_t uTsMsbCycleHeader =
2052  std::floor(fulCurrentMsIdx
2055 
2057  if (kTRUE == fbBinningFw)
2058  uTsMsbCycleHeader = std::floor(fulCurrentMsIdx
2062 
2063  if (kFALSE == fvuInitialHeaderDone[fuCurrDpbIdx]) {
2064  fvuInitialTsMsbCycleHeader[fuCurrDpbIdx] = uTsMsbCycleHeader;
2067  } // if( kFALSE == fvuInitialHeaderDone[ fuCurrDpbIdx ] )
2068  else if (0 == uMsIdx) {
2069  if (uTsMsbCycleHeader != fvuCurrentTsMsbCycle[fuCurrDpbIdx])
2070  LOG(info) << " TS " << std::setw(12) << fulCurrentTsIdx << " MS "
2071  << std::setw(12) << fulCurrentMsIdx << " MS Idx "
2072  << std::setw(4) << uMsIdx << " Msg Idx " << std::setw(5) << 0
2073  << " DPB " << std::setw(2) << fuCurrDpbIdx << " Old TsMsb "
2074  << std::setw(5) << fvulCurrentTsMsb[fuCurrDpbIdx]
2075  << " Old MsbCy " << std::setw(5)
2076  << fvuCurrentTsMsbCycle[fuCurrDpbIdx] << " New MsbCy "
2077  << uTsMsbCycleHeader;
2078  fvuCurrentTsMsbCycle[fuCurrDpbIdx] = uTsMsbCycleHeader;
2080  } // if( 0 == uMsIdx )
2081  else if (uTsMsbCycleHeader != fvuCurrentTsMsbCycle[fuCurrDpbIdx]
2082  && 4194303 != fvulCurrentTsMsb[fuCurrDpbIdx]) {
2083  LOG(warning)
2084  << "TS MSB cycle from MS header does not match current cycle from data "
2085  << "for TS " << std::setw(12) << fulCurrentTsIdx << " MS "
2086  << std::setw(12) << fulCurrentMsIdx << " MsInTs " << std::setw(3)
2087  << uMsIdx << " ====> " << fvuCurrentTsMsbCycle[fuCurrDpbIdx] << " VS "
2088  << uTsMsbCycleHeader;
2089  fvuCurrentTsMsbCycle[fuCurrDpbIdx] = uTsMsbCycleHeader;
2090  } else if (uTsMsbCycleHeader != fvuCurrentTsMsbCycle[fuCurrDpbIdx]) {
2092  if (4194303 == fvulCurrentTsMsb[fuCurrDpbIdx]) {
2093  LOG(info) << " TS " << std::setw(12) << fulCurrentTsIdx << " MS "
2094  << std::setw(12) << fulCurrentMsIdx << " MS Idx "
2095  << std::setw(4) << uMsIdx << " Msg Idx " << std::setw(5) << 0
2096  << " DPB " << std::setw(2) << fuCurrDpbIdx << " Old TsMsb "
2097  << std::setw(5) << fvulCurrentTsMsb[fuCurrDpbIdx]
2098  << " Old MsbCy " << std::setw(5)
2099  << fvuCurrentTsMsbCycle[fuCurrDpbIdx] << " New MsbCy "
2100  << uTsMsbCycleHeader;
2101  } else {
2102  LOG(warning)
2103  << "TS MSB cycle from MS header does not match current cycle from data "
2104  << "for TS " << std::setw(12) << fulCurrentTsIdx << " MS "
2105  << std::setw(12) << fulCurrentMsIdx << " MsInTs " << std::setw(3)
2106  << uMsIdx << " ====> " << fvuCurrentTsMsbCycle[fuCurrDpbIdx]
2107  << " (cnt) VS " << uTsMsbCycleHeader << " (header)";
2108  } // else of if( 4194303 == fvulCurrentTsMsb[fuCurrDpbIdx] )
2109  fvuCurrentTsMsbCycle[fuCurrDpbIdx] = uTsMsbCycleHeader;
2110  } // else if( uTsMsbCycleHeader != fvuCurrentTsMsbCycle[ fuCurrDpbIdx ] )
2111 
2112  // If not integer number of message in input buffer, print warning/error
2113  if (0 != (uSize % kuBytesPerMessage))
2114  LOG(error) << "The input microslice buffer does NOT "
2115  << "contain only complete nDPB messages!";
2116 
2117  // Compute the number of complete messages in the input microslice buffer
2118  uint32_t uNbMessages =
2119  (uSize - (uSize % kuBytesPerMessage)) / kuBytesPerMessage;
2120 
2121  // Prepare variables for the loop on contents
2122  const uint32_t* pInBuff = reinterpret_cast<const uint32_t*>(msContent);
2123 
2124  for (uint32_t uIdx = 0; uIdx < uNbMessages; ++uIdx) {
2125  // Fill message
2126  uint32_t ulData = static_cast<uint32_t>(pInBuff[uIdx]);
2127 
2128  stsxyter::Message mess(static_cast<uint32_t>(ulData & 0xFFFFFFFF));
2129 
2130  // Print message if requested
2131  if (fbPrintMessages) mess.PrintMess(std::cout, fPrintMessCtrl);
2132 
2133  /*
2134  if( 1000 == fulCurrentTsIdx )
2135  {
2136  mess.PrintMess( std::cout, fPrintMessCtrl );
2137  } // if( 0 == fulCurrentTsIdx )
2138 */
2139  stsxyter::MessType typeMess = mess.GetMessType();
2140  fmMsgCounter[typeMess]++;
2141  fhStsMessType->Fill(static_cast<uint16_t>(typeMess));
2142  fhStsMessTypePerDpb->Fill(fuCurrDpbIdx, static_cast<uint16_t>(typeMess));
2143 
2144  switch (typeMess) {
2145  case stsxyter::MessType::Hit: {
2146  // Extract the eLink and Asic indices => Should GO IN the fill method now that obly hits are link/asic specific!
2147  UShort_t usElinkIdx = mess.GetLinkIndex();
2149  if (kTRUE == fbBinningFw) usElinkIdx = mess.GetLinkIndexHitBinning();
2150 
2151  fhStsMessTypePerElink->Fill(
2152  fuCurrDpbIdx * fUnpackParSts->GetNbElinkPerDpb() + usElinkIdx,
2153  static_cast<uint16_t>(typeMess));
2154  fhStsHitsElinkPerDpb->Fill(fuCurrDpbIdx, usElinkIdx);
2155  /*
2157  if( ( 0 == fuCurrDpbIdx || 13 < usElinkIdx ) && fulCurrentTsIdx < 100 )
2158  mess.PrintMess( std::cout, stsxyter::MessagePrintMask::msg_print_Hex | stsxyter::MessagePrintMask::msg_print_Human );
2160 */
2161  UInt_t uCrobIdx = usElinkIdx / fUnpackParSts->GetNbElinkPerCrob();
2162  Int_t uFebIdx = fUnpackParSts->ElinkIdxToFebIdx(usElinkIdx);
2163 
2164  if (-1 == uFebIdx) {
2165  LOG(warning) << "CbmMcbm2018MonitorSts::DoUnpack => "
2166  << "Wrong elink Idx! Elink raw "
2167  << Form("%d remap %d", usElinkIdx, uFebIdx);
2168  continue;
2169  } // if( -1 == uFebIdx )
2170 
2171  UInt_t uAsicIdx =
2172  (fuCurrDpbIdx * fUnpackParSts->GetNbCrobsPerDpb() + uCrobIdx)
2175  1 == fviFebType[fuCurrDpbIdx][uCrobIdx][uFebIdx], usElinkIdx);
2176 
2177  FillHitInfo(mess, usElinkIdx, uAsicIdx, uMsIdx);
2178  break;
2179  } // case stsxyter::MessType::Hit :
2183  static_cast<uint16_t>(typeMess));
2184 
2185  FillTsMsbInfo(mess, uIdx, uMsIdx);
2186  break;
2187  } // case stsxyter::MessType::TsMsb :
2191  static_cast<uint16_t>(typeMess));
2192 
2193  // The first message in the TS is a special ones: EPOCH
2194  FillEpochInfo(mess);
2195 
2196  if (0 < uIdx)
2197  LOG(info) << "CbmMcbm2018MonitorSts::DoUnpack => "
2198  << "EPOCH message at unexpected position in MS: message "
2199  << uIdx << " VS message 0 expected!";
2200  break;
2201  } // case stsxyter::MessType::TsMsb :
2203  UShort_t usElinkIdx = mess.GetStatusLink();
2204  fhStsMessTypePerElink->Fill(
2205  fuCurrDpbIdx * fUnpackParSts->GetNbElinkPerDpb() + usElinkIdx,
2206  static_cast<uint16_t>(typeMess));
2207  /*
2209  if( ( 0 == fuCurrDpbIdx || 13 < usElinkIdx ) && fulCurrentTsIdx < 100 )
2210  mess.PrintMess( std::cout, stsxyter::MessagePrintMask::msg_print_Hex | stsxyter::MessagePrintMask::msg_print_Human );
2212 */
2213  UInt_t uCrobIdx = usElinkIdx / fUnpackParSts->GetNbElinkPerCrob();
2214  Int_t uFebIdx = fUnpackParSts->ElinkIdxToFebIdx(usElinkIdx);
2215  UInt_t uAsicIdx =
2216  (fuCurrDpbIdx * fUnpackParSts->GetNbCrobsPerDpb() + uCrobIdx)
2219  1 == fviFebType[fuCurrDpbIdx][uCrobIdx][uFebIdx], usElinkIdx);
2220 
2221  UShort_t usStatusField = mess.GetStatusStatus();
2222 
2223  fhStsStatusMessType->Fill(uAsicIdx, usStatusField);
2225  if (fbPrintMessages) {
2226  std::cout << Form("DPB %2u TS %12llu MS %12llu mess %5u ",
2227  fuCurrDpbIdx,
2230  uIdx);
2231  mess.PrintMess(std::cout, fPrintMessCtrl);
2232  } // if( fbPrintMessages )
2233  // FillTsMsbInfo( mess );
2234  break;
2235  } // case stsxyter::MessType::Status
2239  static_cast<uint16_t>(typeMess));
2240  // FillTsMsbInfo( mess );
2241  break;
2242  } // case stsxyter::MessType::Empty :
2244  // ++vNbMessType[5];
2245  // sMessPatt += " En";
2246  // bError = pMess[uIdx].IsMsErrorFlagOn();
2247 
2248  // fhStsMessTypePerElink->Fill( fuCurrDpbIdx * fUnpackPar->GetNbElinkPerDpb(), static_cast< uint16_t > (typeMess) );
2249  // FillTsMsbInfo( pMess[uIdx] );
2250  if (mess.IsMsErrorFlagOn()) {
2251  fhMsErrorsEvo->Fill(1e-9 * fulCurrentMsIdx, mess.GetMsErrorType());
2252  } // if( pMess[uIdx].IsMsErrorFlagOn() )
2253  break;
2254  } // case stsxyter::MessType::EndOfMs :
2258  static_cast<uint16_t>(typeMess));
2259  break;
2260  } // case stsxyter::MessType::Dummy / ReadDataAck / Ack :
2261  default: {
2262  LOG(fatal) << "CbmMcbm2018MonitorSts::DoUnpack => "
2263  << "Unknown message type, should never happen, stopping "
2264  "here! Type found was: "
2265  << static_cast<int>(typeMess);
2266  }
2267  } // switch( mess.GetMessType() )
2268  } // for( uint32_t uIdx = 0; uIdx < uNbMessages; ++uIdx )
2269 
2270  return kTRUE;
2271 }
2272 
2274  const UShort_t& /*usElinkIdx*/,
2275  const UInt_t& uAsicIdx,
2276  const UInt_t& uMsIdx) {
2277  UShort_t usChan = mess.GetHitChannel();
2278  UShort_t usRawAdc = mess.GetHitAdc();
2279  // UShort_t usFullTs = mess.GetHitTimeFull();
2280  // UShort_t usTsOver = mess.GetHitTimeOver();
2281  UShort_t usRawTs = mess.GetHitTime();
2282 
2284  if (kTRUE == fbBinningFw) usRawTs = mess.GetHitTimeBinning();
2285 
2287  // usChan = 127 - usChan;
2288 
2289  /*
2290  fhStsChanCntRaw[ uAsicIdx ]->Fill( usChan );
2291  fhStsChanAdcRaw[ uAsicIdx ]->Fill( usChan, usRawAdc );
2292  fhStsChanAdcRawProf[ uAsicIdx ]->Fill( usChan, usRawAdc );
2293  fhStsChanRawTs[ uAsicIdx ]->Fill( usChan, usRawTs );
2294  fhStsChanMissEvt[ uAsicIdx ]->Fill( usChan, mess.IsHitMissedEvts() );
2295 */
2296  // UInt_t uCrobIdx = usElinkIdx / fUnpackParSts->GetNbElinkPerCrob();
2297  UInt_t uFebIdx = uAsicIdx / fUnpackParSts->GetNbAsicsPerFeb();
2298  UInt_t uAsicInFeb = uAsicIdx % fUnpackParSts->GetNbAsicsPerFeb();
2299  UInt_t uChanInFeb = usChan
2301  * (uAsicIdx % fUnpackParSts->GetNbAsicsPerFeb());
2302 
2303  // Double_t dCalAdc = fvdFebAdcOffs[ fuCurrDpbIdx ][ uCrobIdx ][ uFebIdx ]
2304  // + (usRawAdc - 1)* fvdFebAdcGain[ fuCurrDpbIdx ][ uCrobIdx ][ uFebIdx ];
2305 
2306  fhStsFebChanCntRaw[uFebIdx]->Fill(uChanInFeb);
2307  fhStsFebChanAdcRaw[uFebIdx]->Fill(uChanInFeb, usRawAdc);
2308  fhStsFebChanAdcRawProf[uFebIdx]->Fill(uChanInFeb, usRawAdc);
2309  // fhStsFebChanAdcCal[ uFebIdx ]->Fill( uChanInFeb, dCalAdc );
2310  // fhStsFebChanAdcCalProf[ uFebIdx ]->Fill( uChanInFeb, dCalAdc );
2311  fhStsFebChanRawTs[uFebIdx]->Fill(uChanInFeb, usRawTs);
2312  fhStsFebChanMissEvt[uFebIdx]->Fill(uChanInFeb, mess.IsHitMissedEvts());
2313 
2314  // Compute the Full time stamp
2315  // Long64_t ulOldHitTime = fvulChanLastHitTime[ uAsicIdx ][ usChan ];
2316  // Double_t dOldHitTime = fvdChanLastHitTime[ uAsicIdx ][ usChan ];
2317 
2318  // Use TS w/o overlap bits as they will anyway come from the TS_MSB
2319  fvulChanLastHitTime[uAsicIdx][usChan] = usRawTs;
2320 
2321  fvulChanLastHitTime[uAsicIdx][usChan] +=
2322  static_cast<ULong64_t>(stsxyter::kuHitNbTsBins)
2323  * static_cast<ULong64_t>(fvulCurrentTsMsb[fuCurrDpbIdx])
2324  + static_cast<ULong64_t>(stsxyter::kulTsCycleNbBins)
2325  * static_cast<ULong64_t>(fvuCurrentTsMsbCycle[fuCurrDpbIdx]);
2326 
2328  if (kTRUE == fbBinningFw)
2329  fvulChanLastHitTime[uAsicIdx][usChan] =
2330  usRawTs
2331  + static_cast<ULong64_t>(stsxyter::kuHitNbTsBinsBinning)
2332  * static_cast<ULong64_t>(fvulCurrentTsMsb[fuCurrDpbIdx])
2333  + static_cast<ULong64_t>(stsxyter::kulTsCycleNbBinsBinning)
2334  * static_cast<ULong64_t>(fvuCurrentTsMsbCycle[fuCurrDpbIdx]);
2335 
2336  // fvuElinkLastTsHit[fuCurrDpbIdx] = usRawTs;
2337 
2338  // Convert the Hit time in bins to Hit time in ns
2339  Double_t dHitTimeNs =
2340  fvulChanLastHitTime[uAsicIdx][usChan] * stsxyter::kdClockCycleNs;
2341  /*
2342  // If needed fill the hit interval plots
2343  if( fbChanHitDtEna )
2344  {
2345  Double_t dDeltaT = dHitTimeNs - fvdChanLastHitTime[ uAsicIdx ][ usChan ];
2346  if( 0 == dDeltaT )
2347  fhStsChanHitDtNeg[ uAsicIdx ]->Fill( 1, usChan );
2348  else if( 0 < dDeltaT )
2349  fhStsChanHitDt[ uAsicIdx ]->Fill( dDeltaT, usChan );
2350  else fhStsChanHitDtNeg[ uAsicIdx ]->Fill( -dDeltaT, usChan );
2351  } // if( fbChanHitDtEna )
2352 */
2354  Double_t dDeltaT = dHitTimeNs - fvdChanLastHitTime[uAsicIdx][usChan];
2355  fhStsFebChanCloseHitsCounts[uFebIdx]->Fill(uChanInFeb, 0);
2356  fhStsFebChanCloseHitsRatio[uFebIdx]->Fill(uChanInFeb, 0);
2357  if (dDeltaT < 80.0) {
2358  fhStsFebChanCloseHitsCounts[uFebIdx]->Fill(uChanInFeb, 1);
2359  fhStsFebChanCloseHitsRatio[uFebIdx]->Fill(uChanInFeb, 1);
2360  // LOG(info) << Form( "Potential duplicate (bad Vref2) in FEB %2u ASIC %u channel %4u (dt = %f) TS %7llu MS %3u",
2361  // uFebIdx, uAsicInFeb, uChanInFeb, dDeltaT, fulCurrentTsIdx, uMsIdx );
2362  } //
2363 
2364  // Store new value of Hit time in ns
2365  fvdChanLastHitTime[uAsicIdx][usChan] =
2366  fvulChanLastHitTime[uAsicIdx][usChan] * stsxyter::kdClockCycleNs;
2367  /*
2368  LOG(info) << " Asic " << std::setw( 2 ) << uAsicIdx
2369  << " Channel " << std::setw( 3 ) << usChan
2370  << " Diff to last hit " << std::setw( 12 ) << ( fvulChanLastHitTime[ uAsicIdx ][ usChan ] - ulOldHitTime)
2371  << " in s " << std::setw( 12 ) << ( fvdChanLastHitTime[ uAsicIdx ][ usChan ] - dOldHitTime) * 1e-9;
2372 */
2373  // Pulser and MS
2374  fvuChanNbHitsInMs[uAsicIdx][usChan][uMsIdx]++;
2375  fvdChanLastHitTimeInMs[uAsicIdx][usChan][uMsIdx] = dHitTimeNs;
2376  fvusChanLastHitAdcInMs[uAsicIdx][usChan][uMsIdx] = usRawAdc;
2377  /*
2378  fvmChanHitsInTs[ uAsicIdx ][ usChan ].insert( stsxyter::FinalHit( fvulChanLastHitTime[ uAsicIdx ][ usChan ],
2379  usRawAdc, uAsicIdx, usChan ) );
2380 */
2381  fvmHitsInMs.push_back(stsxyter::FinalHit(
2382  fvulChanLastHitTime[uAsicIdx][usChan], usRawAdc, uAsicIdx, usChan));
2383 
2384  /*
2385  if( ( 214514 < fulCurrentTsIdx && fulCurrentTsIdx < 214517 ) ||
2386  ( 260113 < fulCurrentTsIdx && fulCurrentTsIdx < 260116 ) ||
2387  ( 388109 < fulCurrentTsIdx && fulCurrentTsIdx < 388114 ) ||
2388  ( 573361 < fulCurrentTsIdx && fulCurrentTsIdx < 573364 ) ||
2389  ( 661731 < fulCurrentTsIdx && fulCurrentTsIdx < 661734 ) ||
2390  ( 712982 < fulCurrentTsIdx && fulCurrentTsIdx < 712985 ) ||
2391  ( 713857 < fulCurrentTsIdx && fulCurrentTsIdx < 713860 ) ||
2392  ( 739365 < fulCurrentTsIdx && fulCurrentTsIdx < 739368 ))
2393  if( 0 < fulCurrentTsIdx && fulCurrentTsIdx < 3 )
2394  {
2395  LOG(info) << " TS " << std::setw( 12 ) << fulCurrentTsIdx
2396  << " MS " << std::setw( 12 ) << fulCurrentMsIdx
2397  << " MsInTs " << std::setw( 3 ) << uMsIdx
2398  << " Asic " << std::setw( 2 ) << uAsicIdx
2399  << " Channel " << std::setw( 3 ) << usChan
2400  << " ADC " << std::setw( 3 ) << usRawAdc
2401  << " TS " << std::setw( 3 ) << usRawTs // 9 bits TS
2402  << " SX TsMsb " << std::setw( 2 ) << ( fvulCurrentTsMsb[fuCurrDpbIdx] & 0x1F ) // Total StsXyter TS = 14 bits => 9b Hit TS + lower 5b TS_MSB after DPB
2403  << " DPB TsMsb " << std::setw( 6 ) << ( fvulCurrentTsMsb[fuCurrDpbIdx] >> 5 ) // Total StsXyter TS = 14 bits => 9b Hit TS + lower 5b of TS_MSB after DPB
2404  << " TsMsb " << std::setw( 7 ) << fvulCurrentTsMsb[fuCurrDpbIdx]
2405  << " TS(b) " << std::bitset<9>(usRawTs)
2406  << " TSM(b) " << std::bitset<24>(fvulCurrentTsMsb[fuCurrDpbIdx])
2407  << " MsbCy " << std::setw( 4 ) << fvuCurrentTsMsbCycle[fuCurrDpbIdx]
2408  << " Time " << std::setw ( 12 ) << fvulChanLastHitTime[ uAsicIdx ][ usChan ];
2409  }
2410 */
2411  // Check Starting point of histos with time as X axis
2412  if (-1 == fdStartTime) fdStartTime = fvdChanLastHitTime[uAsicIdx][usChan];
2413 
2414  // Fill histos with time as X axis
2415  Double_t dTimeSinceStartSec =
2416  (fvdChanLastHitTime[uAsicIdx][usChan] - fdStartTime) * 1e-9;
2417  Double_t dTimeSinceStartMin = dTimeSinceStartSec / 60.0;
2418 
2420  fvdFebChanCountsSinceLastRateUpdate[uFebIdx][uChanInFeb] += 1;
2421 
2422  fhStsFebAsicHitCounts->Fill(uFebIdx, uAsicInFeb);
2423  fhStsAllFebsHitRateEvo->Fill(dTimeSinceStartSec, uFebIdx);
2424  fhStsAllAsicsHitRateEvo->Fill(dTimeSinceStartSec, uAsicIdx);
2425  fhStsFebChanHitRateEvo[uFebIdx]->Fill(dTimeSinceStartSec, uChanInFeb);
2426  fhStsFebAsicHitRateEvo[uFebIdx]->Fill(dTimeSinceStartSec, uAsicInFeb);
2427  fhStsFebHitRateEvo[uFebIdx]->Fill(dTimeSinceStartSec);
2428  fhStsFebChanHitRateEvoLong[uFebIdx]->Fill(
2429  dTimeSinceStartMin, uChanInFeb, 1.0 / 60.0);
2430  fhStsFebAsicHitRateEvoLong[uFebIdx]->Fill(
2431  dTimeSinceStartMin, uAsicInFeb, 1.0 / 60.0);
2432  fhStsFebHitRateEvoLong[uFebIdx]->Fill(dTimeSinceStartMin, 1.0 / 60.0);
2433  if (mess.IsHitMissedEvts()) {
2434  fhStsFebChanMissEvtEvo[uFebIdx]->Fill(dTimeSinceStartSec, uChanInFeb);
2435  fhStsFebAsicMissEvtEvo[uFebIdx]->Fill(dTimeSinceStartSec, uAsicInFeb);
2436  fhStsFebMissEvtEvo[uFebIdx]->Fill(dTimeSinceStartSec);
2437  } // if( mess.IsHitMissedEvts() )
2438  /*
2439  if( kTRUE == fbLongHistoEnable )
2440  {
2441  std::chrono::steady_clock::time_point tNow = std::chrono::steady_clock::now();
2442  Double_t dUnixTimeInRun = std::chrono::duration_cast< std::chrono::seconds >(tNow - ftStartTimeUnix).count();
2443  fhFebRateEvoLong[ uAsicIdx ]->Fill( dUnixTimeInRun , 1.0 / fuLongHistoBinSizeSec );
2444  fhFebChRateEvoLong[ uAsicIdx ]->Fill( dUnixTimeInRun , usChan, 1.0 / fuLongHistoBinSizeSec );
2445  } // if( kTRUE == fbLongHistoEnable )
2446 */
2447 }
2448 
2450  UInt_t uMessIdx,
2451  UInt_t uMsIdx) {
2452  UInt_t uVal = mess.GetTsMsbVal();
2454  if (kTRUE == fbBinningFw) uVal = mess.GetTsMsbValBinning();
2455 
2456  /*
2457  if( ( 419369 < fulCurrentTsIdx && fulCurrentTsIdx < 419371 ) )
2458  LOG(info) << " TS " << std::setw( 12 ) << fulCurrentTsIdx
2459  << " MS " << std::setw( 12 ) << fulCurrentMsIdx
2460  << " MsInTs " << std::setw( 3 ) << uMsIdx
2461  << " DPB " << std::setw( 2 ) << fuCurrDpbIdx
2462  << " Mess " << std::setw( 5 ) << uMessIdx
2463  << " TsMsb " << std::setw( 5 ) << uVal;
2464 */
2465  /*
2466  if( (uVal != fvulCurrentTsMsb[fuCurrDpbIdx] + 1) && 0 < uVal &&
2467  !( 1 == uMessIdx && usVal == fvulCurrentTsMsb[fuCurrDpbIdx] ) ) // 1st TS_MSB in MS is always a repeat of the last one in previous MS!
2468  {
2469  LOG(info) << "TS MSB not increasing by 1! TS " << std::setw( 12 ) << fulCurrentTsIdx
2470  << " MS " << std::setw( 12 ) << fulCurrentMsIdx
2471  << " MsInTs " << std::setw( 3 ) << uMsIdx
2472  << " DPB " << std::setw( 2 ) << fuCurrDpbIdx
2473  << " Mess " << std::setw( 5 ) << uMessIdx
2474  << " Old TsMsb " << std::setw( 5 ) << fvulCurrentTsMsb[fuCurrDpbIdx]
2475  << " new TsMsb " << std::setw( 5 ) << uVal
2476  << " Diff " << std::setw( 5 ) << uVal - fvulCurrentTsMsb[fuCurrDpbIdx]
2477  << " Old MsbCy " << std::setw( 5 ) << fvuCurrentTsMsbCycle[fuCurrDpbIdx];
2478  } // if( (uVal != fvulCurrentTsMsb[fuCurrDpbIdx] + 1) && 0 < uVal )
2479 */
2480 
2481  // Update Status counters
2482  if (uVal < fvulCurrentTsMsb[fuCurrDpbIdx]) {
2483 
2484  LOG(info) << " TS " << std::setw(12) << fulCurrentTsIdx << " MS "
2485  << std::setw(12) << fulCurrentMsIdx << " MS Idx " << std::setw(4)
2486  << uMsIdx << " Msg Idx " << std::setw(5) << uMessIdx << " DPB "
2487  << std::setw(2) << fuCurrDpbIdx << " Old TsMsb " << std::setw(5)
2488  << fvulCurrentTsMsb[fuCurrDpbIdx] << " Old MsbCy " << std::setw(5)
2489  << fvuCurrentTsMsbCycle[fuCurrDpbIdx] << " new TsMsb "
2490  << std::setw(5) << uVal;
2491 
2493  } // if( uVal < fvulCurrentTsMsb[fuCurrDpbIdx] )
2494  if (
2495  uVal != fvulCurrentTsMsb[fuCurrDpbIdx] + 1 && 0 != uVal
2496  && 4194303 != fvulCurrentTsMsb[fuCurrDpbIdx] && 1 != uMessIdx
2497  &&
2498  !(0 == uVal && 0 == fvulCurrentTsMsb[fuCurrDpbIdx] && 2 == uMessIdx)
2499  &&
2500  !(uVal == fvulCurrentTsMsb[fuCurrDpbIdx] && 2 == uMessIdx)
2501  &&
2502  uVal < fvulCurrentTsMsb
2503  [fuCurrDpbIdx]
2504  ) {
2505  LOG(info) << "TS MSb Jump in "
2506  << " TS " << std::setw(12) << fulCurrentTsIdx << " MS "
2507  << std::setw(12) << fulCurrentMsIdx << " MS Idx " << std::setw(4)
2508  << uMsIdx << " Msg Idx " << std::setw(5) << uMessIdx << " DPB "
2509  << std::setw(2) << fuCurrDpbIdx << " => Old TsMsb "
2510  << std::setw(5) << fvulCurrentTsMsb[fuCurrDpbIdx] << " new TsMsb "
2511  << std::setw(5) << uVal;
2512  } // if( uVal + 1 != fvulCurrentTsMsb[fuCurrDpbIdx] && 4194303 != uVal && 0 != fvulCurrentTsMsb[fuCurrDpbIdx] )
2514  /*
2515  if( 1 < uMessIdx )
2516  {
2517  fhStsDpbRawTsMsb->Fill( fuCurrDpbIdx, fvulCurrentTsMsb[fuCurrDpbIdx] );
2518  fhStsDpbRawTsMsbSx->Fill( fuCurrDpbIdx, ( fvulCurrentTsMsb[fuCurrDpbIdx] & 0x1F ) );
2519  fhStsDpbRawTsMsbDpb->Fill( fuCurrDpbIdx, ( fvulCurrentTsMsb[fuCurrDpbIdx] >> 5 ) );
2520  } // if( 0 < uMessIdx )
2521 */
2522  // fhStsAsicTsMsb->Fill( fvulCurrentTsMsb[fuCurrDpbIdx], uAsicIdx );
2523  /*
2524  ULong64_t ulNewTsMsbTime = static_cast< ULong64_t >( stsxyter::kuHitNbTsBins )
2525  * static_cast< ULong64_t >( fvulCurrentTsMsb[fuCurrDpbIdx])
2526  + static_cast< ULong64_t >( stsxyter::kulTsCycleNbBins )
2527  * static_cast< ULong64_t >( fvuCurrentTsMsbCycle[fuCurrDpbIdx] );
2528 */
2529 }
2530 
2532  // UInt_t uVal = mess.GetEpochVal();
2533  // UInt_t uCurrentCycle = uVal % stsxyter::kulTsCycleNbBins;
2534 
2535  /*
2536  // Update Status counters
2537  if( usVal < fvulCurrentTsMsb[fuCurrDpbIdx] )
2538  fvuCurrentTsMsbCycle[fuCurrDpbIdx] ++;
2539  fvulCurrentTsMsb[fuCurrDpbIdx] = usVal;
2540 
2541 // fhStsAsicTsMsb->Fill( fvulCurrentTsMsb[fuCurrDpbIdx], uAsicIdx );
2542 */
2543 }
2544 
2546 
2548 
2549  LOG(info) << "-------------------------------------";
2550  LOG(info) << "CbmMcbm2018MonitorSts statistics are ";
2551  LOG(info) << " Hit messages: " << fmMsgCounter[stsxyter::MessType::Hit]
2552  << "\n"
2553  << " Ts MSB messages: " << fmMsgCounter[stsxyter::MessType::TsMsb]
2554  << "\n"
2555  << " Dummy messages: " << fmMsgCounter[stsxyter::MessType::Dummy]
2556  << "\n"
2557  << " Epoch messages: " << fmMsgCounter[stsxyter::MessType::Epoch]
2558  << "\n"
2559  << " Empty messages: "
2561 
2562  LOG(info) << "-------------------------------------";
2563 
2565  // SaveAllHistos();
2566 }
2567 
2568 
2569 void CbmMcbm2018MonitorSts::SaveAllHistos(TString sFileName) {
2570  TDirectory* oldDir = NULL;
2571  TFile* histoFile = NULL;
2572  if ("" != sFileName) {
2573  // Store current directory position to allow restore later
2574  oldDir = gDirectory;
2575  // open separate histo file in recreate mode
2576  histoFile = new TFile(sFileName, "RECREATE");
2577  histoFile->cd();
2578  } // if( "" != sFileName )
2579 
2580  /***************************/
2581  gDirectory->mkdir("Sts_Raw");
2582  gDirectory->cd("Sts_Raw");
2583 
2584  fhStsMessType->Write();
2585  fhStsSysMessType->Write();
2586  fhStsMessTypePerDpb->Write();
2587  fhStsSysMessTypePerDpb->Write();
2588  fhStsStatusMessType->Write();
2589  fhStsMsStatusFieldType->Write();
2590  fhStsMessTypePerElink->Write();
2591  fhStsHitsElinkPerDpb->Write();
2592  fhStsAllFebsHitRateEvo->Write();
2593  fhStsAllAsicsHitRateEvo->Write();
2594  fhStsFebAsicHitCounts->Write();
2595  gDirectory->cd("..");
2596  /***************************/
2597 
2598  /***************************/
2599  gDirectory->mkdir("Sts_Feb");
2600  gDirectory->cd("Sts_Feb");
2601  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
2602  if (kTRUE == fUnpackParSts->IsFebActive(uFebIdx)) {
2603  fhStsFebChanCntRaw[uFebIdx]->Write();
2604  fhStsFebChanCntRawGood[uFebIdx]->Write();
2605  fhStsFebChanAdcRaw[uFebIdx]->Write();
2606  fhStsFebChanAdcRawProf[uFebIdx]->Write();
2607  // fhStsFebChanAdcCal[ uFebIdx ]->Write();
2608  // fhStsFebChanAdcCalProf[ uFebIdx ]->Write();
2609  fhStsFebChanRawTs[uFebIdx]->Write();
2610  fhStsFebChanMissEvt[uFebIdx]->Write();
2611  fhStsFebChanMissEvtEvo[uFebIdx]->Write();
2612  fhStsFebAsicMissEvtEvo[uFebIdx]->Write();
2613  fhStsFebMissEvtEvo[uFebIdx]->Write();
2614  fhStsFebChanHitRateEvo[uFebIdx]->Write();
2615  fhStsFebChanHitRateProf[uFebIdx]->Write();
2616  fhStsFebAsicHitRateEvo[uFebIdx]->Write();
2617  fhStsFebHitRateEvo[uFebIdx]->Write();
2618  fhStsFebChanHitRateEvoLong[uFebIdx]->Write();
2619  fhStsFebAsicHitRateEvoLong[uFebIdx]->Write();
2620  fhStsFebHitRateEvoLong[uFebIdx]->Write();
2621  fhStsFebChanDistT[uFebIdx]->Write();
2622  fhStsFebChanCloseHitsCounts[uFebIdx]->Write();
2623  fhStsFebChanCloseHitsRatio[uFebIdx]->Write();
2624  /*
2625  for( UInt_t uFebIdxB = uFebIdx; uFebIdxB < fuNbFebs; ++uFebIdxB )
2626  {
2627  fhStsFebChanDtCoinc[ uFebIdx ][ uFebIdxB ]->Write();
2628  fhStsFebChanCoinc[ uFebIdx ][ uFebIdxB ]->Write();
2629  } // for( UInt_t uFebIdxB = uFebIdx; uFebIdxB < fuNbFebs; ++uFebIdxB )
2630 */
2631  } // if( kTRUE == fUnpackParSts->IsFebActive( uFebIdx ) )
2632  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
2633  gDirectory->cd("..");
2634  /***************************/
2635 
2636  /***************************/
2637  /*
2638  gDirectory->mkdir("Sts_Module");
2639  gDirectory->cd("Sts_Module");
2640  for( UInt_t uModIdx = 0; uModIdx < fuNbModules; ++ uModIdx )
2641  {
2642  fhStsModulePNCoincDt[ uModIdx ]->Write();
2643  fhStsModulePNCoincDtAsicP[ uModIdx ]->Write();
2644  fhStsModulePNCoincDtAsicN[ uModIdx ]->Write();
2645  fhStsModulePNCoincChan[ uModIdx ]->Write();
2646  fhStsModulePNCoincAdc[ uModIdx ]->Write();
2647  fhStsModuleCoincAdcChanP[ uModIdx ]->Write();
2648  fhStsModuleCoincAdcChanN[ uModIdx ]->Write();
2649  fhStsModuleCoincMap[ uModIdx ]->Write();
2650  } // for( UInt_t uModIdx = 0; uModIdx < fuNbModules; ++ uModIdx )
2651  gDirectory->cd("..");
2652 */
2653  /***************************/
2654 
2656  if (kTRUE == fbEnableCheckBugSmx20) {
2657  gDirectory->mkdir("Sts_SmxErr");
2658  gDirectory->cd("Sts_SmxErr");
2659  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
2660  if (kTRUE == fUnpackParSts->IsFebActive(uFebIdx)) {
2661  fhStsFebSmxErrRatioEvo[uFebIdx]->Write();
2662  fhStsFebSmxErrRatioEvoAsic[uFebIdx]->Write();
2663  fhStsFebSmxErrRatioCopyEvo[uFebIdx]->Write();
2664  fhStsFebSmxErrRatioCopyEvoAsic[uFebIdx]->Write();
2665  fhStsFebSmxErrRatioCopySameAdcEvo[uFebIdx]->Write();
2666  fhStsFebSmxErrRatioCopySameAdcEvoAsic[uFebIdx]->Write();
2667  } // if( kTRUE == fUnpackParSts->IsFebActive( uFebIdx ) )
2668  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
2669  gDirectory->cd("..");
2670  } // if( kTRUE == fbEnableCheckBugSmx20 )
2672 
2673  /***************************/
2674  // Flib Histos
2675  gDirectory->mkdir("Flib_Raw");
2676  gDirectory->cd("Flib_Raw");
2677  for (UInt_t uLinks = 0; uLinks < kiMaxNbFlibLinks; uLinks++) {
2678  TString sMsSzName = Form("MsSz_link_%02u", uLinks);
2679  if (fHM->Exists(sMsSzName.Data())) fHM->H1(sMsSzName.Data())->Write();
2680 
2681  sMsSzName = Form("MsSzTime_link_%02u", uLinks);
2682  if (fHM->Exists(sMsSzName.Data())) fHM->P1(sMsSzName.Data())->Write();
2683  } // for( UInt_t uLinks = 0; uLinks < 16; uLinks ++)
2684 
2685  TH1* pMissedTsH1 = dynamic_cast<TH1*>(gROOT->FindObjectAny("Missed_TS"));
2686  if (NULL != pMissedTsH1) pMissedTsH1->Write();
2687 
2688  TProfile* pMissedTsEvoP =
2689  dynamic_cast<TProfile*>(gROOT->FindObjectAny("Missed_TS_Evo"));
2690  if (NULL != pMissedTsEvoP) pMissedTsEvoP->Write();
2691 
2692  gDirectory->cd("..");
2693  /***************************/
2694  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
2695  if (kTRUE == fUnpackParSts->IsFebActive(uFebIdx)) {
2696  fvcStsSumm[uFebIdx]->Write();
2697  if (kTRUE == fbEnableCheckBugSmx20) fvcStsSmxErr[uFebIdx]->Write();
2698  } // if( kTRUE == fUnpackParSts->IsFebActive( uFebIdx ) )
2699  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
2700  /***************************/
2701 
2702  if ("" != sFileName) {
2703  // Restore original directory position
2704  histoFile->Close();
2705  oldDir->cd();
2706  } // if( "" != sFileName )
2707 }
2709  LOG(info) << "Reseting all STS histograms.";
2710 
2711  fhStsMessType->Reset();
2712  fhStsSysMessType->Reset();
2713  fhStsMessTypePerDpb->Reset();
2714  fhStsSysMessTypePerDpb->Reset();
2715  fhStsStatusMessType->Reset();
2716  fhStsMsStatusFieldType->Reset();
2717  fhStsMessTypePerElink->Reset();
2718  fhStsHitsElinkPerDpb->Reset();
2719  fhStsAllFebsHitRateEvo->Reset();
2720  fhStsAllAsicsHitRateEvo->Reset();
2721  fhStsFebAsicHitCounts->Reset();
2722 
2723  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
2724  if (kTRUE == fUnpackParSts->IsFebActive(uFebIdx)) {
2725  fhStsFebChanCntRaw[uFebIdx]->Reset();
2726  fhStsFebChanCntRawGood[uFebIdx]->Reset();
2727  fhStsFebChanAdcRaw[uFebIdx]->Reset();
2728  fhStsFebChanAdcRawProf[uFebIdx]->Reset();
2729  // fhStsFebChanAdcCal[ uFebIdx ]->Reset();
2730  // fhStsFebChanAdcCalProf[ uFebIdx ]->Reset();
2731  fhStsFebChanRawTs[uFebIdx]->Reset();
2732  fhStsFebChanMissEvt[uFebIdx]->Reset();
2733  fhStsFebChanMissEvtEvo[uFebIdx]->Reset();
2734  fhStsFebAsicMissEvtEvo[uFebIdx]->Reset();
2735  fhStsFebMissEvtEvo[uFebIdx]->Reset();
2736  fhStsFebChanHitRateEvo[uFebIdx]->Reset();
2737  fhStsFebChanHitRateProf[uFebIdx]->Reset();
2738  fhStsFebAsicHitRateEvo[uFebIdx]->Reset();
2739  fhStsFebHitRateEvo[uFebIdx]->Reset();
2740  fhStsFebChanHitRateEvoLong[uFebIdx]->Reset();
2741  fhStsFebAsicHitRateEvoLong[uFebIdx]->Reset();
2742  fhStsFebHitRateEvoLong[uFebIdx]->Reset();
2743  fhStsFebChanDistT[uFebIdx]->Reset();
2744  fhStsFebChanCloseHitsCounts[uFebIdx]->Reset();
2745  fhStsFebChanCloseHitsRatio[uFebIdx]->Reset();
2746  /*
2747  for( UInt_t uFebIdxB = uFebIdx; uFebIdxB < fuNbFebs; ++uFebIdxB )
2748  {
2749  fhStsFebChanDtCoinc[ uFebIdx ][ uFebIdxB ]->Reset();
2750  fhStsFebChanCoinc[ uFebIdx ][ uFebIdxB ]->Reset();
2751  } // for( UInt_t uFebIdxB = uFebIdx; uFebIdxB < fuNbFebs; ++uFebIdxB )
2752 */
2754  if (kTRUE == fbEnableCheckBugSmx20) {
2755  fhStsFebSmxErrRatioEvo[uFebIdx]->Reset();
2756  fhStsFebSmxErrRatioEvoAsic[uFebIdx]->Reset();
2757  fhStsFebSmxErrRatioCopyEvo[uFebIdx]->Reset();
2758  fhStsFebSmxErrRatioCopyEvoAsic[uFebIdx]->Reset();
2759  fhStsFebSmxErrRatioCopySameAdcEvo[uFebIdx]->Reset();
2760  fhStsFebSmxErrRatioCopySameAdcEvoAsic[uFebIdx]->Reset();
2761  } // if( kTRUE == fbEnableCheckBugSmx20 )
2763  } // if( kTRUE == fUnpackParSts->IsFebActive( uFebIdx ) )
2764  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
2765  /*
2766  for( UInt_t uModIdx = 0; uModIdx < fuNbModules; ++ uModIdx )
2767  {
2768  fhStsModulePNCoincDt[ uModIdx ]->Reset();
2769  fhStsModulePNCoincDtAsicP[ uModIdx ]->Reset();
2770  fhStsModulePNCoincDtAsicN[ uModIdx ]->Reset();
2771  fhStsModulePNCoincChan[ uModIdx ]->Reset();
2772  fhStsModulePNCoincAdc[ uModIdx ]->Reset();
2773  fhStsModuleCoincAdcChanP[ uModIdx ]->Reset();
2774  fhStsModuleCoincAdcChanN[ uModIdx ]->Reset();
2775  fhStsModuleCoincMap[ uModIdx ]->Reset();
2776  } // for( UInt_t uModIdx = 0; uModIdx < fuNbModules; ++ uModIdx )
2777 */
2778  for (UInt_t uLinks = 0; uLinks < kiMaxNbFlibLinks; ++uLinks) {
2779  TString sMsSzName = Form("MsSz_link_%02u", uLinks);
2780  if (fHM->Exists(sMsSzName.Data())) fHM->H1(sMsSzName.Data())->Reset();
2781 
2782  sMsSzName = Form("MsSzTime_link_%02u", uLinks);
2783  if (fHM->Exists(sMsSzName.Data())) fHM->P1(sMsSzName.Data())->Reset();
2784  } // for( UInt_t uLinks = 0; uLinks < kiMaxNbFlibLinks; ++uLinks )
2785 
2786  fdStartTime = -1;
2787  fdStartTimeMsSz = -1;
2788 }
2789 /*
2790 void CbmMcbm2018MonitorSts::UpdatePairMeanValue( UInt_t uAsicA, UInt_t uAsicB, Double_t dNewValue )
2791 {
2792  if( fvuLastTimeDiffSlotAsicPair.size() < uAsicA )
2793  {
2794  LOG(warning) << "CbmMcbm2018MonitorSts::UpdatePairMeanValue => wrong ASIC A value: " << uAsicA
2795  << " VS " << fvuLastTimeDiffSlotAsicPair.size();
2796  return;
2797  } // if( fvuLastTimeDiffSlotAsicPair.size() < uAsicA )
2798  if( fvuLastTimeDiffSlotAsicPair[ uAsicA ].size() < uAsicB )
2799  {
2800  LOG(warning) << "CbmMcbm2018MonitorSts::UpdatePairMeanValue => wrong ASIC B value: " << uAsicB
2801  << " VS " << fvuLastTimeDiffSlotAsicPair[ uAsicA ].size();
2802  return;
2803  } // if( fvuLastTimeDiffSlotAsicPair[ uAsicA ].size() < uAsicB )
2804 
2805  if( kuNbValuesForTimeDiffMean == fvdLastTimeDiffValuesAsicPair[ uAsicA ][ uAsicB ].size() )
2806  {
2807  fvdLastTimeDiffValuesAsicPair[ uAsicA ][ uAsicB ][ fvuLastTimeDiffSlotAsicPair[ uAsicA ][ uAsicB ] ] = dNewValue;
2808  fvuLastTimeDiffSlotAsicPair[ uAsicA ][ uAsicB ] = ( fvuLastTimeDiffSlotAsicPair[ uAsicA ][ uAsicB ] + 1 )
2809  % kuNbValuesForTimeDiffMean;
2810  } // if( kuNbValuesForTimeDiffMean == fvdLastTimeDiffValuesAsicPair[ uAsicA ][ uAsicB ].size() )
2811  else fvdLastTimeDiffValuesAsicPair[ uAsicA ][ uAsicB ].push_back( dNewValue );
2812 
2813  Double_t dNewMean = 0.0;
2814  UInt_t uNbVal = fvdLastTimeDiffValuesAsicPair[ uAsicA ][ uAsicB ].size();
2815  for( UInt_t uIdx = 0; uIdx < uNbVal; ++uIdx )
2816  dNewMean += fvdLastTimeDiffValuesAsicPair[ uAsicA ][ uAsicB ][ uIdx ];
2817  dNewMean /= uNbVal;
2818 
2819  fvdMeanTimeDiffAsicPair[ uAsicA ][ uAsicB ] = dNewMean;
2820 }
2821 */
2823  Int_t timeIn,
2824  Int_t iBinSize) {
2825  TDatime* fRunStartDateTime = new TDatime(dateIn, timeIn);
2826  fiRunStartDateTimeSec = fRunStartDateTime->Convert();
2827  fiBinSizeDatePlots = iBinSize;
2828 
2829  LOG(info) << "Assigned new MUCH Run Start Date-Time: "
2830  << fRunStartDateTime->AsString();
2831 }
2832 
2834  UInt_t uBinSize) {
2835  fbLongHistoEnable = kTRUE;
2836  fuLongHistoNbSeconds = uDurationSeconds;
2837  fuLongHistoBinSizeSec = uBinSize;
2838 }
2843 
2844  if (kTRUE == fbSmx2ErrorUseNoiseLevels) {
2850  } // if( kTRUE == fbSmx2ErrorUseNoiseLevels )
2851 
2858  fvuSmxErrIdxLastHit.resize(fuNbFebs);
2859  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
2867  for (UInt_t uAsicIdx = 0; uAsicIdx < fUnpackParSts->GetNbAsicsPerFeb();
2868  ++uAsicIdx) {
2869  //fvulLastHitTs[ uXyterIdx ].resize( fuNbChanPerAsic, 0 );
2870  fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx].resize(kuSmxErrCoincWinNbHits,
2871  -1.0);
2872  fvuSmxErrIdxFirstHitM07[uFebIdx][uAsicIdx] = kuSmxErrCoincWinNbHits;
2873  fvuSmxErrIdxFirstHitM08[uFebIdx][uAsicIdx] = kuSmxErrCoincWinNbHits;
2874  fvuSmxErrIdxFirstHitM09[uFebIdx][uAsicIdx] = kuSmxErrCoincWinNbHits;
2875  fvuSmxErrIdxFirstHitM10[uFebIdx][uAsicIdx] = kuSmxErrCoincWinNbHits;
2876  fvuSmxErrIdxFirstHitM11[uFebIdx][uAsicIdx] = kuSmxErrCoincWinNbHits;
2877  fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx] = kuSmxErrCoincWinNbHits;
2878  } // for( UInt_t uAsicIdx = 0; uAsicIdx < fUnpackParSts->GetNbAsicsPerFeb(); ++uAsicIdx )
2879  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
2880 }
2881 
2883  UInt_t uAsicIdx,
2884  Double_t dNewHitTime) {
2885  if (kuSmxErrCoincWinNbHits == fvuSmxErrIdxFirstHitM07[uFebIdx][uAsicIdx]
2886  && kuSmxErrCoincWinNbHits == fvuSmxErrIdxFirstHitM08[uFebIdx][uAsicIdx]
2887  && kuSmxErrCoincWinNbHits == fvuSmxErrIdxFirstHitM09[uFebIdx][uAsicIdx]
2888  && kuSmxErrCoincWinNbHits == fvuSmxErrIdxFirstHitM10[uFebIdx][uAsicIdx]
2889  && kuSmxErrCoincWinNbHits == fvuSmxErrIdxFirstHitM11[uFebIdx][uAsicIdx]
2890  && kuSmxErrCoincWinNbHits == fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx]) {
2892  fvuSmxErrIdxFirstHitM07[uFebIdx][uAsicIdx] = 4;
2893  fvuSmxErrIdxFirstHitM08[uFebIdx][uAsicIdx] = 3;
2894  fvuSmxErrIdxFirstHitM09[uFebIdx][uAsicIdx] = 2;
2895  fvuSmxErrIdxFirstHitM10[uFebIdx][uAsicIdx] = 1;
2896  fvuSmxErrIdxFirstHitM11[uFebIdx][uAsicIdx] = 0;
2897  fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx] = 0;
2898  fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2899  [fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx]] = dNewHitTime;
2900 
2902  return kFALSE;
2903  }
2904  else if (kuSmxErrCoincWinNbHits - 1
2905  == fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx]
2906  - fvuSmxErrIdxFirstHitM11[uFebIdx][uAsicIdx]
2907  || fvuSmxErrIdxFirstHitM11[uFebIdx][uAsicIdx] - 1
2908  == fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx]) {
2910  fvuSmxErrIdxFirstHitM07[uFebIdx][uAsicIdx] =
2911  (fvuSmxErrIdxFirstHitM07[uFebIdx][uAsicIdx] + 1) % kuSmxErrCoincWinNbHits;
2912  fvuSmxErrIdxFirstHitM08[uFebIdx][uAsicIdx] =
2913  (fvuSmxErrIdxFirstHitM08[uFebIdx][uAsicIdx] + 1) % kuSmxErrCoincWinNbHits;
2914  fvuSmxErrIdxFirstHitM09[uFebIdx][uAsicIdx] =
2915  (fvuSmxErrIdxFirstHitM09[uFebIdx][uAsicIdx] + 1) % kuSmxErrCoincWinNbHits;
2916  fvuSmxErrIdxFirstHitM10[uFebIdx][uAsicIdx] =
2917  (fvuSmxErrIdxFirstHitM10[uFebIdx][uAsicIdx] + 1) % kuSmxErrCoincWinNbHits;
2918  fvuSmxErrIdxFirstHitM11[uFebIdx][uAsicIdx] =
2919  (fvuSmxErrIdxFirstHitM11[uFebIdx][uAsicIdx] + 1) % kuSmxErrCoincWinNbHits;
2920  fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx] =
2921  (fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx] + 1) % kuSmxErrCoincWinNbHits;
2922  fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2923  [fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx]] = dNewHitTime;
2924  }
2925  else {
2927  fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx] =
2928  fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx] + 1;
2929  fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2930  [fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx]] = dNewHitTime;
2931 
2933  return kFALSE;
2934  }
2935 
2937  Double_t dTimeDiff07 =
2938  fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2939  [fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx]]
2940  - fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2941  [fvuSmxErrIdxFirstHitM07[uFebIdx][uAsicIdx]];
2942  Double_t dTimeDiff08 =
2943  fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2944  [fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx]]
2945  - fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2946  [fvuSmxErrIdxFirstHitM08[uFebIdx][uAsicIdx]];
2947  Double_t dTimeDiff09 =
2948  fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2949  [fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx]]
2950  - fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2951  [fvuSmxErrIdxFirstHitM09[uFebIdx][uAsicIdx]];
2952  Double_t dTimeDiff10 =
2953  fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2954  [fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx]]
2955  - fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2956  [fvuSmxErrIdxFirstHitM10[uFebIdx][uAsicIdx]];
2957  Double_t dTimeDiff11 =
2958  fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2959  [fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx]]
2960  - fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2961  [fvuSmxErrIdxFirstHitM11[uFebIdx][uAsicIdx]];
2962 
2964  /*
2965  if( 3200 <= dTimeDiff07 && dTimeDiff07 <= 4500 )
2966  dTimeDiff7 -= 3200;
2967  if( 3200 <= dTimeDiff08 && dTimeDiff08 <= 4500 )
2968  dTimeDiff8 -= 3200;
2969  if( 3200 <= dTimeDiff09 && dTimeDiff09 <= 4500 )
2970  dTimeDiff9 -= 3200;
2971  if( 3200 <= dTimeDiff10 && dTimeDiff10 <= 4500 )
2972  dTimeDiff10 -= 3200;
2973  if( 3200 <= dTimeDiff11 && dTimeDiff11 <= 4500 )
2974  dTimeDiff11 -= 3200;
2975 */
2976 
2978  if ((kdSmxErrCoincWinBeg <= dTimeDiff07 && dTimeDiff07 <= fdSmxErrCoincWinM07)
2979  || (kdSmxErrCoincWinBeg <= dTimeDiff08
2980  && dTimeDiff08 <= fdSmxErrCoincWinM08)
2981  || (kdSmxErrCoincWinBeg <= dTimeDiff09
2982  && dTimeDiff09 <= fdSmxErrCoincWinM09)
2983  || (kdSmxErrCoincWinBeg <= dTimeDiff10
2984  && dTimeDiff10 <= fdSmxErrCoincWinM10)
2985  || (kdSmxErrCoincWinBeg <= dTimeDiff11
2986  && dTimeDiff11 <= fdSmxErrCoincWinM11)) {
2987  return kTRUE;
2988  }
2989  else {
2990  return kFALSE;
2991  }
2992 }
2994 Bool_t CbmMcbm2018MonitorSts::ScanForNoisyChannels(Double_t dNoiseThreshold) {
2995  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
2996  if (kTRUE == fUnpackParSts->IsFebActive(uFebIdx)) {
2997  LOG(info) << Form(
2998  " ------------------ Noisy channels scan for FEB %2d ------------",
2999  uFebIdx);
3000  for (UInt_t uAsicIdx = 0; uAsicIdx < fUnpackParSts->GetNbAsicsPerFeb();
3001  ++uAsicIdx)
3002  for (UInt_t uChanIdx = 0; uChanIdx < fUnpackParSts->GetNbChanPerAsic();
3003  ++uChanIdx) {
3004  UInt_t uChanInFeb =
3005  uAsicIdx * fUnpackParSts->GetNbChanPerAsic() + uChanIdx;
3006  if (dNoiseThreshold
3007  < fhStsFebChanHitRateProf[uFebIdx]->GetBinContent(1 + uChanInFeb))
3008  LOG(info) << Form(
3009  "Noisy Channel ASIC %d channel %3d (%4d) level %6.0f",
3010  uAsicIdx,
3011  uChanIdx,
3012  uChanInFeb,
3013  fhStsFebChanHitRateProf[uFebIdx]->GetBinContent(1 + uChanInFeb));
3014 
3015  } // for( UInt_t uChanIdx = 0; uChanIdx < fUnpackParSts->GetNbChanPerAsic(); ++uChanIdx )
3016 
3017  LOG(info)
3018  << " ---------------------------------------------------------------";
3019  } // if( kTRUE == fUnpackParSts->IsFebActive( uFebIdx ) )
3020  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
3021  return kTRUE;
3022 }
3024 
CbmMcbm2018MonitorSts::CreateHistograms
void CreateHistograms()
Definition: CbmMcbm2018MonitorSts.cxx:545
CbmMcbm2018MonitorSts::fhStsFebAsicHitCounts
TH2 * fhStsFebAsicHitCounts
Definition: CbmMcbm2018MonitorSts.h:226
CbmMcbm2018MonitorSts::fuNrOfDpbs
UInt_t fuNrOfDpbs
STS address for the first strip of each module.
Definition: CbmMcbm2018MonitorSts.h:111
CbmMcbm2018MonitorSts::fhStsMessTypePerDpb
TH2 * fhStsMessTypePerDpb
Definition: CbmMcbm2018MonitorSts.h:218
CbmHistManager::P1
TProfile * P1(const std::string &name) const
Return pointer to TProfile.
Definition: CbmHistManager.h:263
CbmMcbm2018MonitorSts::fbLongHistoEnable
Bool_t fbLongHistoEnable
Rate evolution histos.
Definition: CbmMcbm2018MonitorSts.h:203
CbmMcbm2018MonitorSts::kdSmxErrCoincWinNoiseM11
constexpr static const Double_t kdSmxErrCoincWinNoiseM11
Definition: CbmMcbm2018MonitorSts.h:283
CbmHistManager::Exists
Bool_t Exists(const std::string &name) const
Check existence of histogram in manager.
Definition: CbmHistManager.h:303
CbmMcbm2018StsPar::GetNbChanPerFeb
static constexpr UInt_t GetNbChanPerFeb()
Definition: CbmMcbm2018StsPar.h:53
CbmMcbm2018MonitorSts::FillTsMsbInfo
void FillTsMsbInfo(stsxyter::Message mess, UInt_t uMessIdx=0, UInt_t uMsIdx=0)
Definition: CbmMcbm2018MonitorSts.cxx:2449
CbmMcbm2018MonitorSts::fvuSmxErrIdxLastHit
std::vector< std::vector< UInt_t > > fvuSmxErrIdxLastHit
[ NbFebs ][ NbSmxPerFeb ]
Definition: CbmMcbm2018MonitorSts.h:302
CbmMcbm2018MonitorSts::DoUnpack
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
Definition: CbmMcbm2018MonitorSts.cxx:1375
CbmMcbm2018MonitorSts::fuNbCoreMsPerTs
size_t fuNbCoreMsPerTs
Definition: CbmMcbm2018MonitorSts.h:100
CbmMcbm2018MonitorSts::fhStsAllFebsHitRateEvo
TH2 * fhStsAllFebsHitRateEvo
Definition: CbmMcbm2018MonitorSts.h:224
CbmMcbm2018StsPar::GetModuleAddress
UInt_t GetModuleAddress(UInt_t uModuleIdx)
Definition: CbmMcbm2018StsPar.cxx:175
CbmMcbm2018StsPar::IsFebActive
Bool_t IsFebActive(UInt_t uFebInSystIdx)
Definition: CbmMcbm2018StsPar.cxx:235
CbmMcbm2018MonitorSts::fDpbIdIndexMap
std::map< UInt_t, UInt_t > fDpbIdIndexMap
Total number of STS DPBs in system.
Definition: CbmMcbm2018MonitorSts.h:113
CbmMcbm2018MonitorSts::fuMaxNbMicroslices
UInt_t fuMaxNbMicroslices
Definition: CbmMcbm2018MonitorSts.h:196
CbmMcbm2018MonitorSts::fdStsFebChanLastTimeForDist
std::vector< std::vector< Double_t > > fdStsFebChanLastTimeForDist
Definition: CbmMcbm2018MonitorSts.h:249
CbmMcbm2018MonitorSts::fdStartTimeMsSz
Double_t fdStartTimeMsSz
Definition: CbmMcbm2018MonitorSts.h:184
CbmMcbm2018MonitorSts::fhStsFebSmxErrRatioCopyEvoAsic
std::vector< TProfile2D * > fhStsFebSmxErrRatioCopyEvoAsic
Definition: CbmMcbm2018MonitorSts.h:311
CbmMcbm2018MonitorSts::fbIgnoreOverlapMs
Bool_t fbIgnoreOverlapMs
Definition: CbmMcbm2018MonitorSts.h:103
CbmMcbm2018MonitorSts::fvdSmxErrTimeLastHits
std::vector< std::vector< std::vector< Double_t > > > fvdSmxErrTimeLastHits
Definition: CbmMcbm2018MonitorSts.h:291
CbmMcbm2018MonitorSts::fiRunStartDateTimeSec
Int_t fiRunStartDateTimeSec
Index of the DPB from which the MS currently unpacked is coming.
Definition: CbmMcbm2018MonitorSts.h:155
CbmMcbm2018MonitorSts::kdSmxErrCoincWinNoiseM09
constexpr static const Double_t kdSmxErrCoincWinNoiseM09
Definition: CbmMcbm2018MonitorSts.h:281
CbmMcbm2018StsPar::GetFebModuleSide
Int_t GetFebModuleSide(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx)
Definition: CbmMcbm2018StsPar.cxx:307
CbmMcbm2018MonitorSts::fhStsFebChanHitRateEvoLong
std::vector< TH2 * > fhStsFebChanHitRateEvoLong
Definition: CbmMcbm2018MonitorSts.h:246
CbmMcbm2018MonitorSts::ResetAllHistos
void ResetAllHistos()
Definition: CbmMcbm2018MonitorSts.cxx:2708
CbmMcbm2018MonitorSts::CbmMcbm2018MonitorSts
CbmMcbm2018MonitorSts()
Definition: CbmMcbm2018MonitorSts.cxx:47
CbmMcbm2018MonitorSts::fuCurrentEquipmentId
UInt_t fuCurrentEquipmentId
Definition: CbmMcbm2018MonitorSts.h:149
CbmMcbm2018MonitorSts::fuNbStsXyters
UInt_t fuNbStsXyters
Number of StsXyter ASICs.
Definition: CbmMcbm2018MonitorSts.h:117
CbmMcbm2018MonitorSts::fhMsSz
TH1 * fhMsSz[kiMaxNbFlibLinks]
Definition: CbmMcbm2018MonitorSts.h:323
CbmMcbm2018MonitorSts::fhMsErrorsEvo
TH2 * fhMsErrorsEvo
Binning FW error flag.
Definition: CbmMcbm2018MonitorSts.h:316
CbmMcbm2018MonitorSts::SetNbMsInTs
virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
Definition: CbmMcbm2018MonitorSts.cxx:493
CbmMcbm2018StsPar::GetModuleType
UInt_t GetModuleType(UInt_t uModuleIdx)
Definition: CbmMcbm2018StsPar.cxx:166
CbmMcbm2018MonitorSts::kiMaxNbFlibLinks
static const Int_t kiMaxNbFlibLinks
ADC offset in e-, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ].
Definition: CbmMcbm2018MonitorSts.h:130
CbmMcbm2018MonitorSts::SetRunStart
void SetRunStart(Int_t dateIn, Int_t timeIn, Int_t iBinSize=5)
Definition: CbmMcbm2018MonitorSts.cxx:2822
CbmMcbm2018MonitorSts::kdSmxErrCoincWinNoiseM08
constexpr static const Double_t kdSmxErrCoincWinNoiseM08
Definition: CbmMcbm2018MonitorSts.h:280
CbmMcbm2018MonitorSts::kdSmxErrCoincWinNoiseM07
constexpr static const Double_t kdSmxErrCoincWinNoiseM07
Coincidence windows 99.9% tagging (up to 0.1% of corruption not detected)
Definition: CbmMcbm2018MonitorSts.h:279
CbmMcbm2018MonitorSts::fhStsFebHitRateEvoLong
std::vector< TH1 * > fhStsFebHitRateEvoLong
Definition: CbmMcbm2018MonitorSts.h:248
CbmMcbm2018MonitorSts::fbSmx2ErrorUseNoiseLevels
Bool_t fbSmx2ErrorUseNoiseLevels
SXM 2.0 logic error detection and tagging, 1 eLink case.
Definition: CbmMcbm2018MonitorSts.h:268
CbmMcbm2018MonitorSts::Init
virtual Bool_t Init()
Definition: CbmMcbm2018MonitorSts.cxx:195
CbmMcbm2018MonitorSts::fiTimeIntervalRateUpdate
Int_t fiTimeIntervalRateUpdate
Mean Rate per channel plots.
Definition: CbmMcbm2018MonitorSts.h:198
CbmMcbm2018MonitorSts::fvMsComponentsList
std::vector< size_t > fvMsComponentsList
Definition: CbmMcbm2018MonitorSts.h:99
stsxyter::Message
Definition: StsXyterMessage.h:165
CbmMcbm2018MonitorSts::fhStsMsStatusFieldType
TH2 * fhStsMsStatusFieldType
Definition: CbmMcbm2018MonitorSts.h:221
gdpbv100::msg_print_Human
@ msg_print_Human
Definition: gDpbMessv100.h:91
CbmMcbm2018MonitorSts::ReInitContainers
Bool_t ReInitContainers()
Definition: CbmMcbm2018MonitorSts.cxx:221
CbmMcbm2018MonitorSts::fhStsFebChanDistT
std::vector< TH2 * > fhStsFebChanDistT
Definition: CbmMcbm2018MonitorSts.h:250
stsxyter::MessType::Status
@ Status
CbmMcbm2018StsPar::GetDpbId
UInt_t GetDpbId(UInt_t uDpbIdx)
Definition: CbmMcbm2018StsPar.cxx:206
CbmMcbm2018MonitorSts::fvdFebAdcOffs
std::vector< std::vector< std::vector< Double_t > > > fvdFebAdcOffs
ADC gain in e-/b, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ].
Definition: CbmMcbm2018MonitorSts.h:127
CbmMcbm2018MonitorSts::fdSmxErrCoincWinM11
Double_t fdSmxErrCoincWinM11
Definition: CbmMcbm2018MonitorSts.h:289
CbmMcbm2018MonitorSts::fhStsFebSmxErrRatioCopySameAdcEvoAsic
std::vector< TProfile2D * > fhStsFebSmxErrRatioCopySameAdcEvoAsic
Definition: CbmMcbm2018MonitorSts.h:313
CbmMcbm2018MonitorSts::fhStsMessType
TH1 * fhStsMessType
Histogram manager.
Definition: CbmMcbm2018MonitorSts.h:216
CbmMcbm2018StsPar::IsCrobActive
Bool_t IsCrobActive(UInt_t uDpbIdx, UInt_t uCrobIdx)
Definition: CbmMcbm2018StsPar.cxx:215
stsxyter::kulTsCycleNbBinsBinning
static const uint64_t kulTsCycleNbBinsBinning
Definition: StsXyterMessage.h:161
CbmMcbm2018MonitorSts::fhStsFebAsicMissEvtEvo
std::vector< TH2 * > fhStsFebAsicMissEvtEvo
Definition: CbmMcbm2018MonitorSts.h:240
CbmMcbm2018MonitorSts::fhStsFebChanCloseHitsRatio
std::vector< TProfile * > fhStsFebChanCloseHitsRatio
Definition: CbmMcbm2018MonitorSts.h:252
bMcbm2018WriteSts
Bool_t bMcbm2018WriteSts
Definition: CbmMcbm2018MonitorSts.cxx:44
stsxyter::Message::GetLinkIndexHitBinning
uint16_t GetLinkIndexHitBinning() const
Definition: StsXyterMessage.h:296
CbmMcbm2018MonitorSts::kuSmxErrCoincWinNbHits
static const UInt_t kuSmxErrCoincWinNbHits
Definition: CbmMcbm2018MonitorSts.h:269
CbmMcbm2018MonitorSts::fhStsFebAsicHitRateEvo
std::vector< TH2 * > fhStsFebAsicHitRateEvo
Definition: CbmMcbm2018MonitorSts.h:244
stsxyter::Message::GetTsMsbVal
uint32_t GetTsMsbVal() const
For TS MSB data: Returns the TS MSB 22 bit field)
Definition: StsXyterMessage.h:334
CbmMcbm2018MonitorSts::FillEpochInfo
void FillEpochInfo(stsxyter::Message mess)
Definition: CbmMcbm2018MonitorSts.cxx:2531
CbmMcbm2018StsPar::GetNrOfFebs
UInt_t GetNrOfFebs()
Definition: CbmMcbm2018StsPar.h:86
CbmMcbm2018MonitorSts::fvbCrobActiveFlag
std::vector< std::vector< Bool_t > > fvbCrobActiveFlag
Map of DPB Identifier to DPB index.
Definition: CbmMcbm2018MonitorSts.h:115
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
CbmMcbm2018MonitorSts::SetLongDurationLimits
void SetLongDurationLimits(UInt_t uDurationSeconds=3600, UInt_t uBinSize=1)
Definition: CbmMcbm2018MonitorSts.cxx:2833
bMcbm2018ScanNoisySts
Bool_t bMcbm2018ScanNoisySts
Definition: CbmMcbm2018MonitorSts.cxx:45
CbmMcbm2018StsPar::GetNrOfAsics
UInt_t GetNrOfAsics()
Definition: CbmMcbm2018StsPar.h:87
stsxyter::kulTsCycleNbBins
static const uint64_t kulTsCycleNbBins
Definition: StsXyterMessage.h:152
CbmMcbm2018MonitorSts::fvuSmxErrIdxFirstHitM08
std::vector< std::vector< UInt_t > > fvuSmxErrIdxFirstHitM08
[ NbFebs ][ NbSmxPerFeb ]
Definition: CbmMcbm2018MonitorSts.h:295
CbmMcbm2018MonitorSts::fdSmxErrCoincWinM10
Double_t fdSmxErrCoincWinM10
Definition: CbmMcbm2018MonitorSts.h:288
CbmMcbm2018MonitorSts::fvcStsSmxErr
std::vector< TCanvas * > fvcStsSmxErr
Definition: CbmMcbm2018MonitorSts.h:320
CbmMcbm2018MonitorSts::fhStsFebChanHitRateProf
std::vector< TProfile * > fhStsFebChanHitRateProf
Definition: CbmMcbm2018MonitorSts.h:243
CbmMcbm2018MonitorSts::fbPrintMessages
Bool_t fbPrintMessages
Task configuration values.
Definition: CbmMcbm2018MonitorSts.h:137
CbmMcbm2018StsPar::GetNbFebsPerCrob
static constexpr UInt_t GetNbFebsPerCrob()
Definition: CbmMcbm2018StsPar.h:41
CbmMcbm2018MonitorSts::fvuSmxErrIdxFirstHitM11
std::vector< std::vector< UInt_t > > fvuSmxErrIdxFirstHitM11
[ NbFebs ][ NbSmxPerFeb ]
Definition: CbmMcbm2018MonitorSts.h:301
CbmMcbm2018StsPar::GetNrOfDpbs
UInt_t GetNrOfDpbs()
Definition: CbmMcbm2018StsPar.h:83
CbmMcbm2018StsPar::GetNbAsicsPerCrob
static constexpr UInt_t GetNbAsicsPerCrob()
Definition: CbmMcbm2018StsPar.h:46
CbmHistManager.h
Histogram manager.
CbmMcbm2018MonitorSts::fhStsFebHitRateEvo
std::vector< TH1 * > fhStsFebHitRateEvo
Definition: CbmMcbm2018MonitorSts.h:245
stsxyter::Message::IsHitMissedEvts
bool IsHitMissedEvts() const
For Hit data: Returns Missed event flag (1 bit field)
Definition: StsXyterMessage.h:301
CbmMcbm2018MonitorSts::fvmAsicHitsInMs
std::vector< std::vector< stsxyter::FinalHit > > fvmAsicHitsInMs
All hits (time in bins, ADC in bins, asic, channel) in last TS, sorted with "<" operator.
Definition: CbmMcbm2018MonitorSts.h:192
CbmMcbm2018MonitorSts::fhStsHitsElinkPerDpb
TH2 * fhStsHitsElinkPerDpb
Definition: CbmMcbm2018MonitorSts.h:223
CbmMcbm2018MonitorSts::fvdChanLastHitTime
std::vector< std::vector< Double_t > > fvdChanLastHitTime
Last hit time in bins for each Channel.
Definition: CbmMcbm2018MonitorSts.h:170
CbmMcbm2018MonitorSts::fhStsFebChanHitRateEvo
std::vector< TH2 * > fhStsFebChanHitRateEvo
Definition: CbmMcbm2018MonitorSts.h:242
stsxyter::Message::GetHitAdc
uint16_t GetHitAdc() const
For Hit data: Returns ADC value (5 bit field)
Definition: StsXyterMessage.h:277
CbmMcbm2018MonitorSts::fdSmxErrCoincWinM07
Double_t fdSmxErrCoincWinM07
Tagging variables.
Definition: CbmMcbm2018MonitorSts.h:285
CbmMcbm2018MonitorSts::fvulCurrentTsMsb
std::vector< ULong64_t > fvulCurrentTsMsb
Bin size in s for the plots with date as X axis.
Definition: CbmMcbm2018MonitorSts.h:159
CbmMcbm2018MonitorSts::fhStsFebMissEvtEvo
std::vector< TH1 * > fhStsFebMissEvtEvo
Definition: CbmMcbm2018MonitorSts.h:241
CbmMcbm2018MonitorSts::fdStartTime
Double_t fdStartTime
Last hit ADC in bins in each MS for each Channel.
Definition: CbmMcbm2018MonitorSts.h:182
CbmMcbm2018MonitorSts::fvdFebAdcGain
std::vector< std::vector< std::vector< Double_t > > > fvdFebAdcGain
FEB type, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ], 0 = A, 1 = B, -1 if inactive.
Definition: CbmMcbm2018MonitorSts.h:125
stsxyter::Message::GetMsErrorType
uint16_t GetMsErrorType() const
For End of MS data: Returns the MS error type field (2 bit field)
Definition: StsXyterMessage.h:400
CbmMcbm2018MonitorSts::ProcessStsMs
Bool_t ProcessStsMs(const fles::Timeslice &ts, size_t uMsComp, UInt_t uMsIdx)
Definition: CbmMcbm2018MonitorSts.cxx:1935
CbmMcbm2018StsPar::GetNbElinkPerDpb
static constexpr UInt_t GetNbElinkPerDpb()
Definition: CbmMcbm2018StsPar.h:38
CbmMcbm2018MonitorSts::fvuSmxErrIdxFirstHitM10
std::vector< std::vector< UInt_t > > fvuSmxErrIdxFirstHitM10
[ NbFebs ][ NbSmxPerFeb ]
Definition: CbmMcbm2018MonitorSts.h:299
CbmMcbm2018StsPar::GetFebAdcOffset
Double_t GetFebAdcOffset(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx)
Definition: CbmMcbm2018StsPar.cxx:369
CbmMcbm2018MonitorSts::fvbMaskedComponents
std::vector< Bool_t > fvbMaskedComponents
Definition: CbmMcbm2018MonitorSts.h:92
CbmMcbm2018StsPar::GetNbAsicsPerFeb
static constexpr UInt_t GetNbAsicsPerFeb()
Definition: CbmMcbm2018StsPar.h:45
CbmHistManager
Histogram manager.
Definition: CbmHistManager.h:41
stsxyter::MessType::Empty
@ Empty
h
Data class with information on a STS local track.
CbmMcbm2018MonitorSts::fuLongHistoBinSizeSec
UInt_t fuLongHistoBinSizeSec
Definition: CbmMcbm2018MonitorSts.h:205
CbmMcbm2018MonitorSts::fhStsAllAsicsHitRateEvo
TH2 * fhStsAllAsicsHitRateEvo
Definition: CbmMcbm2018MonitorSts.h:225
CbmMcbm2018MonitorSts::fvulChanLastHitTime
std::vector< std::vector< ULong64_t > > fvulChanLastHitTime
Definition: CbmMcbm2018MonitorSts.h:168
CbmMcbm2018MonitorSts::fhStsFebChanMissEvtEvo
std::vector< TH2 * > fhStsFebChanMissEvtEvo
Definition: CbmMcbm2018MonitorSts.h:239
CbmMcbm2018MonitorSts::fhStsFebChanCntRaw
std::vector< TH1 * > fhStsFebChanCntRaw
Definition: CbmMcbm2018MonitorSts.h:231
CbmMcbm2018MonitorSts::fUnpackParSts
CbmMcbm2018StsPar * fUnpackParSts
/‍** Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice **‍/
Definition: CbmMcbm2018MonitorSts.h:105
CbmMcbm2018MonitorSts::fulCurrentTsIdx
ULong64_t fulCurrentTsIdx
TS/MS info.
Definition: CbmMcbm2018MonitorSts.h:144
CbmMcbm2018MonitorSts::fhStsFebChanRawTs
std::vector< TH2 * > fhStsFebChanRawTs
Definition: CbmMcbm2018MonitorSts.h:237
CbmMcbm2018MonitorSts::SaveAllHistos
void SaveAllHistos(TString sFileName="")
Definition: CbmMcbm2018MonitorSts.cxx:2569
CbmMcbm2018MonitorSts::Finish
virtual void Finish()
Definition: CbmMcbm2018MonitorSts.cxx:2547
stsxyter::FinalHit
Definition: StsXyterFinalHit.h:16
stsxyter::MessType::Hit
@ Hit
CbmMcbm2018MonitorSts::fvmFebHitsInMs
std::vector< std::vector< stsxyter::FinalHit > > fvmFebHitsInMs
All hits (time in bins, ADC in bins, asic, channel) in last TS, per ASIC, sorted with "<" operator.
Definition: CbmMcbm2018MonitorSts.h:194
CbmMcbm2018MonitorSts::ScanForNoisyChannels
Bool_t ScanForNoisyChannels(Double_t dNoiseThreshold=1e3)
---------------------------------------------------------------—///
Definition: CbmMcbm2018MonitorSts.cxx:2994
stsxyter::kuHitNbTsBins
static const uint32_t kuHitNbTsBins
Definition: StsXyterMessage.h:146
CbmMcbm2018MonitorSts::fvdMsTime
std::vector< Double_t > fvdMsTime
Header time of previous MS per link.
Definition: CbmMcbm2018MonitorSts.h:172
CbmMcbm2018StsPar::ElinkIdxToAsicIdx
UInt_t ElinkIdxToAsicIdx(Bool_t bFebType, UInt_t uElink)
Definition: CbmMcbm2018StsPar.h:69
CbmMcbm2018MonitorSts::fviFebModuleIdx
std::vector< std::vector< std::vector< Int_t > > > fviFebModuleIdx
Number of StsXyter ASICs.
Definition: CbmMcbm2018MonitorSts.h:119
CbmMcbm2018MonitorSts::kdSmxErrCoincWinNoiseM10
constexpr static const Double_t kdSmxErrCoincWinNoiseM10
Definition: CbmMcbm2018MonitorSts.h:282
CbmMcbm2018MonitorSts::fuCurrDpbIdx
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
Definition: CbmMcbm2018MonitorSts.h:153
stsxyter::Message::GetStatusStatus
uint16_t GetStatusStatus() const
For Status data: Returns the Status field from ACK frame (4 bit field)
Definition: StsXyterMessage.h:359
CbmMcbm2018MonitorSts::fhStsFebAsicHitRateEvoLong
std::vector< TH2 * > fhStsFebAsicHitRateEvoLong
Definition: CbmMcbm2018MonitorSts.h:247
CbmMcbm2018MonitorSts::fPrintMessCtrl
stsxyter::MessagePrintMask fPrintMessCtrl
Definition: CbmMcbm2018MonitorSts.h:138
CbmMcbm2018MonitorSts::fhStsFebChanAdcRawProf
std::vector< TProfile * > fhStsFebChanAdcRawProf
Definition: CbmMcbm2018MonitorSts.h:234
CbmMcbm2018MonitorSts::fuCurrDpbId
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
Definition: CbmMcbm2018MonitorSts.h:151
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmMcbm2018StsPar::GetNbOfModules
UInt_t GetNbOfModules()
Definition: CbmMcbm2018StsPar.h:76
CbmMcbm2018MonitorSts::fhStsFebSmxErrRatioCopySameAdcEvo
std::vector< TProfile * > fhStsFebSmxErrRatioCopySameAdcEvo
Definition: CbmMcbm2018MonitorSts.h:312
CbmMcbm2018MonitorSts::fviFebModuleSide
std::vector< std::vector< std::vector< Int_t > > > fviFebModuleSide
Idx of the STS module for each FEB, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ], -1 if inactive.
Definition: CbmMcbm2018MonitorSts.h:121
CbmMcbm2018MonitorSts::fhStsFebChanAdcRaw
std::vector< TH2 * > fhStsFebChanAdcRaw
Definition: CbmMcbm2018MonitorSts.h:233
CbmMcbm2018MonitorSts::fdSmxErrCoincWinM08
Double_t fdSmxErrCoincWinM08
Definition: CbmMcbm2018MonitorSts.h:286
CbmHistManager::H1
TH1 * H1(const std::string &name) const
Return pointer to TH1 histogram.
Definition: CbmHistManager.h:170
CbmMcbm2018MonitorSts::fhStsMessTypePerElink
TH2 * fhStsMessTypePerElink
Definition: CbmMcbm2018MonitorSts.h:222
CbmMcbm2018MonitorSts::fdSmxErrCoincWinM09
Double_t fdSmxErrCoincWinM09
Definition: CbmMcbm2018MonitorSts.h:287
CbmMcbm2018MonitorSts::fvdFebTimeSecLastRateUpdate
std::vector< Double_t > fvdFebTimeSecLastRateUpdate
Definition: CbmMcbm2018MonitorSts.h:199
CbmMcbm2018MonitorSts::fbEnableCheckBugSmx20
Bool_t fbEnableCheckBugSmx20
Definition: CbmMcbm2018MonitorSts.h:140
CbmMcbm2018MonitorSts::fuNbOverMsPerTs
size_t fuNbOverMsPerTs
Definition: CbmMcbm2018MonitorSts.h:101
CbmMcbm2018MonitorSts::SetParContainers
void SetParContainers()
Definition: CbmMcbm2018MonitorSts.cxx:204
stsxyter::kdClockCycleNs
static const double kdClockCycleNs
Definition: StsXyterMessage.h:156
CbmMcbm2018MonitorSts::fhStsFebChanMissEvt
std::vector< TH2 * > fhStsFebChanMissEvt
Definition: CbmMcbm2018MonitorSts.h:238
CbmMcbm2018StsPar::GetNbElinkPerCrob
static constexpr UInt_t GetNbElinkPerCrob()
Definition: CbmMcbm2018StsPar.h:37
stsxyter::kuHitNbTsBinsBinning
static const uint32_t kuHitNbTsBinsBinning
Definition: StsXyterMessage.h:160
CbmMcbm2018StsPar
Definition: CbmMcbm2018StsPar.h:18
CbmMcbm2018MonitorSts::fvuCurrentTsMsbCycle
std::vector< UInt_t > fvuCurrentTsMsbCycle
Current TS MSB for each DPB.
Definition: CbmMcbm2018MonitorSts.h:160
CbmMcbm2018MonitorSts::InitStsParameters
Bool_t InitStsParameters()
Definition: CbmMcbm2018MonitorSts.cxx:227
CbmMcbm2018MonitorSts::fvuSmxErrIdxFirstHitM07
std::vector< std::vector< UInt_t > > fvuSmxErrIdxFirstHitM07
[ NbFebs ][ NbSmxPerFeb ][ kuSmxErrCoincWinNbHits ]
Definition: CbmMcbm2018MonitorSts.h:293
stsxyter::Message::GetMessType
MessType GetMessType() const
Returns the message type, see enum MessType.
Definition: StsXyterMessage.h:259
CbmMcbm2018StsPar::GetFebModuleIdx
Int_t GetFebModuleIdx(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx)
Definition: CbmMcbm2018StsPar.cxx:276
CbmMcbm2018MonitorSts::fvcStsSumm
std::vector< TCanvas * > fvcStsSumm
Canvases.
Definition: CbmMcbm2018MonitorSts.h:319
CbmMcbm2018MonitorSts::fulCurrentMsIdx
ULong64_t fulCurrentMsIdx
Definition: CbmMcbm2018MonitorSts.h:145
FormatMsHeaderPrintout
std::string FormatMsHeaderPrintout(const fles::MicrosliceDescriptor &msDescriptor)
Definition: CbmFormatMsHeaderPrintout.cxx:5
CbmMcbm2018MonitorSts::fhStsFebSmxErrRatioEvo
std::vector< TProfile * > fhStsFebSmxErrRatioEvo
Histograms.
Definition: CbmMcbm2018MonitorSts.h:308
CbmMcbm2018MonitorSts::fhStsFebSmxErrRatioEvoAsic
std::vector< TProfile2D * > fhStsFebSmxErrRatioEvoAsic
Definition: CbmMcbm2018MonitorSts.h:309
gdpbv100::MessagePrintMask
MessagePrintMask
Definition: gDpbMessv100.h:87
CbmMcbm2018MonitorSts::fuLongHistoNbSeconds
UInt_t fuLongHistoNbSeconds
Definition: CbmMcbm2018MonitorSts.h:204
CbmMcbm2018MonitorSts::SmxErrInitializeVariables
void SmxErrInitializeVariables()
Methods.
Definition: CbmMcbm2018MonitorSts.cxx:2842
CbmMcbm2018MonitorSts::fvuSmxErrIdxFirstHitM09
std::vector< std::vector< UInt_t > > fvuSmxErrIdxFirstHitM09
[ NbFebs ][ NbSmxPerFeb ]
Definition: CbmMcbm2018MonitorSts.h:297
stsxyter::Message::GetHitChannel
uint16_t GetHitChannel() const
For Hit data: Returns StsXYTER channel number (7 bit field)
Definition: StsXyterMessage.h:274
CbmMcbm2018MonitorSts::kuBytesPerMessage
static const UInt_t kuBytesPerMessage
Definition: CbmMcbm2018MonitorSts.h:131
CbmMcbm2018MonitorSts::fuNbModules
UInt_t fuNbModules
Definition: CbmMcbm2018MonitorSts.h:106
stsxyter::Message::GetStatusLink
uint16_t GetStatusLink() const
For Status data: Returns the Link Inedx (9 bit field)
Definition: StsXyterMessage.h:353
stsxyter::Message::PrintMess
bool PrintMess(std::ostream &os, MessagePrintMask ctrl=MessagePrintMask::msg_print_Human) const
Definition: StsXyterMessage.cxx:29
stsxyter::Message::IsMsErrorFlagOn
bool IsMsErrorFlagOn() const
For End of MS data: Returns the MS error flag (1 bit field)
Definition: StsXyterMessage.h:397
CbmMcbm2018MonitorSts
Definition: CbmMcbm2018MonitorSts.h:32
CbmMcbm2018MonitorSts::fvuInitialHeaderDone
std::vector< UInt_t > fvuInitialHeaderDone
Current TS MSB cycle for DPB.
Definition: CbmMcbm2018MonitorSts.h:162
CbmMcbm2018MonitorSts::~CbmMcbm2018MonitorSts
virtual ~CbmMcbm2018MonitorSts()
Definition: CbmMcbm2018MonitorSts.cxx:193
CbmMcbm2018StsPar::GetFebAdcGain
Double_t GetFebAdcGain(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx)
Definition: CbmMcbm2018StsPar.cxx:338
CbmMcbm2018MonitorSts::fvusChanLastHitAdcInMs
std::vector< std::vector< std::vector< UShort_t > > > fvusChanLastHitAdcInMs
Last hit time in bins in each MS for each Channel.
Definition: CbmMcbm2018MonitorSts.h:178
CbmMcbm2018MonitorSts::fHM
CbmHistManager * fHM
Histograms.
Definition: CbmMcbm2018MonitorSts.h:215
CbmMcbm2018MonitorSts::fvdChanLastHitTimeInMs
std::vector< std::vector< std::vector< Double_t > > > fvdChanLastHitTimeInMs
Number of hits in each MS for each Channel.
Definition: CbmMcbm2018MonitorSts.h:176
CbmMcbm2018MonitorSts::Reset
virtual void Reset()
Definition: CbmMcbm2018MonitorSts.cxx:2545
CbmMcbm2018MonitorSts::fuNbFebs
UInt_t fuNbFebs
Array to hold the active flag for all CROBs, [ NbDpb ][ NbCrobPerDpb ].
Definition: CbmMcbm2018MonitorSts.h:116
CbmMcbm2018MonitorSts::fviFebCountsSinceLastRateUpdate
std::vector< Int_t > fviFebCountsSinceLastRateUpdate
Definition: CbmMcbm2018MonitorSts.h:200
CbmMcbm2018MonitorSts::fviModuleType
std::vector< Int_t > fviModuleType
Total number of STS modules in the setup.
Definition: CbmMcbm2018MonitorSts.h:108
CbmMcbm2018MonitorSts::fviModAddress
std::vector< Int_t > fviModAddress
Type of each module: 0 for connectors on the right, 1 for connectors on the left.
Definition: CbmMcbm2018MonitorSts.h:110
CbmMcbm2018MonitorSts::kdSmxErrCoincWinBeg
constexpr static const Double_t kdSmxErrCoincWinBeg
Definition: CbmMcbm2018MonitorSts.h:270
stsxyter::MessType::TsMsb
@ TsMsb
CbmMcbm2018MonitorSts::fviFebType
std::vector< std::vector< std::vector< Int_t > > > fviFebType
STS module side for each FEB, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ], 0 = P, 1 = N,...
Definition: CbmMcbm2018MonitorSts.h:123
stsxyter::Message::GetHitTime
uint16_t GetHitTime() const
For Hit data: Returns timestamp (8 bit field, 2 MSB bits overlap removed)
Definition: StsXyterMessage.h:286
CbmMcbm2018MonitorSts::fiBinSizeDatePlots
Int_t fiBinSizeDatePlots
Start of run time since "epoch" in s, for the plots with date as X axis.
Definition: CbmMcbm2018MonitorSts.h:156
stsxyter::MessType::Dummy
@ Dummy
CbmMcbm2018StsPar.h
CbmMcbm2018StsPar::GetNbFebsPerDpb
static constexpr UInt_t GetNbFebsPerDpb()
Definition: CbmMcbm2018StsPar.h:42
CbmMcbm2018MonitorSts::fhStsFebSmxErrRatioCopyEvo
std::vector< TProfile * > fhStsFebSmxErrRatioCopyEvo
Definition: CbmMcbm2018MonitorSts.h:310
stsxyter::MessType::Epoch
@ Epoch
CbmMcbm2018MonitorSts::fbBinningFw
Bool_t fbBinningFw
=> Quick and dirty hack for binning FW!!!
Definition: CbmMcbm2018MonitorSts.h:142
CbmMcbm2018MonitorSts::fhStsSysMessTypePerDpb
TH2 * fhStsSysMessTypePerDpb
Definition: CbmMcbm2018MonitorSts.h:219
CbmMcbm2018MonitorSts::fuLongHistoBinNb
UInt_t fuLongHistoBinNb
Definition: CbmMcbm2018MonitorSts.h:206
CbmMcbm2018MonitorSts::fvuInitialTsMsbCycleHeader
std::vector< UInt_t > fvuInitialTsMsbCycleHeader
Flag set after seeing MS header in 1st MS for DPB.
Definition: CbmMcbm2018MonitorSts.h:164
CbmMcbm2018MonitorSts::fhStsStatusMessType
TH2 * fhStsStatusMessType
Definition: CbmMcbm2018MonitorSts.h:220
stsxyter::Message::GetTsMsbValBinning
uint32_t GetTsMsbValBinning() const
For TS MSB data: Returns the TS MSB 29 bit field)
Definition: StsXyterMessage.h:337
stsxyter::kuHitNbAdcBins
static const uint32_t kuHitNbAdcBins
Status/properties constants.
Definition: StsXyterMessage.h:144
CbmMcbm2018MonitorSts::FillHitInfo
void FillHitInfo(stsxyter::Message mess, const UShort_t &usElinkIdx, const UInt_t &uAsicIdx, const UInt_t &uMsIdx)
Definition: CbmMcbm2018MonitorSts.cxx:2273
CbmMcbm2018MonitorSts::fvuElinkLastTsHit
std::vector< UInt_t > fvuElinkLastTsHit
TS MSB cycle from MS header in 1st MS for DPB.
Definition: CbmMcbm2018MonitorSts.h:165
CbmMcbmUnpack
Definition: CbmMcbmUnpack.h:15
bMcbm2018ResetSts
Bool_t bMcbm2018ResetSts
Definition: CbmMcbm2018MonitorSts.cxx:43
CbmMcbm2018MonitorSts::fhStsFebChanCloseHitsCounts
std::vector< TH2 * > fhStsFebChanCloseHitsCounts
Definition: CbmMcbm2018MonitorSts.h:251
CbmMcbm2018MonitorSts::fhMsSzTime
TProfile * fhMsSzTime[kiMaxNbFlibLinks]
Definition: CbmMcbm2018MonitorSts.h:324
CbmMcbm2018StsPar::ElinkIdxToFebIdx
Int_t ElinkIdxToFebIdx(UInt_t uElink)
Definition: CbmMcbm2018StsPar.cxx:125
CbmMcbm2018MonitorSts::fvdPrevMsTime
std::vector< Double_t > fvdPrevMsTime
Last hit time in ns for each Channel.
Definition: CbmMcbm2018MonitorSts.h:171
stsxyter
Definition: StsXyterFinalHit.h:12
CbmMcbm2018MonitorSts::fhStsSysMessType
TH1 * fhStsSysMessType
Definition: CbmMcbm2018MonitorSts.h:217
CbmMcbm2018MonitorSts::AddMsComponentToList
virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Definition: CbmMcbm2018MonitorSts.cxx:437
CbmMcbm2018StsPar::GetNbCrobsPerDpb
static constexpr UInt_t GetNbCrobsPerDpb()
Definition: CbmMcbm2018StsPar.h:36
CbmMcbm2018MonitorSts::fhStsFebChanCntRawGood
std::vector< TH1 * > fhStsFebChanCntRawGood
Definition: CbmMcbm2018MonitorSts.h:232
CbmMcbm2018MonitorSts::fsHistoFileFullname
TString fsHistoFileFullname
Definition: CbmMcbm2018MonitorSts.h:135
CbmMcbm2018StsPar::GetNbChanPerAsic
static constexpr UInt_t GetNbChanPerAsic()
Definition: CbmMcbm2018StsPar.h:52
CbmMcbm2018MonitorSts::fvdFebChanCountsSinceLastRateUpdate
std::vector< std::vector< Double_t > > fvdFebChanCountsSinceLastRateUpdate
Definition: CbmMcbm2018MonitorSts.h:201
CbmMcbm2018MonitorSts::fmMsgCounter
std::map< stsxyter::MessType, UInt_t > fmMsgCounter
Current data properties.
Definition: CbmMcbm2018MonitorSts.h:147
CbmMcbm2018MonitorSts::fcMsSizeAll
TCanvas * fcMsSizeAll
Definition: CbmMcbm2018MonitorSts.h:322
CbmMcbm2018MonitorSts.h
CbmMcbm2018MonitorSts::fvuChanNbHitsInMs
std::vector< std::vector< std::vector< UInt_t > > > fvuChanNbHitsInMs
Header time of each MS.
Definition: CbmMcbm2018MonitorSts.h:174
CbmFormatMsHeaderPrintout.h
CbmMcbm2018MonitorSts::SmxErrCheckCoinc
Bool_t SmxErrCheckCoinc(UInt_t uFebIdx, UInt_t uAsicIdx, Double_t dNewHitTime)
Definition: CbmMcbm2018MonitorSts.cxx:2882
stsxyter::MessType::EndOfMs
@ EndOfMs
CbmMcbm2018MonitorSts::InitContainers
Bool_t InitContainers()
Definition: CbmMcbm2018MonitorSts.cxx:212
CbmHistManager::Add
void Add(const std::string &name, TNamed *object)
Add new named object to manager.
Definition: CbmHistManager.h:58
stsxyter::Message::GetHitTimeBinning
uint16_t GetHitTimeBinning() const
Definition: StsXyterMessage.h:290
CbmMcbm2018MonitorSts::fvmHitsInMs
std::vector< stsxyter::FinalHit > fvmHitsInMs
Hits time-sorting.
Definition: CbmMcbm2018MonitorSts.h:190