53 , fvMsComponentsList()
56 , fbIgnoreOverlapMs(kFALSE)
57 , fuMsAcceptsPercent(100)
62 , fdTsCoreSizeInNs(0.0)
69 , fuNrOfChannelsPerGet4(0)
70 , fuNrOfChannelsPerFee(0)
72 , fuNrOfGet4PerGdpb(0)
73 , fuNrOfChannelsPerGdpb(0)
74 , fuDiamondDpbIdx(10000)
76 fsHistoFilename(
"data/HistosCheckGdpb.root")
77 , fulCurrentTsIndex(0)
93 fulCurrentEpochTime(0)
96 , fdStartTimeMsSz(-1.)
97 , fvhMsSzPerLink(12, NULL)
98 , fvhMsSzTimePerLink(12, NULL)
100 , fhSysMessType(NULL)
101 , fhGet4MessType(NULL)
102 , fhGet4ChanScm(NULL)
103 , fhGet4ChanErrors(NULL)
104 , fhGet4EpochFlags(NULL)
105 , fhGdpbMessType(NULL)
106 , fhGdpbSysMessType(NULL)
107 , fhGdpbSysMessPattType(NULL)
108 , fhGdpbEpochFlags(NULL)
109 , fhGdpbEpochSyncEvo(NULL)
110 , fhGdpbEpochMissEvo(NULL)
111 , fvhGdpbGet4MessType()
112 , fhPatternMissmatch(NULL)
113 , fhPatternEnable(NULL)
114 , fhPatternResync(NULL)
115 , fvuGdpbNbEpochPerMs()
116 , fvvuChanNbHitsPerMs()
117 , fhEpochsPerMs_gDPB()
118 , fhEpochsPerMsPerTs_gDPB()
119 , fhEpochsDiff_gDPB()
120 , fhEpochsDiffPerTs_gDPB()
121 , fhEpochsJumpBitsPre_gDPB()
122 , fhEpochsJumpBitsNew_gDPB()
123 , fhEpochsJumpDigitsPre_gDPB()
124 , fhEpochsJumpDigitsNew_gDPB()
125 , fhStartEpochPerMs_gDPB()
126 , fhCloseEpochPerMs_gDPB()
127 , fhHitsPerMsFirstChan_gDPB()
128 , fvhChannelRatePerMs_gDPB()
130 , fTimeLastHistoSaving()
258 LOG(info) <<
"create Histos for " <<
fuNrOfGdpbs <<
" gDPBs ";
260 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
264 UInt_t uHistoryHistoSize = 1800;
267 name =
"hMessageType";
268 title =
"Nb of message for each type; Type";
281 name =
"hSysMessType";
282 title =
"Nb of system message for each type; System Type";
290 name =
"hGet4MessType";
291 title =
"Nb of message for each type per GET4; GET4 chip # ; Type";
299 name =
"hGet4ChanScm";
300 title =
"SC messages per GET4 channel; GET4 channel # ; SC type";
310 name =
"hGet4ChanErrors";
311 title =
"Error messages per GET4 channel; GET4 channel # ; Error";
337 name =
"hGet4EpochFlags";
338 title =
"Epoch flags per GET4; GET4 chip # ; Type";
346 name =
"hGdpbMessageType";
347 title =
"Nb of message for each type per Gdpb; Type; Gdpb Idx []";
361 name =
"hGdpbSysMessType";
362 title =
"Nb of system message for each type per Gdpb; System Type; Gdpb Idx []";
371 name =
"hGdpbSysMessPattType";
372 title =
"Nb of pattern message for each type per Gdpb; Pattern Type; Gdpb Idx []";
380 name =
"hGdpbEpochFlags";
381 title =
"Epoch flags per gDPB; gDPB # ; Type";
389 name = Form(
"hGdpbEpochSyncEvo");
390 title = Form(
"Epoch SYNC per second and gDPB; Time[s]; gDPB #; SYNC Nb");
392 new TH2D(name.Data(), title.Data(), uHistoryHistoSize, 0, uHistoryHistoSize,
fuNrOfGdpbs, 0.,
fuNrOfGdpbs);
395 name = Form(
"hGdpbEpochMissEvo");
396 title = Form(
"Epoch Missmatch per second and gDPB; Time[s]; gDPB #; Missmatch Nb");
398 new TH2D(name.Data(), title.Data(), uHistoryHistoSize, 0, uHistoryHistoSize,
fuNrOfGdpbs, 0.,
fuNrOfGdpbs);
402 name =
"hPatternMissmatch";
403 title =
"Missmatch pattern integral per Gdpb; ASIC Pattern []; Gdpb Idx []";
406 name =
"hPatternEnable";
407 title =
"Enable pattern integral per Gdpb; ASIC Pattern []; Gdpb Idx []";
410 name =
"hPatternResync";
411 title =
"Resync pattern integral per Gdpb; ASIC Pattern []; Gdpb Idx []";
419 for (UInt_t uGdpb = 0; uGdpb <
fuNrOfGdpbs; ++uGdpb) {
421 name = Form(
"hGdpbGet4MessType_%02u", uGdpb);
422 title = Form(
"Nb of message for each type per GET4 in gDPB %02u; GET4 chip # ; Type", uGdpb);
430 name = Form(
"hGdpbGet4ChanErrors_%02u", uGdpb);
431 title = Form(
"Error messages per GET4 channel in gDPB %02u; GET4 channel # ; Error", uGdpb);
460 Form(
"Epoch Counts per MS in gDPB %02u; Epochs/MS []; MS nb[]", uGdpb), 1000,
463 Form(
"hEpochsPerMsPerTs_gDPB%02u", uGdpb),
464 Form(
"Epoch Counts per MS in gDPB %02u; TS []; Epochs/MS []; MS nb[]", uGdpb), 10000, 0, 10000, 100, -0.5, 99.5));
466 Form(
"Epoch index difference per MS in gDPB %02u; Ep(N) - Ep(N "
469 1001, -500.5, 500.5));
471 Form(
"Epoch index difference per MS in gDPB %02u; TS []; Ep(N) "
472 "- Ep(N - 1) []; MS nb[]",
474 10000, 0, 10000, 101, -50.5, 50.5));
476 Form(
"Bits value in previous epoch when diff not 1 in gDPB "
477 "%02u; TS []; Bit []; Value[]",
479 32, -0.5, 31.5, 2, -0.5, 1.5));
481 Form(
"Bits value in new epoch when diff not 1 in gDPB %02u; TS "
482 "[]; Bit []; Value[]",
484 32, -0.5, 31.5, 2, -0.5, 1.5));
486 Form(
"Digits value in previous epoch when diff not 1 in gDPB "
487 "%02u; TS []; Digit []; Value[]",
489 10, -0.5, 9.5, 10, -0.5, 9.5));
491 Form(
"Digits value in new epoch when diff not 1 in gDPB %02u; "
492 "TS []; Digit []; Value[]",
494 10, -0.5, 9.5, 10, -0.5, 9.5));
496 Form(
"MS start with Epoch in gDPB %02u?; TS []; 1st Msg is "
497 "Epoch? []; MS nb[]",
499 10000, 0, 10000, 2, -0.5, 1.5));
501 Form(
"MS close with Epoch in gDPB %02u?; TS []; Last Msg is "
502 "Epoch? []; MS nb[]",
504 10000, 0, 10000, 2, -0.5, 1.5));
506 Form(
"Hit Counts per MS in first channel in gDPB %02u; TS []; "
507 "Hits/MS []; MS nb[]",
509 10000, 0, 10000, 150, -0.5, 149.5));
511 Form(
"Mean Hit count per MS and channel vs Time in gDPB "
512 "%02u; TS []; Channel []; <Hits/Ms> []",
537 for (UInt_t uGdpb = 0; uGdpb <
fuNrOfGdpbs; ++uGdpb) {
556 server->RegisterCommand(
"/Reset_All_eTOF",
"bCheckFormatGdpbResetHistos=kTRUE");
557 server->RegisterCommand(
"/Save_All_eTof",
"bCheckFormatGdpbSaveHistos=kTRUE");
559 server->Restrict(
"/Reset_All_eTof",
"allow=admin");
560 server->Restrict(
"/Save_All_eTof",
"allow=admin");
566 fcSummary =
new TCanvas(
"cSummary",
"gDPB Monitoring Summary");
594 server->Register(
"/canvases",
fcSummary);
597 for (UInt_t uGdpb = 0; uGdpb <
fuNrOfGdpbs; ++uGdpb) {
598 fcFormatGdpb.push_back(
new TCanvas(Form(
"cFormatGdpb%02u", uGdpb), Form(
"gDPB %02u Data Format Check", uGdpb)));
651 fcMsSizeAll =
dynamic_cast<TCanvas*
>(gROOT->FindObject(
"cMsSizeAll"));
653 fcMsSizeAll =
new TCanvas(
"cMsSizeAll",
"Evolution of MS size in last 300 s", w,
h);
655 LOG(info) <<
"Created MS size canvas in TOF monitor";
658 LOG(info) <<
"Recovered MS size canvas in TOF monitor";
662 LOG(info) <<
"Leaving CreateHistograms";
668 LOG(info) <<
"Reset eTOF STAR histos ";
673 LOG(info) <<
"Start saving eTOF STAR histos ";
679 std::chrono::time_point<std::chrono::system_clock> timeCurrent = std::chrono::system_clock::now();
684 else if (300 < elapsed_seconds.count()) {
685 std::time_t cTimeCurrent = std::chrono::system_clock::to_time_t(timeCurrent);
687 std::strftime(tempBuff, 80,
"%F %T", localtime(&cTimeCurrent));
692 LOG(debug1) <<
"Timeslice contains " << ts.num_microslices(component) <<
"microslices.";
695 if (0 == ts.index())
return kTRUE;
705 Int_t messageType = -111;
709 for (UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx++) {
717 auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
733 constexpr uint32_t kuBytesPerMessage = 8;
736 auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
738 fdMsIndex =
static_cast<double>(msDescriptor.idx);
740 const uint8_t* msContent =
reinterpret_cast<const uint8_t*
>(ts.content(uMsComp, uMsIdx));
742 uint32_t
size = msDescriptor.size;
744 if (
size > 0) LOG(debug) <<
"Microslice: " << msDescriptor.idx <<
" has size: " <<
size;
754 if (0 != (
size % kuBytesPerMessage))
755 LOG(error) <<
"The input microslice buffer does NOT "
756 <<
"contain only complete nDPB messages!";
759 uint32_t uNbMessages = (
size - (
size % kuBytesPerMessage)) / kuBytesPerMessage;
767 LOG(info) <<
"---------------------------------------------------------------";
778 LOG(error) <<
"Could not find the gDPB index for AFCK id 0x" << std::hex <<
fuGdpbId << std::dec
780 << uMsCompIdx <<
"\n"
781 <<
"If valid this index has to be added in the TOF "
782 "parameter file in the RocIdArray field";
789 const uint64_t* pInBuff =
reinterpret_cast<const uint64_t*
>(msContent);
790 for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx++) {
792 uint64_t ulData =
static_cast<uint64_t
>(pInBuff[uIdx]);
795 if (0 == uIdx) {
continue; }
812 <<
" set in parameters.";
815 if (uNbMessages - 1 == uIdx)
818 switch (messageType) {
866 Long64_t iEpDiff = ulEpochNr;
872 for (UInt_t uBit = 0; uBit < 32; ++uBit) {
878 for (UInt_t uDigit = 0; uDigit < 10; ++uDigit) {
882 TMath::Floor((ulEpochNr % (10 * uPower)) / uPower));
1021 LOG(error) <<
"Message type " << std::hex << std::setw(2) << static_cast<uint16_t>(messageType)
1022 <<
" not included in Get4 unpacker.";
1027 for (UInt_t uGdpb = 0; uGdpb <
fuNrOfGdpbs; ++uGdpb) {