19 #include "FairLogger.h"
20 #include "FairRootManager.h"
22 #include "FairRunOnline.h"
23 #include "FairRuntimeDb.h"
26 #include "TClonesArray.h"
27 #include "THttpServer.h"
49 , fvbMaskedComponents()
50 , fvMsComponentsList()
53 , fbIgnoreOverlapMs(kFALSE)
76 fsHistoFileFullname(
"data/SetupHistos.root")
77 , fbPrintMessages(kFALSE)
81 fbEnableCheckBugSmx20(kFALSE)
85 , fuCurrentEquipmentId(0)
88 , fiRunStartDateTimeSec(-1)
89 , fiBinSizeDatePlots(-1)
91 , fvuCurrentTsMsbCycle()
92 , fvuInitialHeaderDone()
93 , fvuInitialTsMsbCycleHeader()
95 , fvulChanLastHitTime()
96 , fvdChanLastHitTime()
100 , fvdChanLastHitTimeInMs()
101 , fvusChanLastHitAdcInMs()
105 , fdStartTimeMsSz(-1.0)
106 , ftStartTimeUnix(std::chrono::steady_clock::now())
110 , fuMaxNbMicroslices(100)
111 , fiTimeIntervalRateUpdate(10)
112 , fvdFebTimeSecLastRateUpdate()
113 , fviFebCountsSinceLastRateUpdate()
114 , fvdFebChanCountsSinceLastRateUpdate()
115 , fbLongHistoEnable(kFALSE)
116 , fuLongHistoNbSeconds(0)
117 , fuLongHistoBinSizeSec(0)
118 , fuLongHistoBinNb(0)
120 , fdCoincBorder(50.0)
121 , fdCoincMin(fdCoincCenter - fdCoincBorder)
122 , fdCoincMax(fdCoincCenter + fdCoincBorder)
124 , fhStsMessType(NULL)
125 , fhStsSysMessType(NULL)
126 , fhStsMessTypePerDpb(NULL)
127 , fhStsSysMessTypePerDpb(NULL)
128 , fhStsStatusMessType(NULL)
129 , fhStsMsStatusFieldType(NULL)
130 , fhStsMessTypePerElink(NULL)
131 , fhStsHitsElinkPerDpb(NULL)
132 , fhStsAllFebsHitRateEvo(nullptr)
133 , fhStsAllAsicsHitRateEvo(nullptr)
134 , fhStsFebAsicHitCounts(nullptr)
135 , fdFebChanCoincidenceLimit(100.0)
136 , fhStsFebChanCntRaw()
137 , fhStsFebChanCntRawGood()
138 , fhStsFebChanAdcRaw()
139 , fhStsFebChanAdcRawProf()
144 , fhStsFebChanMissEvt()
145 , fhStsFebChanMissEvtEvo()
146 , fhStsFebAsicMissEvtEvo()
147 , fhStsFebMissEvtEvo()
148 , fhStsFebChanHitRateEvo()
149 , fhStsFebChanHitRateProf()
150 , fhStsFebAsicHitRateEvo()
151 , fhStsFebHitRateEvo()
152 , fhStsFebChanHitRateEvoLong()
153 , fhStsFebAsicHitRateEvoLong()
154 , fhStsFebHitRateEvoLong()
155 , fdStsFebChanLastTimeForDist()
156 , fhStsFebChanDistT()
157 , fhStsFebChanCloseHitsCounts()
158 , fhStsFebChanCloseHitsRatio()
172 fbSmx2ErrorUseNoiseLevels(kFALSE)
173 , fdSmxErrCoincWinM07(kdSmxErrCoincWinMainM07)
174 , fdSmxErrCoincWinM08(kdSmxErrCoincWinMainM08)
175 , fdSmxErrCoincWinM09(kdSmxErrCoincWinMainM09)
176 , fdSmxErrCoincWinM10(kdSmxErrCoincWinMainM10)
177 , fdSmxErrCoincWinM11(kdSmxErrCoincWinMainM11)
178 , fvdSmxErrTimeLastHits()
179 , fvuSmxErrIdxFirstHitM07()
180 , fvuSmxErrIdxFirstHitM08()
181 , fvuSmxErrIdxFirstHitM09()
182 , fvuSmxErrIdxFirstHitM10()
183 , fvuSmxErrIdxFirstHitM11()
184 , fvuSmxErrIdxLastHit()
185 , fhStsFebSmxErrRatioEvo()
186 , fhStsFebSmxErrRatioEvoAsic()
187 , fhStsFebSmxErrRatioCopyEvo()
188 , fhStsFebSmxErrRatioCopyEvoAsic()
189 , fhStsFebSmxErrRatioCopySameAdcEvo()
190 , fhStsFebSmxErrRatioCopySameAdcEvoAsic()
191 , fcMsSizeAll(NULL) {}
196 LOG(info) <<
"Initializing flib StsXyter unpacker for STS";
198 FairRootManager* ioman = FairRootManager::Instance();
199 if (ioman == NULL) { LOG(fatal) <<
"No FairRootManager instance"; }
205 LOG(info) <<
"Setting parameter containers for " << GetName();
208 "CbmMcbm2018StsPar"));
213 LOG(info) <<
"Init parameter containers for " << GetName();
222 LOG(info) <<
"ReInit parameter containers for " << GetName();
231 LOG(info) <<
"Nr. of STS Modules: " <<
fuNbModules;
235 for (UInt_t uModIdx = 0; uModIdx <
fuNbModules; ++uModIdx) {
238 LOG(info) <<
"Module #" << std::setw(2) << uModIdx <<
" Type "
240 << std::setw(8) << std::hex <<
fviModAddress[uModIdx] << std::dec;
244 LOG(info) <<
"Nr. of STS DPBs: " <<
fuNrOfDpbs;
247 for (UInt_t uDpb = 0; uDpb <
fuNrOfDpbs; ++uDpb) {
249 LOG(info) <<
"Eq. ID for DPB #" << std::setw(2) << uDpb <<
" = 0x"
251 << std::dec <<
" => "
256 LOG(info) <<
"Nr. of FEBs: " <<
fuNbFebs;
267 for (UInt_t uDpb = 0; uDpb <
fuNrOfDpbs; ++uDpb) {
325 for (UInt_t uDpb = 0; uDpb <
fuNrOfDpbs; ++uDpb) {
328 LOG(info) << Form(
"DPB #%02u CROB #%02u Active: ", uDpb, uCrobIdx)
333 for (UInt_t uDpb = 0; uDpb <
fuNrOfDpbs; ++uDpb) {
336 LOG(info) << Form(
"DPB #%02u CROB #%u: ", uDpb, uCrobIdx);
341 " FEB #%02u: Mod. Idx = %03d Side %c (%2d) Type %c (%2d) ADC "
342 "gain %4.0f e- ADC Offs %5.0f e-",
347 1 ==
fviFebType[uDpb][uCrobIdx][uFebIdx] ?
'B' :
'A',
356 LOG(info) <<
"Unpacking data in bin sorter FW mode";
358 LOG(info) <<
"Unpacking data in full time sorter FW mode (legacy)";
366 for (UInt_t uDpb = 0; uDpb <
fuNrOfDpbs; ++uDpb) {
383 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters; ++uXyterIdx) {
406 LOG(info) <<
"CbmMcbm2018MonitorSts::ReInitContainers => Changed "
407 "fvuChanNbHitsInMs size "
409 LOG(info) <<
"CbmMcbm2018MonitorSts::ReInitContainers => Changed "
410 "fvuChanNbHitsInMs size "
413 LOG(info) <<
"CbmMcbm2018MonitorSts::ReInitContainers => Changed "
414 "fvuChanNbHitsInMs size "
422 for (UInt_t uFebIdx = 0; uFebIdx <
fuNbFebs; ++uFebIdx) {
445 LOG(error) <<
"CbmMcbm2018MonitorSts::AddMsComponentToList => "
446 <<
"Ignored the addition of component " << component
447 <<
" as it is above the hadcoded limit of "
450 <<
" To change this behavior check kiMaxNbFlibLinks in "
451 "CbmMcbm2018MonitorSts.cxx";
459 <<
"CbmMcbm2018MonitorSts::AddMsComponentToList => Added component: "
463 if (NULL ==
fhMsSz[component]) {
464 TString sMsSzName = Form(
"MsSz_link_%02lu", component);
466 Form(
"Size of MS for nDPB of link %02lu; Ms Size [bytes]", component);
468 new TH1F(sMsSzName.Data(), sMsSzTitle.Data(), 30000, 0., 30000.);
471 sMsSzName = Form(
"MsSzTime_link_%02lu", component);
473 "Size of MS vs time for gDPB of link %02lu; Time[s] ; Ms Size [bytes]",
476 new TProfile(sMsSzName.Data(), sMsSzTitle.Data(), 15000, 0., 300.);
484 LOG(info) <<
"Added MS size histo for component: " << component <<
" (DPB)";
486 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
488 server->Register(
"/FlibRaw",
fhMsSz[component]);
489 server->Register(
"/FlibRaw",
fhMsSzTime[component]);
506 for (UInt_t uXyterIdx = 0; uXyterIdx <
fuNbStsXyters; ++uXyterIdx) {
525 <<
"CbmMcbm2018MonitorSts::DoUnpack => Changed fvuChanNbHitsInMs size "
528 <<
"CbmMcbm2018MonitorSts::DoUnpack => Changed fvuChanNbHitsInMs size "
532 <<
"CbmMcbm2018MonitorSts::DoUnpack => Changed fvuChanNbHitsInMs size "
546 TString sHistName {
""};
549 sHistName =
"hPulserMessageType";
550 title =
"Nb of message for each type; Type";
567 sHistName =
"hPulserSysMessType";
568 title =
"Nb of system message for each type; System Type";
576 sHistName =
"hPulserMessageTypePerDpb";
577 title =
"Nb of message of each type for each DPB; DPB; Type";
594 sHistName =
"hPulserSysMessTypePerDpb";
595 title =
"Nb of system message of each type for each DPB; DPB; System Type";
604 sHistName =
"hStsStatusMessType";
605 title =
"Nb of status message of each type for each DPB; ASIC; Status Type";
615 sHistName =
"hStsMsStatusFieldType";
617 "For each flag in the MS header, ON/OFF counts; Flag bit []; ON/OFF; MS []";
619 new TH2I(sHistName, title, 16, -0.5, 15.5, 2, -0.5, 1.5);
627 sHistName =
"hStsMessTypePerElink";
628 title =
"Nb of message of each type for each DPB; DPB; Type";
645 sHistName =
"hStsHitsElinkPerDpb";
646 title =
"Nb of hit messages per eLink for each DPB; DPB; eLink; Hits nb []";
651 sHistName =
"hStsAllFebsHitRateEvo";
652 title =
"Hits per second & FEB; Time [s]; FEB []; Hits []";
657 sHistName =
"hStsAllAsicsHitRateEvo";
658 title =
"Hits per second & ASIC; Time [s]; ASIC []; Hits []";
663 sHistName =
"hStsFebAsicHitCounts";
664 title =
"Hits per FEB & ASIC; FEB []; ASIC in FEB[]; Hits []";
709 UInt_t uAlignedLimit =
725 for (UInt_t uFebIdx = 0; uFebIdx <
fuNbFebs; ++uFebIdx) {
727 sHistName = Form(
"hStsFebChanCntRaw_%03u", uFebIdx);
729 Form(
"Hits Count per channel, FEB #%03u; Channel; Hits []", uFebIdx);
737 sHistName = Form(
"hStsFebChanCntRawGood_%03u", uFebIdx);
738 title = Form(
"Hits Count per channel in good MS (SX2 bug flag off), FEB "
739 "#%03u; Channel; Hits []",
749 sHistName = Form(
"hStsFebChanAdcRaw_%03u", uFebIdx);
750 title = Form(
"Raw Adc distribution per channel, FEB #%03u; Channel []; Adc "
764 sHistName = Form(
"hStsFebChanAdcRawProfc_%03u", uFebIdx);
765 title = Form(
"Raw Adc prodile per channel, FEB #%03u; Channel []; Adc []",
768 new TProfile(sHistName,
788 sHistName = Form(
"hStsFebChanRawTs_%03u", uFebIdx);
789 title = Form(
"Raw Timestamp distribution per channel, FEB #%03u; Channel "
790 "[]; Ts []; Hits []",
802 sHistName = Form(
"hStsFebChanMissEvt_%03u", uFebIdx);
803 title = Form(
"Missed Event flags per channel, FEB #%03u; Channel []; Miss "
817 sHistName = Form(
"hStsFebChanMissEvtEvo_%03u", uFebIdx);
818 title = Form(
"Missed Evt flags per second & channel in FEB #%03u; Time "
819 "[s]; Channel []; Missed Evt flags []",
832 sHistName = Form(
"hStsFebAsicMissEvtEvo_%03u", uFebIdx);
833 title = Form(
"Missed Evt flags per second & StsXyter in FEB #%03u; Time "
834 "[s]; Asic []; Missed Evt flags []",
847 sHistName = Form(
"hStsFebMissEvtEvo_%03u", uFebIdx);
848 title = Form(
"Missed Evt flags per second & channel in FEB #%03u; Time "
849 "[s]; Missed Evt flags []",
854 sHistName = Form(
"hStsFebChanRateEvo_%03u", uFebIdx);
856 "Hits per second & channel in FEB #%03u; Time [s]; Channel []; Hits []",
869 sHistName = Form(
"hStsFebChanRateProf_%03u", uFebIdx);
871 "Hits per second for each channel in FEB #%03u; Channel []; Hits/s []",
874 new TProfile(sHistName,
881 sHistName = Form(
"hStsFebAsicRateEvo_%03u", uFebIdx);
883 "Hits per second & StsXyter in FEB #%03u; Time [s]; Asic []; Hits []",
896 sHistName = Form(
"hStsFebRateEvo_%03u", uFebIdx);
897 title = Form(
"Hits per second in FEB #%03u; Time [s]; Hits []", uFebIdx);
901 sHistName = Form(
"hStsFebChanRateEvoLong_%03u", uFebIdx);
903 "Hits per second & channel in FEB #%03u; Time [min]; Channel []; Hits []",
916 sHistName = Form(
"hStsFebAsicRateEvoLong_%03u", uFebIdx);
918 "Hits per second & StsXyter in FEB #%03u; Time [min]; Asic []; Hits []",
931 sHistName = Form(
"hStsFebRateEvoLong_%03u", uFebIdx);
932 title = Form(
"Hits per second in FEB #%03u; Time [min]; Hits []", uFebIdx);
937 sHistName = Form(
"hStsFebChanDistT_%03u", uFebIdx);
938 title = Form(
"Time distance between hits on same channel in FEB #%03u; "
939 "Time difference [ns]; Channel []; ",
952 sHistName = Form(
"hStsFebChanCloseHitsCounts_%03u", uFebIdx);
953 title = Form(
"Hits with too small dt on same channel in FEB #%03u; Channel "
965 sHistName = Form(
"hStsFebChanCloseHitsRatio_%03u", uFebIdx);
966 title = Form(
"Ratio of Hits with too small dt on same channel in FEB "
970 new TProfile(sHistName,
1066 for (UInt_t uFebIdx = 0; uFebIdx <
fuNbFebs; ++uFebIdx) {
1068 sHistName = Form(
"hStsFebSmxErrRatioEvo_%03u", uFebIdx);
1069 title = Form(
"Proportion of uS with SMX logic error in FEB #%03u; Time "
1070 "[s]; Error MS fract. []",
1073 new TProfile(sHistName, title, 1800, 0, 1800));
1076 sHistName = Form(
"hStsFebSmxErrRatioEvoAsic_%03u", uFebIdx);
1077 title = Form(
"Proportion of uS with SMX logic error per ASIC in FEB "
1078 "#%03u; Time [s]; ASIC []; Error MS fract. []",
1081 new TProfile2D(sHistName,
1091 sHistName = Form(
"hStsFebSmxErrRatioCopyEvo_%03u", uFebIdx);
1092 title = Form(
"Proportion of uS with hit copies in FEB #%03u; Time [s]; "
1093 "Copies MS fract. []",
1096 new TProfile(sHistName, title, 1800, 0, 1800));
1099 sHistName = Form(
"hStsFebSmxErrRatioCopyEvoAsic_%03u", uFebIdx);
1100 title = Form(
"Proportion of uS with hit copies per ASIC in FEB #%03u; "
1101 "Time [s]; ASIC []; Copies MS fract. []",
1104 new TProfile2D(sHistName,
1114 sHistName = Form(
"hStsFebSmxErrRatioCopySameAdcEvo_%03u", uFebIdx);
1115 title = Form(
"Proportion of uS with hit full copies in FEB #%03u; Time "
1116 "[s]; Copies MS fract. []",
1119 new TProfile(sHistName, title, 1800, 0, 1800));
1122 sHistName = Form(
"hStsFebSmxErrRatioCopySameAdcEvoAsic_%03u", uFebIdx);
1123 title = Form(
"Proportion of uS with hit full copies per ASIC in FEB "
1124 "#%03u; Time [s]; ASIC []; Copies MS fract. []",
1127 new TProfile2D(sHistName,
1140 "; MS index [s]; Error type []; Counts []",
1151 fhMsSz[component] = NULL;
1156 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
1170 for (UInt_t uFebIdx = 0; uFebIdx <
fuNbFebs; ++uFebIdx) {
1204 server->Register(
"/StsSmxErr",
1206 server->Register(
"/StsSmxErr",
1208 server->Register(
"/StsSmxErr",
1229 server->RegisterCommand(
"/Reset_All",
"bMcbm2018ResetSts=kTRUE");
1230 server->RegisterCommand(
"/Write_All",
"bMcbm2018WriteSts=kTRUE");
1231 server->RegisterCommand(
"/ScanNoisyCh",
"bMcbm2018ScanNoisySts=kTRUE");
1234 server->Restrict(
"/Reset_All",
"allow=admin");
1235 server->Restrict(
"/Write_All",
"allow=admin");
1236 server->Restrict(
"/ScanNoisyCh",
"allow=admin");
1246 for (UInt_t uFebIdx = 0; uFebIdx <
fuNbFebs; ++uFebIdx) {
1249 new TCanvas(Form(
"cStsSum_%03u", uFebIdx),
1250 Form(
"Summary plots for FEB %03u", uFebIdx),
1303 server->Register(
"/canvases",
fvcStsSumm[uFebIdx]);
1307 new TCanvas(Form(
"cStsSmxErr_%03u", uFebIdx),
1308 Form(
"SMX logic error plots for FEB %03u", uFebIdx),
1360 fcMsSizeAll =
dynamic_cast<TCanvas*
>(gROOT->FindObject(
"cMsSizeAll"));
1363 new TCanvas(
"cMsSizeAll",
"Evolution of MS size in last 300 s", w,
h);
1365 LOG(info) <<
"Created MS size canvas in STS monitor";
1368 LOG(info) <<
"Recovered MS size canvas in STS monitor";
1390 LOG(debug) <<
"Timeslice contains " << ts.num_microslices(component)
1402 for (UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx++) {
1411 auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
1422 uint32_t uEqId =
static_cast<uint32_t
>(msDescriptor.eq_id & 0xFFFF);
1426 <<
"Could not find the sDPB index for AFCK id 0x" << std::hex
1427 << uEqId << std::dec <<
" component " << uMsCompIdx <<
"\n"
1428 <<
"If valid this index has to be added in the TOF parameter file "
1429 "in the RocIdArray field"
1431 <<
"For now we remove it from the list of components analyzed";
1441 if (kFALSE ==
ProcessStsMs(ts, uMsComp, uMsIdx))
return kFALSE;
1629 std::vector<stsxyter::FinalHit>::iterator itA;
1630 std::vector<stsxyter::FinalHit>::iterator itB;
1639 UShort_t usAsicIdx = (*itA).GetAsic();
1669 bHitCopyInThisMs[uAsic] = kFALSE;
1670 bHitCopySameAdcInThisMs[uAsic] = kFALSE;
1671 bFlagOnInThisMs[uAsic] = kFALSE;
1688 UShort_t usChanIdx = (*itA).GetChan();
1689 ULong64_t ulHitTs = (*itA).GetTs();
1690 UShort_t usHitAdc = (*itA).GetAdc();
1698 Bool_t bIsNotCopy = kTRUE;
1699 if (vulLastHitTs[usChanIdx] == ulHitTs) {
1700 bIsNotCopy = kFALSE;
1701 bHitCopyInThisMs[uAsic] = kTRUE;
1702 if (vusLastHitAdc[usChanIdx] == usHitAdc)
1703 bHitCopySameAdcInThisMs[uAsic] = kTRUE;
1706 vulLastHitTs[usChanIdx] = ulHitTs;
1707 vusLastHitAdc[usChanIdx] = usHitAdc;
1724 std::vector<Bool_t> vbCopyOnAnyAsicMs(
fuNbFebs, kFALSE);
1725 std::vector<Bool_t> vbCopySameAdcOnAnyAsicMs(
fuNbFebs, kFALSE);
1726 std::vector<Bool_t> vbFlagOnAnyAsicMs(
fuNbFebs, kFALSE);
1727 Bool_t bCopyOnAnyMs = kFALSE;
1728 Bool_t bCopySameAdcOnAnyMs = kFALSE;
1729 Bool_t bFlagOnAnyMs = kFALSE;
1737 bHitCopyInThisMs[uAsic] ? 1.0 : 0.0);
1742 bHitCopySameAdcInThisMs[uAsic] ? 1.0 : 0.0);
1747 bFlagOnInThisMs[uAsic] ? 1.0 : 0.0);
1749 vbCopyOnAnyAsicMs[uFebIdx] =
1750 vbCopyOnAnyAsicMs[uFebIdx] || bHitCopyInThisMs[uAsic];
1751 vbCopySameAdcOnAnyAsicMs[uFebIdx] =
1752 vbCopySameAdcOnAnyAsicMs[uFebIdx] || bHitCopySameAdcInThisMs[uAsic];
1753 vbFlagOnAnyAsicMs[uFebIdx] =
1754 vbFlagOnAnyAsicMs[uFebIdx] || bFlagOnInThisMs[uAsic];
1756 bCopyOnAnyMs |= bHitCopyInThisMs[uAsic];
1757 bCopySameAdcOnAnyMs |= bHitCopySameAdcInThisMs[uAsic];
1758 bFlagOnAnyMs |= bFlagOnInThisMs[uAsic];
1761 for (UInt_t uFebIdx = 0; uFebIdx <
fuNbFebs; ++uFebIdx) {
1766 vbCopySameAdcOnAnyAsicMs[uFebIdx] ? 1.0 : 0.0);
1773 for (UInt_t uFebIdx = 0; uFebIdx <
fuNbFebs; ++uFebIdx) {
1911 if (0 == ts.index() % 1000) {
1912 for (UInt_t uDpb = 0; uDpb <
fuNrOfDpbs; ++uDpb) {
1913 Double_t dTsMsbTime =
1920 LOG(info) <<
"End of TS " << std::setw(7) << ts.index() <<
" eDPB "
1921 << std::setw(2) << uDpb <<
" current TS MSB counter is "
1923 <<
" current TS MSB cycle counter is " << std::setw(12)
1925 << std::setw(12) << dTsMsbTime <<
" s";
1929 if (0 == ts.index() % 10000)
1938 auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
1940 const uint8_t* msContent =
1941 reinterpret_cast<const uint8_t*
>(ts.content(uMsComp, uMsIdx));
1963 <<
"Could not find the sDPB index for AFCK id 0x" << std::hex
1965 <<
"If valid this index has to be added in the TOF parameter file in "
1966 "the RocIdArray field"
1968 <<
"For now we remove it from the list of components analyzed";
1976 uint32_t uSize = msDescriptor.size;
1979 LOG(debug) <<
"Microslice: " <<
fulCurrentMsIdx <<
" from EqId " << std::hex
1987 fhMsSz[uMsComp]->Fill(uSize);
1993 <
static_cast<Int_t
>(dMsTime)) {
1998 UInt_t uFebIdxInSyst = uFebIdxOffset + uFebIdx;
2046 uint16_t uMsHeaderFlags = msDescriptor.flags;
2047 for (UInt_t uBit = 0; uBit < 16; ++uBit)
2051 UInt_t uTsMsbCycleHeader =
2068 else if (0 == uMsIdx) {
2072 << std::setw(4) << uMsIdx <<
" Msg Idx " << std::setw(5) << 0
2073 <<
" DPB " << std::setw(2) <<
fuCurrDpbIdx <<
" Old TsMsb "
2075 <<
" Old MsbCy " << std::setw(5)
2077 << uTsMsbCycleHeader;
2084 <<
"TS MSB cycle from MS header does not match current cycle from data "
2088 << uTsMsbCycleHeader;
2095 << std::setw(4) << uMsIdx <<
" Msg Idx " << std::setw(5) << 0
2096 <<
" DPB " << std::setw(2) <<
fuCurrDpbIdx <<
" Old TsMsb "
2098 <<
" Old MsbCy " << std::setw(5)
2100 << uTsMsbCycleHeader;
2103 <<
"TS MSB cycle from MS header does not match current cycle from data "
2107 <<
" (cnt) VS " << uTsMsbCycleHeader <<
" (header)";
2114 LOG(error) <<
"The input microslice buffer does NOT "
2115 <<
"contain only complete nDPB messages!";
2118 uint32_t uNbMessages =
2122 const uint32_t* pInBuff =
reinterpret_cast<const uint32_t*
>(msContent);
2124 for (uint32_t uIdx = 0; uIdx < uNbMessages; ++uIdx) {
2126 uint32_t ulData =
static_cast<uint32_t
>(pInBuff[uIdx]);
2153 static_cast<uint16_t
>(typeMess));
2164 if (-1 == uFebIdx) {
2165 LOG(warning) <<
"CbmMcbm2018MonitorSts::DoUnpack => "
2166 <<
"Wrong elink Idx! Elink raw "
2167 << Form(
"%d remap %d", usElinkIdx, uFebIdx);
2183 static_cast<uint16_t
>(typeMess));
2191 static_cast<uint16_t
>(typeMess));
2197 LOG(info) <<
"CbmMcbm2018MonitorSts::DoUnpack => "
2198 <<
"EPOCH message at unexpected position in MS: message "
2199 << uIdx <<
" VS message 0 expected!";
2206 static_cast<uint16_t
>(typeMess));
2226 std::cout << Form(
"DPB %2u TS %12llu MS %12llu mess %5u ",
2239 static_cast<uint16_t
>(typeMess));
2258 static_cast<uint16_t
>(typeMess));
2262 LOG(fatal) <<
"CbmMcbm2018MonitorSts::DoUnpack => "
2263 <<
"Unknown message type, should never happen, stopping "
2264 "here! Type found was: "
2265 <<
static_cast<int>(typeMess);
2275 const UInt_t& uAsicIdx,
2276 const UInt_t& uMsIdx) {
2299 UInt_t uChanInFeb = usChan
2339 Double_t dHitTimeNs =
2357 if (dDeltaT < 80.0) {
2415 Double_t dTimeSinceStartSec =
2417 Double_t dTimeSinceStartMin = dTimeSinceStartSec / 60.0;
2429 dTimeSinceStartMin, uChanInFeb, 1.0 / 60.0);
2431 dTimeSinceStartMin, uAsicInFeb, 1.0 / 60.0);
2486 << uMsIdx <<
" Msg Idx " << std::setw(5) << uMessIdx <<
" DPB "
2487 << std::setw(2) <<
fuCurrDpbIdx <<
" Old TsMsb " << std::setw(5)
2490 << std::setw(5) << uVal;
2505 LOG(info) <<
"TS MSb Jump in "
2508 << uMsIdx <<
" Msg Idx " << std::setw(5) << uMessIdx <<
" DPB "
2511 << std::setw(5) << uVal;
2549 LOG(info) <<
"-------------------------------------";
2550 LOG(info) <<
"CbmMcbm2018MonitorSts statistics are ";
2559 <<
" Empty messages: "
2562 LOG(info) <<
"-------------------------------------";
2570 TDirectory* oldDir = NULL;
2571 TFile* histoFile = NULL;
2572 if (
"" != sFileName) {
2574 oldDir = gDirectory;
2576 histoFile =
new TFile(sFileName,
"RECREATE");
2581 gDirectory->mkdir(
"Sts_Raw");
2582 gDirectory->cd(
"Sts_Raw");
2595 gDirectory->cd(
"..");
2599 gDirectory->mkdir(
"Sts_Feb");
2600 gDirectory->cd(
"Sts_Feb");
2601 for (UInt_t uFebIdx = 0; uFebIdx <
fuNbFebs; ++uFebIdx) {
2633 gDirectory->cd(
"..");
2657 gDirectory->mkdir(
"Sts_SmxErr");
2658 gDirectory->cd(
"Sts_SmxErr");
2659 for (UInt_t uFebIdx = 0; uFebIdx <
fuNbFebs; ++uFebIdx) {
2669 gDirectory->cd(
"..");
2675 gDirectory->mkdir(
"Flib_Raw");
2676 gDirectory->cd(
"Flib_Raw");
2678 TString sMsSzName = Form(
"MsSz_link_%02u", uLinks);
2679 if (
fHM->
Exists(sMsSzName.Data()))
fHM->
H1(sMsSzName.Data())->Write();
2681 sMsSzName = Form(
"MsSzTime_link_%02u", uLinks);
2682 if (
fHM->
Exists(sMsSzName.Data()))
fHM->
P1(sMsSzName.Data())->Write();
2685 TH1* pMissedTsH1 =
dynamic_cast<TH1*
>(gROOT->FindObjectAny(
"Missed_TS"));
2686 if (NULL != pMissedTsH1) pMissedTsH1->Write();
2688 TProfile* pMissedTsEvoP =
2689 dynamic_cast<TProfile*
>(gROOT->FindObjectAny(
"Missed_TS_Evo"));
2690 if (NULL != pMissedTsEvoP) pMissedTsEvoP->Write();
2692 gDirectory->cd(
"..");
2694 for (UInt_t uFebIdx = 0; uFebIdx <
fuNbFebs; ++uFebIdx) {
2702 if (
"" != sFileName) {
2709 LOG(info) <<
"Reseting all STS histograms.";
2723 for (UInt_t uFebIdx = 0; uFebIdx <
fuNbFebs; ++uFebIdx) {
2779 TString sMsSzName = Form(
"MsSz_link_%02u", uLinks);
2780 if (
fHM->
Exists(sMsSzName.Data()))
fHM->
H1(sMsSzName.Data())->Reset();
2782 sMsSzName = Form(
"MsSzTime_link_%02u", uLinks);
2783 if (
fHM->
Exists(sMsSzName.Data()))
fHM->
P1(sMsSzName.Data())->Reset();
2825 TDatime* fRunStartDateTime =
new TDatime(dateIn, timeIn);
2829 LOG(info) <<
"Assigned new MUCH Run Start Date-Time: "
2830 << fRunStartDateTime->AsString();
2859 for (UInt_t uFebIdx = 0; uFebIdx <
fuNbFebs; ++uFebIdx) {
2884 Double_t dNewHitTime) {
2937 Double_t dTimeDiff07 =
2942 Double_t dTimeDiff08 =
2947 Double_t dTimeDiff09 =
2952 Double_t dTimeDiff10 =
2957 Double_t dTimeDiff11 =
2995 for (UInt_t uFebIdx = 0; uFebIdx <
fuNbFebs; ++uFebIdx) {
2998 " ------------------ Noisy channels scan for FEB %2d ------------",
3009 "Noisy Channel ASIC %d channel %3d (%4d) level %6.0f",
3018 <<
" ---------------------------------------------------------------";