431 TString sHistName {
""};
434 sHistName =
"hPulserMessageType";
435 title =
"Nb of message for each type; Type";
452 sHistName =
"hPulserSysMessType";
453 title =
"Nb of system message for each type; System Type";
460 sHistName =
"hStsFebChanAdcRaw_combined";
461 title =
"ADC hist combined";
465 LOG(debug) <<
"Initialized 1st Histo";
466 sHistName =
"hPulserMessageTypePerDpb";
467 title =
"Nb of message of each type for each DPB; DPB; Type";
484 for (UInt_t uModuleId = 0; uModuleId < 2; ++uModuleId) {
486 sHistName = Form(
"HistPadDistr_Module_%01u", uModuleId);
487 title = Form(
"Pad distribution for, Module #%01u; ", uModuleId);
490 fHistPadDistr.push_back(
new TH2I(sHistName, title, 23, -0.5, 22.5, 97, -0.5, 96.5));
492 sHistName = Form(
"RealHistPadDistr_Module_%01u", uModuleId);
493 title = Form(
"Progressive Pad distribution for, Module #%01u; ", uModuleId);
495 fRealHistPadDistr.push_back(
new TH2D(sHistName, title, 500, -0.5, 499.5, 1000, -0.5, 999.5));
499 title =
"Rate in kHz";
500 fhRate =
new TH1I(sHistName, title, 10000, -0.5, 9999.5);
502 sHistName =
"hRateAdcCut";
503 title =
"Rate in kHz with Adc cut";
504 fhRateAdcCut =
new TH1I(sHistName, title, 10000, -0.5, 9999.5);
506 sHistName =
"hPulserSysMessTypePerDpb";
507 title =
"Nb of system message of each type for each DPB; DPB; System Type";
515 sHistName =
"hPulserStatusMessType";
516 title =
"Nb of status message of each type for each DPB; ASIC; Status Type";
525 sHistName =
"hPulserMsStatusFieldType";
526 title =
"For each flag in the MS header, ON/OFF counts; Flag bit []; ON/OFF; MS []";
535 sHistName =
"hStsHitsElinkPerDpb";
536 title =
"Nb of hit messages per eLink for each DPB; DPB; eLink; Hits nb []";
539 LOG(debug) <<
"Initialized 2nd Histo";
576 LOG(debug) <<
"Initialized 3rd Histo";
580 UInt_t uAlignedLimit = 0;
595 for (UInt_t uFebIdx = 0; uFebIdx <
fuNbFebs; ++uFebIdx) {
597 sHistName = Form(
"hStsFebChanCntRaw_%03u", uFebIdx);
598 title = Form(
"Hits Count per channel, FEB #%03u; Channel; Hits []", uFebIdx);
602 sHistName = Form(
"hStsFebChanCntRawGood_%03u", uFebIdx);
603 title = Form(
"Hits Count per channel in good MS (SX2 bug flag off), FEB "
604 "#%03u; Channel; Hits []",
610 sHistName = Form(
"hStsFebChanAdcRaw_%03u", uFebIdx);
611 title = Form(
"Raw Adc distribution per channel, FEB #%03u; Channel []; Adc "
619 sHistName = Form(
"hStsFebChanAdcRawProfc_%03u", uFebIdx);
620 title = Form(
"Raw Adc prodile per channel, FEB #%03u; Channel []; Adc []", uFebIdx);
625 sHistName = Form(
"hStsFebChanAdcCal_%03u", uFebIdx);
626 title = Form(
"Cal. Adc distribution per channel, FEB #%03u; Channel []; "
633 sHistName = Form(
"hStsFebChanAdcCalProfc_%03u", uFebIdx);
634 title = Form(
"Cal. Adc prodile per channel, FEB #%03u; Channel []; Adc [e-]", uFebIdx);
639 sHistName = Form(
"hStsFebChanRawTs_%03u", uFebIdx);
640 title = Form(
"Raw Timestamp distribution per channel, FEB #%03u; Channel "
641 "[]; Ts []; Hits []",
648 sHistName = Form(
"hStsFebChanMissEvt_%03u", uFebIdx);
649 title = Form(
"Missed Event flags per channel, FEB #%03u; Channel []; Miss "
656 sHistName = Form(
"hStsFebChanMissEvtEvo_%03u", uFebIdx);
657 title = Form(
"Missed Evt flags per second & channel in FEB #%03u; Time "
658 "[s]; Channel []; Missed Evt flags []",
664 sHistName = Form(
"hStsFebAsicMissEvtEvo_%03u", uFebIdx);
665 title = Form(
"Missed Evt flags per second & StsXyter in FEB #%03u; Time "
666 "[s]; Asic []; Missed Evt flags []",
672 sHistName = Form(
"hStsFebMissEvtEvo_%03u", uFebIdx);
673 title = Form(
"Missed Evt flags per second & channel in FEB #%03u; Time "
674 "[s]; Missed Evt flags []",
679 sHistName = Form(
"hStsFebChanRateEvo_%03u", uFebIdx);
680 title = Form(
"Hits per second & channel in FEB #%03u; Time [s]; Channel []; Hits []", uFebIdx);
685 sHistName = Form(
"hStsFebChanRateProf_%03u", uFebIdx);
686 title = Form(
"Hits per second for each channel in FEB #%03u; Channel []; Hits/s []", uFebIdx);
691 sHistName = Form(
"hStsFebAsicRateEvo_%03u", uFebIdx);
692 title = Form(
"Hits per second & StsXyter in FEB #%03u; Time [s]; Asic []; Hits []", uFebIdx);
697 sHistName = Form( "hStsFebRateEvo_%03u", uFebIdx );
698 title = Form( "Hits per second in FEB #%03u; Time [s]; Hits []", uFebIdx );
699 fhStsFebHitRateEvo.push_back( new TH1I(sHistName, title, 1800, 0, 1800 ) );
702 sHistName = Form(
"hStsFebRateEvo_%03u", uFebIdx);
703 title = Form(
"Hits per second in FEB #%03u; Time [s]; Hits []", uFebIdx);
716 sHistName = Form(
"hStsFebRateEvo_mskch_%03u", uFebIdx);
717 title = Form(
"Hits per second in FEB #%03u; Time [s]; Hits []", uFebIdx);
721 sHistName = Form(
"hStsFebRateEvo_mskch_adcut_%03u", uFebIdx);
722 title = Form(
"Hits per second in FEB #%03u; Time [s]; Hits []", uFebIdx);
726 sHistName = Form(
"hStsFebChanRateEvoLong_%03u", uFebIdx);
727 title = Form(
"Hits per second & channel in FEB #%03u; Time [min]; Channel []; Hits []", uFebIdx);
733 sHistName = Form(
"hStsFebAsicRateEvoLong_%03u", uFebIdx);
734 title = Form(
"Hits per second & StsXyter in FEB #%03u; Time [min]; Asic []; Hits []", uFebIdx);
740 sHistName = Form(
"hStsFebRateEvoLong_%03u", uFebIdx);
741 title = Form(
"Hits per second in FEB #%03u; Time [min]; Hits []", uFebIdx);
745 sHistName = Form(
"hStsFebChanDistT_%03u", uFebIdx);
746 title = Form(
"Time distance between hits on same channel in between FEB "
747 "#%03u; Time difference [ns]; Channel []; ",
755 for (UInt_t uFebIdxB = uFebIdx; uFebIdxB <
fuNbFebs; ++uFebIdxB) {
756 sHistName = Form(
"hStsFebChanDtCoinc_%03u_%03u", uFebIdx, uFebIdxB);
757 title = Form(
"Channel coincidences Time diff between FEB #%03u and FEB "
758 "#%03u; Time difference [ns]",
762 sHistName = Form(
"hStsFebChanCoinc_%03u_%03u", uFebIdx, uFebIdxB);
763 title = Form(
"Channel coincidences between FEB #%03u and FEB #%03u; "
764 "Channel FEB #%03u []; Channel FEB #%03u []; Coinc. []",
765 uFebIdx, uFebIdxB, uFebIdx, uFebIdxB);
775 LOG(debug) <<
"Initialized 4th Histo before SXM 2.0 Logic Error";
778 for (UInt_t uFebIdx = 0; uFebIdx <
fuNbFebs; ++uFebIdx) {
780 sHistName = Form(
"hStsFebSmxErrRatioEvo_%03u", uFebIdx);
781 title = Form(
"Proportion of uS with SMX logic error in FEB #%03u; Time "
782 "[s]; Error MS fract. []",
787 sHistName = Form(
"hStsFebSmxErrRatioEvoAsic_%03u", uFebIdx);
788 title = Form(
"Proportion of uS with SMX logic error per ASIC in FEB #%03u; "
789 "Time [s]; ASIC []; Error MS fract. []",
796 sHistName = Form(
"hStsFebSmxErrRatioCopyEvo_%03u", uFebIdx);
797 title = Form(
"Proportion of uS with hit copies in FEB #%03u; Time [s]; "
798 "Copies MS fract. []",
803 sHistName = Form(
"hStsFebSmxErrRatioCopyEvoAsic_%03u", uFebIdx);
804 title = Form(
"Proportion of uS with hit copies per ASIC in FEB #%03u; Time "
805 "[s]; ASIC []; Copies MS fract. []",
812 sHistName = Form(
"hStsFebSmxErrRatioCopySameAdcEvo_%03u", uFebIdx);
813 title = Form(
"Proportion of uS with hit full copies in FEB #%03u; Time "
814 "[s]; Copies MS fract. []",
819 sHistName = Form(
"hStsFebSmxErrRatioCopySameAdcEvoAsic_%03u", uFebIdx);
820 title = Form(
"Proportion of uS with hit full copies per ASIC in FEB #%03u; "
821 "Time [s]; ASIC []; Copies MS fract. []",
836 LOG(debug) <<
"Initialized 6th Histo before FairRunOnlne Instance";
839#ifdef USE_HTTP_SERVER
840 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
842 for (UInt_t uModuleId = 0; uModuleId < 2; ++uModuleId) {
847 server->Register(
"/StsRaw",
fhRate);
859 for (UInt_t uFebIdx = 0; uFebIdx <
fuNbFebs; ++uFebIdx) {
882 for (UInt_t uFebIdxB = uFebIdx; uFebIdxB <
fuNbFebs; ++uFebIdxB) {
896 server->RegisterCommand(
"/Reset_All",
"bMcbm2018ResetMuch=kTRUE");
897 server->RegisterCommand(
"/Write_All",
"bMcbm2018WriteMuch=kTRUE");
898 server->RegisterCommand(
"/ScanNoisyCh",
"bMcbm2018ScanNoisyMuch=kTRUE");
901 server->Restrict(
"/Reset_All",
"allow=admin");
902 server->Restrict(
"/Write_All",
"allow=admin");
903 server->Restrict(
"/ScanNoisyCh",
"allow=admin");
910 LOG(debug) <<
"Initialized 7th Histo before Summary per FEB";
912 for (UInt_t uFebIdx = 0; uFebIdx <
fuNbFebs; ++uFebIdx) {
914 TCanvas* cStsSumm =
new TCanvas(Form(
"cStsSum_%03u", uFebIdx), Form(
"Summary plots for FEB %03u", uFebIdx), w,
h);
915 cStsSumm->Divide(2, 3);
954 TCanvas* cStsSmxErr =
955 new TCanvas(Form(
"cStsSmxErr_%03u", uFebIdx), Form(
"SMX logic error plots for FEB %03u", uFebIdx), w,
h);
956 cStsSmxErr->Divide(2, 3);
997 LOG(debug) <<
"Initialized Last Histo before exiting CreateHistograms";
1002 fcMsSizeAll =
dynamic_cast<TCanvas*
>(gROOT->FindObject(
"cMsSizeAll"));
1004 fcMsSizeAll =
new TCanvas(
"cMsSizeAll",
"Evolution of MS size in last 300 s", w,
h);
1006 LOG(info) <<
"Created MS size canvas in STS monitor";
1009 LOG(info) <<
"Recovered MS size canvas in STS monitor";
1030 LOG(debug) <<
"Timeslice contains " << ts.num_microslices(component) <<
" microslices.";
1039 for (UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx++) {
1040 Double_t dMsTime = (1e-9) *
static_cast<double>(ts.descriptor(
fvMsComponentsList[0], uMsIdx).idx);
1046 if (kFALSE ==
ProcessStsMs(ts, uMsComp, uMsIdx))
return kFALSE;
1057 std::vector<stsxyter::FinalHit>::iterator itA;
1058 std::vector<stsxyter::FinalHit>::iterator itB;
1066 UShort_t usAsicIdx = (*itA).GetAsic();
1070 UShort_t usFebIdx = usAsicIdx /
fUnpackParMuch->GetNbAsicsPerFeb();
1095 bHitCopyInThisMs[uAsic] = kFALSE;
1096 bHitCopySameAdcInThisMs[uAsic] = kFALSE;
1097 bFlagOnInThisMs[uAsic] = kFALSE;
1105 std::vector<ULong64_t> vulLastHitTs(
fUnpackParMuch->GetNbChanPerAsic(), 0);
1106 std::vector<UShort_t> vusLastHitAdc(
fUnpackParMuch->GetNbChanPerAsic(), 0);
1110 UShort_t usChanIdx = (*itA).GetChan();
1111 ULong64_t ulHitTs = (*itA).GetTs();
1112 UShort_t usHitAdc = (*itA).GetAdc();
1114 UInt_t uChanInFeb = usChanIdx +
fUnpackParMuch->GetNbChanPerAsic() * uAsicInFeb;
1118 Bool_t bIsNotCopy = kTRUE;
1119 if (vulLastHitTs[usChanIdx] == ulHitTs) {
1120 bIsNotCopy = kFALSE;
1121 bHitCopyInThisMs[uAsic] = kTRUE;
1122 if (vusLastHitAdc[usChanIdx] == usHitAdc) bHitCopySameAdcInThisMs[uAsic] = kTRUE;
1125 vulLastHitTs[usChanIdx] = ulHitTs;
1126 vusLastHitAdc[usChanIdx] = usHitAdc;
1140 std::vector<Bool_t> vbCopyOnAnyAsicMs(
fuNbFebs, kFALSE);
1141 std::vector<Bool_t> vbCopySameAdcOnAnyAsicMs(
fuNbFebs, kFALSE);
1142 std::vector<Bool_t> vbFlagOnAnyAsicMs(
fuNbFebs, kFALSE);
1151 bHitCopyInThisMs[uAsic] ? 1.0 : 0.0);
1154 bHitCopySameAdcInThisMs[uAsic] ? 1.0 : 0.0);
1157 bFlagOnInThisMs[uAsic] ? 1.0 : 0.0);
1159 vbCopyOnAnyAsicMs[uFebIdx] = vbCopyOnAnyAsicMs[uFebIdx] || bHitCopyInThisMs[uAsic];
1160 vbCopySameAdcOnAnyAsicMs[uFebIdx] = vbCopySameAdcOnAnyAsicMs[uFebIdx] || bHitCopySameAdcInThisMs[uAsic];
1161 vbFlagOnAnyAsicMs[uFebIdx] = vbFlagOnAnyAsicMs[uFebIdx] || bFlagOnInThisMs[uAsic];
1168 for (UInt_t uFebIdx = 0; uFebIdx <
fuNbFebs; ++uFebIdx) {
1171 vbCopySameAdcOnAnyAsicMs[uFebIdx] ? 1.0 : 0.0);
1176 for (UInt_t uFebIdx = 0; uFebIdx <
fuNbFebs; ++uFebIdx) {
1183 UShort_t usAsicIdxA = (*itA).GetAsic();
1184 UShort_t usAsicInFebA = usAsicIdxA %
fUnpackParMuch->GetNbAsicsPerFeb();
1185 UShort_t usChanIdxA = (*itA).GetChan();
1186 UInt_t uChanInFebA = usChanIdxA +
fUnpackParMuch->GetNbChanPerAsic() * usAsicInFebA;
1187 ULong64_t ulHitTsA = (*itA).GetTs();
1197 for (UInt_t uFebIdxB = uFebIdx; uFebIdxB <
fuNbFebs; ++uFebIdxB) {
1210 UShort_t usAsicIdxB = (*itB).GetAsic();
1211 UShort_t usChanIdxB = (*itB).GetChan();
1212 UInt_t uChanInFebB =
1215 if (uFebIdx == uFebIdxB && uChanInFebA == uChanInFebB)
continue;
1217 ULong64_t ulHitTsB = (*itB).GetTs();
1219 Double_t dDtClk =
static_cast<Double_t
>(ulHitTsB) -
static_cast<Double_t
>(ulHitTsA);
1247 if (0 == ts.index() % 1000) {
1248 for (UInt_t uDpb = 0; uDpb <
fuNrOfDpbs; ++uDpb) {
1249 Double_t dTsMsbTime =
1255 LOG(info) <<
"End of TS " << std::setw(7) << ts.index() <<
" eDPB " << std::setw(2) << uDpb
1256 <<
" current TS MSB counter is " << std::setw(12) <<
fvulCurrentTsMsb[uDpb]
1258 <<
" current TS MSB time is " << std::setw(12) << dTsMsbTime <<
" s";
1460 const UInt_t& uMsIdx)
1482 UInt_t uCrobIdx = usElinkIdx /
fUnpackParMuch->GetNbElinkPerCrob();
1483 UInt_t uAsicInFeb = uAsicIdx %
fUnpackParMuch->GetNbAsicsPerFeb();
1488 Double_t ActualX = (
fUnpackParMuch->GetRealPadSize(channel) * sector);
1562 if (constime < 1000000) {
1579 Double_t dTimeSinceStartMin = dTimeSinceStartSec / 60.0;