51 , fvMsComponentsList()
54 , fbIgnoreOverlapMs(kFALSE)
55 , fUnpackParHodo(NULL)
62 , fsHistoFileFullname(
"data/SetupHistos.root")
63 , fbPrintMessages(kFALSE)
64 , fPrintMessCtrl(
stsxyter::MessagePrintMask::msg_print_Human)
68 , fuCurrentEquipmentId(0)
71 , fiRunStartDateTimeSec(-1)
72 , fiBinSizeDatePlots(-1)
74 , fvuCurrentTsMsbCycle()
75 , fvuInitialHeaderDone()
76 , fvuInitialTsMsbCycleHeader()
78 , fvulChanLastHitTime()
79 , fvdChanLastHitTime()
82 , fvdChanLastHitTimeInMs()
83 , fvusChanLastHitAdcInMs()
87 , fdStartTimeMsSz(-1.0)
88 , ftStartTimeUnix(
std::chrono::steady_clock::now())
91 , fuMaxNbMicroslices(100)
92 , fbLongHistoEnable(kFALSE)
93 , fuLongHistoNbSeconds(0)
94 , fuLongHistoBinSizeSec(0)
98 , fdCoincMin(fdCoincCenter - fdCoincBorder)
99 , fdCoincMax(fdCoincCenter + fdCoincBorder)
101 , fhPulserMessType(NULL)
102 , fhPulserSysMessType(NULL)
103 , fhPulserMessTypePerDpb(NULL)
104 , fhPulserSysMessTypePerDpb(NULL)
105 , fhPulserMessTypePerElink(NULL)
106 , fhPulserSysMessTypePerElink(NULL)
107 , fhPulserStatusMessType(NULL)
108 , fhPulserMsStatusFieldType(NULL)
109 , fhPulserChanCntRaw()
110 , fhPulserChanCntRawGood()
111 , fhPulserChanAdcRaw()
112 , fhPulserChanAdcRawProf()
113 , fhPulserChanRawTs()
114 , fhPulserChanMissEvt()
115 , fhPulserChanMissEvtEvo()
116 , fhPulserChanHitRateEvo()
117 , fhPulserFebRateEvo()
118 , fhPulserFebMissEvtEvo()
119 , fhPulserChanHitRateEvoLong()
120 , fhPulserFebRateEvoLong()
124 , fhPulserTimeDiffPerAsic()
125 , fhPulserTimeDiffPerAsicPair()
126 , fhPulserTimeDiffClkPerAsicPair()
127 , fhPulserTimeDiffEvoPerAsicPair()
128 , fhPulserTimeDiffEvoPerAsicPairProf()
129 , fhPulserRawTimeDiffEvoPerAsicPairProf()
130 , fhPulserTsLsbMatchPerAsicPair()
131 , fhPulserTsMsbMatchPerAsicPair()
132 , fhPulserTsLsbDiffEvoPerAsicPairProf()
133 , fhPulserTsMsbDiffEvoPerAsicPairProf()
134 , fhPulserIntervalAsic()
135 , fhPulserIntervalLongAsic()
136 , fvdLastTimeDiffValuesAsicPair()
137 , fvuLastTimeDiffSlotAsicPair()
138 , fvdMeanTimeDiffAsicPair()
379 TString sHistName {
""};
382 sHistName =
"hPulserMessageType";
383 title =
"Nb of message for each type; Type";
399 sHistName =
"hPulserSysMessType";
400 title =
"Nb of system message for each type; System Type";
408 sHistName =
"hPulserMessageTypePerDpb";
409 title =
"Nb of message of each type for each DPB; DPB; Type";
425 sHistName =
"hPulserSysMessTypePerDpb";
426 title =
"Nb of system message of each type for each DPB; DPB; System Type";
434 sHistName =
"hPulserMessageTypePerElink";
435 title =
"Nb of message of each type for each eLink; eLink; Type";
451 sHistName =
"hPulserSysMessTypePerElink";
452 title =
"Nb of system message of each type for each eLink; eLink; System Type";
461 sHistName =
"hPulserStatusMessType";
462 title =
"Nb of status message of each type for each DPB; eLink; Status Type";
471 sHistName =
"hPulserMsStatusFieldType";
472 title =
"For each flag in the MS header, ON/OFF counts; Flag bit []; ON/OFF; MS []";
519 UInt_t uNbBinEvo = (32768 + 1) * 2;
521 Double_t dMinEdgeEvo = dMaxEdgeEvo * -1.0;
525 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters; ++uXyterIdx) {
527 sHistName = Form(
"hPulserChanCntRaw_%03u", uXyterIdx);
528 title = Form(
"Hits Count per channel, StsXyter #%03u; Channel; Hits []", uXyterIdx);
531 sHistName = Form(
"hPulserChanCntRawGood_%03u", uXyterIdx);
532 title = Form(
"Hits Count per channel in good MS, StsXyter #%03u; Channel; Hits []", uXyterIdx);
536 sHistName = Form(
"hPulserChanAdcRaw_%03u", uXyterIdx);
537 title = Form(
"Raw Adc distribution per channel, StsXyter #%03u; Channel "
538 "[]; Adc []; Hits []",
544 sHistName = Form(
"hPulserChanAdcRawProfc_%03u", uXyterIdx);
545 title = Form(
"Raw Adc prodile per channel, StsXyter #%03u; Channel []; Adc []", uXyterIdx);
549 sHistName = Form(
"hPulserChanRawTs_%03u", uXyterIdx);
550 title = Form(
"Raw Timestamp distribution per channel, StsXyter #%03u; "
551 "Channel []; Ts []; Hits []",
557 sHistName = Form(
"hPulserChanMissEvt_%03u", uXyterIdx);
558 title = Form(
"Missed Event flags per channel, StsXyter #%03u; Channel []; "
559 "Miss Evt []; Hits []",
566 sHistName = Form(
"hPulserChanMissEvtEvo_%03u", uXyterIdx);
567 title = Form(
"Missed Evt flags per second & channel in StsXyter #%03u; "
568 "Time [s]; Channel []; Missed Evt flags []",
575 sHistName = Form(
"hPulserFebMissEvtEvo%03u", uXyterIdx);
576 title = Form(
"Missed Evt flags per second in StsXyter #%03u; Time [s]; "
577 "Missed Evt flags []",
582 sHistName = Form(
"hPulserChanRateEvo_%03u", uXyterIdx);
583 title = Form(
"Hits per second & channel in StsXyter #%03u; Time [s]; "
584 "Channel []; Hits []",
590 sHistName = Form(
"hPulserFebRateEvo_%03u", uXyterIdx);
591 title = Form(
"Hits per second in StsXyter #%03u; Time [s]; Hits []", uXyterIdx);
595 sHistName = Form(
"hPulserChanRateEvoLong_%03u", uXyterIdx);
596 title = Form(
"Hits per second & channel in StsXyter #%03u; Time [min]; "
597 "Channel []; Hits []",
603 sHistName = Form(
"hPulserFebRateEvoLong_%03u", uXyterIdx);
604 title = Form(
"Hits per second in StsXyter #%03u; Time [min]; Hits []", uXyterIdx);
608 sHistName = Form(
"fhPulserTimeDiffPerAsic_%03u", uXyterIdx);
609 title = Form(
"Time diff for pulser hits between ASIC %03u and other ASICs; "
610 "tn - t%03u [ns]; ASIC n; Counts",
611 uXyterIdx, uXyterIdx);
615 for (UInt_t uXyterIdxB = 0; uXyterIdxB <
fuNbStsXyters; ++uXyterIdxB) {
616 if (uXyterIdxB == uXyterIdx) {
617 sHistName = Form(
"fhPulserTimeDiffSameAsic_%03u", uXyterIdx);
618 title = Form(
"Time diff for consecutive hits in ASIC %03u; tn - t [ns]; Counts", uXyterIdx);
621 sHistName = Form(
"fhPulserTimeDiffPerAsicPair_%03u_%03u", uXyterIdx, uXyterIdxB);
622 title = Form(
"Time diff for pulser hits in ASIC %03u and %03u; tn - t "
624 uXyterIdx, uXyterIdxB);
628 if (uXyterIdxB == uXyterIdx) {
629 sHistName = Form(
"fhPulserTimeDiffClkSameAsic_%03u", uXyterIdx);
630 title = Form(
"Time diff for consecutive hits in ASIC %03u; tn - t [Clk]; Counts", uXyterIdx);
633 sHistName = Form(
"fhPulserTimeDiffClkPerAsicPair_%03u_%03u", uXyterIdx, uXyterIdxB);
634 title = Form(
"Time diff for pulser hits in ASIC %03u and %03u; tn - t "
636 uXyterIdx, uXyterIdxB);
640 if (uXyterIdxB == uXyterIdx) {
641 sHistName = Form(
"fhPulserTimeDiffEvoSameAsic_%03u", uXyterIdx);
642 title = Form(
"Time diff for consecutive hits in ASIC %03u; Time in run "
643 "[s]; tn - t [ns]; Counts",
647 sHistName = Form(
"fhPulserTimeDiffEvoPerAsicPair_%03u_%03u", uXyterIdx, uXyterIdxB);
648 title = Form(
"Time diff for pulser hits in ASIC %03u and %03u; Time in "
649 "run [s]; tn - t [ns]; Counts",
650 uXyterIdx, uXyterIdxB);
655 if (uXyterIdxB == uXyterIdx) {
656 sHistName = Form(
"fhPulserTimeDiffEvoSameAsicProf_%03u", uXyterIdx);
657 title = Form(
"Time diff for consecutive hits in ASIC %03u; Time in run "
662 sHistName = Form(
"fhPulserTimeDiffEvoPerAsicPairProf_%03u_%03u", uXyterIdx, uXyterIdxB);
663 title = Form(
"Time diff for pulser hits in ASIC %03u and %03u; Time in "
664 "run [s]; tn - t [ns]",
665 uXyterIdx, uXyterIdxB);
669 if (uXyterIdxB == uXyterIdx) {
670 sHistName = Form(
"fhPulserRawTimeDiffEvoSameAsicProf_%03u", uXyterIdx);
671 title = Form(
"Time diff for consecutive hits in ASIC %03u; Time in run "
676 sHistName = Form(
"fhPulserRawTimeDiffEvoPerAsicPairProf_%03u_%03u", uXyterIdx, uXyterIdxB);
677 title = Form(
"Time diff for pulser hits in ASIC %03u and %03u; Time in "
678 "run [s]; tn - t [ns]",
679 uXyterIdx, uXyterIdxB);
683 sHistName = Form(
"fhPulserTsLsbMatchPerAsicPair_%03u_%03u", uXyterIdx, uXyterIdxB);
684 title = Form(
"TS LSB for pulser hits in ASIC %03u and %03u; TS LSB %03u "
685 "[bin]; TS LSB %03u [bin]",
686 uXyterIdx, uXyterIdxB, uXyterIdx, uXyterIdxB);
688 new TH2I(sHistName, title, 256, -0.5, 255.5, 256, -0.5, 255.5));
690 sHistName = Form(
"fhPulserTsMsbMatchPerAsicPair_%03u_%03u", uXyterIdx, uXyterIdxB);
691 title = Form(
"TS MSB for pulser hits in ASIC %03u and %03u; TS MSB %03u "
692 "[bin]; TS MSB %03u [bin]",
693 uXyterIdx, uXyterIdxB, uXyterIdx, uXyterIdxB);
696 if (uXyterIdxB == uXyterIdx) {
697 sHistName = Form(
"fhPulserTsLsbDiffEvoSameAsicProf_%03u", uXyterIdx);
698 title = Form(
"TS LSB diff for consecutive hits in ASIC %03u; Time in "
699 "run [s]; LSBn - LSB [bins]",
703 sHistName = Form(
"fhPulserTsLsbDiffEvoPerAsicPairProf_%03u_%03u", uXyterIdx, uXyterIdxB);
704 title = Form(
"TS LSB diff for pulser hits in ASIC %03u and %03u; Time "
705 "in run [s]; LSBn - LSB [Bins]",
706 uXyterIdx, uXyterIdxB);
710 if (uXyterIdxB == uXyterIdx) {
711 sHistName = Form(
"fhPulserTsMsbDiffEvoSameAsicProf_%03u", uXyterIdx);
712 title = Form(
"TS MSB diff for consecutive hits in ASIC %03u; Time in "
713 "run [s]; MSBn - MSB [bins]",
717 sHistName = Form(
"fhPulserTsMsbDiffEvoPerAsicPairProf_%03u_%03u", uXyterIdx, uXyterIdxB);
718 title = Form(
"TS MSB diff for pulser hits in ASIC %03u and %03u; Time "
719 "in run [s]; MSBn - MSB [Bins]",
720 uXyterIdx, uXyterIdxB);
726 sHistName = Form(
"fhPulserIntervalAsic_%03u", uXyterIdx);
727 title = Form(
"Time diff between consecutive hits in ASIC %03us; dt [ns]; Counts", uXyterIdx);
730 sHistName = Form(
"fhPulserIntervalLongAsic_%03u", uXyterIdx);
731 title = Form(
"Time diff between consecutive hits in ASIC %03us; dt [ns]; Counts", uXyterIdx);
763 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
773 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters; ++uXyterIdx) {
788 for (UInt_t uXyterIdxB = 0; uXyterIdxB <
fuNbStsXyters; ++uXyterIdxB) {
789 if (uXyterIdxB == uXyterIdx) {
815 server->RegisterCommand(
"/Reset_All_Pulser",
"bMcbm2018ResetStsSync=kTRUE");
816 server->RegisterCommand(
"/Write_All_Pulser",
"bMcbm2018WriteStsSync=kTRUE");
818 server->Restrict(
"/Reset_All_Pulser",
"allow=admin");
819 server->Restrict(
"/Write_All_Pulser",
"allow=admin");
827 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters; ++uXyterIdx) {
829 new TCanvas(Form(
"cStsSum_%03u", uXyterIdx), Form(
"Summary plots for StsXyter %03u", uXyterIdx), w,
h);
830 cStsSumm->Divide(2, 2);
852 TCanvas* cDtPerAsic =
new TCanvas(
"cDtPerAsic",
"Time Differences per ASIC", w,
h);
855 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters; ++uXyterIdx) {
856 cDtPerAsic->cd(1 + uXyterIdx);
865 TCanvas* cDtInAsic =
new TCanvas(
"cDtInAsic",
"Time Differences in ASIC", w,
h);
868 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters; ++uXyterIdx) {
869 cDtInAsic->cd(1 + uXyterIdx);
878 TCanvas* cDtAsicPairs =
new TCanvas(
"cDtAsicPairs",
"Time Differences in ASIC", w,
h);
879 cDtAsicPairs->Divide(2, 3);
880 UInt_t uHistoIdx = 0;
881 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters && uXyterIdx < 3; ++uXyterIdx) {
882 for (UInt_t uXyterIdxB = uXyterIdx + 1; uXyterIdxB <
fuNbStsXyters; ++uXyterIdxB) {
883 cDtAsicPairs->cd(1 + uHistoIdx);
895 TCanvas* cDtClkAsicPairs =
new TCanvas(
"cDtClkAsicPairs",
"Time Differences in ASIC", w,
h);
897 for (UInt_t uXyterIdxB = 1; uXyterIdxB <
fuNbStsXyters; ++uXyterIdxB) {
898 cDtClkAsicPairs->cd(uXyterIdxB);
907 TCanvas* cDtAsicPairsEvo =
new TCanvas(
"cDtAsicPairsEvo",
"Time Differences Evo in ASIC", w,
h);
908 cDtAsicPairsEvo->Divide(2, 3);
910 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters && uXyterIdx < 3; ++uXyterIdx) {
911 for (UInt_t uXyterIdxB = uXyterIdx + 1; uXyterIdxB <
fuNbStsXyters; ++uXyterIdxB) {
912 cDtAsicPairsEvo->cd(1 + uHistoIdx);
924 TCanvas* cDtAsicPairsEvoProf =
new TCanvas(
"cDtAsicPairsEvoProf",
"Time Differences Evo in ASIC", w,
h);
925 cDtAsicPairsEvoProf->Divide(2, 3);
927 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters && uXyterIdx < 3; ++uXyterIdx) {
928 for (UInt_t uXyterIdxB = uXyterIdx + 1; uXyterIdxB <
fuNbStsXyters; ++uXyterIdxB) {
929 cDtAsicPairsEvoProf->cd(1 + uHistoIdx);
941 TCanvas* cDtAsicPairsEvoProfRaw =
new TCanvas(
"cDtAsicPairsEvoProfRaw",
"Time Differences Evo in ASIC", w,
h);
942 cDtAsicPairsEvoProfRaw->Divide(2, 3);
944 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters && uXyterIdx < 3; ++uXyterIdx) {
945 for (UInt_t uXyterIdxB = uXyterIdx + 1; uXyterIdxB <
fuNbStsXyters; ++uXyterIdxB) {
946 cDtAsicPairsEvoProfRaw->cd(1 + uHistoIdx);
958 TCanvas* cTsLsbAsicPairs =
new TCanvas(
"cTsLsbAsicPairs",
"Time Differences in ASIC", w,
h);
959 cTsLsbAsicPairs->Divide(2, 3);
961 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters && uXyterIdx < 3; ++uXyterIdx) {
962 for (UInt_t uXyterIdxB = uXyterIdx + 1; uXyterIdxB <
fuNbStsXyters; ++uXyterIdxB) {
963 cTsLsbAsicPairs->cd(1 + uHistoIdx);
975 TCanvas* cTsMsbAsicPairs =
new TCanvas(
"cTsMsbAsicPairs",
"Time Differences in ASIC", w,
h);
977 cTsMsbAsicPairs->Divide(2, 3);
979 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters && uXyterIdx < 3; ++uXyterIdx) {
980 for (UInt_t uXyterIdxB = uXyterIdx + 1; uXyterIdxB <
fuNbStsXyters; ++uXyterIdxB) {
981 cTsMsbAsicPairs->cd(1 + uHistoIdx);
993 TCanvas* cDlsbAsicPairsEvoProf =
new TCanvas(
"cDlsbAsicPairsEvoProf",
"Time Differences Evo in ASIC", w,
h);
994 cDlsbAsicPairsEvoProf->Divide(2, 3);
996 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters && uXyterIdx < 3; ++uXyterIdx) {
997 for (UInt_t uXyterIdxB = uXyterIdx + 1; uXyterIdxB <
fuNbStsXyters; ++uXyterIdxB) {
998 cDlsbAsicPairsEvoProf->cd(1 + uHistoIdx);
1010 TCanvas* cDmsbAsicPairsEvoProf =
new TCanvas(
"cDmsbAsicPairsEvoProf",
"Time Differences Evo in ASIC", w,
h);
1011 cDmsbAsicPairsEvoProf->Divide(2, 3);
1013 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters && uXyterIdx < 3; ++uXyterIdx) {
1014 for (UInt_t uXyterIdxB = uXyterIdx + 1; uXyterIdxB <
fuNbStsXyters; ++uXyterIdxB) {
1015 cDmsbAsicPairsEvoProf->cd(1 + uHistoIdx);
1030 fcMsSizeAll =
dynamic_cast<TCanvas*
>(gROOT->FindObject(
"cMsSizeAll"));
1032 fcMsSizeAll =
new TCanvas(
"cMsSizeAll",
"Evolution of MS size in last 300 s", w,
h);
1034 LOG(info) <<
"Created MS size canvas in STS monitor";
1037 LOG(info) <<
"Recovered MS size canvas in STS monitor";
1054 LOG(debug) <<
"Timeslice contains " << ts.num_microslices(component) <<
"microslices.";
1062 for (UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx++) {
1066 auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
1068 const uint8_t* msContent =
reinterpret_cast<const uint8_t*
>(ts.content(uMsComp, uMsIdx));
1070 uint32_t uSize = msDescriptor.size;
1078 <<
" (DPB Idx " << std::setw(2) <<
fuCurrDpbIdx <<
" )"
1079 <<
" has size: " << uSize;
1083 fhMsSz[uMsComp]->Fill(uSize);
1091 uint16_t uMsHeaderFlags = msDescriptor.flags;
1092 for (UInt_t uBit = 0; uBit < 16; ++uBit)
1103 LOG(warning) <<
"TS MSB cycle from MS header does not match current "
1107 <<
" VS " << uTsMsbCycleHeader;
1113 LOG(error) <<
"The input microslice buffer does NOT "
1114 <<
"contain only complete nDPB messages!";
1120 const uint32_t* pInBuff =
reinterpret_cast<const uint32_t*
>(msContent);
1123 for (uint32_t uIdx = 0; uIdx < uNbMessages; ++uIdx) {
1125 uint32_t ulData =
static_cast<uint32_t
>(pInBuff[uIdx]);
1146 LOG(fatal) <<
"CbmMcbm2018MonitorStsSync::DoUnpack => "
1147 <<
"eLink index out of bounds!" << usElinkIdx <<
" VS " <<
fuNbElinksPerDpb;
1150 static_cast<uint16_t
>(typeMess));
1166 LOG(info) <<
"CbmMcbm2018MonitorStsSync::DoUnpack => "
1167 <<
"EPOCH message at unexpected position in MS: message " << uIdx <<
" VS message 0 expected!";
1190 LOG(fatal) <<
"CbmMcbm2018MonitorStsSync::DoUnpack => "
1191 <<
"Unknown message type, should never happen, stopping here!";
1206 std::vector<stsxyter::FinalHit>::iterator it;
1207 std::vector<stsxyter::FinalHit>::iterator itB;
1215 UShort_t usAsicIdx = (*it).GetAsic();
1234 for (UInt_t uAsicB = uAsic; uAsicB <
fuNbStsXyters; uAsicB++) {
1237 Double_t dDtClk =
static_cast<Double_t
>((*itB).GetTs()) -
static_cast<Double_t
>((*it).GetTs());
1252 ((*itB).GetTs() & 0x03F00) >> 8);
1257 Int_t iDtLsb = (((*itB).GetTs() & 0x000FF) > ((*it).GetTs() & 0x000FF) ? (*itB).GetTs() & 0x000FF
1258 : 255 + ((*itB).GetTs() & 0x000FF))
1259 - ((*it).GetTs() & 0x000FF);
1260 Int_t iDtMsb =
static_cast<Int_t
>(((*itB).GetTs() & 0x03F00) >> 8)
1261 -
static_cast<Int_t
>(((*it).GetTs() & 0x03F00) >> 8);
1266 && 10 < (*itB).GetAdc())
1296 (
static_cast<Double_t
>((*it).GetTs()) -
static_cast<Double_t
>(
fvmLastHitAsic[uAsic].GetTs()))
1312 if (0 == ts.index() % 1000) {
1313 for (UInt_t uDpb = 0; uDpb <
fuNrOfDpbs; ++uDpb) {
1314 Double_t dTsMsbTime =
1320 LOG(info) <<
"End of TS " << std::setw(7) << ts.index() <<
" eDPB " << std::setw(2) << uDpb
1321 <<
" current TS MSB counter is " << std::setw(12) <<
fvulCurrentTsMsb[uDpb]
1323 <<
" current TS MSB time is " << std::setw(12) << dTsMsbTime <<
" s";
1327 if (0 == ts.index() % 10000)
SavePulserHistos(
"data/PulserPeriodicHistosSave.root");