CbmRoot
CbmMcbm2018MonitorStsPulser.cxx
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 // ----- -----
3 // ----- CbmCosy2018MonitorPulser -----
4 // ----- Created 11/05/18 by P.-A. Loizeau -----
5 // ----- -----
6 // -----------------------------------------------------------------------------
7 
8 #include "CbmCosy2018MonitorPulser.h"
9 
10 // Data
11 
12 // CbmRoot
13 #include "CbmCern2017UnpackParHodo.h"
14 #include "CbmHistManager.h"
15 
16 // FairRoot
17 #include "FairLogger.h"
18 #include "FairRootManager.h"
19 #include "FairRun.h"
20 #include "FairRunOnline.h"
21 #include "FairRuntimeDb.h"
22 
23 // Root
24 #include "TClonesArray.h"
25 #include "THttpServer.h"
26 #include "TMath.h"
27 #include "TROOT.h"
28 #include "TRandom.h"
29 #include "TString.h"
30 #include "TStyle.h"
31 
32 // C++11
33 
34 // C/C++
35 #include <iomanip>
36 #include <iostream>
37 #include <stdint.h>
38 
39 Bool_t bCosy2018ResetPulser = kFALSE;
40 Bool_t bCosy2018WritePulser = kFALSE;
41 
43  : CbmTSUnpack()
44  , fuOverlapMsNb(0)
45  , fUnpackParHodo(NULL)
46  , fuNrOfDpbs(0)
47  , fDpbIdIndexMap()
48  , fuNbElinksPerDpb(0)
49  , fuNbStsXyters(0)
50  , fuNbChanPerAsic(0)
51  , fvuElinkToAsic()
52  , fsHistoFileFullname("data/SetupHistos.root")
53  , fbPrintMessages(kFALSE)
54  , fPrintMessCtrl(stsxyter::MessagePrintMask::msg_print_Human)
55  , fulCurrentTsIdx(0)
56  , fulCurrentMsIdx(0)
57  , fmMsgCounter()
58  , fuCurrentEquipmentId(0)
59  , fuCurrDpbId(0)
60  , fuCurrDpbIdx(0)
61  , fiRunStartDateTimeSec(-1)
62  , fiBinSizeDatePlots(-1)
63  , fvulCurrentTsMsb()
64  , fvuCurrentTsMsbCycle()
65  , fvuElinkLastTsHit()
66  , fvulChanLastHitTime()
67  , fvdChanLastHitTime()
68  , fvdMsTime()
69  , fvuChanNbHitsInMs()
70  , fvdChanLastHitTimeInMs()
71  , fvusChanLastHitAdcInMs()
72  ,
73  // fvmChanHitsInTs(),
74  fdStartTime(-1.0)
75  , fdStartTimeMsSz(-1.0)
76  , ftStartTimeUnix(std::chrono::steady_clock::now())
77  , fvmHitsInTs()
78  , fvmAsicHitsInTs()
79  , fuMaxNbMicroslices(100)
80  , fbLongHistoEnable(kFALSE)
81  , fuLongHistoNbSeconds(0)
82  , fuLongHistoBinSizeSec(0)
83  , fuLongHistoBinNb(0)
84  , fdCoincCenter(0.0)
85  , fdCoincBorder(50.0)
86  , fdCoincMin(fdCoincCenter - fdCoincBorder)
87  , fdCoincMax(fdCoincCenter + fdCoincBorder)
88  , fHM(new CbmHistManager())
89  , fhPulserMessType(NULL)
90  , fhPulserSysMessType(NULL)
91  , fhPulserMessTypePerDpb(NULL)
92  , fhPulserSysMessTypePerDpb(NULL)
93  , fhPulserMessTypePerElink(NULL)
94  , fhPulserSysMessTypePerElink(NULL)
95  , fhPulserChanCntRaw()
96  , fhPulserChanCntRawGood()
97  , fhPulserChanAdcRaw()
98  , fhPulserChanAdcRawProf()
99  , fhPulserChanRawTs()
100  , fhPulserChanMissEvt()
101  , fhPulserChanMissEvtEvo()
102  , fhPulserChanHitRateEvo()
103  , fhPulserFebRateEvo()
104  , fhPulserFebMissEvtEvo()
105  , fhPulserChanHitRateEvoLong()
106  , fhPulserFebRateEvoLong()
107  , fcMsSizeAll(NULL)
108  , fdStartTs(0.0)
109  , fvmLastHitAsic()
110  , fhPulserTimeDiffPerAsic()
111  , fhPulserTimeDiffPerAsicPair()
112  , fhPulserTimeDiffEvoPerAsicPair()
113  , fhPulserTsLsbMatchPerAsicPair()
114  , fhPulserTsMsbMatchPerAsicPair()
115  , fhPulserIntervalAsic()
116  , fhPulserIntervalLongAsic() {}
117 
119 
121  LOG(info) << "Initializing flib StsXyter unpacker for STS";
122 
123  FairRootManager* ioman = FairRootManager::Instance();
124  if (ioman == NULL) { LOG(fatal) << "No FairRootManager instance"; }
125 
126  return kTRUE;
127 }
128 
130  LOG(info) << "Setting parameter containers for " << GetName();
132  (CbmCern2017UnpackParHodo*) (FairRun::Instance()
133  ->GetRuntimeDb()
134  ->getContainer("CbmCern2017UnpackParHodo"));
135 }
136 
137 
139  LOG(info) << "Init parameter containers for " << GetName();
140 
141  Bool_t bReInit = ReInitContainers();
143 
144  return bReInit;
145 }
146 
148  LOG(info) << "ReInit parameter containers for " << GetName();
149 
150  fuNrOfDpbs = fUnpackParHodo->GetNrOfDpbs();
151  fuNbElinksPerDpb = fUnpackParHodo->GetNbElinksPerDpb();
152  fuNbStsXyters = fUnpackParHodo->GetNbStsXyters();
153  fuNbChanPerAsic = fUnpackParHodo->GetNbChanPerAsic();
154 
155 
156  LOG(info) << "Nr. of STS DPBs: " << fuNrOfDpbs;
157 
158  fDpbIdIndexMap.clear();
159  fvuElinkToAsic.resize(fuNrOfDpbs);
160  for (UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb) {
161  fDpbIdIndexMap[fUnpackParHodo->GetDpbId(uDpb)] = uDpb;
162  LOG(info) << "Eq. ID for DPB #" << std::setw(2) << uDpb << " = "
163  << std::setw(4) << std::hex << fUnpackParHodo->GetDpbId(uDpb)
164  << std::dec << " => "
165  << fDpbIdIndexMap[fUnpackParHodo->GetDpbId(uDpb)];
166 
167  fvuElinkToAsic[uDpb].resize(fuNbElinksPerDpb);
168  for (UInt_t uElink = 0; uElink < fuNbElinksPerDpb; ++uElink)
169  fvuElinkToAsic[uDpb][uElink] =
170  fUnpackParHodo->GetElinkToAsicIdx(uDpb * fuNbElinksPerDpb + uElink);
171  } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
172 
173  LOG(info) << "Nr. eLinks per DPB: " << fuNbElinksPerDpb;
174  LOG(info) << "Nr. of StsXyter ASICs: " << fuNbStsXyters;
175  LOG(info) << "Nb. channels per ASIC: " << fuNbChanPerAsic;
176 
177  for (UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb) {
178  LOG(info) << "ASIC ID for eLinks in DPB #" << std::setw(2) << uDpb << ": ";
179 
180  std::stringstream ss;
181  for (UInt_t uElink = 0; uElink < fuNbElinksPerDpb; ++uElink) {
182  if (0 == uElink % 10) ss << "\n------> ";
183 
184  ss << std::setw(5) << fvuElinkToAsic[uDpb][uElink] << " ";
185  } // for( UInt_t uElink = 0; uElink < fuNbElinksPerDpb; ++uElink )
186  LOG(info) << ss.str();
187  } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
188 
189  // Internal status initialization
193  for (UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb) {
194  fvulCurrentTsMsb[uDpb] = 0;
195  fvuCurrentTsMsbCycle[uDpb] = 0;
196  /*
197  fvuElinkLastTsHit[uDpb].resize( fuNbElinksPerDpb );
198  for( UInt_t uElink = 0; uElink < fuNbElinksPerDpb; ++uElink )
199  {
200  fvuElinkLastTsHit[uDpb][uElink] = 0;
201  } // for( UInt_t uElink = 0; uElink < fuNbElinksPerDpb; ++uElink )
202 */
203  } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
204 
217  for (UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx) {
218  fvulChanLastHitTime[uXyterIdx].resize(fuNbChanPerAsic);
219  fvdChanLastHitTime[uXyterIdx].resize(fuNbChanPerAsic);
220  fvuChanNbHitsInMs[uXyterIdx].resize(fuNbChanPerAsic);
221  fvdChanLastHitTimeInMs[uXyterIdx].resize(fuNbChanPerAsic);
222  fvusChanLastHitAdcInMs[uXyterIdx].resize(fuNbChanPerAsic);
223  fvmAsicHitsInTs[uXyterIdx].clear();
224  fhPulserTimeDiffPerAsicPair[uXyterIdx].clear();
225  fhPulserTimeDiffEvoPerAsicPair[uXyterIdx].clear();
226  fhPulserTsLsbMatchPerAsicPair[uXyterIdx].clear();
227  fhPulserTsMsbMatchPerAsicPair[uXyterIdx].clear();
228  for (UInt_t uChan = 0; uChan < fuNbChanPerAsic; ++uChan) {
229  fvulChanLastHitTime[uXyterIdx][uChan] = 0;
230  fvdChanLastHitTime[uXyterIdx][uChan] = -1.0;
231 
232  fvuChanNbHitsInMs[uXyterIdx][uChan].resize(fuMaxNbMicroslices);
233  fvdChanLastHitTimeInMs[uXyterIdx][uChan].resize(fuMaxNbMicroslices);
234  fvusChanLastHitAdcInMs[uXyterIdx][uChan].resize(fuMaxNbMicroslices);
235  for (UInt_t uMsIdx = 0; uMsIdx < fuMaxNbMicroslices; ++uMsIdx) {
236  fvuChanNbHitsInMs[uXyterIdx][uChan][uMsIdx] = 0;
237  fvdChanLastHitTimeInMs[uXyterIdx][uChan][uMsIdx] = -1.0;
238  fvusChanLastHitAdcInMs[uXyterIdx][uChan][uMsIdx] = 0;
239  } // for( UInt_t uMsIdx = 0; uMsIdx < fuMaxNbMicroslices; ++uMsIdx )
240  } // for( UInt_t uChan = 0; uChan < fuNbChanPerAsic; ++uChan )
241  } // for( UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx )
242  LOG(info) << "CbmCosy2018MonitorPulser::ReInitContainers => Changed "
243  "fvuChanNbHitsInMs size "
244  << fvuChanNbHitsInMs.size() << " VS " << fuNbStsXyters;
245  LOG(info) << "CbmCosy2018MonitorPulser::ReInitContainers => Changed "
246  "fvuChanNbHitsInMs size "
247  << fvuChanNbHitsInMs[0].size() << " VS " << fuNbChanPerAsic;
248  LOG(info) << "CbmCosy2018MonitorPulser::ReInitContainers => Changed "
249  "fvuChanNbHitsInMs size "
250  << fvuChanNbHitsInMs[0][0].size() << " VS " << fuMaxNbMicroslices;
251 
252  return kTRUE;
253 }
254 
256  Double_t dBorderVal) {
257  fdCoincCenter = dCenterPos;
258  fdCoincBorder = dBorderVal;
259  fdCoincMin = dCenterPos - dBorderVal;
260  fdCoincMax = dCenterPos + dBorderVal;
261 }
262 
264  TString sHistName {""};
265  TString title {""};
266 
267  sHistName = "hPulserMessageType";
268  title = "Nb of message for each type; Type";
269  fhPulserMessType = new TH1I(sHistName, title, 5, 0., 5.);
270  fhPulserMessType->GetXaxis()->SetBinLabel(1, "Dummy");
271  fhPulserMessType->GetXaxis()->SetBinLabel(2, "Hit");
272  fhPulserMessType->GetXaxis()->SetBinLabel(3, "TsMsb");
273  fhPulserMessType->GetXaxis()->SetBinLabel(4, "Epoch");
274  fhPulserMessType->GetXaxis()->SetBinLabel(5, "Empty");
275  /* *** Missing int + MessType OP!!!! ****
276  fhPulserMessType->GetXaxis()->SetBinLabel(1 + stsxyter::MessType::Dummy, "Dummy");
277  fhPulserMessType->GetXaxis()->SetBinLabel(1 + stsxyter::MessType::Hit, "Hit");
278  fhPulserMessType->GetXaxis()->SetBinLabel(1 + stsxyter::MessType::TsMsb, "TsMsb");
279  fhPulserMessType->GetXaxis()->SetBinLabel(1 + stsxyter::MessType::ReadDataAck, "ReadDataAck");
280  fhPulserMessType->GetXaxis()->SetBinLabel(1 + stsxyter::MessType::Ack, "Ack");
281 */
282 
283  sHistName = "hPulserSysMessType";
284  title = "Nb of system message for each type; System Type";
285  fhPulserSysMessType = new TH1I(sHistName, title, 17, 0., 17.);
286  /*
287  hSysMessType->GetXaxis()->SetBinLabel(1 + ngdpb::SYSMSG_DAQ_START, "DAQ START");
288  hSysMessType->GetXaxis()->SetBinLabel(1 + ngdpb::SYSMSG_DAQ_FINISH, "DAQ FINISH");
289  hSysMessType->GetXaxis()->SetBinLabel(1 + 16, "GET4 Hack 32B");
290 */
291 
292  sHistName = "hPulserMessageTypePerDpb";
293  title = "Nb of message of each type for each DPB; DPB; Type";
295  new TH2I(sHistName, title, fuNrOfDpbs, 0, fuNrOfDpbs, 5, 0., 5.);
296  fhPulserMessTypePerDpb->GetYaxis()->SetBinLabel(1, "Dummy");
297  fhPulserMessTypePerDpb->GetYaxis()->SetBinLabel(2, "Hit");
298  fhPulserMessTypePerDpb->GetYaxis()->SetBinLabel(3, "TsMsb");
299  fhPulserMessTypePerDpb->GetYaxis()->SetBinLabel(4, "Epoch");
300  fhPulserMessTypePerDpb->GetYaxis()->SetBinLabel(5, "Empty");
301  /* *** Missing int + MessType OP!!!! ****
302  fhPulserMessType->GetYaxis()->SetBinLabel(1 + stsxyter::MessType::Dummy, "Dummy");
303  fhPulserMessType->GetYaxis()->SetBinLabel(1 + stsxyter::MessType::Hit, "Hit");
304  fhPulserMessType->GetYaxis()->SetBinLabel(1 + stsxyter::MessType::TsMsb, "TsMsb");
305  fhPulserMessType->GetYaxis()->SetBinLabel(1 + stsxyter::MessType::ReadDataAck, "ReadDataAck");
306  fhPulserMessType->GetYaxis()->SetBinLabel(1 + stsxyter::MessType::Ack, "Ack");
307 */
308 
309  sHistName = "hPulserSysMessTypePerDpb";
310  title = "Nb of system message of each type for each DPB; DPB; System Type";
312  new TH2I(sHistName, title, fuNrOfDpbs, 0, fuNrOfDpbs, 17, 0., 17.);
313  /*
314  hSysMessType->GetYaxis()->SetBinLabel(1 + ngdpb::SYSMSG_DAQ_START, "DAQ START");
315  hSysMessType->GetYaxis()->SetBinLabel(1 + ngdpb::SYSMSG_DAQ_FINISH, "DAQ FINISH");
316  hSysMessType->GetYaxis()->SetBinLabel(1 + 16, "GET4 Hack 32B");
317 */
318 
319  sHistName = "hPulserMessageTypePerElink";
320  title = "Nb of message of each type for each eLink; eLink; Type";
321  fhPulserMessTypePerElink = new TH2I(sHistName,
322  title,
324  0,
326  5,
327  0.,
328  5.);
329  fhPulserMessTypePerElink->GetYaxis()->SetBinLabel(1, "Dummy");
330  fhPulserMessTypePerElink->GetYaxis()->SetBinLabel(2, "Hit");
331  fhPulserMessTypePerElink->GetYaxis()->SetBinLabel(3, "TsMsb");
332  fhPulserMessTypePerElink->GetYaxis()->SetBinLabel(4, "ReadDataAck");
333  fhPulserMessTypePerElink->GetYaxis()->SetBinLabel(5, "Ack");
334  /* *** Missing int + MessType OP!!!! ****
335  fhPulserMessTypePerElink->GetYaxis()->SetBinLabel(1 + stsxyter::MessType::Dummy, "Dummy");
336  fhPulserMessTypePerElink->GetYaxis()->SetBinLabel(1 + stsxyter::MessType::Hit, "Hit");
337  fhPulserMessTypePerElink->GetYaxis()->SetBinLabel(1 + stsxyter::MessType::TsMsb, "TsMsb");
338  fhPulserMessTypePerElink->GetYaxis()->SetBinLabel(1 + stsxyter::MessType::ReadDataAck, "ReadDataAck");
339  fhPulserMessTypePerElink->GetYaxis()->SetBinLabel(1 + stsxyter::MessType::Ack, "Ack");
340 */
341 
342  sHistName = "hPulserSysMessTypePerElink";
343  title =
344  "Nb of system message of each type for each eLink; eLink; System Type";
345  fhPulserSysMessTypePerElink = new TH2I(sHistName,
346  title,
348  0,
350  17,
351  0.,
352  17.);
353  /*
354  fhPulserSysMessTypePerElink->GetYaxis()->SetBinLabel(1 + ngdpb::SYSMSG_DAQ_START, "DAQ START");
355  fhPulserSysMessTypePerElink->GetYaxis()->SetBinLabel(1 + ngdpb::SYSMSG_DAQ_FINISH, "DAQ FINISH");
356  fhPulserSysMessTypePerElink->GetYaxis()->SetBinLabel(1 + 16, "GET4 Hack 32B");
357 */
358 
359  // Number of rate bins =
360  // 9 for the sub-unit decade
361  // + 9 for each unit of each decade * 10 for the subdecade range
362  // + 1 for the closing bin top edge
363  const Int_t iNbDecadesRate = 9;
364  const Int_t iNbStepsDecade = 9;
365  const Int_t iNbSubStepsInStep = 10;
366  const Int_t iNbBinsRate =
367  iNbStepsDecade + iNbStepsDecade * iNbSubStepsInStep * iNbDecadesRate + 1;
368  Double_t dBinsRate[iNbBinsRate];
369  // First fill sub-unit decade
370  for (Int_t iSubU = 0; iSubU < iNbStepsDecade; iSubU++)
371  dBinsRate[iSubU] = 0.1 * (1 + iSubU);
372  std::cout << std::endl;
373  // Then fill the main decades
374  Double_t dSubstepSize = 1.0 / iNbSubStepsInStep;
375  for (Int_t iDecade = 0; iDecade < iNbDecadesRate; iDecade++) {
376  Double_t dBase = std::pow(10, iDecade);
377  Int_t iDecadeIdx =
378  iNbStepsDecade + iDecade * iNbStepsDecade * iNbSubStepsInStep;
379  for (Int_t iStep = 0; iStep < iNbStepsDecade; iStep++) {
380  Int_t iStepIdx = iDecadeIdx + iStep * iNbSubStepsInStep;
381  for (Int_t iSubStep = 0; iSubStep < iNbSubStepsInStep; iSubStep++) {
382  dBinsRate[iStepIdx + iSubStep] =
383  dBase * (1 + iStep) + dBase * dSubstepSize * iSubStep;
384  } // for( Int_t iSubStep = 0; iSubStep < iNbSubStepsInStep; iSubStep++ )
385  } // for( Int_t iStep = 0; iStep < iNbStepsDecade; iStep++ )
386  } // for( Int_t iDecade = 0; iDecade < iNbDecadesRate; iDecade ++)
387  dBinsRate[iNbBinsRate - 1] = std::pow(10, iNbDecadesRate);
388 
390  UInt_t uAlignedLimit =
392  fuLongHistoBinNb = uAlignedLimit / fuLongHistoBinSizeSec;
393 
394  UInt_t uNbBinEvo = (32768 + 1) * 2;
395  Double_t dMaxEdgeEvo =
396  stsxyter::kdClockCycleNs * static_cast<Double_t>(uNbBinEvo) / 2.0;
397  Double_t dMinEdgeEvo = dMaxEdgeEvo * -1.0;
398 
399  UInt_t uNbBinDt =
400  static_cast<UInt_t>((fdCoincMax - fdCoincMin) / stsxyter::kdClockCycleNs);
401 
402  for (UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx) {
403  // Channel counts
404  sHistName = Form("hPulserChanCntRaw_%03u", uXyterIdx);
405  title = Form("Hits Count per channel, StsXyter #%03u; Channel; Hits []",
406  uXyterIdx);
407  fhPulserChanCntRaw.push_back(
408  new TH1I(sHistName, title, fuNbChanPerAsic, -0.5, fuNbChanPerAsic - 0.5));
409 
410  sHistName = Form("hPulserChanCntRawGood_%03u", uXyterIdx);
411  title = Form(
412  "Hits Count per channel in good MS, StsXyter #%03u; Channel; Hits []",
413  uXyterIdx);
414  fhPulserChanCntRawGood.push_back(
415  new TH1I(sHistName, title, fuNbChanPerAsic, -0.5, fuNbChanPerAsic - 0.5));
416 
417  // Raw Adc Distribution
418  sHistName = Form("hPulserChanAdcRaw_%03u", uXyterIdx);
419  title = Form("Raw Adc distribution per channel, StsXyter #%03u; Channel "
420  "[]; Adc []; Hits []",
421  uXyterIdx);
422  fhPulserChanAdcRaw.push_back(new TH2I(sHistName,
423  title,
425  -0.5,
426  fuNbChanPerAsic - 0.5,
428  -0.5,
429  stsxyter::kuHitNbAdcBins - 0.5));
430 
431  // Raw Adc Distribution profile
432  sHistName = Form("hPulserChanAdcRawProfc_%03u", uXyterIdx);
433  title =
434  Form("Raw Adc prodile per channel, StsXyter #%03u; Channel []; Adc []",
435  uXyterIdx);
436  fhPulserChanAdcRawProf.push_back(new TProfile(
437  sHistName, title, fuNbChanPerAsic, -0.5, fuNbChanPerAsic - 0.5));
438 
439  // Raw Ts Distribution
440  sHistName = Form("hPulserChanRawTs_%03u", uXyterIdx);
441  title = Form("Raw Timestamp distribution per channel, StsXyter #%03u; "
442  "Channel []; Ts []; Hits []",
443  uXyterIdx);
444  fhPulserChanRawTs.push_back(new TH2I(sHistName,
445  title,
447  -0.5,
448  fuNbChanPerAsic - 0.5,
450  -0.5,
451  stsxyter::kuHitNbTsBins - 0.5));
452 
453  // Missed event flag
454  sHistName = Form("hPulserChanMissEvt_%03u", uXyterIdx);
455  title = Form("Missed Event flags per channel, StsXyter #%03u; Channel []; "
456  "Miss Evt []; Hits []",
457  uXyterIdx);
458  fhPulserChanMissEvt.push_back(new TH2I(sHistName,
459  title,
461  -0.5,
462  fuNbChanPerAsic - 0.5,
463  2,
464  -0.5,
465  1.5));
466 
467  // Missed event flag counts evolution
468 
469  sHistName = Form("hPulserChanMissEvtEvo_%03u", uXyterIdx);
470  title = Form("Missed Evt flags per second & channel in StsXyter #%03u; "
471  "Time [s]; Channel []; Missed Evt flags []",
472  uXyterIdx);
473  fhPulserChanMissEvtEvo.push_back(new TH2I(sHistName,
474  title,
475  1800,
476  0,
477  1800,
479  -0.5,
480  fuNbChanPerAsic - 0.5));
481 
482  // Missed event flag counts evo per StsXyter
483 
484  sHistName = Form("hPulserFebMissEvtEvo%03u", uXyterIdx);
485  title = Form("Missed Evt flags per second in StsXyter #%03u; Time [s]; "
486  "Missed Evt flags []",
487  uXyterIdx);
488  fhPulserFebMissEvtEvo.push_back(new TH1I(sHistName, title, 1800, 0, 1800));
489 
490  // Hit rates evo per channel
491  sHistName = Form("hPulserChanRateEvo_%03u", uXyterIdx);
492  title = Form("Hits per second & channel in StsXyter #%03u; Time [s]; "
493  "Channel []; Hits []",
494  uXyterIdx);
495  fhPulserChanHitRateEvo.push_back(new TH2I(sHistName,
496  title,
497  1800,
498  0,
499  1800,
501  -0.5,
502  fuNbChanPerAsic - 0.5));
503 
504  // Hit rates evo per StsXyter
505  sHistName = Form("hPulserFebRateEvo_%03u", uXyterIdx);
506  title =
507  Form("Hits per second in StsXyter #%03u; Time [s]; Hits []", uXyterIdx);
508  fhPulserFebRateEvo.push_back(new TH1I(sHistName, title, 1800, 0, 1800));
509 
510  // Hit rates evo per channel, 1 minute bins, 24h
511  sHistName = Form("hPulserChanRateEvoLong_%03u", uXyterIdx);
512  title = Form("Hits per second & channel in StsXyter #%03u; Time [min]; "
513  "Channel []; Hits []",
514  uXyterIdx);
515  fhPulserChanHitRateEvoLong.push_back(new TH2D(sHistName,
516  title,
518  -0.5,
519  uAlignedLimit - 0.5,
521  -0.5,
522  fuNbChanPerAsic - 0.5));
523 
524  // Hit rates evo per StsXyter, 1 minute bins, 24h
525  sHistName = Form("hPulserFebRateEvoLong_%03u", uXyterIdx);
526  title =
527  Form("Hits per second in StsXyter #%03u; Time [min]; Hits []", uXyterIdx);
528  fhPulserFebRateEvoLong.push_back(
529  new TH1D(sHistName, title, fuLongHistoBinNb, -0.5, uAlignedLimit - 0.5));
530 
532  sHistName = Form("fhPulserTimeDiffPerAsic_%03u", uXyterIdx);
533  title = Form("Time diff for pulser hits between ASIC %03u and other ASICs; "
534  "tn - t%03u [ns]; ASIC n; Counts",
535  uXyterIdx,
536  uXyterIdx);
537  fhPulserTimeDiffPerAsic.push_back(new TH2I(sHistName,
538  title,
539  uNbBinEvo,
540  dMinEdgeEvo,
541  dMaxEdgeEvo,
543  -0.5,
544  fuNbStsXyters - 0.5));
545 
546  for (UInt_t uXyterIdxB = 0; uXyterIdxB < fuNbStsXyters; ++uXyterIdxB) {
547  if (uXyterIdxB == uXyterIdx) {
548  sHistName = Form("fhPulserTimeDiffSameAsic_%03u", uXyterIdx);
549  title = Form(
550  "Time diff for consecutive hits in ASIC %03u; tn - t [ns]; Counts",
551  uXyterIdx);
552  } // if( uXyterIdxB == uXyterIdx )
553  else {
554  sHistName =
555  Form("fhPulserTimeDiffPerAsicPair_%03u_%03u", uXyterIdx, uXyterIdxB);
556  title = Form("Time diff for pulser hits in ASIC %03u and %03u; tn - t "
557  "[ns]; Counts",
558  uXyterIdx,
559  uXyterIdxB);
560  } // else of if( uXyterIdxB == uXyterIdx )
561  fhPulserTimeDiffPerAsicPair[uXyterIdx].push_back(
562  new TH1I(sHistName, title, uNbBinEvo, dMinEdgeEvo, dMaxEdgeEvo));
563 
564  if (uXyterIdxB == uXyterIdx) {
565  sHistName = Form("fhPulserTimeDiffEvoSameAsic_%03u", uXyterIdx);
566  title = Form("Time diff for consecutive hits in ASIC %03u; Time in run "
567  "[s]; tn - t [ns]; Counts",
568  uXyterIdx);
569  } // if( uXyterIdxB == uXyterIdx )
570  else {
571  sHistName = Form(
572  "fhPulserTimeDiffEvoPerAsicPair_%03u_%03u", uXyterIdx, uXyterIdxB);
573  title = Form("Time diff for pulser hits in ASIC %03u and %03u; Time in "
574  "run [s]; tn - t [ns]; Counts",
575  uXyterIdx,
576  uXyterIdxB);
577  } // else of if( uXyterIdxB == uXyterIdx )
578  fhPulserTimeDiffEvoPerAsicPair[uXyterIdx].push_back(
579  new TH2I(sHistName,
580  title,
581  3600,
582  0,
583  18000,
584  200,
586  100 * stsxyter::kdClockCycleNs));
587 
588  sHistName =
589  Form("fhPulserTsLsbMatchPerAsicPair_%03u_%03u", uXyterIdx, uXyterIdxB);
590  title = Form("TS LSB for pulser hits in ASIC %03u and %03u; TS LSB %03u "
591  "[bin]; TS LSB %03u [bin]",
592  uXyterIdx,
593  uXyterIdxB,
594  uXyterIdx,
595  uXyterIdxB);
596  fhPulserTsLsbMatchPerAsicPair[uXyterIdx].push_back(
597  new TH2I(sHistName, title, 256, -0.5, 255.5, 256, -0.5, 255.5));
598 
599  sHistName =
600  Form("fhPulserTsMsbMatchPerAsicPair_%03u_%03u", uXyterIdx, uXyterIdxB);
601  title = Form("TS MSB for pulser hits in ASIC %03u and %03u; TS MSB %03u "
602  "[bin]; TS MSB %03u [bin]",
603  uXyterIdx,
604  uXyterIdxB,
605  uXyterIdx,
606  uXyterIdxB);
607  fhPulserTsMsbMatchPerAsicPair[uXyterIdx].push_back(
608  new TH2I(sHistName, title, 64, -0.5, 63.5, 64, -0.5, 63.5));
609  } // for( UInt_t uXyterIdxB = 0; uXyterIdxB < fuNbStsXyters; ++uXyterIdxB )
610 
611  sHistName = Form("fhPulserIntervalAsic_%03u", uXyterIdx);
612  title =
613  Form("Time diff between consecutive hits in ASIC %03us; dt [ns]; Counts",
614  uXyterIdx,
615  uXyterIdx);
616  fhPulserIntervalAsic.push_back(
617  new TH1I(sHistName, title, 200, 0, 200 * stsxyter::kdClockCycleNs));
618 
619  sHistName = Form("fhPulserIntervalLongAsic_%03u", uXyterIdx);
620  title =
621  Form("Time diff between consecutive hits in ASIC %03us; dt [ns]; Counts",
622  uXyterIdx,
623  uXyterIdx);
624  fhPulserIntervalLongAsic.push_back(
625  new TH1I(sHistName, title, 1e5, 0, 1e6 * stsxyter::kdClockCycleNs));
626 
628  } // for( UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx )
629 
630 
632 
633  /*
634  // Distribution of the TS_MSB per StsXyter
635  sHistName = "hPulserFebTsMsb";
636  title = "Raw Timestamp Msb distribution per StsXyter; Ts MSB []; StsXyter []; Hits []";
637  fhPulserFebTsMsb = new TH2I( sHistName, title, stsxyter::kuTsMsbNbTsBins, -0.5, stsxyter::kuTsMsbNbTsBins - 0.5,
638  fuNbStsXyters, -0.5, fuNbStsXyters - 0.5 );
639  if( server ) server->Register("/StsRaw", fhPulserFebTsMsb );
640 */
641  // Miscroslice properties histos
642  for (Int_t component = 0; component < kiMaxNbFlibLinks; component++) {
643  fhMsSz[component] = NULL;
644  fhMsSzTime[component] = NULL;
645  } // for( Int_t component = 0; component < kiMaxNbFlibLinks; component ++ )
646 
647  // Online histo browser commands
648  THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
649  if (server) {
650  server->Register("/StsRaw", fhPulserMessType);
651  server->Register("/StsRaw", fhPulserSysMessType);
652  server->Register("/StsRaw", fhPulserMessTypePerDpb);
653  server->Register("/StsRaw", fhPulserSysMessTypePerDpb);
654  server->Register("/StsRaw", fhPulserMessTypePerElink);
655  server->Register("/StsRaw", fhPulserSysMessTypePerElink);
656  for (UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx) {
657  server->Register("/StsRaw", fhPulserChanCntRaw[uXyterIdx]);
658  server->Register("/StsRaw", fhPulserChanCntRawGood[uXyterIdx]);
659  server->Register("/StsRaw", fhPulserChanAdcRaw[uXyterIdx]);
660  server->Register("/StsRaw", fhPulserChanAdcRawProf[uXyterIdx]);
661  server->Register("/StsRaw", fhPulserChanRawTs[uXyterIdx]);
662  server->Register("/StsRaw", fhPulserChanMissEvt[uXyterIdx]);
663  server->Register("/StsRaw", fhPulserChanMissEvtEvo[uXyterIdx]);
664  server->Register("/StsRaw", fhPulserFebMissEvtEvo[uXyterIdx]);
665  server->Register("/StsRaw", fhPulserChanHitRateEvo[uXyterIdx]);
666  server->Register("/StsRaw", fhPulserFebRateEvo[uXyterIdx]);
667  server->Register("/StsRaw", fhPulserChanHitRateEvoLong[uXyterIdx]);
668  server->Register("/StsRaw", fhPulserFebRateEvoLong[uXyterIdx]);
669 
670  server->Register("/DtAsic", fhPulserTimeDiffPerAsic[uXyterIdx]);
671  for (UInt_t uXyterIdxB = 0; uXyterIdxB < fuNbStsXyters; ++uXyterIdxB) {
672  if (uXyterIdxB == uXyterIdx) {
673  server->Register("/DtChan",
674  fhPulserTimeDiffPerAsicPair[uXyterIdx][uXyterIdxB]);
675  server->Register(
676  "/DtChan", fhPulserTimeDiffEvoPerAsicPair[uXyterIdx][uXyterIdxB]);
677  } // if( uXyterIdxB == uXyterIdx )
678  else {
679  server->Register("/DtAsicPair",
680  fhPulserTimeDiffPerAsicPair[uXyterIdx][uXyterIdxB]);
681  server->Register(
682  "/DtAsicPair",
683  fhPulserTimeDiffEvoPerAsicPair[uXyterIdx][uXyterIdxB]);
684  } // else of if( uXyterIdxB == uXyterIdx )
685  server->Register("/TsMatch",
686  fhPulserTsLsbMatchPerAsicPair[uXyterIdx][uXyterIdxB]);
687  server->Register("/TsMatch",
688  fhPulserTsMsbMatchPerAsicPair[uXyterIdx][uXyterIdxB]);
689  } // for( UInt_t uXyterIdxB = 0; uXyterIdxB < fuNbStsXyters; ++uXyterIdxB )
690  server->Register("/DtPulses", fhPulserIntervalAsic[uXyterIdx]);
691  server->Register("/DtPulses", fhPulserIntervalLongAsic[uXyterIdx]);
692 
693  } // for( UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx )
694 
695  server->RegisterCommand("/Reset_All_Pulser", "bCosy2018ResetPulser=kTRUE");
696  server->RegisterCommand("/Write_All_Pulser", "bCosy2018WritePulser=kTRUE");
697 
698  server->Restrict("/Reset_All_Pulser", "allow=admin");
699  server->Restrict("/Write_All_Pulser", "allow=admin");
700  } // if( server )
701 
703  Double_t w = 10;
704  Double_t h = 10;
705 
706  // Summary per StsXyter
707  for (UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx) {
708  TCanvas* cStsSumm =
709  new TCanvas(Form("cStsSum_%03u", uXyterIdx),
710  Form("Summary plots for StsXyter %03u", uXyterIdx),
711  w,
712  h);
713  cStsSumm->Divide(2, 2);
714 
715  cStsSumm->cd(1);
716  gPad->SetLogy();
717  fhPulserChanCntRaw[uXyterIdx]->Draw();
718 
719  cStsSumm->cd(2);
720  gPad->SetLogz();
721  fhPulserChanAdcRaw[uXyterIdx]->Draw("colz");
722 
723  cStsSumm->cd(3);
724  gPad->SetLogz();
725  fhPulserChanHitRateEvo[uXyterIdx]->Draw("colz");
726 
727  cStsSumm->cd(4);
728  // gPad->SetLogy();
729  fhPulserChanAdcRawProf[uXyterIdx]->Draw();
730  } // for( UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx )
731 
732  //====================================================================//
733 
734  //====================================================================//
735  TCanvas* cDtPerAsic =
736  new TCanvas("cDtPerAsic", "Time Differences per ASIC", w, h);
737  cDtPerAsic->Divide(fuNbStsXyters / 2 + fuNbStsXyters % 2, 2);
738 
739  for (UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx) {
740  cDtPerAsic->cd(1 + uXyterIdx);
741  gPad->SetGridx();
742  gPad->SetGridy();
743  gPad->SetLogz();
744  fhPulserTimeDiffPerAsic[uXyterIdx]->Draw(" colz");
745  } // for( UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx )
746  //====================================================================//
747 
748  //====================================================================//
749  TCanvas* cDtInAsic =
750  new TCanvas("cDtInAsic", "Time Differences in ASIC", w, h);
751  cDtInAsic->Divide(fuNbStsXyters / 2 + fuNbStsXyters % 2, 2);
752 
753  for (UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx) {
754  cDtInAsic->cd(1 + uXyterIdx);
755  gPad->SetGridx();
756  gPad->SetLogy();
757  fhPulserTimeDiffPerAsicPair[uXyterIdx][uXyterIdx]->Draw("hist");
758  } // for( UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx )
759  //====================================================================//
760 
761  //====================================================================//
762  TCanvas* cDtAsicPairs =
763  new TCanvas("cDtAsicPairs", "Time Differences in ASIC", w, h);
764  // cDtAsicPairs->Divide( fuNbStsXyters / 3, 3 );
765  cDtAsicPairs->Divide(3);
766 
767  for (UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters && uXyterIdx < 3;
768  ++uXyterIdx) {
769  for (UInt_t uXyterIdxB = uXyterIdx + 1; uXyterIdxB < fuNbStsXyters;
770  ++uXyterIdxB) {
771  cDtAsicPairs->cd(uXyterIdx + uXyterIdxB);
772  gPad->SetGridx();
773  gPad->SetLogy();
774  fhPulserTimeDiffPerAsicPair[uXyterIdx][uXyterIdxB]->Draw("hist");
775  } // for( UInt_t uXyterIdxB = 0; uXyterIdxB < fuNbStsXyters; ++uXyterIdxB )
776  } // for( UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx )
777  //====================================================================//
778 
779  //====================================================================//
780  TCanvas* cTsLsbAsicPairs =
781  new TCanvas("cTsLsbAsicPairs", "Time Differences in ASIC", w, h);
782  // cDtAsicPairs->Divide( fuNbStsXyters / 3, 3 );
783  cTsLsbAsicPairs->Divide(3);
784 
785  for (UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters && uXyterIdx < 3;
786  ++uXyterIdx) {
787  for (UInt_t uXyterIdxB = uXyterIdx + 1; uXyterIdxB < fuNbStsXyters;
788  ++uXyterIdxB) {
789  cTsLsbAsicPairs->cd(uXyterIdx + uXyterIdxB);
790  gPad->SetGridx();
791  gPad->SetGridy();
792  gPad->SetLogz();
793  fhPulserTsLsbMatchPerAsicPair[uXyterIdx][uXyterIdxB]->Draw("colz");
794  } // for( UInt_t uXyterIdxB = 0; uXyterIdxB < fuNbStsXyters; ++uXyterIdxB )
795  } // for( UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx )
796  //====================================================================//
797 
798  //====================================================================//
799  TCanvas* cTsMsbAsicPairs =
800  new TCanvas("cTsMsbAsicPairs", "Time Differences in ASIC", w, h);
801  // cDtAsicPairs->Divide( fuNbStsXyters / 3, 3 );
802  cTsMsbAsicPairs->Divide(3);
803 
804  for (UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters && uXyterIdx < 3;
805  ++uXyterIdx) {
806  for (UInt_t uXyterIdxB = uXyterIdx + 1; uXyterIdxB < fuNbStsXyters;
807  ++uXyterIdxB) {
808  cTsMsbAsicPairs->cd(uXyterIdx + uXyterIdxB);
809  gPad->SetGridx();
810  gPad->SetGridy();
811  gPad->SetLogz();
812  fhPulserTsMsbMatchPerAsicPair[uXyterIdx][uXyterIdxB]->Draw("colz");
813  } // for( UInt_t uXyterIdxB = 0; uXyterIdxB < fuNbStsXyters; ++uXyterIdxB )
814  } // for( UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx )
815  //====================================================================//
816 
817  //====================================================================//
819  // Try to recover canvas in case it was created already by another monitor
820  // If not existing, create it
821  fcMsSizeAll = dynamic_cast<TCanvas*>(gROOT->FindObject("cMsSizeAll"));
822  if (NULL == fcMsSizeAll) {
823  fcMsSizeAll =
824  new TCanvas("cMsSizeAll", "Evolution of MS size in last 300 s", w, h);
825  fcMsSizeAll->Divide(4, 4);
826  LOG(info) << "Created MS size canvas in STS monitor";
827  } // if( NULL == fcMsSizeAll )
828  else
829  LOG(info) << "Recovered MS size canvas in STS monitor";
830  //====================================================================//
831 
832  /*****************************/
833 }
834 
835 Bool_t CbmCosy2018MonitorPulser::DoUnpack(const fles::Timeslice& ts,
836  size_t component) {
837  THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
838 
839  if (bCosy2018ResetPulser) {
840  ResetAllHistos();
841  bCosy2018ResetPulser = kFALSE;
842  } // if( bCosy2018ResetPulser )
843  if (bCosy2018WritePulser) {
845  bCosy2018WritePulser = kFALSE;
846  } // if( bCosy2018WritePulser )
847 
848  LOG(debug) << "Timeslice contains " << ts.num_microslices(component)
849  << "microslices.";
850 
851  if (component < kiMaxNbFlibLinks)
852  if (NULL == fhMsSz[component]) {
853  TString sMsSzName = Form("MsSz_link_%02lu", component);
854  TString sMsSzTitle =
855  Form("Size of MS for nDPB of link %02lu; Ms Size [bytes]", component);
856  fhMsSz[component] =
857  new TH1F(sMsSzName.Data(), sMsSzTitle.Data(), 160000, 0., 20000.);
858  fHM->Add(sMsSzName.Data(), fhMsSz[component]);
859  if (server) server->Register("/FlibRaw", fhMsSz[component]);
860  sMsSzName = Form("MsSzTime_link_%02lu", component);
861  sMsSzTitle = Form(
862  "Size of MS vs time for gDPB of link %02lu; Time[s] ; Ms Size [bytes]",
863  component);
864  fhMsSzTime[component] =
865  new TProfile(sMsSzName.Data(), sMsSzTitle.Data(), 15000, 0., 300.);
866  fHM->Add(sMsSzName.Data(), fhMsSzTime[component]);
867  if (server) server->Register("/FlibRaw", fhMsSzTime[component]);
868  if (NULL != fcMsSizeAll) {
869  fcMsSizeAll->cd(1 + component);
870  gPad->SetLogy();
871  fhMsSzTime[component]->Draw("hist le0");
872  } // if( NULL != fcMsSizeAll )
873  LOG(info) << "Added MS size histo for component: " << component
874  << " (DPB)";
875  } // if( NULL == fhMsSz[ component ] )
876 
877  // Int_t messageType = -111;
878  // Loop over microslices
879  size_t numCompMsInTs = ts.num_microslices(component);
880  /*
881  if( fulCurrentTsIdx + 1 != ts.index() && 0 == component)
882  LOG(info) << "Missed TS from " << fulCurrentTsIdx
883  << " to " << ts.index();
884 */
885  fulCurrentTsIdx = ts.index();
886 
887  if (fuMaxNbMicroslices < numCompMsInTs) {
888  fuMaxNbMicroslices = numCompMsInTs;
889 
894  for (UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx) {
895  fvuChanNbHitsInMs[uXyterIdx].resize(fuNbChanPerAsic);
896  fvdChanLastHitTimeInMs[uXyterIdx].resize(fuNbChanPerAsic);
897  fvusChanLastHitAdcInMs[uXyterIdx].resize(fuNbChanPerAsic);
898  for (UInt_t uChan = 0; uChan < fuNbChanPerAsic; ++uChan) {
899  fvuChanNbHitsInMs[uXyterIdx][uChan].resize(fuMaxNbMicroslices);
900  fvdChanLastHitTimeInMs[uXyterIdx][uChan].resize(fuMaxNbMicroslices);
901  fvusChanLastHitAdcInMs[uXyterIdx][uChan].resize(fuMaxNbMicroslices);
902  for (UInt_t uMsIdx = 0; uMsIdx < fuMaxNbMicroslices; ++uMsIdx) {
903  fvuChanNbHitsInMs[uXyterIdx][uChan][uMsIdx] = 0;
904  fvdChanLastHitTimeInMs[uXyterIdx][uChan][uMsIdx] = -1.0;
905  fvusChanLastHitAdcInMs[uXyterIdx][uChan][uMsIdx] = 0;
906  } // for( UInt_t uMsIdx = 0; uMsIdx < fuMaxNbMicroslices; ++uMsIdx )
907  } // for( UInt_t uChan = 0; uChan < fuNbChanPerAsic; ++uChan )
908  } // for( UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx )
909  LOG(info)
910  << "CbmCosy2018MonitorPulser::DoUnpack => Changed fvuChanNbHitsInMs size "
911  << fvuChanNbHitsInMs.size() << " VS " << fuNbStsXyters;
912  LOG(info) << "CbmCosy2018MonitorPulser::DoUnpack => Changed "
913  "fvuChanNbHitsInMs size "
914  << fvuChanNbHitsInMs[0].size() << " VS " << fuNbChanPerAsic;
915  LOG(info) << "CbmCosy2018MonitorPulser::DoUnpack => Changed "
916  "fvuChanNbHitsInMs size "
917  << fvuChanNbHitsInMs[0][0].size() << " VS " << fuMaxNbMicroslices;
918  } // if( fuMaxNbMicroslices < numCompMsInTs )
919 
920  for (size_t m = 0; m < numCompMsInTs; ++m) {
921  // Ignore overlap ms if number defined by user
922  if (numCompMsInTs - fuOverlapMsNb <= m) continue;
923 
924  auto msDescriptor = ts.descriptor(component, m);
925  fuCurrentEquipmentId = msDescriptor.eq_id;
926  const uint8_t* msContent =
927  reinterpret_cast<const uint8_t*>(ts.content(component, m));
928 
929  uint32_t size = msDescriptor.size;
930  fulCurrentMsIdx = msDescriptor.idx;
931  Double_t dMsTime = (1e-9) * static_cast<double>(fulCurrentMsIdx);
932  LOG(debug) << "Microslice: " << fulCurrentMsIdx << " from EqId " << std::hex
933  << fuCurrentEquipmentId << std::dec << " has size: " << size;
934 
935  fuCurrDpbId = static_cast<uint32_t>(fuCurrentEquipmentId & 0xFFFF);
937 
938  if (component < kiMaxNbFlibLinks) {
939  if (fdStartTimeMsSz < 0) fdStartTimeMsSz = dMsTime;
940  fhMsSz[component]->Fill(size);
941  fhMsSzTime[component]->Fill(dMsTime - fdStartTimeMsSz, size);
942  } // if( component < kiMaxNbFlibLinks )
943 
944  // Store MS time for coincidence plots
945  fvdMsTime[m] = dMsTime;
946 
947  // If not integer number of message in input buffer, print warning/error
948  if (0 != (size % kuBytesPerMessage))
949  LOG(error) << "The input microslice buffer does NOT "
950  << "contain only complete nDPB messages!";
951 
952  // Compute the number of complete messages in the input microslice buffer
953  uint32_t uNbMessages =
954  (size - (size % kuBytesPerMessage)) / kuBytesPerMessage;
955 
956  // Prepare variables for the loop on contents
957  const uint32_t* pInBuff = reinterpret_cast<const uint32_t*>(msContent);
958 
959  for (uint32_t uIdx = 0; uIdx < uNbMessages; ++uIdx) {
960  // Fill message
961  uint32_t ulData = static_cast<uint32_t>(pInBuff[uIdx]);
962 
963  stsxyter::Message mess(static_cast<uint32_t>(ulData & 0xFFFFFFFF));
964 
965  // Print message if requested
966  if (fbPrintMessages) mess.PrintMess(std::cout, fPrintMessCtrl);
967 
968  stsxyter::MessType typeMess = mess.GetMessType();
969  fmMsgCounter[typeMess]++;
970  fhPulserMessType->Fill(static_cast<uint16_t>(typeMess));
972  static_cast<uint16_t>(typeMess));
973 
974  switch (typeMess) {
976  // Extract the eLink and Asic indices => Should GO IN the fill method now that obly hits are link/asic specific!
977  UShort_t usElinkIdx = mess.GetLinkIndex();
978  if (fuNbElinksPerDpb <= usElinkIdx) {
979  LOG(fatal) << "CbmCosy2018MonitorPulser::DoUnpack => "
980  << "eLink index out of bounds!" << usElinkIdx << " VS "
981  << fuNbElinksPerDpb;
982  } // if( fuNbElinksPerDpb <= usElinkIdx )
984  + usElinkIdx,
985  static_cast<uint16_t>(typeMess));
986 
987  UInt_t uAsicIdx = fvuElinkToAsic[fuCurrDpbIdx][usElinkIdx];
988 
989  FillHitInfo(mess, usElinkIdx, uAsicIdx, m);
990  break;
991  } // case stsxyter::MessType::Hit :
993  FillTsMsbInfo(mess, uIdx, m);
994  break;
995  } // case stsxyter::MessType::TsMsb :
997  // The first message in the TS is a special ones: EPOCH
998  FillEpochInfo(mess);
999 
1000  if (0 < uIdx)
1001  LOG(info) << "CbmCosy2018MonitorPulser::DoUnpack => "
1002  << "EPOCH message at unexpected position in MS: message "
1003  << uIdx << " VS message 0 expected!";
1004  break;
1005  } // case stsxyter::MessType::TsMsb :
1007  // FillTsMsbInfo( mess );
1008  break;
1009  } // case stsxyter::MessType::Empty :
1011  break;
1012  } // case stsxyter::MessType::Dummy / ReadDataAck / Ack :
1013  default: {
1014  LOG(fatal)
1015  << "CbmCosy2018MonitorPulser::DoUnpack => "
1016  << "Unknown message type, should never happen, stopping here!";
1017  }
1018  } // switch( mess.GetMessType() )
1019  } // for( uint32_t uIdx = 0; uIdx < uNbMessages; ++uIdx )
1020  } // for( size_t m = 0; m < numCompMsInTs; ++m )
1021 
1022  // End of TS, check if stuff to do with the hits inside each MS
1023  // Usefull for low rate pulser tests
1024  // Need to do it only when last DPB is processed, as they are done one by one
1025  if (fuCurrDpbIdx == fuNrOfDpbs - 1) {
1027  // Sort the buffer of hits
1028  std::sort(fvmHitsInTs.begin(), fvmHitsInTs.end());
1029 
1030  // Time differences plotting using the fully time sorted hits
1031  if (0 < fvmHitsInTs.size()) {
1032  ULong64_t ulLastHitTime = (*(fvmHitsInTs.rbegin())).GetTs();
1033  std::vector<stsxyter::FinalHit>::iterator it;
1034  std::vector<stsxyter::FinalHit>::iterator itB;
1035 
1036  std::chrono::steady_clock::time_point tNow =
1037  std::chrono::steady_clock::now();
1038  Double_t dUnixTimeInRun =
1039  std::chrono::duration_cast<std::chrono::seconds>(tNow - ftStartTimeUnix)
1040  .count();
1041 
1042  for (
1043  it = fvmHitsInTs.begin(); it != fvmHitsInTs.end();
1044  // it != fvmHitsInTs.end() && (*it).GetTs() < ulLastHitTime - 320; // 320 * 3.125 ns = 1000 ns
1045  ++it) {
1046  UShort_t usAsicIdx = (*it).GetAsic();
1047  UShort_t usChanIdx = (*it).GetChan();
1048  ULong64_t ulHitTs = (*it).GetTs();
1049  UShort_t usHitAdc = (*it).GetAdc();
1050 
1051  Double_t dTimeSinceStartSec =
1052  (ulHitTs * stsxyter::kdClockCycleNs - fdStartTime) * 1e-9;
1053 
1054  fvmAsicHitsInTs[usAsicIdx].push_back((*it));
1055  } // loop on time sorted hits and split per asic
1056 
1057  // Remove all hits which were already used
1058  fvmHitsInTs.erase(fvmHitsInTs.begin(), it);
1059 
1060  for (UInt_t uAsic = 0; uAsic < fuNbStsXyters; uAsic++) {
1061  for (it = fvmAsicHitsInTs[uAsic].begin();
1062  it != fvmAsicHitsInTs[uAsic].end();
1063  ++it) {
1064  UShort_t usChanIdx = (*it).GetChan();
1065  if (0.0 == fdStartTs)
1066  fdStartTs = (*it).GetTs() * stsxyter::kdClockCycleNs;
1067  Double_t dTimeSinceStartSec =
1068  ((*it).GetTs() * stsxyter::kdClockCycleNs - fdStartTs) * 1e-9;
1069 
1070  for (UInt_t uAsicB = uAsic; uAsicB < fuNbStsXyters; uAsicB++) {
1071  for (itB = fvmAsicHitsInTs[uAsicB].begin();
1072  itB != fvmAsicHitsInTs[uAsicB].end();
1073  ++itB) {
1074  UShort_t usChanIdxB = (*itB).GetChan();
1075  Double_t dDt = (static_cast<Double_t>((*itB).GetTs())
1076  - static_cast<Double_t>((*it).GetTs()))
1078 
1079  fhPulserTimeDiffPerAsic[uAsic]->Fill(dDt, uAsicB);
1080  fhPulserTimeDiffPerAsicPair[uAsic][uAsicB]->Fill(dDt);
1081  fhPulserTimeDiffEvoPerAsicPair[uAsic][uAsicB]->Fill(
1082  dTimeSinceStartSec, dDt);
1083 
1084  fhPulserTsLsbMatchPerAsicPair[uAsic][uAsicB]->Fill(
1085  (*it).GetTs() & 0x000FF, (*itB).GetTs() & 0x000FF);
1086  fhPulserTsMsbMatchPerAsicPair[uAsic][uAsicB]->Fill(
1087  ((*it).GetTs() & 0x03F00) >> 8,
1088  ((*itB).GetTs() & 0x03F00) >> 8);
1089  } // for( it = fvmAsicHitsInTs[ uAsicB ].begin(); it != fvmAsicHitsInTs[ uAsicB ].end(); ++it )
1090  } // for( UInt_t uAsic = 0; uAsic < fuNbStsXyters; uAsic++)
1091 
1092  Double_t dDtPulse =
1093  (static_cast<Double_t>((*it).GetTs())
1094  - static_cast<Double_t>(fvmLastHitAsic[uAsic].GetTs()))
1096  fhPulserIntervalAsic[uAsic]->Fill(dDtPulse);
1097  fhPulserIntervalLongAsic[uAsic]->Fill(dDtPulse);
1098  fvmLastHitAsic[uAsic] = (*it);
1099  } // for( it = fvmAsicHitsInTs[ uAsic ].begin(); it != fvmAsicHitsInTs[ uAsic ].end(); ++it )
1100 
1102  fvmAsicHitsInTs[uAsic].clear();
1103  } // for( UInt_t uAsic = 0; uAsic < fuNbStsXyters; uAsic++)
1104  } // if( 0 < fvmHitsInTs.size() )
1105 
1106  for (UInt_t uMsIdx = 0; uMsIdx < fuMaxNbMicroslices; ++uMsIdx) {
1107  fvdMsTime[uMsIdx] = 0.0;
1108  } // for( UInt_t uMsIdx = 0; uMsIdx < fuMaxNbMicroslices; ++uMsIdx )
1109  } // if( fuCurrDpbIdx == fuNrOfDpbs - 1 )
1110 
1111  if (0 == ts.index() % 1000 && fuCurrDpbIdx == fuNrOfDpbs - 1) {
1112  for (UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb) {
1113  Double_t dTsMsbTime =
1114  static_cast<ULong64_t>(stsxyter::kuHitNbTsBins)
1115  * static_cast<ULong64_t>(fvulCurrentTsMsb[fuCurrDpbIdx])
1116  + static_cast<ULong64_t>(stsxyter::kulTsCycleNbBins)
1117  * static_cast<ULong64_t>(fvuCurrentTsMsbCycle[fuCurrDpbIdx]);
1118  dTsMsbTime *= stsxyter::kdClockCycleNs * 1e-9;
1119 
1120  LOG(info) << "End of TS " << std::setw(7) << ts.index() << " eDPB "
1121  << std::setw(2) << uDpb << " current TS MSB counter is "
1122  << std::setw(12) << fvulCurrentTsMsb[uDpb]
1123  << " current TS MSB cycle counter is " << std::setw(12)
1124  << fvuCurrentTsMsbCycle[uDpb] << " current TS MSB time is "
1125  << std::setw(12) << dTsMsbTime << " s";
1126  }
1127  } // if( 0 == ts.index() % 1000 && fuCurrDpbIdx == fuNrOfDpbs - 1 )
1128 
1129  return kTRUE;
1130 }
1131 
1133  const UShort_t& usElinkIdx,
1134  const UInt_t& uAsicIdx,
1135  const UInt_t& uMsIdx) {
1136  UShort_t usChan = mess.GetHitChannel();
1137  UShort_t usRawAdc = mess.GetHitAdc();
1138  // UShort_t usFullTs = mess.GetHitTimeFull();
1139  UShort_t usTsOver = mess.GetHitTimeOver();
1140  UShort_t usRawTs = mess.GetHitTime();
1141 
1142  fhPulserChanCntRaw[uAsicIdx]->Fill(usChan);
1143  fhPulserChanAdcRaw[uAsicIdx]->Fill(usChan, usRawAdc);
1144  fhPulserChanAdcRawProf[uAsicIdx]->Fill(usChan, usRawAdc);
1145  fhPulserChanRawTs[uAsicIdx]->Fill(usChan, usRawTs);
1146  fhPulserChanMissEvt[uAsicIdx]->Fill(usChan, mess.IsHitMissedEvts());
1147 
1148  // Compute the Full time stamp
1149  Long64_t ulOldHitTime = fvulChanLastHitTime[uAsicIdx][usChan];
1150  Double_t dOldHitTime = fvdChanLastHitTime[uAsicIdx][usChan];
1151 
1152  // Use TS w/o overlap bits as they will anyway come from the TS_MSB
1153  fvulChanLastHitTime[uAsicIdx][usChan] = usRawTs;
1154 
1155  fvulChanLastHitTime[uAsicIdx][usChan] +=
1156  static_cast<ULong64_t>(stsxyter::kuHitNbTsBins)
1157  * static_cast<ULong64_t>(fvulCurrentTsMsb[fuCurrDpbIdx])
1158  + static_cast<ULong64_t>(stsxyter::kulTsCycleNbBins)
1159  * static_cast<ULong64_t>(fvuCurrentTsMsbCycle[fuCurrDpbIdx]);
1160 
1161  // fvuElinkLastTsHit[fuCurrDpbIdx] = usRawTs;
1162 
1163  // Convert the Hit time in bins to Hit time in ns
1164  Double_t dHitTimeNs =
1165  fvulChanLastHitTime[uAsicIdx][usChan] * stsxyter::kdClockCycleNs;
1166  /*
1167  // If needed fill the hit interval plots
1168  if( fbChanHitDtEna )
1169  {
1170  Double_t dDeltaT = dHitTimeNs - fvdChanLastHitTime[ uAsicIdx ][ usChan ];
1171  if( 0 == dDeltaT )
1172  fhStsChanHitDtNeg[ uAsicIdx ]->Fill( 1, usChan );
1173  else if( 0 < dDeltaT )
1174  fhStsChanHitDt[ uAsicIdx ]->Fill( dDeltaT, usChan );
1175  else fhStsChanHitDtNeg[ uAsicIdx ]->Fill( -dDeltaT, usChan );
1176  } // if( fbChanHitDtEna )
1177 */
1178  // Store new value of Hit time in ns
1179  fvdChanLastHitTime[uAsicIdx][usChan] =
1180  fvulChanLastHitTime[uAsicIdx][usChan] * stsxyter::kdClockCycleNs;
1181  /*
1182  LOG(info) << " Asic " << std::setw( 2 ) << uAsicIdx
1183  << " Channel " << std::setw( 3 ) << usChan
1184  << " Diff to last hit " << std::setw( 12 ) << ( fvulChanLastHitTime[ uAsicIdx ][ usChan ] - ulOldHitTime)
1185  << " in s " << std::setw( 12 ) << ( fvdChanLastHitTime[ uAsicIdx ][ usChan ] - dOldHitTime) * 1e-9;
1186 */
1187  // Pulser and MS
1188  fvuChanNbHitsInMs[uAsicIdx][usChan][uMsIdx]++;
1189  fvdChanLastHitTimeInMs[uAsicIdx][usChan][uMsIdx] = dHitTimeNs;
1190  fvusChanLastHitAdcInMs[uAsicIdx][usChan][uMsIdx] = usRawAdc;
1191  /*
1192  fvmChanHitsInTs[ uAsicIdx ][ usChan ].insert( stsxyter::FinalHit( fvulChanLastHitTime[ uAsicIdx ][ usChan ],
1193  usRawAdc, uAsicIdx, usChan ) );
1194 */
1195  fvmHitsInTs.push_back(stsxyter::FinalHit(
1196  fvulChanLastHitTime[uAsicIdx][usChan], usRawAdc, uAsicIdx, usChan));
1197 
1198  /*
1199  LOG(info) << " TS " << std::setw( 12 ) << fulCurrentTsIdx
1200  << " MS " << std::setw( 12 ) << fulCurrentMsIdx
1201  << " MsInTs " << std::setw( 3 ) << uMsIdx
1202  << " Asic " << std::setw( 2 ) << uAsicIdx
1203  << " Channel " << std::setw( 3 ) << usChan
1204  << " ADC " << std::setw( 3 ) << usRawAdc
1205  << " TS " << std::setw( 3 ) << usRawTs // 9 bits TS
1206  << " SX TsMsb " << std::setw( 2 ) << ( fvulCurrentTsMsb[fuCurrDpbIdx] & 0x1F ) // Total StsXyter TS = 14 bits => 9b Hit TS + lower 5b TS_MSB after DPB
1207  << " DPB TsMsb " << std::setw( 6 ) << ( fvulCurrentTsMsb[fuCurrDpbIdx] >> 5 ) // Total StsXyter TS = 14 bits => 9b Hit TS + lower 5b of TS_MSB after DPB
1208  << " TsMsb " << std::setw( 7 ) << fvulCurrentTsMsb[fuCurrDpbIdx]
1209  << " MsbCy " << std::setw( 4 ) << fvuCurrentTsMsbCycle[fuCurrDpbIdx]
1210  << " Time " << std::setw ( 12 ) << fvulChanLastHitTime[ uAsicIdx ][ usChan ];
1211 */
1212  // Check Starting point of histos with time as X axis
1213  if (-1 == fdStartTime) fdStartTime = fvdChanLastHitTime[uAsicIdx][usChan];
1214 
1215  // Fill histos with time as X axis
1216  Double_t dTimeSinceStartSec =
1217  (fvdChanLastHitTime[uAsicIdx][usChan] - fdStartTime) * 1e-9;
1218  Double_t dTimeSinceStartMin = dTimeSinceStartSec / 60.0;
1219  fhPulserChanHitRateEvo[uAsicIdx]->Fill(dTimeSinceStartSec, usChan);
1220  fhPulserFebRateEvo[uAsicIdx]->Fill(dTimeSinceStartSec);
1221  fhPulserChanHitRateEvoLong[uAsicIdx]->Fill(
1222  dTimeSinceStartMin, usChan, 1.0 / 60.0);
1223  fhPulserFebRateEvoLong[uAsicIdx]->Fill(dTimeSinceStartMin, 1.0 / 60.0);
1224  if (mess.IsHitMissedEvts()) {
1225  fhPulserChanMissEvtEvo[uAsicIdx]->Fill(dTimeSinceStartSec, usChan);
1226  fhPulserFebMissEvtEvo[uAsicIdx]->Fill(dTimeSinceStartSec);
1227  } // if( mess.IsHitMissedEvts() )
1228  /*
1229  if( kTRUE == fbLongHistoEnable )
1230  {
1231  std::chrono::steady_clock::time_point tNow = std::chrono::steady_clock::now();
1232  Double_t dUnixTimeInRun = std::chrono::duration_cast< std::chrono::seconds >(tNow - ftStartTimeUnix).count();
1233  fhFebRateEvoLong[ uAsicIdx ]->Fill( dUnixTimeInRun , 1.0 / fuLongHistoBinSizeSec );
1234  fhFebChRateEvoLong[ uAsicIdx ]->Fill( dUnixTimeInRun , usChan, 1.0 / fuLongHistoBinSizeSec );
1235  } // if( kTRUE == fbLongHistoEnable )
1236 */
1237 }
1238 
1240  UInt_t uMessIdx,
1241  UInt_t uMsIdx) {
1242  UInt_t uVal = mess.GetTsMsbVal();
1243  /*
1244  if( 0 == fuCurrDpbIdx )
1245  LOG(info) << " TS " << std::setw( 12 ) << fulCurrentTsIdx
1246  << " MS " << std::setw( 12 ) << fulCurrentMsIdx
1247  << " MsInTs " << std::setw( 3 ) << uMsIdx
1248  << " DPB " << std::setw( 2 ) << fuCurrDpbIdx
1249  << " Mess " << std::setw( 5 ) << uMessIdx
1250  << " TsMsb " << std::setw( 5 ) << uVal;
1251 */
1252  /*
1253  if( (uVal != fvulCurrentTsMsb[fuCurrDpbIdx] + 1) && 0 < uVal &&
1254  !( 1 == uMessIdx && usVal == fvulCurrentTsMsb[fuCurrDpbIdx] ) ) // 1st TS_MSB in MS is always a repeat of the last one in previous MS!
1255  {
1256  LOG(info) << "TS MSB not increasing by 1! TS " << std::setw( 12 ) << fulCurrentTsIdx
1257  << " MS " << std::setw( 12 ) << fulCurrentMsIdx
1258  << " MsInTs " << std::setw( 3 ) << uMsIdx
1259  << " DPB " << std::setw( 2 ) << fuCurrDpbIdx
1260  << " Mess " << std::setw( 5 ) << uMessIdx
1261  << " Old TsMsb " << std::setw( 5 ) << fvulCurrentTsMsb[fuCurrDpbIdx]
1262  << " new TsMsb " << std::setw( 5 ) << uVal
1263  << " Diff " << std::setw( 5 ) << uVal - fvulCurrentTsMsb[fuCurrDpbIdx]
1264  << " Old MsbCy " << std::setw( 5 ) << fvuCurrentTsMsbCycle[fuCurrDpbIdx];
1265  } // if( (uVal != fvulCurrentTsMsb[fuCurrDpbIdx] + 1) && 0 < uVal )
1266 */
1267 
1268  // Update Status counters
1269  if (uVal < fvulCurrentTsMsb[fuCurrDpbIdx]) {
1270 
1271  LOG(info) << " TS " << std::setw(12) << fulCurrentTsIdx << " MS "
1272  << std::setw(12) << fulCurrentMsIdx << " DPB " << std::setw(2)
1273  << fuCurrDpbIdx << " Old TsMsb " << std::setw(5)
1274  << fvulCurrentTsMsb[fuCurrDpbIdx] << " Old MsbCy " << std::setw(5)
1275  << fvuCurrentTsMsbCycle[fuCurrDpbIdx] << " new TsMsb "
1276  << std::setw(5) << uVal;
1277 
1279  } // if( uVal < fvulCurrentTsMsb[fuCurrDpbIdx] )
1281  /*
1282  if( 1 < uMessIdx )
1283  {
1284  fhStsDpbRawTsMsb->Fill( fuCurrDpbIdx, fvulCurrentTsMsb[fuCurrDpbIdx] );
1285  fhStsDpbRawTsMsbSx->Fill( fuCurrDpbIdx, ( fvulCurrentTsMsb[fuCurrDpbIdx] & 0x1F ) );
1286  fhStsDpbRawTsMsbDpb->Fill( fuCurrDpbIdx, ( fvulCurrentTsMsb[fuCurrDpbIdx] >> 5 ) );
1287  } // if( 0 < uMessIdx )
1288 */
1289  // fhStsAsicTsMsb->Fill( fvulCurrentTsMsb[fuCurrDpbIdx], uAsicIdx );
1290 
1291  ULong64_t ulNewTsMsbTime =
1292  static_cast<ULong64_t>(stsxyter::kuHitNbTsBins)
1293  * static_cast<ULong64_t>(fvulCurrentTsMsb[fuCurrDpbIdx])
1294  + static_cast<ULong64_t>(stsxyter::kulTsCycleNbBins)
1295  * static_cast<ULong64_t>(fvuCurrentTsMsbCycle[fuCurrDpbIdx]);
1296 }
1297 
1299  UInt_t uVal = mess.GetTsMsbVal();
1300  /*
1301  // Update Status counters
1302  if( usVal < fvulCurrentTsMsb[fuCurrDpbIdx] )
1303  fvuCurrentTsMsbCycle[fuCurrDpbIdx] ++;
1304  fvulCurrentTsMsb[fuCurrDpbIdx] = usVal;
1305 
1306 // fhStsAsicTsMsb->Fill( fvulCurrentTsMsb[fuCurrDpbIdx], uAsicIdx );
1307 */
1308 }
1309 
1311 
1313 
1314  LOG(info) << "-------------------------------------";
1315  LOG(info) << "CbmCosy2018MonitorPulser statistics are ";
1316  LOG(info) << " Hit messages: " << fmMsgCounter[stsxyter::MessType::Hit]
1317  << "\n"
1318  << " Ts MSB messages: " << fmMsgCounter[stsxyter::MessType::TsMsb]
1319  << "\n"
1320  << " Dummy messages: " << fmMsgCounter[stsxyter::MessType::Dummy]
1321  << "\n"
1322  << " Epoch messages: " << fmMsgCounter[stsxyter::MessType::Epoch]
1323  << "\n"
1324  << " Empty messages: "
1326 
1327  LOG(info) << "-------------------------------------";
1328 
1330  SaveAllHistos();
1331 }
1332 
1333 
1335  TDirectory* oldDir = NULL;
1336  TFile* histoFile = NULL;
1337  if ("" != sFileName) {
1338  // Store current directory position to allow restore later
1339  oldDir = gDirectory;
1340  // open separate histo file in recreate mode
1341  histoFile = new TFile(sFileName, "RECREATE");
1342  histoFile->cd();
1343  } // if( "" != sFileName )
1344 
1345  /***************************/
1346  gDirectory->mkdir("Sts_Raw");
1347  gDirectory->cd("Sts_Raw");
1348 
1349  fhPulserMessType->Write();
1350  fhPulserSysMessType->Write();
1351  fhPulserMessTypePerDpb->Write();
1352  fhPulserSysMessTypePerDpb->Write();
1353  fhPulserMessTypePerElink->Write();
1354  fhPulserSysMessTypePerElink->Write();
1355 
1356  for (UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx) {
1357  fhPulserChanCntRaw[uXyterIdx]->Write();
1358  fhPulserChanAdcRaw[uXyterIdx]->Write();
1359  fhPulserChanAdcRawProf[uXyterIdx]->Write();
1360  fhPulserChanRawTs[uXyterIdx]->Write();
1361  fhPulserChanMissEvt[uXyterIdx]->Write();
1362  fhPulserChanMissEvtEvo[uXyterIdx]->Write();
1363  fhPulserFebMissEvtEvo[uXyterIdx]->Write();
1364  fhPulserChanHitRateEvo[uXyterIdx]->Write();
1365  fhPulserFebRateEvo[uXyterIdx]->Write();
1366  fhPulserChanHitRateEvoLong[uXyterIdx]->Write();
1367  fhPulserFebRateEvoLong[uXyterIdx]->Write();
1368  /*
1369  if( kTRUE == fbLongHistoEnable )
1370  {
1371  fhFebRateEvoLong[ uXyterIdx ]->Write();
1372  fhFebChRateEvoLong[ uXyterIdx ]->Write();
1373  } // if( kTRUE == fbLongHistoEnable )
1374 */
1375  } // for( UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx )
1376 
1377  gDirectory->cd("..");
1378  /***************************/
1379 
1380  /***************************/
1381  // Flib Histos
1382  gDirectory->mkdir("Flib_Raw");
1383  gDirectory->cd("Flib_Raw");
1384  for (UInt_t uLinks = 0; uLinks < kiMaxNbFlibLinks; uLinks++) {
1385  TString sMsSzName = Form("MsSz_link_%02u", uLinks);
1386  if (fHM->Exists(sMsSzName.Data())) fHM->H1(sMsSzName.Data())->Write();
1387 
1388  sMsSzName = Form("MsSzTime_link_%02u", uLinks);
1389  if (fHM->Exists(sMsSzName.Data())) fHM->P1(sMsSzName.Data())->Write();
1390  } // for( UInt_t uLinks = 0; uLinks < 16; uLinks ++)
1391 
1392  TH1* pMissedTsH1 = dynamic_cast<TH1*>(gROOT->FindObjectAny("Missed_TS"));
1393  if (NULL != pMissedTsH1) pMissedTsH1->Write();
1394 
1395  TProfile* pMissedTsEvoP =
1396  dynamic_cast<TProfile*>(gROOT->FindObjectAny("Missed_TS_Evo"));
1397  if (NULL != pMissedTsEvoP) pMissedTsEvoP->Write();
1398 
1399  gDirectory->cd("..");
1400  /***************************/
1401 
1402  if ("" != sFileName) {
1403  // Restore original directory position
1404  histoFile->Close();
1405  oldDir->cd();
1406  } // if( "" != sFileName )
1407 }
1409  LOG(info) << "Reseting all STS histograms.";
1410 
1411  fhPulserMessType->Reset();
1412  fhPulserSysMessType->Reset();
1413  fhPulserMessTypePerDpb->Reset();
1414  fhPulserSysMessTypePerDpb->Reset();
1415  fhPulserMessTypePerElink->Reset();
1416  fhPulserSysMessTypePerElink->Reset();
1417 
1418  for (UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx) {
1419  fhPulserChanCntRaw[uXyterIdx]->Reset();
1420  fhPulserChanAdcRaw[uXyterIdx]->Reset();
1421  fhPulserChanAdcRawProf[uXyterIdx]->Reset();
1422  fhPulserChanRawTs[uXyterIdx]->Reset();
1423  fhPulserChanMissEvt[uXyterIdx]->Reset();
1424  fhPulserChanMissEvtEvo[uXyterIdx]->Reset();
1425  fhPulserFebMissEvtEvo[uXyterIdx]->Reset();
1426  fhPulserChanHitRateEvo[uXyterIdx]->Reset();
1427  fhPulserFebRateEvo[uXyterIdx]->Reset();
1428  fhPulserChanHitRateEvoLong[uXyterIdx]->Reset();
1429  fhPulserFebRateEvoLong[uXyterIdx]->Reset();
1430  /*
1431  if( kTRUE == fbLongHistoEnable )
1432  {
1433  ftStartTimeUnix = std::chrono::steady_clock::now();
1434  fhFebRateEvoLong[ uXyterIdx ]->Reset();
1435  fhFebChRateEvoLong[ uXyterIdx ]->Reset();
1436  } // if( kTRUE == fbLongHistoEnable )
1437 */
1438 
1439  fhPulserTimeDiffPerAsic[uXyterIdx]->Reset();
1440  for (UInt_t uXyterIdxB = 0; uXyterIdxB < fuNbStsXyters; ++uXyterIdxB) {
1441  fhPulserTimeDiffPerAsicPair[uXyterIdx][uXyterIdxB]->Reset();
1442  fhPulserTimeDiffEvoPerAsicPair[uXyterIdx][uXyterIdxB]->Reset();
1443  fhPulserTsLsbMatchPerAsicPair[uXyterIdx][uXyterIdxB]->Reset();
1444  fhPulserTsMsbMatchPerAsicPair[uXyterIdx][uXyterIdxB]->Reset();
1445  } // for( UInt_t uXyterIdxB = 0; uXyterIdxB < fuNbStsXyters; ++uXyterIdxB )
1446  fhPulserIntervalAsic[uXyterIdx]->Reset();
1447  fhPulserIntervalLongAsic[uXyterIdx]->Reset();
1448  } // for( UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx )
1449 
1450  for (UInt_t uLinks = 0; uLinks < kiMaxNbFlibLinks; ++uLinks) {
1451  TString sMsSzName = Form("MsSz_link_%02u", uLinks);
1452  if (fHM->Exists(sMsSzName.Data())) fHM->H1(sMsSzName.Data())->Reset();
1453 
1454  sMsSzName = Form("MsSzTime_link_%02u", uLinks);
1455  if (fHM->Exists(sMsSzName.Data())) fHM->P1(sMsSzName.Data())->Reset();
1456  } // for( UInt_t uLinks = 0; uLinks < kiMaxNbFlibLinks; ++uLinks )
1457 
1458  fdStartTime = -1;
1459  fdStartTimeMsSz = -1;
1460 }
1461 
1463  Int_t timeIn,
1464  Int_t iBinSize) {
1465  TDatime* fRunStartDateTime = new TDatime(dateIn, timeIn);
1466  fiRunStartDateTimeSec = fRunStartDateTime->Convert();
1467  fiBinSizeDatePlots = iBinSize;
1468 
1469  LOG(info) << "Assigned new MUCH Run Start Date-Time: "
1470  << fRunStartDateTime->AsString();
1471 }
1472 
1474  UInt_t uBinSize) {
1475  fbLongHistoEnable = kTRUE;
1476  fuLongHistoNbSeconds = uDurationSeconds;
1477  fuLongHistoBinSizeSec = uBinSize;
1478 }
1479 
CbmCosy2018MonitorPulser::fhPulserMessTypePerDpb
TH2 * fhPulserMessTypePerDpb
Definition: CbmMcbm2018MonitorStsPulser.h:164
CbmHistManager::P1
TProfile * P1(const std::string &name) const
Return pointer to TProfile.
Definition: CbmHistManager.h:263
bCosy2018WritePulser
Bool_t bCosy2018WritePulser
Definition: CbmMcbm2018MonitorStsPulser.cxx:40
CbmCosy2018MonitorPulser::fPrintMessCtrl
stsxyter::MessagePrintMask fPrintMessCtrl
Definition: CbmMcbm2018MonitorStsPulser.h:100
CbmHistManager::Exists
Bool_t Exists(const std::string &name) const
Check existence of histogram in manager.
Definition: CbmHistManager.h:303
CbmCosy2018MonitorPulser::fuNbStsXyters
UInt_t fuNbStsXyters
Number of possible eLinks per DPB.
Definition: CbmMcbm2018MonitorStsPulser.h:85
CbmCosy2018MonitorPulser::fvuElinkLastTsHit
std::vector< UInt_t > fvuElinkLastTsHit
Current TS MSB cycle for DPB.
Definition: CbmMcbm2018MonitorStsPulser.h:119
CbmCosy2018MonitorPulser::FillEpochInfo
void FillEpochInfo(stsxyter::Message mess)
Definition: CbmMcbm2018MonitorStsPulser.cxx:1298
CbmCosy2018MonitorPulser::fvdChanLastHitTimeInMs
std::vector< std::vector< std::vector< Double_t > > > fvdChanLastHitTimeInMs
Number of hits in each MS for each Channel.
Definition: CbmMcbm2018MonitorStsPulser.h:129
CbmCosy2018MonitorPulser
Definition: CbmMcbm2018MonitorStsPulser.h:32
CbmCosy2018MonitorPulser::ReInitContainers
Bool_t ReInitContainers()
Definition: CbmMcbm2018MonitorStsPulser.cxx:147
CbmCosy2018MonitorPulser::fvulCurrentTsMsb
std::vector< ULong64_t > fvulCurrentTsMsb
Bin size in s for the plots with date as X axis.
Definition: CbmMcbm2018MonitorStsPulser.h:117
CbmCosy2018MonitorPulser::fdStartTs
Double_t fdStartTs
Pulser time difference histos.
Definition: CbmMcbm2018MonitorStsPulser.h:192
CbmCosy2018MonitorPulser::SetCoincidenceBorder
void SetCoincidenceBorder(Double_t dCenterPos, Double_t dBorderVal)
Definition: CbmMcbm2018MonitorStsPulser.cxx:255
CbmCosy2018MonitorPulser::fDpbIdIndexMap
std::map< UInt_t, UInt_t > fDpbIdIndexMap
Total number of Sts DPBs in system.
Definition: CbmMcbm2018MonitorStsPulser.h:83
CbmCosy2018MonitorPulser::fvuElinkToAsic
std::vector< std::vector< UInt_t > > fvuElinkToAsic
Number of channels per StsXyter ASIC => should be constant somewhere!!!!
Definition: CbmMcbm2018MonitorStsPulser.h:89
stsxyter::Message
Definition: StsXyterMessage.h:165
gdpbv100::msg_print_Human
@ msg_print_Human
Definition: gDpbMessv100.h:91
CbmCosy2018MonitorPulser::fvdChanLastHitTime
std::vector< std::vector< Double_t > > fvdChanLastHitTime
Last hit time in bins for each Channel.
Definition: CbmMcbm2018MonitorStsPulser.h:124
CbmCosy2018MonitorPulser::fhPulserTimeDiffPerAsic
std::vector< TH2 * > fhPulserTimeDiffPerAsic
Last hits in each ASIC.
Definition: CbmMcbm2018MonitorStsPulser.h:194
CbmCosy2018MonitorPulser::fuNbChanPerAsic
UInt_t fuNbChanPerAsic
Number of StsXyter ASICs.
Definition: CbmMcbm2018MonitorStsPulser.h:87
CbmCosy2018MonitorPulser::fhPulserFebMissEvtEvo
std::vector< TH1 * > fhPulserFebMissEvtEvo
Definition: CbmMcbm2018MonitorStsPulser.h:183
CbmCosy2018MonitorPulser::fulCurrentMsIdx
ULong64_t fulCurrentMsIdx
Definition: CbmMcbm2018MonitorStsPulser.h:103
CbmCosy2018MonitorPulser::fuCurrDpbId
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
Definition: CbmMcbm2018MonitorStsPulser.h:109
CbmCosy2018MonitorPulser::fhPulserIntervalLongAsic
std::vector< TH1 * > fhPulserIntervalLongAsic
Definition: CbmMcbm2018MonitorStsPulser.h:200
CbmCosy2018MonitorPulser::CbmCosy2018MonitorPulser
CbmCosy2018MonitorPulser()
Definition: CbmMcbm2018MonitorStsPulser.cxx:42
CbmCosy2018MonitorPulser::fuLongHistoNbSeconds
UInt_t fuLongHistoNbSeconds
Definition: CbmMcbm2018MonitorStsPulser.h:150
stsxyter::Message::GetTsMsbVal
uint32_t GetTsMsbVal() const
For TS MSB data: Returns the TS MSB 22 bit field)
Definition: StsXyterMessage.h:334
stsxyter::Message::GetLinkIndex
uint16_t GetLinkIndex() const
For all data: Returns the (global) index of the eLink on which the message was received (n bit field)
Definition: StsXyterMessage.h:249
stsxyter::MessType
MessType
Message types.
Definition: StsXyterMessage.h:27
CbmCosy2018MonitorPulser::fUnpackParHodo
CbmCern2017UnpackParHodo * fUnpackParHodo
Definition: CbmMcbm2018MonitorStsPulser.h:80
CbmCosy2018MonitorPulser::fuCurrDpbIdx
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
Definition: CbmMcbm2018MonitorStsPulser.h:111
stsxyter::kulTsCycleNbBins
static const uint64_t kulTsCycleNbBins
Definition: StsXyterMessage.h:152
CbmCosy2018MonitorPulser::SaveAllHistos
void SaveAllHistos(TString sFileName="")
Definition: CbmMcbm2018MonitorStsPulser.cxx:1334
CbmCosy2018MonitorPulser::DoUnpack
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
Definition: CbmMcbm2018MonitorStsPulser.cxx:835
CbmCosy2018MonitorPulser::~CbmCosy2018MonitorPulser
virtual ~CbmCosy2018MonitorPulser()
Definition: CbmMcbm2018MonitorStsPulser.cxx:118
CbmCosy2018MonitorPulser::fdCoincMax
Double_t fdCoincMax
Definition: CbmMcbm2018MonitorStsPulser.h:158
CbmHistManager.h
Histogram manager.
stsxyter::Message::IsHitMissedEvts
bool IsHitMissedEvts() const
For Hit data: Returns Missed event flag (1 bit field)
Definition: StsXyterMessage.h:301
CbmCosy2018MonitorPulser::fbPrintMessages
Bool_t fbPrintMessages
Definition: CbmMcbm2018MonitorStsPulser.h:99
CbmCosy2018MonitorPulser::fuLongHistoBinSizeSec
UInt_t fuLongHistoBinSizeSec
Definition: CbmMcbm2018MonitorStsPulser.h:151
CbmCosy2018MonitorPulser::fhPulserTsMsbMatchPerAsicPair
std::vector< std::vector< TH2 * > > fhPulserTsMsbMatchPerAsicPair
Definition: CbmMcbm2018MonitorStsPulser.h:198
CbmCosy2018MonitorPulser::Finish
virtual void Finish()
Definition: CbmMcbm2018MonitorStsPulser.cxx:1312
stsxyter::Message::GetHitAdc
uint16_t GetHitAdc() const
For Hit data: Returns ADC value (5 bit field)
Definition: StsXyterMessage.h:277
CbmCosy2018MonitorPulser::fdStartTime
Double_t fdStartTime
Last hit ADC in bins in each MS for each Channel.
Definition: CbmMcbm2018MonitorStsPulser.h:135
CbmCosy2018MonitorPulser::fulCurrentTsIdx
ULong64_t fulCurrentTsIdx
Definition: CbmMcbm2018MonitorStsPulser.h:102
CbmHistManager
Histogram manager.
Definition: CbmHistManager.h:41
stsxyter::MessType::Empty
@ Empty
h
Data class with information on a STS local track.
CbmCosy2018MonitorPulser::fdCoincCenter
Double_t fdCoincCenter
Definition: CbmMcbm2018MonitorStsPulser.h:155
CbmCosy2018MonitorPulser::fcMsSizeAll
TCanvas * fcMsSizeAll
Definition: CbmMcbm2018MonitorStsPulser.h:187
CbmCosy2018MonitorPulser::fuLongHistoBinNb
UInt_t fuLongHistoBinNb
Definition: CbmMcbm2018MonitorStsPulser.h:152
CbmCosy2018MonitorPulser::FillHitInfo
void FillHitInfo(stsxyter::Message mess, const UShort_t &usElinkIdx, const UInt_t &uAsicIdx, const UInt_t &uMsIdx)
Definition: CbmMcbm2018MonitorStsPulser.cxx:1132
CbmCosy2018MonitorPulser::fvmHitsInTs
std::vector< stsxyter::FinalHit > fvmHitsInTs
Definition: CbmMcbm2018MonitorStsPulser.h:143
CbmCosy2018MonitorPulser::fuOverlapMsNb
size_t fuOverlapMsNb
Definition: CbmMcbm2018MonitorStsPulser.h:73
CbmCosy2018MonitorPulser::fhPulserTimeDiffEvoPerAsicPair
std::vector< std::vector< TH2 * > > fhPulserTimeDiffEvoPerAsicPair
Definition: CbmMcbm2018MonitorStsPulser.h:196
CbmCosy2018MonitorPulser::ftStartTimeUnix
std::chrono::steady_clock::time_point ftStartTimeUnix
Definition: CbmMcbm2018MonitorStsPulser.h:139
CbmCosy2018MonitorPulser::fuNrOfDpbs
UInt_t fuNrOfDpbs
Definition: CbmMcbm2018MonitorStsPulser.h:81
CbmCosy2018MonitorPulser::fvmLastHitAsic
std::vector< stsxyter::FinalHit > fvmLastHitAsic
Last hits in each ASIC.
Definition: CbmMcbm2018MonitorStsPulser.h:193
CbmCosy2018MonitorPulser::fuCurrentEquipmentId
UInt_t fuCurrentEquipmentId
Definition: CbmMcbm2018MonitorStsPulser.h:107
stsxyter::FinalHit
Definition: StsXyterFinalHit.h:16
stsxyter::MessType::Hit
@ Hit
CbmCosy2018MonitorPulser::fhPulserChanCntRaw
std::vector< TH1 * > fhPulserChanCntRaw
Definition: CbmMcbm2018MonitorStsPulser.h:174
CbmCosy2018MonitorPulser::fiRunStartDateTimeSec
Int_t fiRunStartDateTimeSec
Index of the DPB from which the MS currently unpacked is coming.
Definition: CbmMcbm2018MonitorStsPulser.h:113
CbmCosy2018MonitorPulser::fuMaxNbMicroslices
UInt_t fuMaxNbMicroslices
All hits (time in bins, ADC in bins, asic, channel) in last TS, per ASIC, sorted with "<" operator.
Definition: CbmMcbm2018MonitorStsPulser.h:147
stsxyter::kuHitNbTsBins
static const uint32_t kuHitNbTsBins
Definition: StsXyterMessage.h:146
CbmCosy2018MonitorPulser::fhMsSz
TH1 * fhMsSz[kiMaxNbFlibLinks]
Definition: CbmMcbm2018MonitorStsPulser.h:188
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmCosy2018MonitorPulser::Reset
virtual void Reset()
Definition: CbmMcbm2018MonitorStsPulser.cxx:1310
CbmCosy2018MonitorPulser::fHM
CbmHistManager * fHM
Definition: CbmMcbm2018MonitorStsPulser.h:161
CbmCosy2018MonitorPulser::ResetAllHistos
void ResetAllHistos()
Definition: CbmMcbm2018MonitorStsPulser.cxx:1408
CbmHistManager::H1
TH1 * H1(const std::string &name) const
Return pointer to TH1 histogram.
Definition: CbmHistManager.h:170
CbmCosy2018MonitorPulser::SetParContainers
void SetParContainers()
Definition: CbmMcbm2018MonitorStsPulser.cxx:129
CbmCosy2018MonitorPulser::fhPulserChanRawTs
std::vector< TH2 * > fhPulserChanRawTs
Definition: CbmMcbm2018MonitorStsPulser.h:178
CbmCosy2018MonitorPulser::fiBinSizeDatePlots
Int_t fiBinSizeDatePlots
Start of run time since "epoch" in s, for the plots with date as X axis.
Definition: CbmMcbm2018MonitorStsPulser.h:114
CbmCosy2018MonitorPulser::fhPulserTimeDiffPerAsicPair
std::vector< std::vector< TH1 * > > fhPulserTimeDiffPerAsicPair
Definition: CbmMcbm2018MonitorStsPulser.h:195
CbmCosy2018MonitorPulser::fhPulserIntervalAsic
std::vector< TH1 * > fhPulserIntervalAsic
Definition: CbmMcbm2018MonitorStsPulser.h:199
stsxyter::kdClockCycleNs
static const double kdClockCycleNs
Definition: StsXyterMessage.h:156
CbmCosy2018MonitorPulser::fdCoincBorder
Double_t fdCoincBorder
Definition: CbmMcbm2018MonitorStsPulser.h:156
CbmCosy2018MonitorPulser::fvuCurrentTsMsbCycle
std::vector< UInt_t > fvuCurrentTsMsbCycle
Current TS MSB for each DPB.
Definition: CbmMcbm2018MonitorStsPulser.h:118
stsxyter::Message::GetMessType
MessType GetMessType() const
Returns the message type, see enum MessType.
Definition: StsXyterMessage.h:259
CbmCosy2018MonitorPulser::fhPulserChanHitRateEvo
std::vector< TH2 * > fhPulserChanHitRateEvo
Definition: CbmMcbm2018MonitorStsPulser.h:181
CbmCosy2018MonitorPulser::fhPulserChanMissEvt
std::vector< TH2 * > fhPulserChanMissEvt
Definition: CbmMcbm2018MonitorStsPulser.h:179
CbmCosy2018MonitorPulser::fhPulserFebRateEvoLong
std::vector< TH1 * > fhPulserFebRateEvoLong
Definition: CbmMcbm2018MonitorStsPulser.h:185
CbmCosy2018MonitorPulser::fvuChanNbHitsInMs
std::vector< std::vector< std::vector< UInt_t > > > fvuChanNbHitsInMs
Header time of each MS.
Definition: CbmMcbm2018MonitorStsPulser.h:127
gdpbv100::MessagePrintMask
MessagePrintMask
Definition: gDpbMessv100.h:87
CbmCosy2018MonitorPulser::fbLongHistoEnable
Bool_t fbLongHistoEnable
Definition: CbmMcbm2018MonitorStsPulser.h:149
CbmCosy2018MonitorPulser::fhPulserChanAdcRaw
std::vector< TH2 * > fhPulserChanAdcRaw
Definition: CbmMcbm2018MonitorStsPulser.h:176
CbmCosy2018MonitorPulser::fdCoincMin
Double_t fdCoincMin
Definition: CbmMcbm2018MonitorStsPulser.h:157
CbmCosy2018MonitorPulser::FillTsMsbInfo
void FillTsMsbInfo(stsxyter::Message mess, UInt_t uMessIdx=0, UInt_t uMsIdx=0)
Definition: CbmMcbm2018MonitorStsPulser.cxx:1239
stsxyter::Message::GetHitChannel
uint16_t GetHitChannel() const
For Hit data: Returns StsXYTER channel number (7 bit field)
Definition: StsXyterMessage.h:274
stsxyter::Message::PrintMess
bool PrintMess(std::ostream &os, MessagePrintMask ctrl=MessagePrintMask::msg_print_Human) const
Definition: StsXyterMessage.cxx:29
CbmCosy2018MonitorPulser::fhPulserMessType
TH1 * fhPulserMessType
Histogram manager.
Definition: CbmMcbm2018MonitorStsPulser.h:162
CbmCosy2018MonitorPulser::SetRunStart
void SetRunStart(Int_t dateIn, Int_t timeIn, Int_t iBinSize=5)
Definition: CbmMcbm2018MonitorStsPulser.cxx:1462
CbmCosy2018MonitorPulser::SetLongDurationLimits
void SetLongDurationLimits(UInt_t uDurationSeconds=3600, UInt_t uBinSize=1)
Definition: CbmMcbm2018MonitorStsPulser.cxx:1473
m
__m128 m
Definition: L1/vectors/P4_F32vec4.h:26
stsxyter::Message::GetHitTimeOver
uint16_t GetHitTimeOver() const
For Hit data: Returns timestamp overlap bits (2 bits field, overlap with 2 LSBs of TS_MSB message)
Definition: StsXyterMessage.h:283
CbmCosy2018MonitorPulser::fuNbElinksPerDpb
UInt_t fuNbElinksPerDpb
Map of DPB Identifier to DPB index.
Definition: CbmMcbm2018MonitorStsPulser.h:84
CbmCosy2018MonitorPulser::fhPulserSysMessTypePerDpb
TH2 * fhPulserSysMessTypePerDpb
Definition: CbmMcbm2018MonitorStsPulser.h:165
CbmCosy2018MonitorPulser::fhPulserSysMessType
TH1 * fhPulserSysMessType
Definition: CbmMcbm2018MonitorStsPulser.h:163
bCosy2018ResetPulser
Bool_t bCosy2018ResetPulser
Definition: CbmMcbm2018MonitorStsPulser.cxx:39
stsxyter::MessType::TsMsb
@ TsMsb
CbmCosy2018MonitorPulser::InitContainers
Bool_t InitContainers()
Definition: CbmMcbm2018MonitorStsPulser.cxx:138
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
CbmCosy2018MonitorPulser::kuBytesPerMessage
static const UInt_t kuBytesPerMessage
Definition: CbmMcbm2018MonitorStsPulser.h:93
CbmCosy2018MonitorPulser::fhPulserMessTypePerElink
TH2 * fhPulserMessTypePerElink
Definition: CbmMcbm2018MonitorStsPulser.h:171
CbmCosy2018MonitorPulser::fhMsSzTime
TProfile * fhMsSzTime[kiMaxNbFlibLinks]
Definition: CbmMcbm2018MonitorStsPulser.h:189
CbmCosy2018MonitorPulser::CreateHistograms
void CreateHistograms()
Definition: CbmMcbm2018MonitorStsPulser.cxx:263
stsxyter::MessType::Epoch
@ Epoch
CbmCosy2018MonitorPulser::kiMaxNbFlibLinks
static const Int_t kiMaxNbFlibLinks
Vector holding for each link the corresponding ASIC index [fuNrOfDpbs * fuNbElinksPerDpb].
Definition: CbmMcbm2018MonitorStsPulser.h:92
CbmCosy2018MonitorPulser::fvusChanLastHitAdcInMs
std::vector< std::vector< std::vector< UShort_t > > > fvusChanLastHitAdcInMs
Last hit time in bins in each MS for each Channel.
Definition: CbmMcbm2018MonitorStsPulser.h:131
CbmCosy2018MonitorPulser::fvulChanLastHitTime
std::vector< std::vector< ULong64_t > > fvulChanLastHitTime
TS from last hit for DPB.
Definition: CbmMcbm2018MonitorStsPulser.h:122
CbmCosy2018MonitorPulser::fhPulserChanMissEvtEvo
std::vector< TH2 * > fhPulserChanMissEvtEvo
Definition: CbmMcbm2018MonitorStsPulser.h:180
CbmCosy2018MonitorPulser::fhPulserSysMessTypePerElink
TH2 * fhPulserSysMessTypePerElink
Definition: CbmMcbm2018MonitorStsPulser.h:172
stsxyter::kuHitNbAdcBins
static const uint32_t kuHitNbAdcBins
Status/properties constants.
Definition: StsXyterMessage.h:144
CbmCosy2018MonitorPulser::fhPulserChanAdcRawProf
std::vector< TProfile * > fhPulserChanAdcRawProf
Definition: CbmMcbm2018MonitorStsPulser.h:177
CbmCosy2018MonitorPulser::fsHistoFileFullname
TString fsHistoFileFullname
Definition: CbmMcbm2018MonitorStsPulser.h:97
CbmCosy2018MonitorPulser::fhPulserChanCntRawGood
std::vector< TH1 * > fhPulserChanCntRawGood
Definition: CbmMcbm2018MonitorStsPulser.h:175
CbmCosy2018MonitorPulser::fdStartTimeMsSz
Double_t fdStartTimeMsSz
Definition: CbmMcbm2018MonitorStsPulser.h:137
stsxyter
Definition: StsXyterFinalHit.h:12
CbmCosy2018MonitorPulser::fmMsgCounter
std::map< stsxyter::MessType, UInt_t > fmMsgCounter
Definition: CbmMcbm2018MonitorStsPulser.h:105
CbmCosy2018MonitorPulser::fvmAsicHitsInTs
std::vector< std::vector< stsxyter::FinalHit > > fvmAsicHitsInTs
All hits (time in bins, ADC in bins, asic, channel) in last TS, sorted with "<" operator.
Definition: CbmMcbm2018MonitorStsPulser.h:145
CbmCosy2018MonitorPulser::fhPulserChanHitRateEvoLong
std::vector< TH2 * > fhPulserChanHitRateEvoLong
Definition: CbmMcbm2018MonitorStsPulser.h:184
CbmCosy2018MonitorPulser::Init
virtual Bool_t Init()
Definition: CbmMcbm2018MonitorStsPulser.cxx:120
CbmCosy2018MonitorPulser::fhPulserFebRateEvo
std::vector< TH1 * > fhPulserFebRateEvo
Definition: CbmMcbm2018MonitorStsPulser.h:182
CbmCosy2018MonitorPulser::fhPulserTsLsbMatchPerAsicPair
std::vector< std::vector< TH2 * > > fhPulserTsLsbMatchPerAsicPair
Definition: CbmMcbm2018MonitorStsPulser.h:197
CbmHistManager::Add
void Add(const std::string &name, TNamed *object)
Add new named object to manager.
Definition: CbmHistManager.h:58
CbmCosy2018MonitorPulser::fvdMsTime
std::vector< Double_t > fvdMsTime
Last hit time in ns for each Channel.
Definition: CbmMcbm2018MonitorStsPulser.h:125