378 TString sHistName {
""};
381 sHistName =
"hPulserMessageType";
382 title =
"Nb of message for each type; Type";
398 sHistName =
"hPulserSysMessType";
399 title =
"Nb of system message for each type; System Type";
407 sHistName =
"hPulserMessageTypePerDpb";
408 title =
"Nb of message of each type for each DPB; DPB; Type";
424 sHistName =
"hPulserSysMessTypePerDpb";
425 title =
"Nb of system message of each type for each DPB; DPB; System Type";
433 sHistName =
"hPulserMessageTypePerElink";
434 title =
"Nb of message of each type for each eLink; eLink; Type";
450 sHistName =
"hPulserSysMessTypePerElink";
451 title =
"Nb of system message of each type for each eLink; eLink; System Type";
460 sHistName =
"hPulserStatusMessType";
461 title =
"Nb of status message of each type for each DPB; eLink; Status Type";
470 sHistName =
"hPulserMsStatusFieldType";
471 title =
"For each flag in the MS header, ON/OFF counts; Flag bit []; ON/OFF; MS []";
518 UInt_t uNbBinEvo = (32768 + 1) * 2;
520 Double_t dMinEdgeEvo = dMaxEdgeEvo * -1.0;
524 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters; ++uXyterIdx) {
526 sHistName = Form(
"hPulserChanCntRaw_%03u", uXyterIdx);
527 title = Form(
"Hits Count per channel, StsXyter #%03u; Channel; Hits []", uXyterIdx);
530 sHistName = Form(
"hPulserChanCntRawGood_%03u", uXyterIdx);
531 title = Form(
"Hits Count per channel in good MS, StsXyter #%03u; Channel; Hits []", uXyterIdx);
535 sHistName = Form(
"hPulserChanAdcRaw_%03u", uXyterIdx);
536 title = Form(
"Raw Adc distribution per channel, StsXyter #%03u; Channel "
537 "[]; Adc []; Hits []",
543 sHistName = Form(
"hPulserChanAdcRawProfc_%03u", uXyterIdx);
544 title = Form(
"Raw Adc prodile per channel, StsXyter #%03u; Channel []; Adc []", uXyterIdx);
548 sHistName = Form(
"hPulserChanRawTs_%03u", uXyterIdx);
549 title = Form(
"Raw Timestamp distribution per channel, StsXyter #%03u; "
550 "Channel []; Ts []; Hits []",
556 sHistName = Form(
"hPulserChanMissEvt_%03u", uXyterIdx);
557 title = Form(
"Missed Event flags per channel, StsXyter #%03u; Channel []; "
558 "Miss Evt []; Hits []",
565 sHistName = Form(
"hPulserChanMissEvtEvo_%03u", uXyterIdx);
566 title = Form(
"Missed Evt flags per second & channel in StsXyter #%03u; "
567 "Time [s]; Channel []; Missed Evt flags []",
574 sHistName = Form(
"hPulserFebMissEvtEvo%03u", uXyterIdx);
575 title = Form(
"Missed Evt flags per second in StsXyter #%03u; Time [s]; "
576 "Missed Evt flags []",
581 sHistName = Form(
"hPulserChanRateEvo_%03u", uXyterIdx);
582 title = Form(
"Hits per second & channel in StsXyter #%03u; Time [s]; "
583 "Channel []; Hits []",
589 sHistName = Form(
"hPulserFebRateEvo_%03u", uXyterIdx);
590 title = Form(
"Hits per second in StsXyter #%03u; Time [s]; Hits []", uXyterIdx);
594 sHistName = Form(
"hPulserChanRateEvoLong_%03u", uXyterIdx);
595 title = Form(
"Hits per second & channel in StsXyter #%03u; Time [min]; "
596 "Channel []; Hits []",
602 sHistName = Form(
"hPulserFebRateEvoLong_%03u", uXyterIdx);
603 title = Form(
"Hits per second in StsXyter #%03u; Time [min]; Hits []", uXyterIdx);
607 sHistName = Form(
"fhPulserTimeDiffPerAsic_%03u", uXyterIdx);
608 title = Form(
"Time diff for pulser hits between ASIC %03u and other ASICs; "
609 "tn - t%03u [ns]; ASIC n; Counts",
610 uXyterIdx, uXyterIdx);
614 for (UInt_t uXyterIdxB = 0; uXyterIdxB <
fuNbStsXyters; ++uXyterIdxB) {
615 if (uXyterIdxB == uXyterIdx) {
616 sHistName = Form(
"fhPulserTimeDiffSameAsic_%03u", uXyterIdx);
617 title = Form(
"Time diff for consecutive hits in ASIC %03u; tn - t [ns]; Counts", uXyterIdx);
620 sHistName = Form(
"fhPulserTimeDiffPerAsicPair_%03u_%03u", uXyterIdx, uXyterIdxB);
621 title = Form(
"Time diff for pulser hits in ASIC %03u and %03u; tn - t "
623 uXyterIdx, uXyterIdxB);
627 if (uXyterIdxB == uXyterIdx) {
628 sHistName = Form(
"fhPulserTimeDiffClkSameAsic_%03u", uXyterIdx);
629 title = Form(
"Time diff for consecutive hits in ASIC %03u; tn - t [Clk]; Counts", uXyterIdx);
632 sHistName = Form(
"fhPulserTimeDiffClkPerAsicPair_%03u_%03u", uXyterIdx, uXyterIdxB);
633 title = Form(
"Time diff for pulser hits in ASIC %03u and %03u; tn - t "
635 uXyterIdx, uXyterIdxB);
639 if (uXyterIdxB == uXyterIdx) {
640 sHistName = Form(
"fhPulserTimeDiffEvoSameAsic_%03u", uXyterIdx);
641 title = Form(
"Time diff for consecutive hits in ASIC %03u; Time in run "
642 "[s]; tn - t [ns]; Counts",
646 sHistName = Form(
"fhPulserTimeDiffEvoPerAsicPair_%03u_%03u", uXyterIdx, uXyterIdxB);
647 title = Form(
"Time diff for pulser hits in ASIC %03u and %03u; Time in "
648 "run [s]; tn - t [ns]; Counts",
649 uXyterIdx, uXyterIdxB);
654 if (uXyterIdxB == uXyterIdx) {
655 sHistName = Form(
"fhPulserTimeDiffEvoSameAsicProf_%03u", uXyterIdx);
656 title = Form(
"Time diff for consecutive hits in ASIC %03u; Time in run "
661 sHistName = Form(
"fhPulserTimeDiffEvoPerAsicPairProf_%03u_%03u", uXyterIdx, uXyterIdxB);
662 title = Form(
"Time diff for pulser hits in ASIC %03u and %03u; Time in "
663 "run [s]; tn - t [ns]",
664 uXyterIdx, uXyterIdxB);
668 if (uXyterIdxB == uXyterIdx) {
669 sHistName = Form(
"fhPulserRawTimeDiffEvoSameAsicProf_%03u", uXyterIdx);
670 title = Form(
"Time diff for consecutive hits in ASIC %03u; Time in run "
675 sHistName = Form(
"fhPulserRawTimeDiffEvoPerAsicPairProf_%03u_%03u", uXyterIdx, uXyterIdxB);
676 title = Form(
"Time diff for pulser hits in ASIC %03u and %03u; Time in "
677 "run [s]; tn - t [ns]",
678 uXyterIdx, uXyterIdxB);
682 sHistName = Form(
"fhPulserTsLsbMatchPerAsicPair_%03u_%03u", uXyterIdx, uXyterIdxB);
683 title = Form(
"TS LSB for pulser hits in ASIC %03u and %03u; TS LSB %03u "
684 "[bin]; TS LSB %03u [bin]",
685 uXyterIdx, uXyterIdxB, uXyterIdx, uXyterIdxB);
687 new TH2I(sHistName, title, 256, -0.5, 255.5, 256, -0.5, 255.5));
689 sHistName = Form(
"fhPulserTsMsbMatchPerAsicPair_%03u_%03u", uXyterIdx, uXyterIdxB);
690 title = Form(
"TS MSB for pulser hits in ASIC %03u and %03u; TS MSB %03u "
691 "[bin]; TS MSB %03u [bin]",
692 uXyterIdx, uXyterIdxB, uXyterIdx, uXyterIdxB);
695 if (uXyterIdxB == uXyterIdx) {
696 sHistName = Form(
"fhPulserTsLsbDiffEvoSameAsicProf_%03u", uXyterIdx);
697 title = Form(
"TS LSB diff for consecutive hits in ASIC %03u; Time in "
698 "run [s]; LSBn - LSB [bins]",
702 sHistName = Form(
"fhPulserTsLsbDiffEvoPerAsicPairProf_%03u_%03u", uXyterIdx, uXyterIdxB);
703 title = Form(
"TS LSB diff for pulser hits in ASIC %03u and %03u; Time "
704 "in run [s]; LSBn - LSB [Bins]",
705 uXyterIdx, uXyterIdxB);
709 if (uXyterIdxB == uXyterIdx) {
710 sHistName = Form(
"fhPulserTsMsbDiffEvoSameAsicProf_%03u", uXyterIdx);
711 title = Form(
"TS MSB diff for consecutive hits in ASIC %03u; Time in "
712 "run [s]; MSBn - MSB [bins]",
716 sHistName = Form(
"fhPulserTsMsbDiffEvoPerAsicPairProf_%03u_%03u", uXyterIdx, uXyterIdxB);
717 title = Form(
"TS MSB diff for pulser hits in ASIC %03u and %03u; Time "
718 "in run [s]; MSBn - MSB [Bins]",
719 uXyterIdx, uXyterIdxB);
725 sHistName = Form(
"fhPulserIntervalAsic_%03u", uXyterIdx);
726 title = Form(
"Time diff between consecutive hits in ASIC %03us; dt [ns]; Counts", uXyterIdx);
729 sHistName = Form(
"fhPulserIntervalLongAsic_%03u", uXyterIdx);
730 title = Form(
"Time diff between consecutive hits in ASIC %03us; dt [ns]; Counts", uXyterIdx);
762 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
772 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters; ++uXyterIdx) {
787 for (UInt_t uXyterIdxB = 0; uXyterIdxB <
fuNbStsXyters; ++uXyterIdxB) {
788 if (uXyterIdxB == uXyterIdx) {
814 server->RegisterCommand(
"/Reset_All_Pulser",
"bMcbm2018ResetStsSync=kTRUE");
815 server->RegisterCommand(
"/Write_All_Pulser",
"bMcbm2018WriteStsSync=kTRUE");
817 server->Restrict(
"/Reset_All_Pulser",
"allow=admin");
818 server->Restrict(
"/Write_All_Pulser",
"allow=admin");
826 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters; ++uXyterIdx) {
828 new TCanvas(Form(
"cStsSum_%03u", uXyterIdx), Form(
"Summary plots for StsXyter %03u", uXyterIdx), w,
h);
829 cStsSumm->Divide(2, 2);
851 TCanvas* cDtPerAsic =
new TCanvas(
"cDtPerAsic",
"Time Differences per ASIC", w,
h);
854 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters; ++uXyterIdx) {
855 cDtPerAsic->cd(1 + uXyterIdx);
864 TCanvas* cDtInAsic =
new TCanvas(
"cDtInAsic",
"Time Differences in ASIC", w,
h);
867 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters; ++uXyterIdx) {
868 cDtInAsic->cd(1 + uXyterIdx);
877 TCanvas* cDtAsicPairs =
new TCanvas(
"cDtAsicPairs",
"Time Differences in ASIC", w,
h);
878 cDtAsicPairs->Divide(2, 3);
879 UInt_t uHistoIdx = 0;
880 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters && uXyterIdx < 3; ++uXyterIdx) {
881 for (UInt_t uXyterIdxB = uXyterIdx + 1; uXyterIdxB <
fuNbStsXyters; ++uXyterIdxB) {
882 cDtAsicPairs->cd(1 + uHistoIdx);
894 TCanvas* cDtClkAsicPairs =
new TCanvas(
"cDtClkAsicPairs",
"Time Differences in ASIC", w,
h);
896 for (UInt_t uXyterIdxB = 1; uXyterIdxB <
fuNbStsXyters; ++uXyterIdxB) {
897 cDtClkAsicPairs->cd(uXyterIdxB);
906 TCanvas* cDtAsicPairsEvo =
new TCanvas(
"cDtAsicPairsEvo",
"Time Differences Evo in ASIC", w,
h);
907 cDtAsicPairsEvo->Divide(2, 3);
909 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters && uXyterIdx < 3; ++uXyterIdx) {
910 for (UInt_t uXyterIdxB = uXyterIdx + 1; uXyterIdxB <
fuNbStsXyters; ++uXyterIdxB) {
911 cDtAsicPairsEvo->cd(1 + uHistoIdx);
923 TCanvas* cDtAsicPairsEvoProf =
new TCanvas(
"cDtAsicPairsEvoProf",
"Time Differences Evo in ASIC", w,
h);
924 cDtAsicPairsEvoProf->Divide(2, 3);
926 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters && uXyterIdx < 3; ++uXyterIdx) {
927 for (UInt_t uXyterIdxB = uXyterIdx + 1; uXyterIdxB <
fuNbStsXyters; ++uXyterIdxB) {
928 cDtAsicPairsEvoProf->cd(1 + uHistoIdx);
940 TCanvas* cDtAsicPairsEvoProfRaw =
new TCanvas(
"cDtAsicPairsEvoProfRaw",
"Time Differences Evo in ASIC", w,
h);
941 cDtAsicPairsEvoProfRaw->Divide(2, 3);
943 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters && uXyterIdx < 3; ++uXyterIdx) {
944 for (UInt_t uXyterIdxB = uXyterIdx + 1; uXyterIdxB <
fuNbStsXyters; ++uXyterIdxB) {
945 cDtAsicPairsEvoProfRaw->cd(1 + uHistoIdx);
957 TCanvas* cTsLsbAsicPairs =
new TCanvas(
"cTsLsbAsicPairs",
"Time Differences in ASIC", w,
h);
958 cTsLsbAsicPairs->Divide(2, 3);
960 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters && uXyterIdx < 3; ++uXyterIdx) {
961 for (UInt_t uXyterIdxB = uXyterIdx + 1; uXyterIdxB <
fuNbStsXyters; ++uXyterIdxB) {
962 cTsLsbAsicPairs->cd(1 + uHistoIdx);
974 TCanvas* cTsMsbAsicPairs =
new TCanvas(
"cTsMsbAsicPairs",
"Time Differences in ASIC", w,
h);
976 cTsMsbAsicPairs->Divide(2, 3);
978 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters && uXyterIdx < 3; ++uXyterIdx) {
979 for (UInt_t uXyterIdxB = uXyterIdx + 1; uXyterIdxB <
fuNbStsXyters; ++uXyterIdxB) {
980 cTsMsbAsicPairs->cd(1 + uHistoIdx);
992 TCanvas* cDlsbAsicPairsEvoProf =
new TCanvas(
"cDlsbAsicPairsEvoProf",
"Time Differences Evo in ASIC", w,
h);
993 cDlsbAsicPairsEvoProf->Divide(2, 3);
995 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters && uXyterIdx < 3; ++uXyterIdx) {
996 for (UInt_t uXyterIdxB = uXyterIdx + 1; uXyterIdxB <
fuNbStsXyters; ++uXyterIdxB) {
997 cDlsbAsicPairsEvoProf->cd(1 + uHistoIdx);
1009 TCanvas* cDmsbAsicPairsEvoProf =
new TCanvas(
"cDmsbAsicPairsEvoProf",
"Time Differences Evo in ASIC", w,
h);
1010 cDmsbAsicPairsEvoProf->Divide(2, 3);
1012 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters && uXyterIdx < 3; ++uXyterIdx) {
1013 for (UInt_t uXyterIdxB = uXyterIdx + 1; uXyterIdxB <
fuNbStsXyters; ++uXyterIdxB) {
1014 cDmsbAsicPairsEvoProf->cd(1 + uHistoIdx);
1029 fcMsSizeAll =
dynamic_cast<TCanvas*
>(gROOT->FindObject(
"cMsSizeAll"));
1031 fcMsSizeAll =
new TCanvas(
"cMsSizeAll",
"Evolution of MS size in last 300 s", w,
h);
1033 LOG(info) <<
"Created MS size canvas in STS monitor";
1036 LOG(info) <<
"Recovered MS size canvas in STS monitor";
1053 LOG(debug) <<
"Timeslice contains " << ts.num_microslices(component) <<
"microslices.";
1061 for (UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx++) {
1065 auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
1067 const uint8_t* msContent =
reinterpret_cast<const uint8_t*
>(ts.content(uMsComp, uMsIdx));
1069 uint32_t uSize = msDescriptor.size;
1077 <<
" (DPB Idx " << std::setw(2) <<
fuCurrDpbIdx <<
" )"
1078 <<
" has size: " << uSize;
1082 fhMsSz[uMsComp]->Fill(uSize);
1090 uint16_t uMsHeaderFlags = msDescriptor.flags;
1091 for (UInt_t uBit = 0; uBit < 16; ++uBit)
1102 LOG(warning) <<
"TS MSB cycle from MS header does not match current "
1106 <<
" VS " << uTsMsbCycleHeader;
1112 LOG(error) <<
"The input microslice buffer does NOT "
1113 <<
"contain only complete nDPB messages!";
1119 const uint32_t* pInBuff =
reinterpret_cast<const uint32_t*
>(msContent);
1122 for (uint32_t uIdx = 0; uIdx < uNbMessages; ++uIdx) {
1124 uint32_t ulData =
static_cast<uint32_t
>(pInBuff[uIdx]);
1145 LOG(fatal) <<
"CbmMcbm2018MonitorStsSync::DoUnpack => "
1146 <<
"eLink index out of bounds!" << usElinkIdx <<
" VS " <<
fuNbElinksPerDpb;
1149 static_cast<uint16_t
>(typeMess));
1165 LOG(info) <<
"CbmMcbm2018MonitorStsSync::DoUnpack => "
1166 <<
"EPOCH message at unexpected position in MS: message " << uIdx <<
" VS message 0 expected!";
1189 LOG(fatal) <<
"CbmMcbm2018MonitorStsSync::DoUnpack => "
1190 <<
"Unknown message type, should never happen, stopping here!";
1205 std::vector<stsxyter::FinalHit>::iterator it;
1206 std::vector<stsxyter::FinalHit>::iterator itB;
1214 UShort_t usAsicIdx = (*it).GetAsic();
1233 for (UInt_t uAsicB = uAsic; uAsicB <
fuNbStsXyters; uAsicB++) {
1236 Double_t dDtClk =
static_cast<Double_t
>((*itB).GetTs()) -
static_cast<Double_t
>((*it).GetTs());
1251 ((*itB).GetTs() & 0x03F00) >> 8);
1256 Int_t iDtLsb = (((*itB).GetTs() & 0x000FF) > ((*it).GetTs() & 0x000FF) ? (*itB).GetTs() & 0x000FF
1257 : 255 + ((*itB).GetTs() & 0x000FF))
1258 - ((*it).GetTs() & 0x000FF);
1259 Int_t iDtMsb =
static_cast<Int_t>(((*itB).GetTs() & 0x03F00) >> 8)
1260 -
static_cast<Int_t>(((*it).GetTs() & 0x03F00) >> 8);
1265 && 10 < (*itB).GetAdc())
1295 (
static_cast<Double_t
>((*it).GetTs()) -
static_cast<Double_t
>(
fvmLastHitAsic[uAsic].GetTs()))
1311 if (0 == ts.index() % 1000) {
1312 for (UInt_t uDpb = 0; uDpb <
fuNrOfDpbs; ++uDpb) {
1313 Double_t dTsMsbTime =
1319 LOG(info) <<
"End of TS " << std::setw(7) << ts.index() <<
" eDPB " << std::setw(2) << uDpb
1320 <<
" current TS MSB counter is " << std::setw(12) <<
fvulCurrentTsMsb[uDpb]
1322 <<
" current TS MSB time is " << std::setw(12) << dTsMsbTime <<
" s";
1326 if (0 == ts.index() % 10000)
SavePulserHistos(
"data/PulserPeriodicHistosSave.root");