CbmRoot
CbmMcbm2018MonitorMuch.cxx
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 // ----- -----
3 // ----- CbmMcbm2018MonitorMuch -----
4 // ----- Created 11/05/18 by P.-A. Loizeau -----
5 // ----- Modified 11/05/18 by Ajit kumar -----
6 // ----- -----
7 // -----------------------------------------------------------------------------
8 
10 
11 // Data
12 
13 // CbmRoot
14 #include "CbmHistManager.h"
15 #include "CbmMcbm2018MuchPar.h"
16 
17 // FairRoot
18 #include "FairLogger.h"
19 #include "FairRootManager.h"
20 #include "FairRun.h"
21 #include "FairRunOnline.h"
22 #include "FairRuntimeDb.h"
23 
24 // Root
25 #include "TClonesArray.h"
26 #include "THttpServer.h"
27 #include "TMath.h"
28 #include "TROOT.h"
29 #include "TRandom.h"
30 #include "TString.h"
31 #include "TStyle.h"
32 #include <TFile.h>
33 
34 // C++11
35 #include <bitset>
36 
37 // C/C++
38 #include <iomanip>
39 #include <iostream>
40 #include <stdint.h>
41 
42 Bool_t bMcbm2018ResetMuch = kFALSE;
43 Bool_t bMcbm2018WriteMuch = kFALSE;
44 Bool_t bMcbm2018ScanNoisyMuch = kFALSE;
45 
47  : CbmMcbmUnpack()
48  , fbMuchMode(kFALSE)
49  , fvMsComponentsList()
50  , fuNbCoreMsPerTs(0)
51  , fuNbOverMsPerTs(0)
52  ,
53  //uTimeBin(1e-9),
54  fbIgnoreOverlapMs(kFALSE)
55  , fUnpackParMuch(NULL)
56  , fuNrOfDpbs(0)
57  , fDpbIdIndexMap()
58  , fvbCrobActiveFlag()
59  , fuNbFebs(0)
60  , fuNbStsXyters(0)
61  , fvdFebAdcGain()
62  , fvdFebAdcOffs()
63  ,
64  /*
65  fuNrOfDpbs(0),
66  fDpbIdIndexMap(),
67  fuNbStsXyters(0),
68  fUnpackParMuch->GetNbChanPerAsic()(0),
69  fuNbFebs(0),
70 */
71  fsHistoFileFullname("data/SetupHistos.root")
72  , fbPrintMessages(kFALSE)
73  , fPrintMessCtrl(stsxyter::MessagePrintMask::msg_print_Human)
74  , fbEnableCoincidenceMaps(kFALSE)
75  , fulCurrentTsIdx(0)
76  , fulCurrentMsIdx(0)
77  , fmMsgCounter()
78  , fuCurrentEquipmentId(0)
79  , fuCurrDpbId(0)
80  , fuCurrDpbIdx(0)
81  , fiRunStartDateTimeSec(-1)
82  , fiBinSizeDatePlots(-1)
83  , fvulCurrentTsMsb()
84  , fvuCurrentTsMsbCycle()
85  , fvuInitialHeaderDone()
86  , fvuInitialTsMsbCycleHeader()
87  , fvuElinkLastTsHit()
88  , fvulChanLastHitTime()
89  , fvdChanLastHitTime()
90  , fvdPrevMsTime()
91  , fvdMsTime()
92  , fvuChanNbHitsInMs()
93  , fvdChanLastHitTimeInMs()
94  , fvusChanLastHitAdcInMs()
95  ,
96  // fvmChanHitsInTs(),
97  fdStartTime(-1.0)
98  , prevtime(0.0)
99  , fdStartTimeMsSz(-1.0)
100  , ftStartTimeUnix(std::chrono::steady_clock::now())
101  , fvmHitsInMs()
102  , fvmAsicHitsInMs()
103  , fvmFebHitsInMs()
104  , fuMaxNbMicroslices(100)
105  , fiTimeIntervalRateUpdate(10)
106  , fviFebTimeSecLastRateUpdate()
107  , fviFebCountsSinceLastRateUpdate()
108  , fvdFebChanCountsSinceLastRateUpdate()
109  , fbLongHistoEnable(kFALSE)
110  , fuLongHistoNbSeconds(0)
111  , fuLongHistoBinSizeSec(0)
112  , fuLongHistoBinNb(0)
113  , Counter(0)
114  , Counter1(0)
115  , fdCoincCenter(0.0)
116  , fdCoincBorder(50.0)
117  , fdCoincMin(fdCoincCenter - fdCoincBorder)
118  , fdCoincMax(fdCoincCenter + fdCoincBorder)
119  , fHM(new CbmHistManager())
120  , fhStsMessType(NULL)
121  , fhStsSysMessType(NULL)
122  , fhStsFebChanAdcRaw_combined(NULL)
123  , fhStsMessTypePerDpb(NULL)
124  , fhStsSysMessTypePerDpb(NULL)
125  , fhPulserStatusMessType(NULL)
126  , fhPulserMsStatusFieldType(NULL)
127  , fhStsHitsElinkPerDpb(NULL)
128  , fhRate(NULL)
129  , fhRateAdcCut(NULL)
130  , fHistPadDistr()
131  , fRealHistPadDistr()
132  , fdFebChanCoincidenceLimit(100.0)
133  , fhStsFebChanCntRaw()
134  , fhStsFebChanCntRawGood()
135  , fhStsFebChanAdcRaw()
136  , fhStsFebChanAdcRawProf()
137  , fhStsFebChanAdcCal()
138  , fhStsFebChanAdcCalProf()
139  , fhStsFebChanRawTs()
140  , fhStsFebChanMissEvt()
141  , fhStsFebChanMissEvtEvo()
142  , fhStsFebAsicMissEvtEvo()
143  , fhStsFebMissEvtEvo()
144  , fhStsFebChanHitRateEvo()
145  , fhStsFebChanHitRateProf()
146  , fhStsFebAsicHitRateEvo()
147  , fhStsFebHitRateEvo()
148  , fhStsFebHitRateEvo_mskch()
149  , fhStsFebHitRateEvo_mskch_adccut()
150  , fhStsFebChanHitRateEvoLong()
151  , fhStsFebAsicHitRateEvoLong()
152  , fhStsFebHitRateEvoLong()
153  , fdStsFebChanLastTimeForDist()
154  , fhStsFebChanDistT()
155  , fhStsFebChanDtCoinc()
156  , fhStsFebChanCoinc()
157  , fbSmx2ErrorUseNoiseLevels(kFALSE)
158  , fdSmxErrCoincWinM07(kdSmxErrCoincWinMainM07)
159  , fdSmxErrCoincWinM08(kdSmxErrCoincWinMainM08)
160  , fdSmxErrCoincWinM09(kdSmxErrCoincWinMainM09)
161  , fdSmxErrCoincWinM10(kdSmxErrCoincWinMainM10)
162  , fdSmxErrCoincWinM11(kdSmxErrCoincWinMainM11)
163  , fvdSmxErrTimeLastHits()
164  , fvuSmxErrIdxFirstHitM07()
165  , fvuSmxErrIdxFirstHitM08()
166  , fvuSmxErrIdxFirstHitM09()
167  , fvuSmxErrIdxFirstHitM10()
168  , fvuSmxErrIdxFirstHitM11()
169  , fvuSmxErrIdxLastHit()
170  , fhStsFebSmxErrRatioEvo()
171  , fhStsFebSmxErrRatioEvoAsic()
172  , fhStsFebSmxErrRatioCopyEvo()
173  , fhStsFebSmxErrRatioCopyEvoAsic()
174  , fhStsFebSmxErrRatioCopySameAdcEvo()
175  , fhStsFebSmxErrRatioCopySameAdcEvoAsic()
176  , fcMsSizeAll(NULL) {}
177 
179 
181  LOG(info) << "Initializing flib StsXyter unpacker for STS";
182 
183  FairRootManager* ioman = FairRootManager::Instance();
184  if (ioman == NULL) { LOG(fatal) << "No FairRootManager instance"; }
185 
186  return kTRUE;
187 }
188 
190  LOG(info) << "Setting parameter containers for " << GetName();
192  (CbmMcbm2018MuchPar*) (FairRun::Instance()->GetRuntimeDb()->getContainer(
193  "CbmMcbm2018MuchPar"));
194 }
195 
196 
198  LOG(info) << "Init parameter containers for " << GetName();
199 
200  Bool_t bInit = InitStsParameters();
201  if (kTRUE == bInit) CreateHistograms();
202 
203  return bInit;
204 }
205 
207  LOG(info) << "ReInit parameter containers for " << GetName();
208 
209  return InitStsParameters();
210 }
211 
213 
215  LOG(info) << "Nr. of MUCH DPBs: " << fuNrOfDpbs;
216 
217  fDpbIdIndexMap.clear();
218  for (UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb) {
219  fDpbIdIndexMap[fUnpackParMuch->GetDpbId(uDpb)] = uDpb;
220  LOG(info) << "Eq. ID for DPB #" << std::setw(2) << uDpb << " = 0x"
221  << std::setw(4) << std::hex << fUnpackParMuch->GetDpbId(uDpb)
222  << std::dec << " => "
224  } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
225 
227  LOG(info) << "Nr. of FEBs: " << fuNbFebs;
228 
230  LOG(info) << "Nr. of StsXyter ASICs: " << fuNbStsXyters;
231 
233  fvdFebAdcGain.resize(fuNrOfDpbs);
234  fvdFebAdcOffs.resize(fuNrOfDpbs);
235  for (UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb) {
239  for (UInt_t uCrobIdx = 0; uCrobIdx < fUnpackParMuch->GetNbCrobsPerDpb();
240  ++uCrobIdx) {
241  fvbCrobActiveFlag[uDpb][uCrobIdx] =
242  fUnpackParMuch->IsCrobActive(uDpb, uCrobIdx);
243  fvdFebAdcGain[uDpb][uCrobIdx].resize(fUnpackParMuch->GetNbFebsPerCrob(),
244  0.0);
245  fvdFebAdcOffs[uDpb][uCrobIdx].resize(fUnpackParMuch->GetNbFebsPerCrob(),
246  0.0);
247  } // for( UInt_t uCrobIdx = 0; uCrobIdx < fUnpackParMuch->GetNbCrobsPerDpb(); ++uCrobIdx )
248  } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
249 
250  for (UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb) {
251  for (UInt_t uCrobIdx = 0; uCrobIdx < fUnpackParMuch->GetNbCrobsPerDpb();
252  ++uCrobIdx) {
253  LOG(info) << Form("DPB #%02u CROB #%02u Active: ", uDpb, uCrobIdx)
254  << fvbCrobActiveFlag[uDpb][uCrobIdx];
255  } // for( UInt_t uCrobIdx = 0; uCrobIdx < fUnpackParMuch->GetNbCrobsPerDpb(); ++uCrobIdx )
256  } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
257 
258  // Internal status initialization
264  for (UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb) {
265  fvulCurrentTsMsb[uDpb] = 0;
266  fvuCurrentTsMsbCycle[uDpb] = 0;
267  fvuInitialHeaderDone[uDpb] = kFALSE;
268  fvuInitialTsMsbCycleHeader[uDpb] = 0;
269  } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
270 
272 
280 
281  for (UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx) {
283  fvdChanLastHitTime[uXyterIdx].resize(fUnpackParMuch->GetNbChanPerAsic());
284  fvuChanNbHitsInMs[uXyterIdx].resize(fUnpackParMuch->GetNbChanPerAsic());
285  fvdChanLastHitTimeInMs[uXyterIdx].resize(
287  fvusChanLastHitAdcInMs[uXyterIdx].resize(
289  fvmAsicHitsInMs[uXyterIdx].clear();
290 
291  for (UInt_t uChan = 0; uChan < fUnpackParMuch->GetNbChanPerAsic();
292  ++uChan) {
293  fvulChanLastHitTime[uXyterIdx][uChan] = 0;
294  fvdChanLastHitTime[uXyterIdx][uChan] = -1.0;
295 
296  fvuChanNbHitsInMs[uXyterIdx][uChan].resize(fuMaxNbMicroslices);
297  fvdChanLastHitTimeInMs[uXyterIdx][uChan].resize(fuMaxNbMicroslices);
298  fvusChanLastHitAdcInMs[uXyterIdx][uChan].resize(fuMaxNbMicroslices);
299  for (UInt_t uMsIdx = 0; uMsIdx < fuMaxNbMicroslices; ++uMsIdx) {
300  fvuChanNbHitsInMs[uXyterIdx][uChan][uMsIdx] = 0;
301  fvdChanLastHitTimeInMs[uXyterIdx][uChan][uMsIdx] = -1.0;
302  fvusChanLastHitAdcInMs[uXyterIdx][uChan][uMsIdx] = 0;
303  } // for( UInt_t uMsIdx = 0; uMsIdx < fuMaxNbMicroslices; ++uMsIdx )
304  } // for( UInt_t uChan = 0; uChan < fUnpackParMuch->GetNbChanPerAsic(); ++uChan )
305  } // for( UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx )
306 
307  LOG(info) << "CbmMcbm2018MonitorMuch::ReInitContainers => Changed "
308  "fvuChanNbHitsInMs size "
309  << fvuChanNbHitsInMs.size() << " VS " << fuNbStsXyters;
310  LOG(info) << "CbmMcbm2018MonitorMuch::ReInitContainers => Changed "
311  "fvuChanNbHitsInMs size "
312  << fvuChanNbHitsInMs[0].size() << " VS "
314  LOG(info) << "CbmMcbm2018MonitorMuch::ReInitContainers => Changed "
315  "fvuChanNbHitsInMs size "
316  << fvuChanNbHitsInMs[0][0].size() << " VS " << fuMaxNbMicroslices;
317 
318  fvmFebHitsInMs.resize(fuNbFebs);
323  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
324  fvmFebHitsInMs[uFebIdx].clear();
325  fvdFebChanCountsSinceLastRateUpdate[uFebIdx].resize(
327  fdStsFebChanLastTimeForDist[uFebIdx].resize(
329  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
330 
334 
335  return kTRUE;
336 }
337 
339  UShort_t /*usDetectorId*/) {
341  for (UInt_t uCompIdx = 0; uCompIdx < fvMsComponentsList.size(); ++uCompIdx)
342  if (component == fvMsComponentsList[uCompIdx]) return;
343 
345  if (kiMaxNbFlibLinks <= component) {
346  LOG(error) << "CbmMcbm2018MonitorMuch::AddMsComponentToList => "
347  << "Ignored the addition of component " << component
348  << " as it is above the hadcoded limit of "
349  << static_cast<const Int_t>(kiMaxNbFlibLinks) << " !!!!!!!!! "
350  << "\n"
351  << " To change this behavior check kiMaxNbFlibLinks in "
352  "CbmMcbm2018MonitorMuch.cxx";
353  return;
354  } // if( kiMaxNbFlibLinks <= component )
355 
356 
358  fvMsComponentsList.push_back(component);
359  LOG(info)
360  << "CbmMcbm2018MonitorMuch::AddMsComponentToList => Added component: "
361  << component;
362 
364  if (NULL == fhMsSz[component]) {
365  TString sMsSzName = Form("MsSz_link_%02lu", component);
366  TString sMsSzTitle =
367  Form("Size of MS for nDPB of link %02lu; Ms Size [bytes]", component);
368  fhMsSz[component] =
369  new TH1F(sMsSzName.Data(), sMsSzTitle.Data(), 160000, 0., 20000.);
370  fHM->Add(sMsSzName.Data(), fhMsSz[component]);
371 
372  sMsSzName = Form("MsSzTime_link_%02lu", component);
373  sMsSzTitle = Form(
374  "Size of MS vs time for gDPB of link %02lu; Time[s] ; Ms Size [bytes]",
375  component);
376  fhMsSzTime[component] =
377  new TProfile(sMsSzName.Data(), sMsSzTitle.Data(), 15000, 0., 300.);
378  fHM->Add(sMsSzName.Data(), fhMsSzTime[component]);
379 
380  if (NULL != fcMsSizeAll) {
381  fcMsSizeAll->cd(1 + component);
382  gPad->SetLogy();
383  fhMsSzTime[component]->Draw("hist le0");
384  } // if( NULL != fcMsSizeAll )
385  LOG(info) << "Added MS size histo for component: " << component << " (DPB)";
386 
387 #ifdef USE_HTTP_SERVER
388  THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
389  if (server) {
390  server->Register("/FlibRaw", fhMsSz[component]);
391  server->Register("/FlibRaw", fhMsSzTime[component]);
392  } // if( server )
393 #endif
394  } // if( NULL == fhMsSz[ component ] )
395 }
397  size_t uOverlapMsNb) {
398  fuNbCoreMsPerTs = uCoreMsNb;
399  fuNbOverMsPerTs = uOverlapMsNb;
400  //LOG(info) <<" fuNbCoreMsPerTs "<<fuNbCoreMsPerTs<<" fuNbOverMsPerTs "<<fuNbOverMsPerTs;
401  UInt_t uNbMsTotal = fuNbCoreMsPerTs + fuNbOverMsPerTs;
402 
403  if (fuMaxNbMicroslices < uNbMsTotal) {
404  fuMaxNbMicroslices = uNbMsTotal;
405 
410  for (UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx) {
411  fvuChanNbHitsInMs[uXyterIdx].resize(fUnpackParMuch->GetNbChanPerAsic());
412  fvdChanLastHitTimeInMs[uXyterIdx].resize(
414  fvusChanLastHitAdcInMs[uXyterIdx].resize(
416  for (UInt_t uChan = 0; uChan < fUnpackParMuch->GetNbChanPerAsic();
417  ++uChan) {
418  fvuChanNbHitsInMs[uXyterIdx][uChan].resize(fuMaxNbMicroslices);
419  fvdChanLastHitTimeInMs[uXyterIdx][uChan].resize(fuMaxNbMicroslices);
420  fvusChanLastHitAdcInMs[uXyterIdx][uChan].resize(fuMaxNbMicroslices);
421  for (UInt_t uMsIdx = 0; uMsIdx < fuMaxNbMicroslices; ++uMsIdx) {
422  fvuChanNbHitsInMs[uXyterIdx][uChan][uMsIdx] = 0;
423  fvdChanLastHitTimeInMs[uXyterIdx][uChan][uMsIdx] = -1.0;
424  fvusChanLastHitAdcInMs[uXyterIdx][uChan][uMsIdx] = 0;
425  } // for( UInt_t uMsIdx = 0; uMsIdx < fuMaxNbMicroslices; ++uMsIdx )
426  } // for( UInt_t uChan = 0; uChan < fUnpackParMuch->GetNbChanPerAsic(); ++uChan )
427  } // for( UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx )
428  LOG(info)
429  << "CbmMcbm2018MonitorMuch::DoUnpack => Changed fvuChanNbHitsInMs size "
430  << fvuChanNbHitsInMs.size() << " VS " << fuNbStsXyters;
431  LOG(info)
432  << "CbmMcbm2018MonitorMuch::DoUnpack => Changed fvuChanNbHitsInMs size "
433  << fvuChanNbHitsInMs[0].size() << " VS "
435  LOG(info)
436  << "CbmMcbm2018MonitorMuch::DoUnpack => Changed fvuChanNbHitsInMs size "
437  << fvuChanNbHitsInMs[0][0].size() << " VS " << fuMaxNbMicroslices;
438  } // if( fuMaxNbMicroslices < uNbMsTotal )
439 }
440 
442  Double_t dBorderVal) {
443  fdCoincCenter = dCenterPos;
444  fdCoincBorder = dBorderVal;
445  fdCoincMin = dCenterPos - dBorderVal;
446  fdCoincMax = dCenterPos + dBorderVal;
447 }
448 
450  TString sHistName {""};
451  TString title {""};
452 
453  sHistName = "hPulserMessageType";
454  title = "Nb of message for each type; Type";
455  fhStsMessType = new TH1I(sHistName, title, 6, 0., 6.);
456  fhStsMessType->GetXaxis()->SetBinLabel(1, "Dummy");
457  fhStsMessType->GetXaxis()->SetBinLabel(2, "Hit");
458  fhStsMessType->GetXaxis()->SetBinLabel(3, "TsMsb");
459  fhStsMessType->GetXaxis()->SetBinLabel(4, "Epoch");
460  fhStsMessType->GetXaxis()->SetBinLabel(5, "Status");
461  fhStsMessType->GetXaxis()->SetBinLabel(6, "Empty");
462 
463  /* *** Missing int + MessType OP!!!! ****
464  fhStsMessType->GetXaxis()->SetBinLabel(1 + stsxyter::MessType::Dummy, "Dummy");
465  fhStsMessType->GetXaxis()->SetBinLabel(1 + stsxyter::MessType::Hit, "Hit");
466  fhStsMessType->GetXaxis()->SetBinLabel(1 + stsxyter::MessType::TsMsb, "TsMsb");
467  fhStsMessType->GetXaxis()->SetBinLabel(1 + stsxyter::MessType::ReadDataAck, "ReadDataAck");
468  fhStsMessType->GetXaxis()->SetBinLabel(1 + stsxyter::MessType::Ack, "Ack");
469 */
470 
471  sHistName = "hPulserSysMessType";
472  title = "Nb of system message for each type; System Type";
473  fhStsSysMessType = new TH1I(sHistName, title, 17, 0., 17.);
474  /*
475  hSysMessType->GetXaxis()->SetBinLabel(1 + ngdpb::SYSMSG_DAQ_START, "DAQ START");
476  hSysMessType->GetXaxis()->SetBinLabel(1 + ngdpb::SYSMSG_DAQ_FINISH, "DAQ FINISH");
477  hSysMessType->GetXaxis()->SetBinLabel(1 + 16, "GET4 Hack 32B");
478 */
479  sHistName = "hStsFebChanAdcRaw_combined";
480  title = "ADC hist combined";
481  fhStsFebChanAdcRaw_combined = new TH1I(sHistName,
482  title,
484  -0.5,
486 
487  LOG(debug) << "Initialized 1st Histo";
488  sHistName = "hPulserMessageTypePerDpb";
489  title = "Nb of message of each type for each DPB; DPB; Type";
491  new TH2I(sHistName, title, fuNrOfDpbs, 0, fuNrOfDpbs, 6, 0., 6.);
492  fhStsMessTypePerDpb->GetYaxis()->SetBinLabel(1, "Dummy");
493  fhStsMessTypePerDpb->GetYaxis()->SetBinLabel(2, "Hit");
494  fhStsMessTypePerDpb->GetYaxis()->SetBinLabel(3, "TsMsb");
495  fhStsMessTypePerDpb->GetYaxis()->SetBinLabel(4, "Epoch");
496  fhStsMessTypePerDpb->GetYaxis()->SetBinLabel(5, "Status");
497  fhStsMessTypePerDpb->GetYaxis()->SetBinLabel(6, "Empty");
498  /* *** Missing int + MessType OP!!!! ****
499  fhStsMessType->GetYaxis()->SetBinLabel(1 + stsxyter::MessType::Dummy, "Dummy");
500  fhStsMessType->GetYaxis()->SetBinLabel(1 + stsxyter::MessType::Hit, "Hit");
501  fhStsMessType->GetYaxis()->SetBinLabel(1 + stsxyter::MessType::TsMsb, "TsMsb");
502  fhStsMessType->GetYaxis()->SetBinLabel(1 + stsxyter::MessType::ReadDataAck, "ReadDataAck");
503  fhStsMessType->GetYaxis()->SetBinLabel(1 + stsxyter::MessType::Ack, "Ack");
504 */
505 
506 
507  for (UInt_t uModuleId = 0; uModuleId < 2; ++uModuleId) {
509  sHistName = Form("HistPadDistr_Module_%01u", uModuleId);
510  title = Form("Pad distribution for, Module #%01u; ", uModuleId);
511 
512  //Below for Rectangular Module shape VS
513  fHistPadDistr.push_back(
514  new TH2I(sHistName, title, 23, -0.5, 22.5, 97, -0.5, 96.5));
515 
516  sHistName = Form("RealHistPadDistr_Module_%01u", uModuleId);
517  title = Form("Progressive Pad distribution for, Module #%01u; ", uModuleId);
518  //Below for Progressive Geometry Module shape VS
519  fRealHistPadDistr.push_back(
520  new TH2D(sHistName, title, 500, -0.5, 499.5, 1000, -0.5, 999.5));
521  }
522 
523  sHistName = "hRate";
524  title = "Rate in kHz";
525  fhRate = new TH1I(sHistName, title, 10000, -0.5, 9999.5);
526 
527  sHistName = "hRateAdcCut";
528  title = "Rate in kHz with Adc cut";
529  fhRateAdcCut = new TH1I(sHistName, title, 10000, -0.5, 9999.5);
530 
531  sHistName = "hPulserSysMessTypePerDpb";
532  title = "Nb of system message of each type for each DPB; DPB; System Type";
534  new TH2I(sHistName, title, fuNrOfDpbs, 0, fuNrOfDpbs, 17, 0., 17.);
535  /*
536  hSysMessType->GetYaxis()->SetBinLabel(1 + ngdpb::SYSMSG_DAQ_START, "DAQ START");
537  hSysMessType->GetYaxis()->SetBinLabel(1 + ngdpb::SYSMSG_DAQ_FINISH, "DAQ FINISH");
538  hSysMessType->GetYaxis()->SetBinLabel(1 + 16, "GET4 Hack 32B");
539 */
540 
541  sHistName = "hPulserStatusMessType";
542  title = "Nb of status message of each type for each DPB; ASIC; Status Type";
544  new TH2I(sHistName, title, fuNbStsXyters, 0, fuNbStsXyters, 16, 0., 16.);
545  /*
546  fhPulserStatusMessType->GetYaxis()->SetBinLabel( 1, "Dummy");
547  fhPulserStatusMessType->GetYaxis()->SetBinLabel( 2, "Hit");
548  fhPulserStatusMessType->GetYaxis()->SetBinLabel( 3, "TsMsb");
549  fhPulserStatusMessType->GetYaxis()->SetBinLabel( 4, "Epoch");
550 */
551 
552  sHistName = "hPulserMsStatusFieldType";
553  title =
554  "For each flag in the MS header, ON/OFF counts; Flag bit []; ON/OFF; MS []";
556  new TH2I(sHistName, title, 16, -0.5, 15.5, 2, -0.5, 1.5);
557  /*
558  fhPulserMsStatusFieldType->GetYaxis()->SetBinLabel( 1, "Dummy");
559  fhPulserMsStatusFieldType->GetYaxis()->SetBinLabel( 2, "Hit");
560  fhPulserMsStatusFieldType->GetYaxis()->SetBinLabel( 3, "TsMsb");
561  fhPulserMsStatusFieldType->GetYaxis()->SetBinLabel( 4, "Epoch");
562 */
563 
564  sHistName = "hStsHitsElinkPerDpb";
565  title = "Nb of hit messages per eLink for each DPB; DPB; eLink; Hits nb []";
567  new TH2I(sHistName, title, fuNrOfDpbs, 0, fuNrOfDpbs, 42, 0., 42.);
568 
569  LOG(debug) << "Initialized 2nd Histo";
570  /*
571  // Number of rate bins =
572  // 9 for the sub-unit decade
573  // + 9 for each unit of each decade * 10 for the subdecade range
574  // + 1 for the closing bin top edge
575  const Int_t iNbDecadesRate = 9;
576  const Int_t iNbStepsDecade = 9;
577  const Int_t iNbSubStepsInStep = 10;
578  const Int_t iNbBinsRate = iNbStepsDecade
579  + iNbStepsDecade * iNbSubStepsInStep * iNbDecadesRate
580  + 1;
581  Double_t dBinsRate[iNbBinsRate];
582  // First fill sub-unit decade
583  for( Int_t iSubU = 0; iSubU < iNbStepsDecade; iSubU ++ )
584  dBinsRate[ iSubU ] = 0.1 * ( 1 + iSubU );
585  std::cout << std::endl;
586  // Then fill the main decades
587  Double_t dSubstepSize = 1.0 / iNbSubStepsInStep;
588  for( Int_t iDecade = 0; iDecade < iNbDecadesRate; iDecade ++)
589  {
590  Double_t dBase = std::pow( 10, iDecade );
591  Int_t iDecadeIdx = iNbStepsDecade
592  + iDecade * iNbStepsDecade * iNbSubStepsInStep;
593  for( Int_t iStep = 0; iStep < iNbStepsDecade; iStep++ )
594  {
595  Int_t iStepIdx = iDecadeIdx + iStep * iNbSubStepsInStep;
596  for( Int_t iSubStep = 0; iSubStep < iNbSubStepsInStep; iSubStep++ )
597  {
598  dBinsRate[ iStepIdx + iSubStep ] = dBase * (1 + iStep)
599  + dBase * dSubstepSize * iSubStep;
600  } // for( Int_t iSubStep = 0; iSubStep < iNbSubStepsInStep; iSubStep++ )
601  } // for( Int_t iStep = 0; iStep < iNbStepsDecade; iStep++ )
602  } // for( Int_t iDecade = 0; iDecade < iNbDecadesRate; iDecade ++)
603  dBinsRate[ iNbBinsRate - 1 ] = std::pow( 10, iNbDecadesRate );
604 */
605 
606  LOG(debug) << "Initialized 3rd Histo";
608 
609  //UInt_t uAlignedLimit = fuLongHistoNbSeconds - (fuLongHistoNbSeconds % fuLongHistoBinSizeSec);
610  UInt_t uAlignedLimit = 0;
611  //fuLongHistoBinNb = uAlignedLimit / fuLongHistoBinSizeSec; VS & AK: Commented due to Floating Point Exception error;
612  /*
613  UInt_t uNbBinEvo = (32768 + 1) * 2;
614  Double_t dMaxEdgeEvo = stsxyter::kdClockCycleNs
615  * static_cast< Double_t >( uNbBinEvo ) / 2.0;
616  Double_t dMinEdgeEvo = dMaxEdgeEvo * -1.0;
617 
618  UInt_t uNbBinDt = static_cast<UInt_t>( (fdCoincMax - fdCoincMin )/stsxyter::kdClockCycleNs );
619 */
624  fhStsFebChanCoinc.resize(fuNbFebs);
625  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
627  sHistName = Form("hStsFebChanCntRaw_%03u", uFebIdx);
628  title =
629  Form("Hits Count per channel, FEB #%03u; Channel; Hits []", uFebIdx);
630  fhStsFebChanCntRaw.push_back(
631  new TH1I(sHistName,
632  title,
634  -0.5,
635  fUnpackParMuch->GetNbChanPerFeb() - 0.5));
636 
637  sHistName = Form("hStsFebChanCntRawGood_%03u", uFebIdx);
638  title = Form("Hits Count per channel in good MS (SX2 bug flag off), FEB "
639  "#%03u; Channel; Hits []",
640  uFebIdx);
641  fhStsFebChanCntRawGood.push_back(
642  new TH1I(sHistName,
643  title,
645  -0.5,
646  fUnpackParMuch->GetNbChanPerFeb() - 0.5));
647 
649  sHistName = Form("hStsFebChanAdcRaw_%03u", uFebIdx);
650  title = Form("Raw Adc distribution per channel, FEB #%03u; Channel []; Adc "
651  "[]; Hits []",
652  uFebIdx);
653  fhStsFebChanAdcRaw.push_back(
654  new TH2I(sHistName,
655  title,
657  -0.5,
660  -0.5,
661  stsxyter::kuHitNbAdcBins - 0.5));
662 
664  sHistName = Form("hStsFebChanAdcRawProfc_%03u", uFebIdx);
665  title = Form("Raw Adc prodile per channel, FEB #%03u; Channel []; Adc []",
666  uFebIdx);
667  fhStsFebChanAdcRawProf.push_back(
668  new TProfile(sHistName,
669  title,
671  -0.5,
672  fUnpackParMuch->GetNbChanPerFeb() - 0.5));
673 
675  sHistName = Form("hStsFebChanAdcCal_%03u", uFebIdx);
676  title = Form("Cal. Adc distribution per channel, FEB #%03u; Channel []; "
677  "Adc [e-]; Hits []",
678  uFebIdx);
679  fhStsFebChanAdcCal.push_back(
680  new TH2I(sHistName,
681  title,
683  -0.5,
685  50,
686  0.,
687  100000.));
688 
690  sHistName = Form("hStsFebChanAdcCalProfc_%03u", uFebIdx);
691  title = Form(
692  "Cal. Adc prodile per channel, FEB #%03u; Channel []; Adc [e-]", uFebIdx);
693  fhStsFebChanAdcCalProf.push_back(
694  new TProfile(sHistName,
695  title,
697  -0.5,
698  fUnpackParMuch->GetNbChanPerFeb() - 0.5));
699 
701  sHistName = Form("hStsFebChanRawTs_%03u", uFebIdx);
702  title = Form("Raw Timestamp distribution per channel, FEB #%03u; Channel "
703  "[]; Ts []; Hits []",
704  uFebIdx);
705  fhStsFebChanRawTs.push_back(
706  new TH2I(sHistName,
707  title,
709  -0.5,
712  -0.5,
713  stsxyter::kuHitNbTsBins - 0.5));
714 
716  sHistName = Form("hStsFebChanMissEvt_%03u", uFebIdx);
717  title = Form("Missed Event flags per channel, FEB #%03u; Channel []; Miss "
718  "Evt []; Hits []",
719  uFebIdx);
720  fhStsFebChanMissEvt.push_back(
721  new TH2I(sHistName,
722  title,
724  -0.5,
726  2,
727  -0.5,
728  1.5));
729 
731  sHistName = Form("hStsFebChanMissEvtEvo_%03u", uFebIdx);
732  title = Form("Missed Evt flags per second & channel in FEB #%03u; Time "
733  "[s]; Channel []; Missed Evt flags []",
734  uFebIdx);
735  fhStsFebChanMissEvtEvo.push_back(
736  new TH2I(sHistName,
737  title,
738  1800,
739  0,
740  1800,
742  -0.5,
743  fUnpackParMuch->GetNbChanPerFeb() - 0.5));
744 
746  sHistName = Form("hStsFebAsicMissEvtEvo_%03u", uFebIdx);
747  title = Form("Missed Evt flags per second & StsXyter in FEB #%03u; Time "
748  "[s]; Asic []; Missed Evt flags []",
749  uFebIdx);
750  fhStsFebAsicMissEvtEvo.push_back(
751  new TH2I(sHistName,
752  title,
753  1800,
754  0,
755  1800,
757  -0.5,
758  fUnpackParMuch->GetNbAsicsPerFeb() - 0.5));
759 
761  sHistName = Form("hStsFebMissEvtEvo_%03u", uFebIdx);
762  title = Form("Missed Evt flags per second & channel in FEB #%03u; Time "
763  "[s]; Missed Evt flags []",
764  uFebIdx);
765  fhStsFebMissEvtEvo.push_back(new TH1I(sHistName, title, 1800, 0, 1800));
766 
768  sHistName = Form("hStsFebChanRateEvo_%03u", uFebIdx);
769  title = Form(
770  "Hits per second & channel in FEB #%03u; Time [s]; Channel []; Hits []",
771  uFebIdx);
772  fhStsFebChanHitRateEvo.push_back(
773  new TH2I(sHistName,
774  title,
775  1800,
776  0,
777  1800,
779  -0.5,
780  fUnpackParMuch->GetNbChanPerFeb() - 0.5));
781 
783  sHistName = Form("hStsFebChanRateProf_%03u", uFebIdx);
784  title = Form(
785  "Hits per second for each channel in FEB #%03u; Channel []; Hits/s []",
786  uFebIdx);
787  fhStsFebChanHitRateProf.push_back(
788  new TProfile(sHistName,
789  title,
791  -0.5,
792  fUnpackParMuch->GetNbChanPerFeb() - 0.5));
793 
795  sHistName = Form("hStsFebAsicRateEvo_%03u", uFebIdx);
796  title = Form(
797  "Hits per second & StsXyter in FEB #%03u; Time [s]; Asic []; Hits []",
798  uFebIdx);
799  fhStsFebAsicHitRateEvo.push_back(
800  new TH2I(sHistName,
801  title,
802  1800,
803  0,
804  1800,
806  -0.5,
807  fUnpackParMuch->GetNbAsicsPerFeb() - 0.5));
808  /*
810  sHistName = Form( "hStsFebRateEvo_%03u", uFebIdx );
811  title = Form( "Hits per second in FEB #%03u; Time [s]; Hits []", uFebIdx );
812  fhStsFebHitRateEvo.push_back( new TH1I(sHistName, title, 1800, 0, 1800 ) );
813 */
815  sHistName = Form("hStsFebRateEvo_%03u", uFebIdx);
816  title = Form("Hits per second in FEB #%03u; Time [s]; Hits []", uFebIdx);
817  //fhStsFebHitRateEvo.push_back( new TH1I(sHistName, title, 5000000, 0., 10000000. ) ); //2ms
818  fhStsFebHitRateEvo.push_back(
819  new TH1I(sHistName, title, 250000, 0., 1000000.)); //4ms
820  //fhStsFebHitRateEvo.push_back( new TH1I(sHistName, title, 200000, 0., 1000000. ) ); //5ms
821  // fhStsFebHitRateEvo.push_back( new TH1I(sHistName, title, 125000, 0., 1000000. ) ); //8ms
822  // fhStsFebHitRateEvo.push_back( new TH1I(sHistName, title, 100000, 0., 1000000. ) ); //10ms
823  // fhStsFebHitRateEvo.push_back( new TH1I(sHistName, title, 62500, 0., 1000000. ) ); //16ms
824  // fhStsFebHitRateEvo.push_back( new TH1I(sHistName, title, 50000, 0., 1000000. ) ); //20ms
825  // fhStsFebHitRateEvo.push_back( new TH1I(sHistName, title, 20000, 0., 1000000. ) ); //50ms
826  // fhStsFebHitRateEvo.push_back( new TH1I(sHistName, title, 10000, 0., 1000000. ) ); //100ms
827  // fhStsFebHitRateEvo.push_back( new TH1I(sHistName, title, 2000, 0., 1000000. ) ); //500ms
828 
830  sHistName = Form("hStsFebRateEvo_mskch_%03u", uFebIdx);
831  title = Form("Hits per second in FEB #%03u; Time [s]; Hits []", uFebIdx);
832  fhStsFebHitRateEvo_mskch.push_back(
833  new TH1I(sHistName, title, 1800, 0, 1800));
834 
836  sHistName = Form("hStsFebRateEvo_mskch_adcut_%03u", uFebIdx);
837  title = Form("Hits per second in FEB #%03u; Time [s]; Hits []", uFebIdx);
839  new TH1I(sHistName, title, 1800, 0, 1800));
840 
842  sHistName = Form("hStsFebChanRateEvoLong_%03u", uFebIdx);
843  title = Form(
844  "Hits per second & channel in FEB #%03u; Time [min]; Channel []; Hits []",
845  uFebIdx);
846  fhStsFebChanHitRateEvoLong.push_back(
847  new TH2D(sHistName,
848  title,
850  -0.5,
851  uAlignedLimit - 0.5,
853  -0.5,
854  fUnpackParMuch->GetNbChanPerFeb() - 0.5));
855 
857  sHistName = Form("hStsFebAsicRateEvoLong_%03u", uFebIdx);
858  title = Form(
859  "Hits per second & StsXyter in FEB #%03u; Time [min]; Asic []; Hits []",
860  uFebIdx);
861  fhStsFebAsicHitRateEvoLong.push_back(
862  new TH2D(sHistName,
863  title,
865  -0.5,
866  uAlignedLimit - 0.5,
868  -0.5,
869  fUnpackParMuch->GetNbAsicsPerFeb() - 0.5));
870 
872  sHistName = Form("hStsFebRateEvoLong_%03u", uFebIdx);
873  title = Form("Hits per second in FEB #%03u; Time [min]; Hits []", uFebIdx);
874  fhStsFebHitRateEvoLong.push_back(
875  new TH1D(sHistName, title, fuLongHistoBinNb, -0.5, uAlignedLimit - 0.5));
876 
878  sHistName = Form("hStsFebChanDistT_%03u", uFebIdx);
879  title = Form("Time distance between hits on same channel in between FEB "
880  "#%03u; Time difference [ns]; Channel []; ",
881  uFebIdx);
882  fhStsFebChanDistT.push_back(
883  new TH2I(sHistName,
884  title,
885  1000,
886  -0.5,
887  6250.0 - 0.5,
889  -0.5,
890  fUnpackParMuch->GetNbChanPerFeb() - 0.5));
891 
893  fhStsFebChanDtCoinc[uFebIdx].resize(fuNbFebs, nullptr);
894  fhStsFebChanCoinc[uFebIdx].resize(fuNbFebs, nullptr);
895  for (UInt_t uFebIdxB = uFebIdx; uFebIdxB < fuNbFebs; ++uFebIdxB) {
896  sHistName = Form("hStsFebChanDtCoinc_%03u_%03u", uFebIdx, uFebIdxB);
897  title = Form("Channel coincidences Time diff between FEB #%03u and FEB "
898  "#%03u; Time difference [ns]",
899  uFebIdx,
900  uFebIdxB);
901  fhStsFebChanDtCoinc[uFebIdx][uFebIdxB] =
902  new TH1I(sHistName, title, 400, -1250., 1250.);
903 
904  sHistName = Form("hStsFebChanCoinc_%03u_%03u", uFebIdx, uFebIdxB);
905  title = Form("Channel coincidences between FEB #%03u and FEB #%03u; "
906  "Channel FEB #%03u []; Channel FEB #%03u []; Coinc. []",
907  uFebIdx,
908  uFebIdxB,
909  uFebIdx,
910  uFebIdxB);
911  fhStsFebChanCoinc[uFebIdx][uFebIdxB] =
912  new TH2I(sHistName,
913  title,
915  -0.5,
918  -0.5,
920  } // for( UInt_t uFebIdxB = uFebIdx; uFebIdxB < fuNbFebs; ++uFebIdxB )
921 
922  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
923 
925 
926  LOG(debug) << "Initialized 4th Histo before SXM 2.0 Logic Error";
929  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
931  sHistName = Form("hStsFebSmxErrRatioEvo_%03u", uFebIdx);
932  title = Form("Proportion of uS with SMX logic error in FEB #%03u; Time "
933  "[s]; Error MS fract. []",
934  uFebIdx);
935  fhStsFebSmxErrRatioEvo.push_back(
936  new TProfile(sHistName, title, 1800, 0, 1800));
937 
939  sHistName = Form("hStsFebSmxErrRatioEvoAsic_%03u", uFebIdx);
940  title = Form("Proportion of uS with SMX logic error per ASIC in FEB #%03u; "
941  "Time [s]; ASIC []; Error MS fract. []",
942  uFebIdx);
943  fhStsFebSmxErrRatioEvoAsic.push_back(
944  new TProfile2D(sHistName,
945  title,
946  1800,
947  0,
948  1800,
950  -0.5,
951  fUnpackParMuch->GetNbAsicsPerFeb() - 0.5));
952 
954  sHistName = Form("hStsFebSmxErrRatioCopyEvo_%03u", uFebIdx);
955  title = Form("Proportion of uS with hit copies in FEB #%03u; Time [s]; "
956  "Copies MS fract. []",
957  uFebIdx);
958  fhStsFebSmxErrRatioCopyEvo.push_back(
959  new TProfile(sHistName, title, 1800, 0, 1800));
960 
962  sHistName = Form("hStsFebSmxErrRatioCopyEvoAsic_%03u", uFebIdx);
963  title = Form("Proportion of uS with hit copies per ASIC in FEB #%03u; Time "
964  "[s]; ASIC []; Copies MS fract. []",
965  uFebIdx);
967  new TProfile2D(sHistName,
968  title,
969  1800,
970  0,
971  1800,
973  -0.5,
974  fUnpackParMuch->GetNbAsicsPerFeb() - 0.5));
975 
977  sHistName = Form("hStsFebSmxErrRatioCopySameAdcEvo_%03u", uFebIdx);
978  title = Form("Proportion of uS with hit full copies in FEB #%03u; Time "
979  "[s]; Copies MS fract. []",
980  uFebIdx);
982  new TProfile(sHistName, title, 1800, 0, 1800));
983 
985  sHistName = Form("hStsFebSmxErrRatioCopySameAdcEvoAsic_%03u", uFebIdx);
986  title = Form("Proportion of uS with hit full copies per ASIC in FEB #%03u; "
987  "Time [s]; ASIC []; Copies MS fract. []",
988  uFebIdx);
990  new TProfile2D(sHistName,
991  title,
992  1800,
993  0,
994  1800,
996  -0.5,
997  fUnpackParMuch->GetNbAsicsPerFeb() - 0.5));
998  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
1001 
1002  // Miscroslice properties histos
1003  for (Int_t component = 0; component < kiMaxNbFlibLinks; component++) {
1004  fhMsSz[component] = NULL;
1005  fhMsSzTime[component] = NULL;
1006  } // for( Int_t component = 0; component < kiMaxNbFlibLinks; component ++ )
1007 
1008  LOG(debug) << "Initialized 6th Histo before FairRunOnlne Instance";
1009 
1010  // Online histo browser commands
1011 #ifdef USE_HTTP_SERVER
1012  THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
1013  if (server) {
1014  for (UInt_t uModuleId = 0; uModuleId < 2; ++uModuleId) {
1015  server->Register("/StsRaw", fHistPadDistr[uModuleId]);
1016  server->Register("/StsRaw", fRealHistPadDistr[uModuleId]);
1017  }
1018 
1019  server->Register("/StsRaw", fhRate);
1020  server->Register("/StsRaw", fhRateAdcCut);
1021  server->Register("/StsRaw", fhStsMessType);
1022  server->Register("/StsRaw", fhStsSysMessType);
1023  server->Register("/StsRaw", fhStsMessTypePerDpb);
1024  server->Register("/StsRaw", fhStsSysMessTypePerDpb);
1025  server->Register("/StsRaw", fhPulserStatusMessType);
1026  server->Register("/StsRaw", fhPulserMsStatusFieldType);
1027  server->Register("/StsRaw", fhStsHitsElinkPerDpb);
1028  server->Register("/StsRaw", fhStsFebChanAdcRaw_combined);
1029 
1030 
1031  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
1032  if (kTRUE == fUnpackParMuch->IsFebActive(uFebIdx)) {
1033  server->Register("/StsFeb", fhStsFebChanCntRaw[uFebIdx]);
1034  server->Register("/StsFeb", fhStsFebChanCntRawGood[uFebIdx]);
1035  server->Register("/StsFeb", fhStsFebChanAdcRaw[uFebIdx]);
1036  server->Register("/StsFeb", fhStsFebChanAdcRawProf[uFebIdx]);
1037  server->Register("/StsFeb", fhStsFebChanAdcCal[uFebIdx]);
1038  server->Register("/StsFeb", fhStsFebChanAdcCalProf[uFebIdx]);
1039  server->Register("/StsFeb", fhStsFebChanRawTs[uFebIdx]);
1040  server->Register("/StsFeb", fhStsFebChanMissEvt[uFebIdx]);
1041  server->Register("/StsFeb", fhStsFebChanMissEvtEvo[uFebIdx]);
1042  server->Register("/StsFeb", fhStsFebAsicMissEvtEvo[uFebIdx]);
1043  server->Register("/StsFeb", fhStsFebMissEvtEvo[uFebIdx]);
1044  server->Register("/StsFeb", fhStsFebChanHitRateEvo[uFebIdx]);
1045  server->Register("/StsFeb", fhStsFebChanHitRateProf[uFebIdx]);
1046  server->Register("/StsFeb", fhStsFebAsicHitRateEvo[uFebIdx]);
1047  server->Register("/StsFeb", fhStsFebHitRateEvo[uFebIdx]);
1048  server->Register("/StsFeb", fhStsFebHitRateEvo_mskch[uFebIdx]);
1049  server->Register("/StsFeb", fhStsFebHitRateEvo_mskch_adccut[uFebIdx]);
1050  server->Register("/StsFeb", fhStsFebChanHitRateEvoLong[uFebIdx]);
1051  server->Register("/StsFeb", fhStsFebAsicHitRateEvoLong[uFebIdx]);
1052  server->Register("/StsFeb", fhStsFebHitRateEvoLong[uFebIdx]);
1053  server->Register("/StsFeb", fhStsFebChanDistT[uFebIdx]);
1054  for (UInt_t uFebIdxB = uFebIdx; uFebIdxB < fuNbFebs; ++uFebIdxB) {
1055  server->Register("/StsFeb", fhStsFebChanDtCoinc[uFebIdx][uFebIdxB]);
1056  server->Register("/StsFeb", fhStsFebChanCoinc[uFebIdx][uFebIdxB]);
1057  } // for( UInt_t uFebIdxB = uFebIdx; uFebIdxB < fuNbFebs; ++uFebIdxB )
1058 
1059  server->Register("/StsSmxErr", fhStsFebSmxErrRatioEvo[uFebIdx]);
1060  server->Register("/StsSmxErr", fhStsFebSmxErrRatioEvoAsic[uFebIdx]);
1061  server->Register("/StsSmxErr", fhStsFebSmxErrRatioCopyEvo[uFebIdx]);
1062  server->Register("/StsSmxErr", fhStsFebSmxErrRatioCopyEvoAsic[uFebIdx]);
1063  server->Register("/StsSmxErr",
1065  server->Register("/StsSmxErr",
1067  } // if( kTRUE == fUnpackParMuch->IsFebActive( uFebIdx ) )
1068  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
1069 
1070  server->RegisterCommand("/Reset_All", "bMcbm2018ResetMuch=kTRUE");
1071  server->RegisterCommand("/Write_All", "bMcbm2018WriteMuch=kTRUE");
1072  server->RegisterCommand("/ScanNoisyCh", "bMcbm2018ScanNoisyMuch=kTRUE");
1073 
1074 
1075  server->Restrict("/Reset_All", "allow=admin");
1076  server->Restrict("/Write_All", "allow=admin");
1077  server->Restrict("/ScanNoisyCh", "allow=admin");
1078  } // if( server )
1079 #endif
1080 
1082  Double_t w = 10;
1083  Double_t h = 10;
1084  LOG(debug) << "Initialized 7th Histo before Summary per FEB";
1085  // Summary per FEB
1086  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
1087  if (kTRUE == fUnpackParMuch->IsFebActive(uFebIdx)) {
1088  TCanvas* cStsSumm =
1089  new TCanvas(Form("cStsSum_%03u", uFebIdx),
1090  Form("Summary plots for FEB %03u", uFebIdx),
1091  w,
1092  h);
1093  cStsSumm->Divide(2, 3);
1094 
1095  cStsSumm->cd(1);
1096  gPad->SetGridx();
1097  gPad->SetGridy();
1098  gPad->SetLogy();
1099  fhStsFebChanCntRaw[uFebIdx]->Draw();
1100 
1101  cStsSumm->cd(2);
1102  gPad->SetGridx();
1103  gPad->SetGridy();
1104  gPad->SetLogy();
1105  fhStsFebChanHitRateProf[uFebIdx]->Draw("e0");
1106 
1107  cStsSumm->cd(3);
1108  gPad->SetGridx();
1109  gPad->SetGridy();
1110  gPad->SetLogz();
1111  fhStsFebChanAdcRaw[uFebIdx]->Draw("colz");
1112 
1113  cStsSumm->cd(4);
1114  gPad->SetGridx();
1115  gPad->SetGridy();
1116  // gPad->SetLogy();
1117  fhStsFebChanAdcRawProf[uFebIdx]->Draw();
1118 
1119  cStsSumm->cd(5);
1120  gPad->SetGridx();
1121  gPad->SetGridy();
1122  gPad->SetLogz();
1123  fhStsFebChanAdcCal[uFebIdx]->Draw("colz");
1124 
1125  cStsSumm->cd(6);
1126  gPad->SetGridx();
1127  gPad->SetGridy();
1128  // gPad->SetLogy();
1129  fhStsFebChanAdcCalProf[uFebIdx]->Draw();
1130 
1131 
1132  TCanvas* cStsSmxErr =
1133  new TCanvas(Form("cStsSmxErr_%03u", uFebIdx),
1134  Form("SMX logic error plots for FEB %03u", uFebIdx),
1135  w,
1136  h);
1137  cStsSmxErr->Divide(2, 3);
1138 
1139  cStsSmxErr->cd(1);
1140  gPad->SetGridx();
1141  gPad->SetGridy();
1142  gPad->SetLogy();
1143  fhStsFebSmxErrRatioEvo[uFebIdx]->Draw();
1144 
1145  cStsSmxErr->cd(2);
1146  gPad->SetGridx();
1147  gPad->SetGridy();
1148  gPad->SetLogz();
1149  fhStsFebSmxErrRatioEvoAsic[uFebIdx]->Draw("colz");
1150 
1151  cStsSmxErr->cd(3);
1152  gPad->SetGridx();
1153  gPad->SetGridy();
1154  gPad->SetLogy();
1155  fhStsFebSmxErrRatioCopyEvo[uFebIdx]->Draw();
1156 
1157  cStsSmxErr->cd(4);
1158  gPad->SetGridx();
1159  gPad->SetGridy();
1160  gPad->SetLogz();
1161  fhStsFebSmxErrRatioCopyEvoAsic[uFebIdx]->Draw("colz");
1162 
1163  cStsSmxErr->cd(5);
1164  gPad->SetGridx();
1165  gPad->SetGridy();
1166  gPad->SetLogy();
1167  fhStsFebSmxErrRatioCopySameAdcEvo[uFebIdx]->Draw();
1168 
1169  cStsSmxErr->cd(6);
1170  gPad->SetGridx();
1171  gPad->SetGridy();
1172  gPad->SetLogz();
1173  fhStsFebSmxErrRatioCopySameAdcEvoAsic[uFebIdx]->Draw("colz");
1174  } // if( kTRUE == fUnpackParMuch->IsFebActive( uFebIdx ) )
1175  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
1176 
1177  //====================================================================//
1178  LOG(debug) << "Initialized Last Histo before exiting CreateHistograms";
1179  //====================================================================//
1181  // Try to recover canvas in case it was created already by another monitor
1182  // If not existing, create it
1183  fcMsSizeAll = dynamic_cast<TCanvas*>(gROOT->FindObject("cMsSizeAll"));
1184  if (NULL == fcMsSizeAll) {
1185  fcMsSizeAll =
1186  new TCanvas("cMsSizeAll", "Evolution of MS size in last 300 s", w, h);
1187  fcMsSizeAll->Divide(4, 4);
1188  LOG(info) << "Created MS size canvas in STS monitor";
1189  } // if( NULL == fcMsSizeAll )
1190  else
1191  LOG(info) << "Recovered MS size canvas in STS monitor";
1192  //====================================================================//
1193 
1194  /*****************************/
1195 }
1196 
1197 Bool_t CbmMcbm2018MonitorMuch::DoUnpack(const fles::Timeslice& ts,
1198  size_t component) {
1199  if (bMcbm2018ResetMuch) {
1200  ResetAllHistos();
1201  bMcbm2018ResetMuch = kFALSE;
1202  } // if( bMcbm2018ResetMuch )
1203  if (bMcbm2018WriteMuch) {
1205  bMcbm2018WriteMuch = kFALSE;
1206  } // if( bMcbm2018WriteMuch )
1207  if (bMcbm2018ScanNoisyMuch) {
1209  bMcbm2018ScanNoisyMuch = kFALSE;
1210  } // if( bMcbm2018WriteMuch )
1211 
1212  LOG(debug) << "Timeslice contains " << ts.num_microslices(component)
1213  << " microslices.";
1214  fulCurrentTsIdx = ts.index();
1215 
1216  // Ignore overlap ms if flag set by user
1217  UInt_t uNbMsLoop = fuNbCoreMsPerTs;
1218  if (kFALSE == fbIgnoreOverlapMs) uNbMsLoop += fuNbOverMsPerTs;
1219 
1220  //LOG(info) <<" uNbMsLoop "<<uNbMsLoop;
1221  // Loop over core microslices (and overlap ones if chosen)
1222  for (UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx++) {
1223  Double_t dMsTime =
1224  (1e-9)
1225  * static_cast<double>(ts.descriptor(fvMsComponentsList[0], uMsIdx).idx);
1226 
1227  // Loop over registered components
1228  for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size();
1229  ++uMsCompIdx) {
1230  UInt_t uMsComp = fvMsComponentsList[uMsCompIdx];
1231 
1232  if (kFALSE == ProcessStsMs(ts, uMsComp, uMsIdx)) return kFALSE;
1233 
1234  } // for( UInt_t uMsComp = 0; uMsComp < fvMsComponentsList.size(); ++uMsComp )
1235 
1237  // Sort the buffer of hits
1238  std::sort(fvmHitsInMs.begin(), fvmHitsInMs.end());
1239 
1240  // Time differences plotting using the fully time sorted hits
1241  if (0 < fvmHitsInMs.size()) {
1242  // ULong64_t ulLastHitTime = ( *( fvmHitsInMs.rbegin() ) ).GetTs();
1243  std::vector<stsxyter::FinalHit>::iterator itA;
1244  std::vector<stsxyter::FinalHit>::iterator itB;
1245 
1246  // std::chrono::steady_clock::time_point tNow = std::chrono::steady_clock::now();
1247  // Double_t dUnixTimeInRun = std::chrono::duration_cast< std::chrono::seconds >(tNow - ftStartTimeUnix).count();
1248  //LOG(info) <<" ulLastHitTime "<<ulLastHitTime<<" dUnixTimeInRun "<<dUnixTimeInRun;
1249  for (
1250  itA = fvmHitsInMs.begin(); itA != fvmHitsInMs.end();
1251  // itA != fvmHitsInMs.end() && (*itA).GetTs() < ulLastHitTime - 320; // 320 * 3.125 ns = 1000 ns
1252  ++itA) {
1253  UShort_t usAsicIdx = (*itA).GetAsic();
1254  // UShort_t usChanIdx = (*itA).GetChan();
1255  // ULong64_t ulHitTs = (*itA).GetTs();
1256  // UShort_t usHitAdc = (*itA).GetAdc();
1257  UShort_t usFebIdx = usAsicIdx / fUnpackParMuch->GetNbAsicsPerFeb();
1258  // UShort_t usAsicInFeb = usAsicIdx % fUnpackParMuch->GetNbAsicsPerFeb();
1259  //LOG(info) <<" usAsicIdx "<<usAsicIdx<<" usChanIdx "<<usChanIdx<<" ulHitTs "<<ulHitTs<<" usHitAdc "<<usHitAdc<<" usFebIdx "<<usFebIdx<<" usAsicInFeb "<<usAsicInFeb;
1260  // Double_t dTimeSinceStartSec = (ulHitTs * stsxyter::kdClockCycleNs - fdStartTime)* 1e-9;
1261  //LOG(info) <<" dTimeSinceStartSec "<<dTimeSinceStartSec;
1262  fvmAsicHitsInMs[usAsicIdx].push_back((*itA));
1263  fvmFebHitsInMs[usFebIdx].push_back((*itA));
1264  /*
1265  if( 1000 == fulCurrentTsIdx )
1266  {
1267  LOG(info) << Form( "FEB %02u ASIC %u Chan %03u TS %12u ADC %2u Time %8.3f",
1268  usFebIdx, usAsicInFeb, usChanIdx, ulHitTs, usHitAdc,
1269  ulHitTs* stsxyter::kdClockCycleNs );
1270  } // if( 0 == fulCurrentTsIdx )
1271 */
1272  } // loop on time sorted hits and split per asic/feb
1273 
1274  // Remove all hits which were already used
1275  fvmHitsInMs.erase(fvmHitsInMs.begin(), itA);
1276 
1278  Bool_t bHitCopyInThisMs[fuNbStsXyters];
1279  Bool_t bHitCopySameAdcInThisMs[fuNbStsXyters];
1280  Bool_t bFlagOnInThisMs[fuNbStsXyters];
1281  for (UInt_t uAsic = 0; uAsic < fuNbStsXyters; uAsic++) {
1282  bHitCopyInThisMs[uAsic] = kFALSE;
1283  bHitCopySameAdcInThisMs[uAsic] = kFALSE;
1284  bFlagOnInThisMs[uAsic] = kFALSE;
1285  } // for( UInt_t uAsic = 0; uAsic < fuNbStsXyters; uAsic++)
1287 
1288  for (UInt_t uAsic = 0; uAsic < fuNbStsXyters; uAsic++) {
1289  UInt_t uFebIdx = uAsic / fUnpackParMuch->GetNbAsicsPerFeb();
1290  UInt_t uAsicInFeb = uAsic % fUnpackParMuch->GetNbAsicsPerFeb();
1291 
1292  std::vector<ULong64_t> vulLastHitTs(fUnpackParMuch->GetNbChanPerAsic(),
1293  0);
1294  std::vector<UShort_t> vusLastHitAdc(fUnpackParMuch->GetNbChanPerAsic(),
1295  0);
1296 
1297  for (itA = fvmAsicHitsInMs[uAsic].begin();
1298  itA != fvmAsicHitsInMs[uAsic].end();
1299  ++itA) {
1300  // UShort_t usAsicIdx = (*itA).GetAsic();
1301  UShort_t usChanIdx = (*itA).GetChan();
1302  ULong64_t ulHitTs = (*itA).GetTs();
1303  UShort_t usHitAdc = (*itA).GetAdc();
1304 
1305  UInt_t uChanInFeb =
1306  usChanIdx + fUnpackParMuch->GetNbChanPerAsic() * uAsicInFeb;
1307 
1310  Bool_t bIsNotCopy = kTRUE;
1311  if (vulLastHitTs[usChanIdx] == ulHitTs) {
1312  bIsNotCopy = kFALSE;
1313  bHitCopyInThisMs[uAsic] = kTRUE;
1314  if (vusLastHitAdc[usChanIdx] == usHitAdc)
1315  bHitCopySameAdcInThisMs[uAsic] = kTRUE;
1316  } // if( vulLastHitTs[ usChanIdx ] == ulHitTs)
1317 
1318  vulLastHitTs[usChanIdx] = ulHitTs;
1319  vusLastHitAdc[usChanIdx] = usHitAdc;
1320 
1321  if (bIsNotCopy) {
1322  fhStsFebChanCntRawGood[uFebIdx]->Fill(uChanInFeb);
1323  bFlagOnInThisMs[uAsic] |= SmxErrCheckCoinc(
1324  uFebIdx, uAsicInFeb, ulHitTs * stsxyter::kdClockCycleNs);
1325  } // if( bIsNotCopy )
1327  } // for( it = fvmAsicHitsInMs[ uAsic ].begin(); it != fvmAsicHitsInMs[ uAsic ].end(); ++it )
1328 
1330  fvmAsicHitsInMs[uAsic].clear();
1331  } // for( UInt_t uAsic = 0; uAsic < fuNbStsXyters; uAsic++)
1332 
1334  std::vector<Bool_t> vbCopyOnAnyAsicMs(fuNbFebs, kFALSE);
1335  std::vector<Bool_t> vbCopySameAdcOnAnyAsicMs(fuNbFebs, kFALSE);
1336  std::vector<Bool_t> vbFlagOnAnyAsicMs(fuNbFebs, kFALSE);
1337  Bool_t bCopyOnAnyMs = kFALSE;
1338  Bool_t bCopySameAdcOnAnyMs = kFALSE;
1339  Bool_t bFlagOnAnyMs = kFALSE;
1340  for (UInt_t uAsic = 0; uAsic < fuNbStsXyters; uAsic++) {
1341  UInt_t uFebIdx = uAsic / fUnpackParMuch->GetNbAsicsPerFeb();
1342  UInt_t uAsicInFeb = uAsic % fUnpackParMuch->GetNbAsicsPerFeb();
1343 
1344  fhStsFebSmxErrRatioCopyEvoAsic[uFebIdx]->Fill(
1345  dMsTime - fdStartTimeMsSz,
1346  uAsicInFeb,
1347  bHitCopyInThisMs[uAsic] ? 1.0 : 0.0);
1348 
1350  dMsTime - fdStartTimeMsSz,
1351  uAsicInFeb,
1352  bHitCopySameAdcInThisMs[uAsic] ? 1.0 : 0.0);
1353 
1354  fhStsFebSmxErrRatioEvoAsic[uFebIdx]->Fill(dMsTime - fdStartTimeMsSz,
1355  uAsicInFeb,
1356  bFlagOnInThisMs[uAsic] ? 1.0
1357  : 0.0);
1358 
1359  vbCopyOnAnyAsicMs[uFebIdx] =
1360  vbCopyOnAnyAsicMs[uFebIdx] || bHitCopyInThisMs[uAsic];
1361  vbCopySameAdcOnAnyAsicMs[uFebIdx] =
1362  vbCopySameAdcOnAnyAsicMs[uFebIdx] || bHitCopySameAdcInThisMs[uAsic];
1363  vbFlagOnAnyAsicMs[uFebIdx] =
1364  vbFlagOnAnyAsicMs[uFebIdx] || bFlagOnInThisMs[uAsic];
1365 
1366  bCopyOnAnyMs |= bHitCopyInThisMs[uAsic];
1367  bCopySameAdcOnAnyMs |= bHitCopySameAdcInThisMs[uAsic];
1368  bFlagOnAnyMs |= bFlagOnInThisMs[uAsic];
1369  } // for( UInt_t uAsic = 0; uAsic < fuNbStsXyters; uAsic++)
1370 
1371  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
1372  fhStsFebSmxErrRatioCopyEvo[uFebIdx]->Fill(
1373  dMsTime - fdStartTimeMsSz, vbCopyOnAnyAsicMs[uFebIdx] ? 1.0 : 0.0);
1374  fhStsFebSmxErrRatioCopySameAdcEvo[uFebIdx]->Fill(
1375  dMsTime - fdStartTimeMsSz,
1376  vbCopySameAdcOnAnyAsicMs[uFebIdx] ? 1.0 : 0.0);
1377  fhStsFebSmxErrRatioEvo[uFebIdx]->Fill(
1378  dMsTime - fdStartTimeMsSz, vbFlagOnAnyAsicMs[uFebIdx] ? 1.0 : 0.0);
1379  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
1381 
1382  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
1383  if (kTRUE == fbEnableCoincidenceMaps) {
1384  // UInt_t uFebA = uFebIdx % fUnpackParMuch->GetNbFebsPerCrob();
1385  // UInt_t uCrobIdxA = ( uFebIdx / fUnpackParMuch->GetNbFebsPerCrob() ) % fUnpackParMuch->GetNbCrobsPerDpb();
1386  // UInt_t uDpbIdxA = ( uFebIdx / fUnpackParMuch->GetNbFebsPerCrob() ) / fUnpackParMuch->GetNbCrobsPerDpb();
1387 
1388  for (itA = fvmFebHitsInMs[uFebIdx].begin();
1389  itA != fvmFebHitsInMs[uFebIdx].end();
1390  ++itA) {
1391  UShort_t usAsicIdxA = (*itA).GetAsic();
1392  UShort_t usAsicInFebA =
1393  usAsicIdxA % fUnpackParMuch->GetNbAsicsPerFeb();
1394  UShort_t usChanIdxA = (*itA).GetChan();
1395  UInt_t uChanInFebA =
1396  usChanIdxA + fUnpackParMuch->GetNbChanPerAsic() * usAsicInFebA;
1397  ULong64_t ulHitTsA = (*itA).GetTs();
1398  Double_t dHitTsA = ulHitTsA * stsxyter::kdClockCycleNs;
1399 
1401  if (-1 < fdStsFebChanLastTimeForDist[uFebIdx][uChanInFebA]) {
1402  fhStsFebChanDistT[uFebIdx]->Fill(
1403  dHitTsA - fdStsFebChanLastTimeForDist[uFebIdx][uChanInFebA],
1404  uChanInFebA);
1405  } // if( -1 < fdStsFebChanLastTimeForDist[ uFebIdx ][ uChanInFebA ] )
1406  fdStsFebChanLastTimeForDist[uFebIdx][uChanInFebA] = dHitTsA;
1407 
1408  for (UInt_t uFebIdxB = uFebIdx; uFebIdxB < fuNbFebs; ++uFebIdxB) {
1410  //Bool_t bSameModulePNsides = kFALSE;
1411  // Double_t dBestDtMatch = 1e9; // ns
1412  std::vector<stsxyter::FinalHit>::iterator itBestMatch;
1413  // UInt_t uFebB = uFebIdxB % fUnpackParMuch->GetNbFebsPerCrob();
1414  // UInt_t uCrobIdxB = ( uFebIdxB / fUnpackParMuch->GetNbFebsPerCrob() ) % fUnpackParMuch->GetNbCrobsPerDpb();
1415  // UInt_t uDpbIdxB = ( uFebIdxB / fUnpackParMuch->GetNbFebsPerCrob() ) / fUnpackParMuch->GetNbCrobsPerDpb();
1416  /*if( fviFebModuleIdx[ uDpbIdxA ][ uCrobIdxA ][ uFebA ] == fviFebModuleIdx[ uDpbIdxB ][ uCrobIdxB ][ uFebB ] &&
1417  fviFebModuleSide[ uDpbIdxA ][ uCrobIdxA ][ uFebA ] != fviFebModuleSide[ uDpbIdxB ][ uCrobIdxB ][ uFebB ] )
1418  bSameModulePNsides = kTRUE;
1419  */
1420  for (itB = fvmFebHitsInMs[uFebIdxB].begin();
1421  itB != fvmFebHitsInMs[uFebIdxB].end();
1422  ++itB) {
1423  UShort_t usAsicIdxB = (*itB).GetAsic();
1424  UShort_t usChanIdxB = (*itB).GetChan();
1425  UInt_t uChanInFebB =
1426  usChanIdxB
1428  * (usAsicIdxB % fUnpackParMuch->GetNbAsicsPerFeb());
1429 
1430  if (uFebIdx == uFebIdxB && uChanInFebA == uChanInFebB) continue;
1431 
1432  ULong64_t ulHitTsB = (*itB).GetTs();
1433  // Double_t dHitTsB = ulHitTsB * stsxyter::kdClockCycleNs;
1434  Double_t dDtClk = static_cast<Double_t>(ulHitTsB)
1435  - static_cast<Double_t>(ulHitTsA);
1436  Double_t dDt = dDtClk * stsxyter::kdClockCycleNs;
1437 
1438  fhStsFebChanDtCoinc[uFebIdx][uFebIdxB]->Fill(dDt);
1439 
1441  if (-1.0 * fdFebChanCoincidenceLimit < dDt) {
1443  if (fdFebChanCoincidenceLimit < dDt) break;
1444 
1445  fhStsFebChanCoinc[uFebIdx][uFebIdxB]->Fill(uChanInFebA,
1446  uChanInFebB);
1447 
1448  } // if( -1.0 * fdFebChanCoincidenceLimit < dDt )
1449  } // for( itB = fvmFebHitsInMs[ uFebIdxB ].begin(); itB != fvmFebHitsInMs[ uFebIdxB ].end(); ++itB )
1450  } // for( UInt_t uFebIdxB = uFebIdx; uFebIdxB < fuNbFebs; ++uFebIdxB )
1451  } // for( itA = fvmFebHitsInMs[ uFebIdx ].begin(); itA != fvmFebHitsInMs[ uFebIdx ].end(); ++itA )
1452  } // if( kTRUE == fbEnableCoincidenceMaps )
1453 
1455  fvmFebHitsInMs[uFebIdx].clear();
1456  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
1457  } // if( 0 < fvmHitsInMs.size() )
1458  } // for( UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx ++ )
1459 
1460  for (UInt_t uMsIdx = 0; uMsIdx < fuMaxNbMicroslices; ++uMsIdx) {
1461  fvdMsTime[uMsIdx] = 0.0;
1462  } // for( UInt_t uMsIdx = 0; uMsIdx < fuMaxNbMicroslices; ++uMsIdx )
1463 
1464  if (0 == ts.index() % 1000) {
1465  for (UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb) {
1466  Double_t dTsMsbTime =
1467  static_cast<ULong64_t>(stsxyter::kuHitNbTsBins)
1468  * static_cast<ULong64_t>(fvulCurrentTsMsb[fuCurrDpbIdx])
1469  + static_cast<ULong64_t>(stsxyter::kulTsCycleNbBins)
1470  * static_cast<ULong64_t>(fvuCurrentTsMsbCycle[fuCurrDpbIdx]);
1471  dTsMsbTime *= stsxyter::kdClockCycleNs * 1e-9;
1472 
1473  LOG(info) << "End of TS " << std::setw(7) << ts.index() << " eDPB "
1474  << std::setw(2) << uDpb << " current TS MSB counter is "
1475  << std::setw(12) << fvulCurrentTsMsb[uDpb]
1476  << " current TS MSB cycle counter is " << std::setw(12)
1477  << fvuCurrentTsMsbCycle[uDpb] << " current TS MSB time is "
1478  << std::setw(12) << dTsMsbTime << " s";
1479  }
1480  } // if( 0 == ts.index() % 1000 )
1481 
1482  // if( 0 == ts.index() % 10000 )
1483  //SaveAllHistos( "data/PulserPeriodicHistosSave.root");
1484 
1485  return kTRUE;
1486 }
1487 
1488 Bool_t CbmMcbm2018MonitorMuch::ProcessStsMs(const fles::Timeslice& ts,
1489  size_t uMsComp,
1490  UInt_t uMsIdx) {
1491  auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
1492  fuCurrentEquipmentId = msDescriptor.eq_id;
1493  //LOG(info) << " fuCurrentEquipmentId "<<fuCurrentEquipmentId;
1494  const uint8_t* msContent =
1495  reinterpret_cast<const uint8_t*>(ts.content(uMsComp, uMsIdx));
1496 
1497  uint32_t uSize = msDescriptor.size;
1498  fulCurrentMsIdx = msDescriptor.idx;
1499  Double_t dMsTime = (1e-9) * static_cast<double>(fulCurrentMsIdx);
1500  LOG(debug) << "Microslice: " << fulCurrentMsIdx << " from EqId " << std::hex
1501  << fuCurrentEquipmentId << std::dec << " has size: " << uSize;
1502 
1503  fuCurrDpbId = static_cast<uint32_t>(fuCurrentEquipmentId & 0xFFFF);
1505  //LOG(info) <<" fuCurrDpbIdx "<<fuCurrDpbIdx<<" fuCurrDpbId "<<fuCurrDpbId;
1506 
1507  if (uMsComp < kiMaxNbFlibLinks) {
1508  if (fdStartTimeMsSz < 0) fdStartTimeMsSz = dMsTime;
1509  fhMsSz[uMsComp]->Fill(uSize);
1510  fhMsSzTime[uMsComp]->Fill(dMsTime - fdStartTimeMsSz, uSize);
1511  } // if( uMsComp < kiMaxNbFlibLinks )
1512 
1514  if (static_cast<Int_t>(fvdPrevMsTime[uMsComp])
1515  < static_cast<Int_t>(dMsTime)) {
1517  UInt_t uFebIdxOffset = fUnpackParMuch->GetNbFebsPerDpb() * fuCurrDpbIdx;
1518  for (UInt_t uFebIdx = 0; uFebIdx < fUnpackParMuch->GetNbFebsPerDpb();
1519  ++uFebIdx) {
1520  UInt_t uFebIdxInSyst = uFebIdxOffset + uFebIdx;
1521 
1523  if (0 == fviFebTimeSecLastRateUpdate[uFebIdxInSyst]) {
1524  fviFebTimeSecLastRateUpdate[uFebIdxInSyst] =
1525  static_cast<Int_t>(dMsTime);
1526  fviFebCountsSinceLastRateUpdate[uFebIdxInSyst] = 0;
1527  for (UInt_t uChan = 0; uChan < fUnpackParMuch->GetNbChanPerFeb();
1528  ++uChan)
1529  fvdFebChanCountsSinceLastRateUpdate[uFebIdxInSyst][uChan] = 0.0;
1530  continue;
1531  } // if( 0 == fviFebTimeSecLastRateUpdate[uFebIdxInSyst] )
1532 
1533  Int_t iTimeInt = static_cast<Int_t>(dMsTime)
1534  - fviFebTimeSecLastRateUpdate[uFebIdxInSyst];
1535  if (fiTimeIntervalRateUpdate <= iTimeInt) {
1537  if (0 == fviFebCountsSinceLastRateUpdate[uFebIdxInSyst]) {
1538  fviFebTimeSecLastRateUpdate[uFebIdxInSyst] =
1539  static_cast<Int_t>(dMsTime);
1540  continue;
1541  } // if( 0 == fviFebCountsSinceLastRateUpdate[uFebIdxInSyst] )
1542 
1543  for (UInt_t uChan = 0; uChan < fUnpackParMuch->GetNbChanPerFeb();
1544  ++uChan) {
1545  fhStsFebChanHitRateProf[uFebIdxInSyst]->Fill(
1546  uChan,
1547  fvdFebChanCountsSinceLastRateUpdate[uFebIdxInSyst][uChan]
1548  / iTimeInt);
1549  fvdFebChanCountsSinceLastRateUpdate[uFebIdxInSyst][uChan] = 0.0;
1550  } // for( UInt_t uChan = 0; uChan < fUnpackParMuch->GetNbChanPerFeb(); ++uChan )
1551 
1552  fviFebTimeSecLastRateUpdate[uFebIdxInSyst] =
1553  static_cast<Int_t>(dMsTime);
1554  fviFebCountsSinceLastRateUpdate[uFebIdxInSyst] = 0;
1555  } // if( fiTimeIntervalRateUpdate <= iTimeInt )
1556  } // for( UInt_t uFebIdx = 0; uFebIdx < fUnpackParMuch->GetNbFebsPerDpb(); ++uFebIdx )
1557  } // if( static_cast<Int_t>( fvdMsTime[ uMsCompIdx ] ) < static_cast<Int_t>( dMsTime ) )
1558 
1559  // Store MS time for coincidence plots
1560  fvdPrevMsTime[uMsComp] = dMsTime;
1561 
1563  uint16_t uMsHeaderFlags = msDescriptor.flags;
1564  for (UInt_t uBit = 0; uBit < 16; ++uBit)
1565  fhPulserMsStatusFieldType->Fill(uBit, (uMsHeaderFlags >> uBit) & 0x1);
1566 
1568  UInt_t uTsMsbCycleHeader =
1569  std::floor(fulCurrentMsIdx
1572  if (kFALSE == fvuInitialHeaderDone[fuCurrDpbIdx]) {
1573  fvuInitialTsMsbCycleHeader[fuCurrDpbIdx] = uTsMsbCycleHeader;
1575  } // if( kFALSE == fvuInitialHeaderDone[ fuCurrDpbIdx ] )
1576  else if (uTsMsbCycleHeader != fvuCurrentTsMsbCycle[fuCurrDpbIdx]
1577  && 4194303 != fvulCurrentTsMsb[fuCurrDpbIdx]) {
1578  /*
1579  LOG(warning) << "TS MSB cycle from MS header does not match current cycle from data "
1580  << "for TS " << std::setw( 12 ) << fulCurrentTsIdx
1581  << " MS " << std::setw( 12 ) << fulCurrentMsIdx
1582  << " MsInTs " << std::setw( 3 ) << uMsIdx
1583  << " ====> " << fvuCurrentTsMsbCycle[ fuCurrDpbIdx ]
1584  << " VS " << uTsMsbCycleHeader;
1585 */
1586  fvuCurrentTsMsbCycle[fuCurrDpbIdx] = uTsMsbCycleHeader;
1587  }
1588 
1589  // If not integer number of message in input buffer, print warning/error
1590  if (0 != (uSize % kuBytesPerMessage))
1591  LOG(error) << "The input microslice buffer does NOT "
1592  << "contain only complete nDPB messages!";
1593 
1594  // Compute the number of complete messages in the input microslice buffer
1595  uint32_t uNbMessages =
1596  (uSize - (uSize % kuBytesPerMessage)) / kuBytesPerMessage;
1597 
1598  // Prepare variables for the loop on contents
1599  const uint32_t* pInBuff = reinterpret_cast<const uint32_t*>(msContent);
1600 
1601  for (uint32_t uIdx = 0; uIdx < uNbMessages; ++uIdx) {
1602  // Fill message
1603  uint32_t ulData = static_cast<uint32_t>(pInBuff[uIdx]);
1604 
1605  stsxyter::Message mess(static_cast<uint32_t>(ulData & 0xFFFFFFFF));
1606 
1607  // Print message if requested
1608  if (fbPrintMessages) mess.PrintMess(std::cout, fPrintMessCtrl);
1609  /*
1610  if( 1000 == fulCurrentTsIdx )
1611  {
1612  mess.PrintMess( std::cout, fPrintMessCtrl );
1613  } // if( 0 == fulCurrentTsIdx )
1614 */
1615  stsxyter::MessType typeMess = mess.GetMessType();
1616  fmMsgCounter[typeMess]++;
1617  fhStsMessType->Fill(static_cast<uint16_t>(typeMess));
1618  fhStsMessTypePerDpb->Fill(fuCurrDpbIdx, static_cast<uint16_t>(typeMess));
1619 
1620  switch (typeMess) {
1621  case stsxyter::MessType::Hit: {
1622  // Extract the eLink and Asic indices => Should GO IN the fill method now that obly hits are link/asic specific!
1623  UShort_t usElinkIdx = mess.GetLinkIndex();
1624  UInt_t uCrobIdx = usElinkIdx / fUnpackParMuch->GetNbElinkPerCrob();
1625  Int_t uFebIdx = fUnpackParMuch->ElinkIdxToFebIdx(usElinkIdx);
1626  // if(usElinkIdx!=0)
1627  //LOG(info) <<" usElinkIdx "<<usElinkIdx<<" uCrobIdx "<<uCrobIdx<<" uFebIdx "<<uFebIdx;
1628  if (kTRUE == fbMuchMode) uFebIdx = usElinkIdx;
1629  fhStsHitsElinkPerDpb->Fill(fuCurrDpbIdx, usElinkIdx);
1630  if (-1 == uFebIdx) {
1631  LOG(warning) << "CbmMcbm2018MonitorMuch::DoUnpack => "
1632  << "Wrong elink Idx! Elink raw "
1633  << Form("%d remap %d", usElinkIdx, uFebIdx);
1634  continue;
1635  } // if( -1 == uFebIdx )
1636  //LOG(info) << " uCrobIdx "<<uCrobIdx<<" fUnpackParMuch->ElinkIdxToAsicIdx( usElinkIdx ) "<<fUnpackParMuch->ElinkIdxToAsicIdx( usElinkIdx )<<" usElinkIdx "<<usElinkIdx;
1637  UInt_t uAsicIdx =
1638  (fuCurrDpbIdx * fUnpackParMuch->GetNbCrobsPerDpb() + uCrobIdx)
1640  + fUnpackParMuch->ElinkIdxToAsicIdx(usElinkIdx);
1641 
1642  FillHitInfo(mess, usElinkIdx, uAsicIdx, uMsIdx);
1643  break;
1644  } // case stsxyter::MessType::Hit :
1646  FillTsMsbInfo(mess, uIdx, uMsIdx);
1647  break;
1648  } // case stsxyter::MessType::TsMsb :
1650  // The first message in the TS is a special ones: EPOCH
1651  FillEpochInfo(mess);
1652 
1653  if (0 < uIdx)
1654  LOG(info) << "CbmMcbm2018MonitorMuch::DoUnpack => "
1655  << "EPOCH message at unexpected position in MS: message "
1656  << uIdx << " VS message 0 expected!";
1657  break;
1658  } // case stsxyter::MessType::TsMsb :
1660  UShort_t usElinkIdx = mess.GetStatusLink();
1661  UInt_t uCrobIdx = usElinkIdx / fUnpackParMuch->GetNbElinkPerCrob();
1662  // Int_t uFebIdx = fUnpackParMuch->ElinkIdxToFebIdx( usElinkIdx );
1663  UInt_t uAsicIdx =
1664  (fuCurrDpbIdx * fUnpackParMuch->GetNbCrobsPerDpb() + uCrobIdx)
1666  + fUnpackParMuch->ElinkIdxToAsicIdx(usElinkIdx);
1667 
1668  UShort_t usStatusField = mess.GetStatusStatus();
1669 
1670  fhPulserStatusMessType->Fill(uAsicIdx, usStatusField);
1672  if (fbPrintMessages) {
1673  std::cout << Form("DPB %2u TS %12llu MS %12llu mess %5u ",
1674  fuCurrDpbIdx,
1677  uIdx);
1678  mess.PrintMess(std::cout, fPrintMessCtrl);
1679  } // if( fbPrintMessages )
1680  // FillTsMsbInfo( mess );
1681  break;
1682  } // case stsxyter::MessType::Status
1684  // FillTsMsbInfo( mess );
1685  break;
1686  } // case stsxyter::MessType::Empty :
1688  break;
1689  } // case stsxyter::MessType::Dummy / ReadDataAck / Ack :
1690  default: {
1691  LOG(fatal) << "CbmMcbm2018MonitorMuch::DoUnpack => "
1692  << "Unknown message type, should never happen, stopping "
1693  "here! Type found was: "
1694  << static_cast<int>(typeMess);
1695  }
1696  } // switch( mess.GetMessType() )
1697  } // for( uint32_t uIdx = 0; uIdx < uNbMessages; ++uIdx )
1698 
1699  return kTRUE;
1700 }
1701 
1703  const UShort_t& usElinkIdx,
1704  const UInt_t& uAsicIdx,
1705  const UInt_t& uMsIdx) {
1706  UShort_t usChan = mess.GetHitChannel();
1707  UShort_t usRawAdc = mess.GetHitAdc();
1708  // UShort_t usFullTs = mess.GetHitTimeFull();
1709  // UShort_t usTsOver = mess.GetHitTimeOver();
1710  UShort_t usRawTs = mess.GetHitTime();
1711 
1713  // usChan = 127 - usChan;
1714 
1715  /*
1716  fhStsChanCntRaw[ uAsicIdx ]->Fill( usChan );
1717  fhStsChanAdcRaw[ uAsicIdx ]->Fill( usChan, usRawAdc );
1718  fhStsChanAdcRawProf[ uAsicIdx ]->Fill( usChan, usRawAdc );
1719  fhStsChanRawTs[ uAsicIdx ]->Fill( usChan, usRawTs );
1720  fhStsChanMissEvt[ uAsicIdx ]->Fill( usChan, mess.IsHitMissedEvts() );
1721 */
1722  //LOG(info) <<" uAsicIdx "<<uAsicIdx<<" usChan "<<usChan;
1723  Int_t FebId = fUnpackParMuch->GetFebId(uAsicIdx);
1724 
1725  UInt_t uFebIdx = uAsicIdx / fUnpackParMuch->GetNbAsicsPerFeb();
1726  UInt_t uCrobIdx = usElinkIdx / fUnpackParMuch->GetNbElinkPerCrob();
1727  UInt_t uAsicInFeb = uAsicIdx % fUnpackParMuch->GetNbAsicsPerFeb();
1728  UInt_t uChanInFeb = usChan
1730  * (uAsicIdx % fUnpackParMuch->GetNbAsicsPerFeb());
1731  Int_t sector = fUnpackParMuch->GetPadXA(FebId, usChan);
1732  Int_t channel = fUnpackParMuch->GetPadYA(FebId, usChan);
1733  //Convert into Real X Y Position
1734  Double_t ActualX = (fUnpackParMuch->GetRealPadSize(channel) * sector);
1735  Double_t ActualY = fUnpackParMuch->GetRealX(channel);
1736  //LOG(info) <<" sector "<<sector<<" channel "<<channel<<" FebId "<<FebId<<" usChan "<<usChan;
1737  Int_t ModuleNr = fUnpackParMuch->GetModule(uAsicIdx);
1738  fHistPadDistr[ModuleNr]->Fill(sector, channel);
1739  fRealHistPadDistr[ModuleNr]->Fill(ActualY, ActualX);
1740 
1741  //LOG(info) <<" usElinkIdx "<<usElinkIdx<<" uAsicIdx "<<uAsicIdx<<" uMsIdx "<<uMsIdx<<" uCrobIdx "<<uCrobIdx<<" uFebIdx "<<uFebIdx<<" uAsicInFeb "<<uAsicInFeb<<" uChanInFeb "<<uChanInFeb<<" usChan "<<usChan;
1742 
1743  Double_t dCalAdc =
1744  fvdFebAdcOffs[fuCurrDpbIdx][uCrobIdx][uFebIdx]
1745  + (usRawAdc - 1) * fvdFebAdcGain[fuCurrDpbIdx][uCrobIdx][uFebIdx];
1746  //if(uChanInFeb!=37 && uChanInFeb!=58 && uChanInFeb!=68 && uChanInFeb!=69 && uChanInFeb!=101 && uChanInFeb!=109 ){
1747  fhStsFebChanCntRaw[uFebIdx]->Fill(uChanInFeb);
1748  fhStsFebChanAdcRaw[uFebIdx]->Fill(uChanInFeb, usRawAdc);
1749  fhStsFebChanAdcRawProf[uFebIdx]->Fill(uChanInFeb, usRawAdc);
1750  fhStsFebChanAdcCal[uFebIdx]->Fill(uChanInFeb, dCalAdc);
1751  fhStsFebChanAdcCalProf[uFebIdx]->Fill(uChanInFeb, dCalAdc);
1752  fhStsFebChanRawTs[uFebIdx]->Fill(usChan, usRawTs);
1753  fhStsFebChanMissEvt[uFebIdx]->Fill(usChan, mess.IsHitMissedEvts());
1754  fhStsFebChanAdcRaw_combined->Fill(usRawAdc);
1755  //}
1756  // Compute the Full time stamp
1757  // Long64_t ulOldHitTime = fvulChanLastHitTime[ uAsicIdx ][ usChan ];
1758  //Double_t dOldHitTime = fvdChanLastHitTime[ uAsicIdx ][ usChan ];
1759  // Long64_t dOldHitTime = fvdChanLastHitTime[ uAsicIdx ][ usChan ];
1760 
1761  // Use TS w/o overlap bits as they will anyway come from the TS_MSB
1762  fvulChanLastHitTime[uAsicIdx][usChan] = usRawTs;
1763 
1764  fvulChanLastHitTime[uAsicIdx][usChan] +=
1765  static_cast<ULong64_t>(stsxyter::kuHitNbTsBins)
1766  * static_cast<ULong64_t>(fvulCurrentTsMsb[fuCurrDpbIdx])
1767  + static_cast<ULong64_t>(stsxyter::kulTsCycleNbBins)
1768  * static_cast<ULong64_t>(fvuCurrentTsMsbCycle[fuCurrDpbIdx]);
1769 
1770  // fvuElinkLastTsHit[fuCurrDpbIdx] = usRawTs;
1771 
1772  // Convert the Hit time in bins to Hit time in ns
1773  Long64_t dHitTimeNs =
1774  fvulChanLastHitTime[uAsicIdx][usChan] * stsxyter::kdClockCycleNs;
1775  //Double_t dHitTimeNs = fvulChanLastHitTime[ uAsicIdx ][ usChan ] * stsxyter::kdClockCycleNs;
1776 
1777  /*
1778  // If needed fill the hit interval plots
1779  if( fbChanHitDtEna )
1780  {
1781  Double_t dDeltaT = dHitTimeNs - fvdChanLastHitTime[ uAsicIdx ][ usChan ];
1782  if( 0 == dDeltaT )
1783  fhStsChanHitDtNeg[ uAsicIdx ]->Fill( 1, usChan );
1784  else if( 0 < dDeltaT )
1785  fhStsChanHitDt[ uAsicIdx ]->Fill( dDeltaT, usChan );
1786  else fhStsChanHitDtNeg[ uAsicIdx ]->Fill( -dDeltaT, usChan );
1787  } // if( fbChanHitDtEna )
1788 */
1789  // Store new value of Hit time in ns
1790  fvdChanLastHitTime[uAsicIdx][usChan] =
1791  fvulChanLastHitTime[uAsicIdx][usChan] * stsxyter::kdClockCycleNs;
1792  /*
1793  LOG(info) << " Asic " << std::setw( 2 ) << uAsicIdx
1794  << " Channel " << std::setw( 3 ) << usChan
1795  << " Diff to last hit " << std::setw( 12 ) << ( fvulChanLastHitTime[ uAsicIdx ][ usChan ] - ulOldHitTime)
1796  << " in s " << std::setw( 12 ) << ( fvdChanLastHitTime[ uAsicIdx ][ usChan ] - dOldHitTime) * 1e-9;
1797 */
1798  // Pulser and MS
1799  fvuChanNbHitsInMs[uAsicIdx][usChan][uMsIdx]++;
1800  fvdChanLastHitTimeInMs[uAsicIdx][usChan][uMsIdx] = dHitTimeNs;
1801  fvusChanLastHitAdcInMs[uAsicIdx][usChan][uMsIdx] = usRawAdc;
1802  /*
1803  fvmChanHitsInTs[ uAsicIdx ][ usChan ].insert( stsxyter::FinalHit( fvulChanLastHitTime[ uAsicIdx ][ usChan ],
1804  usRawAdc, uAsicIdx, usChan ) );
1805 */
1806  fvmHitsInMs.push_back(stsxyter::FinalHit(
1807  fvulChanLastHitTime[uAsicIdx][usChan], usRawAdc, uAsicIdx, usChan));
1808 
1809  // Check Starting point of histos with time as X axis
1810  if (-1 == fdStartTime) fdStartTime = fvdChanLastHitTime[uAsicIdx][usChan];
1811 
1812  int64_t constime = (fvdChanLastHitTime[uAsicIdx][usChan] - prevtime);
1813 
1814  if (constime < 1000000) {
1815  if (usRawAdc > 1) { Counter1++; }
1816  Counter++;
1817  } else {
1818  fhRate->Fill(Counter);
1819  fhRateAdcCut->Fill(Counter1);
1820  Counter = 0;
1821  Counter1 = 0;
1822  }
1823 
1824  prevtime = fvdChanLastHitTime[uAsicIdx][usChan];
1825 
1826  // Fill histos with time as X axis
1827  Double_t dTimeSinceStartSec =
1828  (fvdChanLastHitTime[uAsicIdx][usChan] - fdStartTime) * 1e-6; //uTimeBin
1829  // Double_t SpillTimeMs = dTimeSinceStartSec/1000000;
1830  //Double_t dTimeSinceStartSec = (fvdChanLastHitTime[ uAsicIdx ][ usChan ] - fdStartTime)* uTimeBin; //uTimeBin
1831  Double_t dTimeSinceStartMin = dTimeSinceStartSec / 60.0;
1832 
1833  //LOG(info)<<" full time "<<fvdChanLastHitTime[ uAsicIdx ][ usChan ]<<" start time "<<fdStartTime<<" dTimeSinceStartSec "<<dTimeSinceStartSec<<" dTimeSinceStartSec*1e-9 "<<dTimeSinceStartSec*1e+9<< " fvulChanLastHitTime[ uAsicIdx ][ usChan ] "<<fvulChanLastHitTime[ uAsicIdx ][ usChan ]<< " usChan "<<usChan<<" usrawadc "<<usRawAdc;
1835  fvdFebChanCountsSinceLastRateUpdate[uFebIdx][uChanInFeb] += 1;
1836  //LOG(info)<<" fviFebCountsSinceLastRateUpdate "<<fviFebCountsSinceLastRateUpdate[uFebIdx]<<" fvdFebChanCountsSinceLastRateUpdate "<<fvdFebChanCountsSinceLastRateUpdate[uFebIdx][uChanInFeb] <<" uFebIdx " << uFebIdx;
1837  //if((fvdChanLastHitTime[ uAsicIdx ][ usChan ] - fdStartTime) < 60.0)
1838  //fviFebCountsSinceLastRateUpdate[uFebIdx]++;
1839  fhStsFebChanHitRateEvo[uFebIdx]->Fill(dTimeSinceStartSec, uChanInFeb);
1840  fhStsFebAsicHitRateEvo[uFebIdx]->Fill(dTimeSinceStartSec, uAsicInFeb);
1841  fhStsFebHitRateEvo[uFebIdx]->Fill(dTimeSinceStartSec);
1842  // fhStsFebHitRateEvo[ uFebIdx ]->Fill( 10.0*SpillTimeMs );
1843  fhStsFebHitRateEvo_mskch[uFebIdx]->Fill(dTimeSinceStartSec);
1844  if (usRawAdc > 1)
1845  fhStsFebHitRateEvo_mskch_adccut[uFebIdx]->Fill(dTimeSinceStartSec);
1846  fhStsFebChanHitRateEvoLong[uFebIdx]->Fill(
1847  dTimeSinceStartMin, uChanInFeb, 1.0 / 60.0);
1848  fhStsFebAsicHitRateEvoLong[uFebIdx]->Fill(
1849  dTimeSinceStartMin, uAsicInFeb, 1.0 / 60.0);
1850  fhStsFebHitRateEvoLong[uFebIdx]->Fill(dTimeSinceStartMin, 1.0 / 60.0);
1851  if (mess.IsHitMissedEvts()) {
1852  fhStsFebChanMissEvtEvo[uFebIdx]->Fill(dTimeSinceStartSec, uChanInFeb);
1853  fhStsFebAsicMissEvtEvo[uFebIdx]->Fill(dTimeSinceStartSec, uAsicInFeb);
1854  fhStsFebMissEvtEvo[uFebIdx]->Fill(dTimeSinceStartSec);
1855  } // if( mess.IsHitMissedEvts() )
1856 }
1857 
1859  UInt_t uMessIdx,
1860  UInt_t /*uMsIdx*/) {
1861  UInt_t uVal = mess.GetTsMsbVal();
1862  /*
1863  if( ( 419369 < fulCurrentTsIdx && fulCurrentTsIdx < 419371 ) )
1864  LOG(info) << " TS " << std::setw( 12 ) << fulCurrentTsIdx
1865  << " MS " << std::setw( 12 ) << fulCurrentMsIdx
1866  << " MsInTs " << std::setw( 3 ) << uMsIdx
1867  << " DPB " << std::setw( 2 ) << fuCurrDpbIdx
1868  << " Mess " << std::setw( 5 ) << uMessIdx
1869  << " TsMsb " << std::setw( 5 ) << uVal;
1870 */
1871  /*
1872  if( (uVal != fvulCurrentTsMsb[fuCurrDpbIdx] + 1) && 0 < uVal &&
1873  !( 1 == uMessIdx && usVal == fvulCurrentTsMsb[fuCurrDpbIdx] ) ) // 1st TS_MSB in MS is always a repeat of the last one in previous MS!
1874  {
1875  LOG(info) << "TS MSB not increasing by 1! TS " << std::setw( 12 ) << fulCurrentTsIdx
1876  << " MS " << std::setw( 12 ) << fulCurrentMsIdx
1877  << " MsInTs " << std::setw( 3 ) << uMsIdx
1878  << " DPB " << std::setw( 2 ) << fuCurrDpbIdx
1879  << " Mess " << std::setw( 5 ) << uMessIdx
1880  << " Old TsMsb " << std::setw( 5 ) << fvulCurrentTsMsb[fuCurrDpbIdx]
1881  << " new TsMsb " << std::setw( 5 ) << uVal
1882  << " Diff " << std::setw( 5 ) << uVal - fvulCurrentTsMsb[fuCurrDpbIdx]
1883  << " Old MsbCy " << std::setw( 5 ) << fvuCurrentTsMsbCycle[fuCurrDpbIdx];
1884  } // if( (uVal != fvulCurrentTsMsb[fuCurrDpbIdx] + 1) && 0 < uVal )
1885 */
1886 
1887  // Update Status counters
1888  if (uVal < fvulCurrentTsMsb[fuCurrDpbIdx]) {
1889  /*
1890  LOG(info) << " TS " << std::setw( 12 ) << fulCurrentTsIdx
1891  << " MS " << std::setw( 12 ) << fulCurrentMsIdx
1892  << " MS Idx " << std::setw( 4 ) << uMsIdx
1893  << " Msg Idx " << std::setw( 5 ) << uMessIdx
1894  << " DPB " << std::setw( 2 ) << fuCurrDpbIdx
1895  << " Old TsMsb " << std::setw( 5 ) << fvulCurrentTsMsb[fuCurrDpbIdx]
1896  << " Old MsbCy " << std::setw( 5 ) << fvuCurrentTsMsbCycle[fuCurrDpbIdx]
1897  << " new TsMsb " << std::setw ( 5 ) << uVal;
1898 */
1899 
1901  } // if( uVal < fvulCurrentTsMsb[fuCurrDpbIdx] )
1902  if (uVal != fvulCurrentTsMsb[fuCurrDpbIdx] + 1 && 0 != uVal
1903  && 4194303 != fvulCurrentTsMsb[fuCurrDpbIdx] && 1 != uMessIdx) {
1904  /*
1905  LOG(info) << "TS MSb Jump in "
1906  << " TS " << std::setw( 12 ) << fulCurrentTsIdx
1907  << " MS " << std::setw( 12 ) << fulCurrentMsIdx
1908  << " MS Idx " << std::setw( 4 ) << uMsIdx
1909  << " Msg Idx " << std::setw( 5 ) << uMessIdx
1910  << " DPB " << std::setw( 2 ) << fuCurrDpbIdx
1911  << " => Old TsMsb " << std::setw( 5 ) << fvulCurrentTsMsb[fuCurrDpbIdx]
1912  << " new TsMsb " << std::setw ( 5 ) << uVal;
1913 */
1914  } // if( uVal + 1 != fvulCurrentTsMsb[fuCurrDpbIdx] && 4194303 != uVal && 0 != fvulCurrentTsMsb[fuCurrDpbIdx] )
1916  /*
1917  ULong64_t ulNewTsMsbTime = static_cast< ULong64_t >( stsxyter::kuHitNbTsBins )
1918  * static_cast< ULong64_t >( fvulCurrentTsMsb[fuCurrDpbIdx])
1919  + static_cast< ULong64_t >( stsxyter::kulTsCycleNbBins )
1920  * static_cast< ULong64_t >( fvuCurrentTsMsbCycle[fuCurrDpbIdx] );
1921 */
1922 }
1923 
1925  // UInt_t uVal = mess.GetEpochVal();
1926  // UInt_t uCurrentCycle = uVal % stsxyter::kulTsCycleNbBins;
1927 }
1928 
1930 
1932 
1933  LOG(info) << "-------------------------------------";
1934  LOG(info) << "CbmMcbm2018MonitorMuch statistics are ";
1935  LOG(info) << " Hit messages: " << fmMsgCounter[stsxyter::MessType::Hit]
1936  << "\n"
1937  << " Ts MSB messages: " << fmMsgCounter[stsxyter::MessType::TsMsb]
1938  << "\n"
1939  << " Dummy messages: " << fmMsgCounter[stsxyter::MessType::Dummy]
1940  << "\n"
1941  << " Epoch messages: " << fmMsgCounter[stsxyter::MessType::Epoch]
1942  << "\n"
1943  << " Empty messages: "
1945 
1946  LOG(info) << "-------------------------------------";
1947 
1949  //SaveAllHistos();
1950 }
1951 
1952 
1953 void CbmMcbm2018MonitorMuch::SaveAllHistos(TString sFileName) {
1954  TDirectory* oldDir = NULL;
1955  TFile* histoFile = NULL;
1956  if ("" != sFileName) {
1957  // Store current directory position to allow restore later
1958  oldDir = gDirectory;
1959  // open separate histo file in recreate mode
1960  histoFile = new TFile(sFileName, "RECREATE");
1961  histoFile->cd();
1962  } // if( "" != sFileName )
1963 
1964  /***************************/
1965  gDirectory->mkdir("Sts_Raw");
1966  gDirectory->cd("Sts_Raw");
1967 
1968  for (UInt_t uModuleId = 0; uModuleId < 2; ++uModuleId) {
1969  fHistPadDistr[uModuleId]->Write();
1970  fRealHistPadDistr[uModuleId]->Write();
1971  }
1972  fhRate->Write();
1973  fhRateAdcCut->Write();
1974  fhStsMessType->Write();
1975  fhStsSysMessType->Write();
1976  fhStsMessTypePerDpb->Write();
1977  fhStsSysMessTypePerDpb->Write();
1978  fhPulserStatusMessType->Write();
1979  fhPulserMsStatusFieldType->Write();
1980  fhStsHitsElinkPerDpb->Write();
1981  fhStsFebChanAdcRaw_combined->Write();
1982  gDirectory->cd("..");
1983  /***************************/
1984 
1985  /***************************/
1986  gDirectory->mkdir("Sts_Feb");
1987  gDirectory->cd("Sts_Feb");
1988  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
1989  if (kTRUE == fUnpackParMuch->IsFebActive(uFebIdx)) {
1990  fhStsFebChanCntRaw[uFebIdx]->Write();
1991  fhStsFebChanCntRawGood[uFebIdx]->Write();
1992  fhStsFebChanAdcRaw[uFebIdx]->Write();
1993  fhStsFebChanAdcRawProf[uFebIdx]->Write();
1994  fhStsFebChanAdcCal[uFebIdx]->Write();
1995  fhStsFebChanAdcCalProf[uFebIdx]->Write();
1996  fhStsFebChanRawTs[uFebIdx]->Write();
1997  fhStsFebChanMissEvt[uFebIdx]->Write();
1998  fhStsFebChanMissEvtEvo[uFebIdx]->Write();
1999  fhStsFebAsicMissEvtEvo[uFebIdx]->Write();
2000  fhStsFebMissEvtEvo[uFebIdx]->Write();
2001  fhStsFebChanHitRateEvo[uFebIdx]->Write();
2002  fhStsFebChanHitRateProf[uFebIdx]->Write();
2003  fhStsFebAsicHitRateEvo[uFebIdx]->Write();
2004  fhStsFebHitRateEvo[uFebIdx]->Write();
2005  fhStsFebHitRateEvo_mskch[uFebIdx]->Write();
2006  fhStsFebHitRateEvo_mskch_adccut[uFebIdx]->Write();
2007  fhStsFebChanHitRateEvoLong[uFebIdx]->Write();
2008  fhStsFebAsicHitRateEvoLong[uFebIdx]->Write();
2009  fhStsFebHitRateEvoLong[uFebIdx]->Write();
2010  fhStsFebChanDistT[uFebIdx]->Write();
2011  for (UInt_t uFebIdxB = uFebIdx; uFebIdxB < fuNbFebs; ++uFebIdxB) {
2012  fhStsFebChanDtCoinc[uFebIdx][uFebIdxB]->Write();
2013  fhStsFebChanCoinc[uFebIdx][uFebIdxB]->Write();
2014  } // for( UInt_t uFebIdxB = uFebIdx; uFebIdxB < fuNbFebs; ++uFebIdxB )
2015  } // if( kTRUE == fUnpackParMuch->IsFebActive( uFebIdx ) )
2016  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
2017  gDirectory->cd("..");
2018  /***************************/
2019 
2020 
2022  gDirectory->mkdir("Sts_SmxErr");
2023  gDirectory->cd("Sts_SmxErr");
2024  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
2025  if (kTRUE == fUnpackParMuch->IsFebActive(uFebIdx)) {
2026  fhStsFebSmxErrRatioEvo[uFebIdx]->Write();
2027  fhStsFebSmxErrRatioEvoAsic[uFebIdx]->Write();
2028  fhStsFebSmxErrRatioCopyEvo[uFebIdx]->Write();
2029  fhStsFebSmxErrRatioCopyEvoAsic[uFebIdx]->Write();
2030  fhStsFebSmxErrRatioCopySameAdcEvo[uFebIdx]->Write();
2031  fhStsFebSmxErrRatioCopySameAdcEvoAsic[uFebIdx]->Write();
2032  } // if( kTRUE == fUnpackParMuch->IsFebActive( uFebIdx ) )
2033  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
2034  gDirectory->cd("..");
2036 
2037  /***************************/
2038  // Flib Histos
2039  gDirectory->mkdir("Flib_Raw");
2040  gDirectory->cd("Flib_Raw");
2041  for (UInt_t uLinks = 0; uLinks < kiMaxNbFlibLinks; uLinks++) {
2042  TString sMsSzName = Form("MsSz_link_%02u", uLinks);
2043  if (fHM->Exists(sMsSzName.Data())) fHM->H1(sMsSzName.Data())->Write();
2044 
2045  sMsSzName = Form("MsSzTime_link_%02u", uLinks);
2046  if (fHM->Exists(sMsSzName.Data())) fHM->P1(sMsSzName.Data())->Write();
2047  } // for( UInt_t uLinks = 0; uLinks < 16; uLinks ++)
2048 
2049  TH1* pMissedTsH1 = dynamic_cast<TH1*>(gROOT->FindObjectAny("Missed_TS"));
2050  if (NULL != pMissedTsH1) pMissedTsH1->Write();
2051 
2052  TProfile* pMissedTsEvoP =
2053  dynamic_cast<TProfile*>(gROOT->FindObjectAny("Missed_TS_Evo"));
2054  if (NULL != pMissedTsEvoP) pMissedTsEvoP->Write();
2055 
2056  gDirectory->cd("..");
2057  /***************************/
2058 
2059  if ("" != sFileName) {
2060  // Restore original directory position
2061  histoFile->Close();
2062  oldDir->cd();
2063  } // if( "" != sFileName )
2064 }
2066  LOG(info) << "Reseting all STS histograms.";
2067 
2068  for (UInt_t uModuleId = 0; uModuleId < 2; ++uModuleId) {
2069  fHistPadDistr[uModuleId]->Reset();
2070  fRealHistPadDistr[uModuleId]->Reset();
2071  }
2072 
2073  fhRate->Reset();
2074  fhRateAdcCut->Reset();
2075  fhStsMessType->Reset();
2076  fhStsSysMessType->Reset();
2077  fhStsMessTypePerDpb->Reset();
2078  fhStsSysMessTypePerDpb->Reset();
2079  fhPulserStatusMessType->Reset();
2080  fhPulserMsStatusFieldType->Reset();
2081  fhStsHitsElinkPerDpb->Reset();
2082  fhStsFebChanAdcRaw_combined->Reset();
2083 
2084  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
2085  if (kTRUE == fUnpackParMuch->IsFebActive(uFebIdx)) {
2086  fhStsFebChanCntRaw[uFebIdx]->Reset();
2087  fhStsFebChanCntRawGood[uFebIdx]->Reset();
2088  fhStsFebChanAdcRaw[uFebIdx]->Reset();
2089  fhStsFebChanAdcRawProf[uFebIdx]->Reset();
2090  fhStsFebChanAdcCal[uFebIdx]->Reset();
2091  fhStsFebChanAdcCalProf[uFebIdx]->Reset();
2092  fhStsFebChanRawTs[uFebIdx]->Reset();
2093  fhStsFebChanMissEvt[uFebIdx]->Reset();
2094  fhStsFebChanMissEvtEvo[uFebIdx]->Reset();
2095  fhStsFebAsicMissEvtEvo[uFebIdx]->Reset();
2096  fhStsFebMissEvtEvo[uFebIdx]->Reset();
2097  fhStsFebChanHitRateEvo[uFebIdx]->Reset();
2098  fhStsFebChanHitRateProf[uFebIdx]->Reset();
2099  fhStsFebAsicHitRateEvo[uFebIdx]->Reset();
2100  fhStsFebHitRateEvo[uFebIdx]->Reset();
2101  fhStsFebHitRateEvo_mskch[uFebIdx]->Reset();
2102  fhStsFebHitRateEvo_mskch_adccut[uFebIdx]->Reset();
2103  fhStsFebChanHitRateEvoLong[uFebIdx]->Reset();
2104  fhStsFebAsicHitRateEvoLong[uFebIdx]->Reset();
2105  fhStsFebHitRateEvoLong[uFebIdx]->Reset();
2106  fhStsFebChanDistT[uFebIdx]->Reset();
2107  for (UInt_t uFebIdxB = uFebIdx; uFebIdxB < fuNbFebs; ++uFebIdxB) {
2108  fhStsFebChanDtCoinc[uFebIdx][uFebIdxB]->Reset();
2109  fhStsFebChanCoinc[uFebIdx][uFebIdxB]->Reset();
2110  } // for( UInt_t uFebIdxB = uFebIdx; uFebIdxB < fuNbFebs; ++uFebIdxB )
2111 
2113  fhStsFebSmxErrRatioEvo[uFebIdx]->Reset();
2114  fhStsFebSmxErrRatioEvoAsic[uFebIdx]->Reset();
2115  fhStsFebSmxErrRatioCopyEvo[uFebIdx]->Reset();
2116  fhStsFebSmxErrRatioCopyEvoAsic[uFebIdx]->Reset();
2117  fhStsFebSmxErrRatioCopySameAdcEvo[uFebIdx]->Reset();
2118  fhStsFebSmxErrRatioCopySameAdcEvoAsic[uFebIdx]->Reset();
2120  } // if( kTRUE == fUnpackParMuch->IsFebActive( uFebIdx ) )
2121  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
2122 
2123  for (UInt_t uLinks = 0; uLinks < kiMaxNbFlibLinks; ++uLinks) {
2124  TString sMsSzName = Form("MsSz_link_%02u", uLinks);
2125  if (fHM->Exists(sMsSzName.Data())) fHM->H1(sMsSzName.Data())->Reset();
2126 
2127  sMsSzName = Form("MsSzTime_link_%02u", uLinks);
2128  if (fHM->Exists(sMsSzName.Data())) fHM->P1(sMsSzName.Data())->Reset();
2129  } // for( UInt_t uLinks = 0; uLinks < kiMaxNbFlibLinks; ++uLinks )
2130 
2131  fdStartTime = -1;
2132  fdStartTimeMsSz = -1;
2133 }
2134 
2136  Int_t timeIn,
2137  Int_t iBinSize) {
2138  TDatime* fRunStartDateTime = new TDatime(dateIn, timeIn);
2139  fiRunStartDateTimeSec = fRunStartDateTime->Convert();
2140  fiBinSizeDatePlots = iBinSize;
2141 
2142  LOG(info) << "Assigned new MUCH Run Start Date-Time: "
2143  << fRunStartDateTime->AsString();
2144 }
2145 
2147  UInt_t uBinSize) {
2148  fbLongHistoEnable = kTRUE;
2149  fuLongHistoNbSeconds = uDurationSeconds;
2150  fuLongHistoBinSizeSec = uBinSize;
2151 }
2156 
2157  if (kTRUE == fbSmx2ErrorUseNoiseLevels) {
2163  } // if( kTRUE == fbSmx2ErrorUseNoiseLevels )
2164 
2171  fvuSmxErrIdxLastHit.resize(fuNbFebs);
2172  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
2180  for (UInt_t uAsicIdx = 0; uAsicIdx < fUnpackParMuch->GetNbAsicsPerFeb();
2181  ++uAsicIdx) {
2182  //fvulLastHitTs[ uXyterIdx ].resize( fuNbChanPerAsic, 0 );
2183  fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx].resize(kuSmxErrCoincWinNbHits,
2184  -1.0);
2185  fvuSmxErrIdxFirstHitM07[uFebIdx][uAsicIdx] = kuSmxErrCoincWinNbHits;
2186  fvuSmxErrIdxFirstHitM08[uFebIdx][uAsicIdx] = kuSmxErrCoincWinNbHits;
2187  fvuSmxErrIdxFirstHitM09[uFebIdx][uAsicIdx] = kuSmxErrCoincWinNbHits;
2188  fvuSmxErrIdxFirstHitM10[uFebIdx][uAsicIdx] = kuSmxErrCoincWinNbHits;
2189  fvuSmxErrIdxFirstHitM11[uFebIdx][uAsicIdx] = kuSmxErrCoincWinNbHits;
2190  fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx] = kuSmxErrCoincWinNbHits;
2191  } // for( UInt_t uAsicIdx = 0; uAsicIdx < fUnpackParMuch->GetNbAsicsPerFeb(); ++uAsicIdx )
2192  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
2193 }
2194 
2196  UInt_t uAsicIdx,
2197  Double_t dNewHitTime) {
2198  if (kuSmxErrCoincWinNbHits == fvuSmxErrIdxFirstHitM07[uFebIdx][uAsicIdx]
2199  && kuSmxErrCoincWinNbHits == fvuSmxErrIdxFirstHitM08[uFebIdx][uAsicIdx]
2200  && kuSmxErrCoincWinNbHits == fvuSmxErrIdxFirstHitM09[uFebIdx][uAsicIdx]
2201  && kuSmxErrCoincWinNbHits == fvuSmxErrIdxFirstHitM10[uFebIdx][uAsicIdx]
2202  && kuSmxErrCoincWinNbHits == fvuSmxErrIdxFirstHitM11[uFebIdx][uAsicIdx]
2203  && kuSmxErrCoincWinNbHits == fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx]) {
2205  fvuSmxErrIdxFirstHitM07[uFebIdx][uAsicIdx] = 4;
2206  fvuSmxErrIdxFirstHitM08[uFebIdx][uAsicIdx] = 3;
2207  fvuSmxErrIdxFirstHitM09[uFebIdx][uAsicIdx] = 2;
2208  fvuSmxErrIdxFirstHitM10[uFebIdx][uAsicIdx] = 1;
2209  fvuSmxErrIdxFirstHitM11[uFebIdx][uAsicIdx] = 0;
2210  fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx] = 0;
2211  fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2212  [fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx]] = dNewHitTime;
2213 
2215  return kFALSE;
2216  }
2217  else if (kuSmxErrCoincWinNbHits - 1
2218  == fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx]
2219  - fvuSmxErrIdxFirstHitM11[uFebIdx][uAsicIdx]
2220  || fvuSmxErrIdxFirstHitM11[uFebIdx][uAsicIdx] - 1
2221  == fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx]) {
2223  fvuSmxErrIdxFirstHitM07[uFebIdx][uAsicIdx] =
2224  (fvuSmxErrIdxFirstHitM07[uFebIdx][uAsicIdx] + 1) % kuSmxErrCoincWinNbHits;
2225  fvuSmxErrIdxFirstHitM08[uFebIdx][uAsicIdx] =
2226  (fvuSmxErrIdxFirstHitM08[uFebIdx][uAsicIdx] + 1) % kuSmxErrCoincWinNbHits;
2227  fvuSmxErrIdxFirstHitM09[uFebIdx][uAsicIdx] =
2228  (fvuSmxErrIdxFirstHitM09[uFebIdx][uAsicIdx] + 1) % kuSmxErrCoincWinNbHits;
2229  fvuSmxErrIdxFirstHitM10[uFebIdx][uAsicIdx] =
2230  (fvuSmxErrIdxFirstHitM10[uFebIdx][uAsicIdx] + 1) % kuSmxErrCoincWinNbHits;
2231  fvuSmxErrIdxFirstHitM11[uFebIdx][uAsicIdx] =
2232  (fvuSmxErrIdxFirstHitM11[uFebIdx][uAsicIdx] + 1) % kuSmxErrCoincWinNbHits;
2233  fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx] =
2234  (fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx] + 1) % kuSmxErrCoincWinNbHits;
2235  fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2236  [fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx]] = dNewHitTime;
2237  }
2238  else {
2240  fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx] =
2241  fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx] + 1;
2242  fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2243  [fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx]] = dNewHitTime;
2244 
2246  return kFALSE;
2247  }
2248 
2250  Double_t dTimeDiff07 =
2251  fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2252  [fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx]]
2253  - fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2254  [fvuSmxErrIdxFirstHitM07[uFebIdx][uAsicIdx]];
2255  Double_t dTimeDiff08 =
2256  fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2257  [fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx]]
2258  - fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2259  [fvuSmxErrIdxFirstHitM08[uFebIdx][uAsicIdx]];
2260  Double_t dTimeDiff09 =
2261  fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2262  [fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx]]
2263  - fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2264  [fvuSmxErrIdxFirstHitM09[uFebIdx][uAsicIdx]];
2265  Double_t dTimeDiff10 =
2266  fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2267  [fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx]]
2268  - fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2269  [fvuSmxErrIdxFirstHitM10[uFebIdx][uAsicIdx]];
2270  Double_t dTimeDiff11 =
2271  fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2272  [fvuSmxErrIdxLastHit[uFebIdx][uAsicIdx]]
2273  - fvdSmxErrTimeLastHits[uFebIdx][uAsicIdx]
2274  [fvuSmxErrIdxFirstHitM11[uFebIdx][uAsicIdx]];
2275 
2276 
2278  if ((kdSmxErrCoincWinBeg <= dTimeDiff07 && dTimeDiff07 <= fdSmxErrCoincWinM07)
2279  || (kdSmxErrCoincWinBeg <= dTimeDiff08
2280  && dTimeDiff08 <= fdSmxErrCoincWinM08)
2281  || (kdSmxErrCoincWinBeg <= dTimeDiff09
2282  && dTimeDiff09 <= fdSmxErrCoincWinM09)
2283  || (kdSmxErrCoincWinBeg <= dTimeDiff10
2284  && dTimeDiff10 <= fdSmxErrCoincWinM10)
2285  || (kdSmxErrCoincWinBeg <= dTimeDiff11
2286  && dTimeDiff11 <= fdSmxErrCoincWinM11)) {
2287  return kTRUE;
2288  }
2289  else {
2290  return kFALSE;
2291  }
2292 }
2294 Bool_t CbmMcbm2018MonitorMuch::ScanForNoisyChannels(Double_t dNoiseThreshold) {
2295  for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
2296  if (kTRUE == fUnpackParMuch->IsFebActive(uFebIdx)) {
2297  LOG(info) << Form(
2298  " ------------------ Noisy channels scan for FEB %2d ------------",
2299  uFebIdx);
2300  for (UInt_t uAsicIdx = 0; uAsicIdx < fUnpackParMuch->GetNbAsicsPerFeb();
2301  ++uAsicIdx)
2302  for (UInt_t uChanIdx = 0; uChanIdx < fUnpackParMuch->GetNbChanPerAsic();
2303  ++uChanIdx) {
2304  UInt_t uChanInFeb =
2305  uAsicIdx * fUnpackParMuch->GetNbChanPerAsic() + uChanIdx;
2306  if (dNoiseThreshold
2307  < fhStsFebChanHitRateProf[uFebIdx]->GetBinContent(1 + uChanInFeb))
2308  LOG(info) << Form(
2309  "Noisy Channel ASIC %d channel %3d (%4d) level %6.0f",
2310  uAsicIdx,
2311  uChanIdx,
2312  uChanInFeb,
2313  fhStsFebChanHitRateProf[uFebIdx]->GetBinContent(1 + uChanInFeb));
2314 
2315  } // for( UInt_t uChanIdx = 0; uChanIdx < fUnpackParMuch->GetNbChanPerAsic(); ++uChanIdx )
2316 
2317  LOG(info)
2318  << " ---------------------------------------------------------------";
2319  } // if( kTRUE == fUnpackParMuch->IsFebActive( uFebIdx ) )
2320  } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
2321  return kTRUE;
2322 }
2324 
CbmMcbm2018MonitorMuch::DoUnpack
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
Definition: CbmMcbm2018MonitorMuch.cxx:1197
CbmMcbm2018MonitorMuch::fhStsFebChanRawTs
std::vector< TH2 * > fhStsFebChanRawTs
Definition: CbmMcbm2018MonitorMuch.h:231
CbmHistManager::P1
TProfile * P1(const std::string &name) const
Return pointer to TProfile.
Definition: CbmHistManager.h:263
CbmMcbm2018MonitorMuch::fviFebCountsSinceLastRateUpdate
std::vector< Int_t > fviFebCountsSinceLastRateUpdate
Definition: CbmMcbm2018MonitorMuch.h:188
CbmHistManager::Exists
Bool_t Exists(const std::string &name) const
Check existence of histogram in manager.
Definition: CbmHistManager.h:303
CbmMcbm2018MonitorMuch::fvmHitsInMs
std::vector< stsxyter::FinalHit > fvmHitsInMs
Hits time-sorting.
Definition: CbmMcbm2018MonitorMuch.h:178
CbmMcbm2018MuchPar::GetNbAsicsPerCrob
static constexpr UInt_t GetNbAsicsPerCrob()
Definition: CbmMcbm2018MuchPar.h:44
CbmMcbm2018MonitorMuch::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: CbmMcbm2018MonitorMuch.h:180
CbmMcbm2018MonitorMuch::fuLongHistoBinSizeSec
UInt_t fuLongHistoBinSizeSec
Definition: CbmMcbm2018MonitorMuch.h:193
CbmMcbm2018MonitorMuch::FillEpochInfo
void FillEpochInfo(stsxyter::Message mess)
Definition: CbmMcbm2018MonitorMuch.cxx:1924
CbmMcbm2018MonitorMuch::kdSmxErrCoincWinNoiseM09
constexpr static const Double_t kdSmxErrCoincWinNoiseM09
Definition: CbmMcbm2018MonitorMuch.h:264
CbmMcbm2018MonitorMuch::fvdFebAdcGain
std::vector< std::vector< std::vector< Double_t > > > fvdFebAdcGain
Number of StsXyter ASICs.
Definition: CbmMcbm2018MonitorMuch.h:113
CbmMcbm2018MuchPar::IsCrobActive
Bool_t IsCrobActive(UInt_t uDpbIdx, UInt_t uCrobIdx)
Definition: CbmMcbm2018MuchPar.cxx:151
CbmMcbm2018MonitorMuch::fhStsFebAsicHitRateEvoLong
std::vector< TH2 * > fhStsFebAsicHitRateEvoLong
Definition: CbmMcbm2018MonitorMuch.h:243
CbmMcbm2018MonitorMuch::fhStsFebChanAdcRaw
std::vector< TH2 * > fhStsFebChanAdcRaw
Definition: CbmMcbm2018MonitorMuch.h:227
CbmMcbm2018MonitorMuch::CreateHistograms
void CreateHistograms()
Definition: CbmMcbm2018MonitorMuch.cxx:449
CbmMcbm2018MonitorMuch::AddMsComponentToList
virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Definition: CbmMcbm2018MonitorMuch.cxx:338
CbmMcbm2018MonitorMuch::fhStsHitsElinkPerDpb
TH2 * fhStsHitsElinkPerDpb
Definition: CbmMcbm2018MonitorMuch.h:212
CbmMcbm2018MonitorMuch::InitStsParameters
Bool_t InitStsParameters()
Definition: CbmMcbm2018MonitorMuch.cxx:212
CbmMcbm2018MonitorMuch::fhStsFebSmxErrRatioEvo
std::vector< TProfile * > fhStsFebSmxErrRatioEvo
Histograms.
Definition: CbmMcbm2018MonitorMuch.h:291
CbmMcbm2018MonitorMuch::kiMaxNbFlibLinks
static const Int_t kiMaxNbFlibLinks
ADC offset in e-, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ].
Definition: CbmMcbm2018MonitorMuch.h:118
CbmMcbm2018MonitorMuch::fvusChanLastHitAdcInMs
std::vector< std::vector< std::vector< UShort_t > > > fvusChanLastHitAdcInMs
Last hit time in bins in each MS for each Channel.
Definition: CbmMcbm2018MonitorMuch.h:164
CbmMcbm2018MuchPar::GetNbElinkPerCrob
static constexpr UInt_t GetNbElinkPerCrob()
Definition: CbmMcbm2018MuchPar.h:38
CbmMcbm2018MonitorMuch::fhStsFebChanAdcRawProf
std::vector< TProfile * > fhStsFebChanAdcRawProf
Definition: CbmMcbm2018MonitorMuch.h:228
CbmMcbm2018MonitorMuch::fhStsSysMessTypePerDpb
TH2 * fhStsSysMessTypePerDpb
Definition: CbmMcbm2018MonitorMuch.h:209
CbmMcbm2018MonitorMuch::fulCurrentTsIdx
ULong64_t fulCurrentTsIdx
TS/MS info.
Definition: CbmMcbm2018MonitorMuch.h:129
CbmMcbm2018MuchPar::ElinkIdxToAsicIdx
UInt_t ElinkIdxToAsicIdx(UInt_t uElink)
Definition: CbmMcbm2018MuchPar.h:60
CbmMcbm2018MonitorMuch::Init
virtual Bool_t Init()
Definition: CbmMcbm2018MonitorMuch.cxx:180
CbmMcbm2018MonitorMuch::fuCurrDpbIdx
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
Definition: CbmMcbm2018MonitorMuch.h:138
CbmMcbm2018MonitorMuch::ResetAllHistos
void ResetAllHistos()
Definition: CbmMcbm2018MonitorMuch.cxx:2065
CbmMcbm2018MonitorMuch::fbMuchMode
Bool_t fbMuchMode
Definition: CbmMcbm2018MonitorMuch.h:92
CbmMcbm2018MonitorMuch::fcMsSizeAll
TCanvas * fcMsSizeAll
Definition: CbmMcbm2018MonitorMuch.h:299
CbmMcbm2018MonitorMuch::SetParContainers
void SetParContainers()
Definition: CbmMcbm2018MonitorMuch.cxx:189
CbmMcbm2018MonitorMuch::Reset
virtual void Reset()
Definition: CbmMcbm2018MonitorMuch.cxx:1929
CbmMcbm2018MonitorMuch::fbSmx2ErrorUseNoiseLevels
Bool_t fbSmx2ErrorUseNoiseLevels
SXM 2.0 logic error detection and tagging, 1 eLink case.
Definition: CbmMcbm2018MonitorMuch.h:251
CbmMcbm2018MonitorMuch::kdSmxErrCoincWinNoiseM07
constexpr static const Double_t kdSmxErrCoincWinNoiseM07
Coincidence windows 99.9% tagging (up to 0.1% of corruption not detected)
Definition: CbmMcbm2018MonitorMuch.h:262
CbmMcbm2018MuchPar.h
CbmMcbm2018MonitorMuch::Counter
UInt_t Counter
Definition: CbmMcbm2018MonitorMuch.h:195
CbmMcbm2018MonitorMuch::fbLongHistoEnable
Bool_t fbLongHistoEnable
Rate evolution histos.
Definition: CbmMcbm2018MonitorMuch.h:191
bMcbm2018ScanNoisyMuch
Bool_t bMcbm2018ScanNoisyMuch
Definition: CbmMcbm2018MonitorMuch.cxx:44
bMcbm2018WriteMuch
Bool_t bMcbm2018WriteMuch
Definition: CbmMcbm2018MonitorMuch.cxx:43
stsxyter::Message
Definition: StsXyterMessage.h:165
CbmMcbm2018MonitorMuch::fhPulserStatusMessType
TH2 * fhPulserStatusMessType
Definition: CbmMcbm2018MonitorMuch.h:210
CbmMcbm2018MuchPar::GetDpbId
UInt_t GetDpbId(UInt_t uDpbIdx)
Definition: CbmMcbm2018MuchPar.cxx:142
CbmMcbm2018MonitorMuch::kuBytesPerMessage
static const UInt_t kuBytesPerMessage
Definition: CbmMcbm2018MonitorMuch.h:119
gdpbv100::msg_print_Human
@ msg_print_Human
Definition: gDpbMessv100.h:91
CbmMcbm2018MonitorMuch::fhStsFebAsicMissEvtEvo
std::vector< TH2 * > fhStsFebAsicMissEvtEvo
Definition: CbmMcbm2018MonitorMuch.h:234
CbmMcbm2018MuchPar::GetNbFebsPerDpb
static constexpr UInt_t GetNbFebsPerDpb()
Definition: CbmMcbm2018MuchPar.h:40
stsxyter::MessType::Status
@ Status
CbmMcbm2018MonitorMuch::fdSmxErrCoincWinM08
Double_t fdSmxErrCoincWinM08
Definition: CbmMcbm2018MonitorMuch.h:269
CbmMcbm2018MonitorMuch::fdSmxErrCoincWinM11
Double_t fdSmxErrCoincWinM11
Definition: CbmMcbm2018MonitorMuch.h:272
CbmMcbm2018MuchPar::GetRealPadSize
Double_t GetRealPadSize(Int_t)
Definition: CbmMcbm2018MuchPar.cxx:305
CbmMcbm2018MonitorMuch::fvdChanLastHitTime
std::vector< std::vector< Double_t > > fvdChanLastHitTime
Last hit time in bins for each Channel.
Definition: CbmMcbm2018MonitorMuch.h:155
CbmMcbm2018MonitorMuch::fdCoincBorder
Double_t fdCoincBorder
Definition: CbmMcbm2018MonitorMuch.h:199
CbmMcbm2018MonitorMuch::fhStsFebChanMissEvtEvo
std::vector< TH2 * > fhStsFebChanMissEvtEvo
Definition: CbmMcbm2018MonitorMuch.h:233
CbmMcbm2018MonitorMuch::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: CbmMcbm2018MonitorMuch.h:182
CbmMcbm2018MuchPar::GetNbAsicsPerFeb
static constexpr UInt_t GetNbAsicsPerFeb()
Definition: CbmMcbm2018MuchPar.h:43
CbmMcbm2018MonitorMuch::fhStsMessTypePerDpb
TH2 * fhStsMessTypePerDpb
Definition: CbmMcbm2018MonitorMuch.h:208
CbmMcbm2018MonitorMuch::fvuSmxErrIdxFirstHitM07
std::vector< std::vector< UInt_t > > fvuSmxErrIdxFirstHitM07
[ NbFebs ][ NbSmxPerFeb ][ kuSmxErrCoincWinNbHits ]
Definition: CbmMcbm2018MonitorMuch.h:276
CbmMcbm2018MuchPar::GetNrOfDpbs
UInt_t GetNrOfDpbs()
Definition: CbmMcbm2018MuchPar.h:68
stsxyter::Message::GetTsMsbVal
uint32_t GetTsMsbVal() const
For TS MSB data: Returns the TS MSB 22 bit field)
Definition: StsXyterMessage.h:334
CbmMcbm2018MonitorMuch::fdStartTimeMsSz
Double_t fdStartTimeMsSz
Definition: CbmMcbm2018MonitorMuch.h:172
CbmMcbm2018MuchPar::GetNbChanPerFeb
static constexpr UInt_t GetNbChanPerFeb()
Definition: CbmMcbm2018MuchPar.h:51
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
CbmMcbm2018MonitorMuch::fhStsFebHitRateEvo_mskch_adccut
std::vector< TH1 * > fhStsFebHitRateEvo_mskch_adccut
Definition: CbmMcbm2018MonitorMuch.h:241
stsxyter::MessType
MessType
Message types.
Definition: StsXyterMessage.h:27
CbmMcbm2018MonitorMuch::SetLongDurationLimits
void SetLongDurationLimits(UInt_t uDurationSeconds=3600, UInt_t uBinSize=1)
Definition: CbmMcbm2018MonitorMuch.cxx:2146
CbmMcbm2018MonitorMuch::fdSmxErrCoincWinM07
Double_t fdSmxErrCoincWinM07
Tagging variables.
Definition: CbmMcbm2018MonitorMuch.h:268
CbmMcbm2018MonitorMuch::fRealHistPadDistr
std::vector< TH2 * > fRealHistPadDistr
Definition: CbmMcbm2018MonitorMuch.h:222
CbmMcbm2018MonitorMuch::fdStsFebChanLastTimeForDist
std::vector< std::vector< Double_t > > fdStsFebChanLastTimeForDist
Definition: CbmMcbm2018MonitorMuch.h:245
CbmMcbm2018MonitorMuch::fiRunStartDateTimeSec
Int_t fiRunStartDateTimeSec
Index of the DPB from which the MS currently unpacked is coming.
Definition: CbmMcbm2018MonitorMuch.h:140
CbmMcbm2018MonitorMuch::InitContainers
Bool_t InitContainers()
Definition: CbmMcbm2018MonitorMuch.cxx:197
CbmMcbm2018MonitorMuch::fiBinSizeDatePlots
Int_t fiBinSizeDatePlots
Start of run time since "epoch" in s, for the plots with date as X axis.
Definition: CbmMcbm2018MonitorMuch.h:141
stsxyter::kulTsCycleNbBins
static const uint64_t kulTsCycleNbBins
Definition: StsXyterMessage.h:152
CbmMcbm2018MonitorMuch::fsHistoFileFullname
TString fsHistoFileFullname
Definition: CbmMcbm2018MonitorMuch.h:123
CbmMcbm2018MonitorMuch::fvuInitialHeaderDone
std::vector< UInt_t > fvuInitialHeaderDone
Current TS MSB cycle for DPB.
Definition: CbmMcbm2018MonitorMuch.h:147
CbmMcbm2018MonitorMuch::fhRateAdcCut
TH1 * fhRateAdcCut
Definition: CbmMcbm2018MonitorMuch.h:215
CbmMcbm2018MonitorMuch::fbIgnoreOverlapMs
Bool_t fbIgnoreOverlapMs
Definition: CbmMcbm2018MonitorMuch.h:102
CbmMcbm2018MonitorMuch::fhStsFebSmxErrRatioCopyEvoAsic
std::vector< TProfile2D * > fhStsFebSmxErrRatioCopyEvoAsic
Definition: CbmMcbm2018MonitorMuch.h:294
CbmMcbm2018MonitorMuch::fbPrintMessages
Bool_t fbPrintMessages
Task configuration values.
Definition: CbmMcbm2018MonitorMuch.h:125
CbmMcbm2018MonitorMuch::fhStsFebSmxErrRatioCopySameAdcEvoAsic
std::vector< TProfile2D * > fhStsFebSmxErrRatioCopySameAdcEvoAsic
Definition: CbmMcbm2018MonitorMuch.h:296
CbmMcbm2018MonitorMuch::fhStsFebChanCntRaw
std::vector< TH1 * > fhStsFebChanCntRaw
Definition: CbmMcbm2018MonitorMuch.h:225
CbmMcbm2018MonitorMuch::fHM
CbmHistManager * fHM
Histograms.
Definition: CbmMcbm2018MonitorMuch.h:204
CbmHistManager.h
Histogram manager.
CbmMcbm2018MonitorMuch::CbmMcbm2018MonitorMuch
CbmMcbm2018MonitorMuch()
Definition: CbmMcbm2018MonitorMuch.cxx:46
CbmMcbm2018MonitorMuch::fuLongHistoNbSeconds
UInt_t fuLongHistoNbSeconds
Definition: CbmMcbm2018MonitorMuch.h:192
CbmMcbm2018MonitorMuch::fuNbFebs
UInt_t fuNbFebs
Array to hold the active flag for all CROBs, [ NbDpb ][ NbCrobPerDpb ].
Definition: CbmMcbm2018MonitorMuch.h:110
CbmMcbm2018MonitorMuch::fvdPrevMsTime
std::vector< Double_t > fvdPrevMsTime
Last hit time in ns for each Channel.
Definition: CbmMcbm2018MonitorMuch.h:157
stsxyter::Message::IsHitMissedEvts
bool IsHitMissedEvts() const
For Hit data: Returns Missed event flag (1 bit field)
Definition: StsXyterMessage.h:301
CbmMcbm2018MonitorMuch::fhMsSz
TH1 * fhMsSz[kiMaxNbFlibLinks]
Definition: CbmMcbm2018MonitorMuch.h:300
CbmMcbm2018MonitorMuch::kuSmxErrCoincWinNbHits
static const UInt_t kuSmxErrCoincWinNbHits
Definition: CbmMcbm2018MonitorMuch.h:252
CbmMcbm2018MonitorMuch::fhStsFebChanCntRawGood
std::vector< TH1 * > fhStsFebChanCntRawGood
Definition: CbmMcbm2018MonitorMuch.h:226
CbmMcbm2018MonitorMuch::fvdSmxErrTimeLastHits
std::vector< std::vector< std::vector< Double_t > > > fvdSmxErrTimeLastHits
Definition: CbmMcbm2018MonitorMuch.h:274
CbmMcbm2018MonitorMuch::SaveAllHistos
void SaveAllHistos(TString sFileName="")
Definition: CbmMcbm2018MonitorMuch.cxx:1953
CbmMcbm2018MonitorMuch::kdSmxErrCoincWinBeg
constexpr static const Double_t kdSmxErrCoincWinBeg
Definition: CbmMcbm2018MonitorMuch.h:253
stsxyter::Message::GetHitAdc
uint16_t GetHitAdc() const
For Hit data: Returns ADC value (5 bit field)
Definition: StsXyterMessage.h:277
CbmMcbm2018MuchPar::GetPadYA
Short_t GetPadYA(UShort_t febid, UShort_t channelid)
Definition: CbmMcbm2018MuchPar.cxx:228
CbmMcbm2018MuchPar::IsFebActive
Bool_t IsFebActive(UInt_t uFebInSystIdx)
Definition: CbmMcbm2018MuchPar.cxx:171
CbmMcbm2018MonitorMuch::fhStsFebSmxErrRatioEvoAsic
std::vector< TProfile2D * > fhStsFebSmxErrRatioEvoAsic
Definition: CbmMcbm2018MonitorMuch.h:292
CbmMcbm2018MonitorMuch::fuLongHistoBinNb
UInt_t fuLongHistoBinNb
Definition: CbmMcbm2018MonitorMuch.h:194
CbmMcbm2018MonitorMuch::fvbCrobActiveFlag
std::vector< std::vector< Bool_t > > fvbCrobActiveFlag
Map of DPB Identifier to DPB index.
Definition: CbmMcbm2018MonitorMuch.h:109
CbmMcbm2018MonitorMuch::fiTimeIntervalRateUpdate
Int_t fiTimeIntervalRateUpdate
Mean Rate per channel plots.
Definition: CbmMcbm2018MonitorMuch.h:186
CbmMcbm2018MonitorMuch::SmxErrCheckCoinc
Bool_t SmxErrCheckCoinc(UInt_t uFebIdx, UInt_t uAsicIdx, Double_t dNewHitTime)
Definition: CbmMcbm2018MonitorMuch.cxx:2195
CbmMcbm2018MonitorMuch::fdStartTime
Long64_t fdStartTime
Last hit ADC in bins in each MS for each Channel.
Definition: CbmMcbm2018MonitorMuch.h:168
CbmMcbm2018MonitorMuch::fhStsFebChanCoinc
std::vector< std::vector< TH2 * > > fhStsFebChanCoinc
Definition: CbmMcbm2018MonitorMuch.h:248
CbmMcbm2018MonitorMuch::kdSmxErrCoincWinNoiseM11
constexpr static const Double_t kdSmxErrCoincWinNoiseM11
Definition: CbmMcbm2018MonitorMuch.h:266
CbmHistManager
Histogram manager.
Definition: CbmHistManager.h:41
stsxyter::MessType::Empty
@ Empty
CbmMcbm2018MonitorMuch::fvuSmxErrIdxLastHit
std::vector< std::vector< UInt_t > > fvuSmxErrIdxLastHit
[ NbFebs ][ NbSmxPerFeb ]
Definition: CbmMcbm2018MonitorMuch.h:285
h
Data class with information on a STS local track.
CbmMcbm2018MonitorMuch::fhStsFebChanMissEvt
std::vector< TH2 * > fhStsFebChanMissEvt
Definition: CbmMcbm2018MonitorMuch.h:232
CbmMcbm2018MuchPar::GetNbCrobsPerDpb
static constexpr UInt_t GetNbCrobsPerDpb()
Definition: CbmMcbm2018MuchPar.h:37
CbmMcbm2018MonitorMuch::fhStsFebChanAdcCal
std::vector< TH2 * > fhStsFebChanAdcCal
Definition: CbmMcbm2018MonitorMuch.h:229
CbmMcbm2018MonitorMuch::fhStsFebMissEvtEvo
std::vector< TH1 * > fhStsFebMissEvtEvo
Definition: CbmMcbm2018MonitorMuch.h:235
CbmMcbm2018MonitorMuch::FillTsMsbInfo
void FillTsMsbInfo(stsxyter::Message mess, UInt_t uMessIdx=0, UInt_t uMsIdx=0)
Definition: CbmMcbm2018MonitorMuch.cxx:1858
CbmMcbm2018MuchPar::GetRealX
Double_t GetRealX(Int_t)
Definition: CbmMcbm2018MuchPar.cxx:294
CbmMcbm2018MonitorMuch::fbEnableCoincidenceMaps
Bool_t fbEnableCoincidenceMaps
Definition: CbmMcbm2018MonitorMuch.h:127
stsxyter::FinalHit
Definition: StsXyterFinalHit.h:16
CbmMcbm2018MonitorMuch::fdCoincMax
Double_t fdCoincMax
Definition: CbmMcbm2018MonitorMuch.h:201
CbmMcbm2018MonitorMuch::fhStsSysMessType
TH1 * fhStsSysMessType
Definition: CbmMcbm2018MonitorMuch.h:206
stsxyter::MessType::Hit
@ Hit
CbmMcbm2018MonitorMuch::fviFebTimeSecLastRateUpdate
std::vector< Int_t > fviFebTimeSecLastRateUpdate
Definition: CbmMcbm2018MonitorMuch.h:187
CbmMcbm2018MonitorMuch::fmMsgCounter
std::map< stsxyter::MessType, UInt_t > fmMsgCounter
Current data properties.
Definition: CbmMcbm2018MonitorMuch.h:132
CbmMcbm2018MonitorMuch::fvulCurrentTsMsb
std::vector< ULong64_t > fvulCurrentTsMsb
Bin size in s for the plots with date as X axis.
Definition: CbmMcbm2018MonitorMuch.h:144
stsxyter::kuHitNbTsBins
static const uint32_t kuHitNbTsBins
Definition: StsXyterMessage.h:146
CbmMcbm2018MonitorMuch::fhStsFebChanHitRateEvo
std::vector< TH2 * > fhStsFebChanHitRateEvo
Definition: CbmMcbm2018MonitorMuch.h:236
stsxyter::Message::GetStatusStatus
uint16_t GetStatusStatus() const
For Status data: Returns the Status field from ACK frame (4 bit field)
Definition: StsXyterMessage.h:359
CbmMcbm2018MonitorMuch::fdSmxErrCoincWinM10
Double_t fdSmxErrCoincWinM10
Definition: CbmMcbm2018MonitorMuch.h:271
CbmMcbm2018MonitorMuch::FillHitInfo
void FillHitInfo(stsxyter::Message mess, const UShort_t &usElinkIdx, const UInt_t &uAsicIdx, const UInt_t &uMsIdx)
Definition: CbmMcbm2018MonitorMuch.cxx:1702
CbmMcbm2018MonitorMuch::fvuSmxErrIdxFirstHitM08
std::vector< std::vector< UInt_t > > fvuSmxErrIdxFirstHitM08
[ NbFebs ][ NbSmxPerFeb ]
Definition: CbmMcbm2018MonitorMuch.h:278
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmMcbm2018MonitorMuch::fUnpackParMuch
CbmMcbm2018MuchPar * fUnpackParMuch
/‍** Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice **‍/
Definition: CbmMcbm2018MonitorMuch.h:104
CbmMcbm2018MuchPar::GetNrOfAsics
UInt_t GetNrOfAsics()
Definition: CbmMcbm2018MuchPar.h:72
CbmMcbm2018MonitorMuch
Definition: CbmMcbm2018MonitorMuch.h:35
CbmHistManager::H1
TH1 * H1(const std::string &name) const
Return pointer to TH1 histogram.
Definition: CbmHistManager.h:170
CbmMcbm2018MonitorMuch::fPrintMessCtrl
stsxyter::MessagePrintMask fPrintMessCtrl
Definition: CbmMcbm2018MonitorMuch.h:126
CbmMcbm2018MonitorMuch::Finish
virtual void Finish()
Definition: CbmMcbm2018MonitorMuch.cxx:1931
CbmMcbm2018MonitorMuch::fuNbOverMsPerTs
size_t fuNbOverMsPerTs
Definition: CbmMcbm2018MonitorMuch.h:100
CbmMcbm2018MonitorMuch::fhStsFebChanHitRateProf
std::vector< TProfile * > fhStsFebChanHitRateProf
Definition: CbmMcbm2018MonitorMuch.h:237
CbmMcbm2018MonitorMuch::fvuSmxErrIdxFirstHitM09
std::vector< std::vector< UInt_t > > fvuSmxErrIdxFirstHitM09
[ NbFebs ][ NbSmxPerFeb ]
Definition: CbmMcbm2018MonitorMuch.h:280
CbmMcbm2018MonitorMuch::ProcessStsMs
Bool_t ProcessStsMs(const fles::Timeslice &ts, size_t uMsComp, UInt_t uMsIdx)
Definition: CbmMcbm2018MonitorMuch.cxx:1488
stsxyter::kdClockCycleNs
static const double kdClockCycleNs
Definition: StsXyterMessage.h:156
CbmMcbm2018MonitorMuch::fhStsFebSmxErrRatioCopyEvo
std::vector< TProfile * > fhStsFebSmxErrRatioCopyEvo
Definition: CbmMcbm2018MonitorMuch.h:293
CbmMcbm2018MonitorMuch::ReInitContainers
Bool_t ReInitContainers()
Definition: CbmMcbm2018MonitorMuch.cxx:206
CbmMcbm2018MuchPar
Definition: CbmMcbm2018MuchPar.h:19
CbmMcbm2018MonitorMuch::~CbmMcbm2018MonitorMuch
virtual ~CbmMcbm2018MonitorMuch()
Definition: CbmMcbm2018MonitorMuch.cxx:178
CbmMcbm2018MonitorMuch::SetRunStart
void SetRunStart(Int_t dateIn, Int_t timeIn, Int_t iBinSize=5)
Definition: CbmMcbm2018MonitorMuch.cxx:2135
CbmMcbm2018MonitorMuch::fvdMsTime
std::vector< Double_t > fvdMsTime
Header time of previous MS per link.
Definition: CbmMcbm2018MonitorMuch.h:158
CbmMcbm2018MuchPar::GetNrOfFebs
UInt_t GetNrOfFebs()
Definition: CbmMcbm2018MuchPar.h:71
stsxyter::Message::GetMessType
MessType GetMessType() const
Returns the message type, see enum MessType.
Definition: StsXyterMessage.h:259
CbmMcbm2018MonitorMuch::fhStsFebAsicHitRateEvo
std::vector< TH2 * > fhStsFebAsicHitRateEvo
Definition: CbmMcbm2018MonitorMuch.h:238
CbmMcbm2018MonitorMuch::fvuSmxErrIdxFirstHitM11
std::vector< std::vector< UInt_t > > fvuSmxErrIdxFirstHitM11
[ NbFebs ][ NbSmxPerFeb ]
Definition: CbmMcbm2018MonitorMuch.h:284
CbmMcbm2018MonitorMuch::fvdFebChanCountsSinceLastRateUpdate
std::vector< std::vector< Double_t > > fvdFebChanCountsSinceLastRateUpdate
Definition: CbmMcbm2018MonitorMuch.h:189
CbmMcbm2018MonitorMuch::fhStsFebChanHitRateEvoLong
std::vector< TH2 * > fhStsFebChanHitRateEvoLong
Definition: CbmMcbm2018MonitorMuch.h:242
CbmMcbm2018MonitorMuch::fuNbCoreMsPerTs
size_t fuNbCoreMsPerTs
Definition: CbmMcbm2018MonitorMuch.h:99
CbmMcbm2018MonitorMuch::fhStsFebChanAdcRaw_combined
TH1 * fhStsFebChanAdcRaw_combined
Definition: CbmMcbm2018MonitorMuch.h:207
CbmMcbm2018MonitorMuch::fuCurrDpbId
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
Definition: CbmMcbm2018MonitorMuch.h:136
gdpbv100::MessagePrintMask
MessagePrintMask
Definition: gDpbMessv100.h:87
CbmMcbm2018MonitorMuch::fdFebChanCoincidenceLimit
Double_t fdFebChanCoincidenceLimit
Definition: CbmMcbm2018MonitorMuch.h:224
CbmMcbm2018MonitorMuch::prevtime
Long64_t prevtime
Definition: CbmMcbm2018MonitorMuch.h:169
CbmMcbm2018MonitorMuch::fvdFebAdcOffs
std::vector< std::vector< std::vector< Double_t > > > fvdFebAdcOffs
ADC gain in e-/b, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ].
Definition: CbmMcbm2018MonitorMuch.h:115
CbmMcbm2018MonitorMuch::fuNrOfDpbs
UInt_t fuNrOfDpbs
Definition: CbmMcbm2018MonitorMuch.h:105
CbmMcbm2018MonitorMuch::fvMsComponentsList
std::vector< size_t > fvMsComponentsList
Definition: CbmMcbm2018MonitorMuch.h:98
CbmMcbm2018MonitorMuch::fhPulserMsStatusFieldType
TH2 * fhPulserMsStatusFieldType
Definition: CbmMcbm2018MonitorMuch.h:211
CbmMcbm2018MuchPar::ElinkIdxToFebIdx
Int_t ElinkIdxToFebIdx(UInt_t uElink)
Definition: CbmMcbm2018MuchPar.cxx:119
CbmMcbm2018MuchPar::GetModule
UInt_t GetModule(UInt_t)
Definition: CbmMcbm2018MuchPar.cxx:283
stsxyter::Message::GetHitChannel
uint16_t GetHitChannel() const
For Hit data: Returns StsXYTER channel number (7 bit field)
Definition: StsXyterMessage.h:274
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
CbmMcbm2018MonitorMuch::fhStsMessType
TH1 * fhStsMessType
Histogram manager.
Definition: CbmMcbm2018MonitorMuch.h:205
CbmMcbm2018MonitorMuch::SetNbMsInTs
virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
Definition: CbmMcbm2018MonitorMuch.cxx:396
CbmMcbm2018MonitorMuch::fdCoincMin
Double_t fdCoincMin
Definition: CbmMcbm2018MonitorMuch.h:200
CbmMcbm2018MonitorMuch::fhStsFebChanAdcCalProf
std::vector< TProfile * > fhStsFebChanAdcCalProf
Definition: CbmMcbm2018MonitorMuch.h:230
CbmMcbm2018MonitorMuch::fuCurrentEquipmentId
UInt_t fuCurrentEquipmentId
Definition: CbmMcbm2018MonitorMuch.h:134
CbmMcbm2018MonitorMuch::fhStsFebHitRateEvo
std::vector< TH1 * > fhStsFebHitRateEvo
Definition: CbmMcbm2018MonitorMuch.h:239
CbmMcbm2018MonitorMuch::fuNbStsXyters
UInt_t fuNbStsXyters
Number of StsXyter ASICs.
Definition: CbmMcbm2018MonitorMuch.h:111
CbmMcbm2018MonitorMuch::fvuElinkLastTsHit
std::vector< UInt_t > fvuElinkLastTsHit
TS MSB cycle from MS header in 1st MS for DPB.
Definition: CbmMcbm2018MonitorMuch.h:150
CbmMcbm2018MonitorMuch::fhRate
TH1 * fhRate
Definition: CbmMcbm2018MonitorMuch.h:214
CbmMcbm2018MonitorMuch::fhStsFebHitRateEvo_mskch
std::vector< TH1 * > fhStsFebHitRateEvo_mskch
Definition: CbmMcbm2018MonitorMuch.h:240
stsxyter::MessType::TsMsb
@ TsMsb
stsxyter::Message::GetHitTime
uint16_t GetHitTime() const
For Hit data: Returns timestamp (8 bit field, 2 MSB bits overlap removed)
Definition: StsXyterMessage.h:286
stsxyter::MessType::Dummy
@ Dummy
CbmMcbm2018MonitorMuch::fvuInitialTsMsbCycleHeader
std::vector< UInt_t > fvuInitialTsMsbCycleHeader
Flag set after seeing MS header in 1st MS for DPB.
Definition: CbmMcbm2018MonitorMuch.h:149
CbmMcbm2018MonitorMuch::fhStsFebHitRateEvoLong
std::vector< TH1 * > fhStsFebHitRateEvoLong
Definition: CbmMcbm2018MonitorMuch.h:244
CbmMcbm2018MonitorMuch.h
CbmMcbm2018MonitorMuch::fhStsFebChanDistT
std::vector< TH2 * > fhStsFebChanDistT
Definition: CbmMcbm2018MonitorMuch.h:246
CbmMcbm2018MuchPar::GetNbChanPerAsic
static constexpr UInt_t GetNbChanPerAsic()
Definition: CbmMcbm2018MuchPar.h:50
CbmMcbm2018MonitorMuch::Counter1
UInt_t Counter1
Definition: CbmMcbm2018MonitorMuch.h:196
CbmMcbm2018MonitorMuch::kdSmxErrCoincWinNoiseM08
constexpr static const Double_t kdSmxErrCoincWinNoiseM08
Definition: CbmMcbm2018MonitorMuch.h:263
stsxyter::MessType::Epoch
@ Epoch
CbmMcbm2018MonitorMuch::fhMsSzTime
TProfile * fhMsSzTime[kiMaxNbFlibLinks]
Definition: CbmMcbm2018MonitorMuch.h:301
CbmMcbm2018MonitorMuch::fvdChanLastHitTimeInMs
std::vector< std::vector< std::vector< Double_t > > > fvdChanLastHitTimeInMs
Number of hits in each MS for each Channel.
Definition: CbmMcbm2018MonitorMuch.h:162
CbmMcbm2018MonitorMuch::ScanForNoisyChannels
Bool_t ScanForNoisyChannels(Double_t dNoiseThreshold=1e3)
---------------------------------------------------------------—///
Definition: CbmMcbm2018MonitorMuch.cxx:2294
CbmMcbm2018MonitorMuch::fhStsFebChanDtCoinc
std::vector< std::vector< TH1 * > > fhStsFebChanDtCoinc
Definition: CbmMcbm2018MonitorMuch.h:247
CbmMcbm2018MonitorMuch::fvuChanNbHitsInMs
std::vector< std::vector< std::vector< UInt_t > > > fvuChanNbHitsInMs
Header time of each MS.
Definition: CbmMcbm2018MonitorMuch.h:160
CbmMcbm2018MonitorMuch::fDpbIdIndexMap
std::map< UInt_t, UInt_t > fDpbIdIndexMap
Total number of STS DPBs in system.
Definition: CbmMcbm2018MonitorMuch.h:107
CbmMcbm2018MonitorMuch::fvulChanLastHitTime
std::vector< std::vector< ULong64_t > > fvulChanLastHitTime
Definition: CbmMcbm2018MonitorMuch.h:153
CbmMcbm2018MonitorMuch::kdSmxErrCoincWinNoiseM10
constexpr static const Double_t kdSmxErrCoincWinNoiseM10
Definition: CbmMcbm2018MonitorMuch.h:265
stsxyter::kuHitNbAdcBins
static const uint32_t kuHitNbAdcBins
Status/properties constants.
Definition: StsXyterMessage.h:144
CbmMcbm2018MuchPar::GetNbFebsPerCrob
static constexpr UInt_t GetNbFebsPerCrob()
Definition: CbmMcbm2018MuchPar.h:39
CbmMcbm2018MuchPar::GetFebId
UInt_t GetFebId(UInt_t)
Definition: CbmMcbm2018MuchPar.cxx:267
CbmMcbmUnpack
Definition: CbmMcbmUnpack.h:15
CbmMcbm2018MonitorMuch::SmxErrInitializeVariables
void SmxErrInitializeVariables()
Methods.
Definition: CbmMcbm2018MonitorMuch.cxx:2155
CbmMcbm2018MuchPar::GetPadXA
Short_t GetPadXA(UShort_t febid, UShort_t channelid)
Definition: CbmMcbm2018MuchPar.cxx:215
CbmMcbm2018MonitorMuch::fulCurrentMsIdx
ULong64_t fulCurrentMsIdx
Definition: CbmMcbm2018MonitorMuch.h:130
CbmMcbm2018MonitorMuch::fhStsFebSmxErrRatioCopySameAdcEvo
std::vector< TProfile * > fhStsFebSmxErrRatioCopySameAdcEvo
Definition: CbmMcbm2018MonitorMuch.h:295
CbmMcbm2018MonitorMuch::fvuSmxErrIdxFirstHitM10
std::vector< std::vector< UInt_t > > fvuSmxErrIdxFirstHitM10
[ NbFebs ][ NbSmxPerFeb ]
Definition: CbmMcbm2018MonitorMuch.h:282
CbmMcbm2018MonitorMuch::SetCoincidenceBorder
void SetCoincidenceBorder(Double_t dCenterPos, Double_t dBorderVal)
Definition: CbmMcbm2018MonitorMuch.cxx:441
CbmMcbm2018MonitorMuch::fuMaxNbMicroslices
UInt_t fuMaxNbMicroslices
Definition: CbmMcbm2018MonitorMuch.h:184
stsxyter
Definition: StsXyterFinalHit.h:12
CbmMcbm2018MonitorMuch::fdSmxErrCoincWinM09
Double_t fdSmxErrCoincWinM09
Definition: CbmMcbm2018MonitorMuch.h:270
CbmMcbm2018MonitorMuch::fvuCurrentTsMsbCycle
std::vector< UInt_t > fvuCurrentTsMsbCycle
Current TS MSB for each DPB.
Definition: CbmMcbm2018MonitorMuch.h:145
CbmMcbm2018MonitorMuch::fHistPadDistr
std::vector< TH2 * > fHistPadDistr
Plots per FEB-8.
Definition: CbmMcbm2018MonitorMuch.h:221
CbmMcbm2018MonitorMuch::fdCoincCenter
Double_t fdCoincCenter
Coincidences in sorted hits.
Definition: CbmMcbm2018MonitorMuch.h:198
CbmHistManager::Add
void Add(const std::string &name, TNamed *object)
Add new named object to manager.
Definition: CbmHistManager.h:58
bMcbm2018ResetMuch
Bool_t bMcbm2018ResetMuch
Definition: CbmMcbm2018MonitorMuch.cxx:42