Go to the documentation of this file.
16 #include "FairLogger.h"
17 #include "FairRootManager.h"
19 #include "FairRunOnline.h"
20 #include "FairRuntimeDb.h"
26 #include "TPaveStats.h"
41 for (UInt_t uGdpb = 0; uGdpb <
fuNrOfGdpbs; ++uGdpb) {
49 LOG(info) <<
"Initializing mCBM T0 2019 monitor algo";
62 LOG(info) <<
"Init parameter containers for CbmMcbm2018MonitorAlgoT0";
68 LOG(info) <<
"**********************************************";
69 LOG(info) <<
"ReInit parameter containers for CbmMcbm2018MonitorAlgoT0";
114 LOG(info) <<
"GDPB Id of TOF " <<
i <<
" : " << std::hex
131 UShort_t usDetectorId) {
139 LOG(info) <<
"CbmMcbm2018MonitorAlgoT0::AddMsComponentToList => Component "
140 << component <<
" with detector ID 0x" << std::hex << usDetectorId
141 << std::dec <<
" added to list";
147 fdTsStartTime =
static_cast<Double_t
>(ts.descriptor(0, 0).idx);
166 LOG(info) <<
"In each TS " <<
fuNbMsLoop <<
" MS will be looped over";
182 <<
fuMsIndex <<
" for component " << uMsComp;
230 auto msDescriptor = ts.descriptor(uMsCompIdx, uMsIdx);
232 const uint8_t* msContent =
233 reinterpret_cast<const uint8_t*
>(ts.content(uMsCompIdx, uMsIdx));
235 uint32_t uSize = msDescriptor.size;
238 LOG(debug) <<
"Microslice: " <<
fulCurrentMsIdx <<
" from EqId " << std::hex
252 <<
"---------------------------------------------------------------";
253 LOG(INFO) <<
"Component " << uMsCompIdx <<
" TS Idx " <<
fulCurrentTsIdx;
255 <<
"hi hv eqid flag si sv idx/start crc size offset";
256 LOG(INFO) << Form(
"%02x %02x %04x %04x %02x %02x %016lx %08x %08x %016lx",
257 static_cast<unsigned int>(msDescriptor.hdr_id),
258 static_cast<unsigned int>(msDescriptor.hdr_ver),
261 static_cast<unsigned int>(msDescriptor.sys_id),
262 static_cast<unsigned int>(msDescriptor.sys_ver),
263 static_cast<unsigned long>(msDescriptor.idx),
266 static_cast<unsigned long>(msDescriptor.offset));
276 <<
"---------------------------------------------------------------";
287 LOG(warning) <<
"Could not find the gDPB index for AFCK id 0x" << std::hex
290 <<
" component " << uMsCompIdx <<
"\n"
291 <<
"If valid this index has to be added in the TOF "
292 "parameter file in the DbpIdArray field";
337 LOG(error) <<
"The input microslice buffer does NOT "
338 <<
"contain only complete nDPB messages!";
341 uint32_t uNbMessages =
345 Int_t messageType = -111;
346 const uint64_t* pInBuff =
reinterpret_cast<const uint64_t*
>(msContent);
347 for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx++) {
349 uint64_t ulData =
static_cast<uint64_t
>(pInBuff[uIdx]);
370 LOG(warning) <<
"Message with Get4 ID too high: " <<
fuGet4Id <<
" VS "
373 switch (messageType) {
377 <<
"This event builder does not support 24b hit message!!!.";
474 LOG(error) <<
"Message type " << std::hex << std::setw(2)
475 <<
static_cast<uint16_t
>(messageType)
476 <<
" not included in Get4 unpacker.";
754 std::string sFolder =
"MoniT0";
756 LOG(info) <<
"create Histos for T0 monitoring ";
759 uint32_t iNbBinsLog = 0;
762 double* dBinsLog = dBinsLogVector.data();
767 "Map of hits on T0 detector; DPB; Hits Count []",
772 "Map of hits on T0 detector; Strip; Hits Count []",
777 "Map of hits on T0 detector vs time in run; Chan; "
778 "Time in run [s]; Hits Count []",
786 "Evolution of TOT in T0 detector vs time in run; Time "
787 "in run [s]; TOT [ bin ]; Hits Count []",
795 "Map of hits on T0 detector vs time in run; "
796 "Strip; Time in run [s]; Hits Count []",
805 Form(
"hDpbMapSpill%02u", uSpill),
807 "Map of hits on T0 detector in current spill %02u; DPB; Hits Count []",
813 new TH1I(Form(
"hChannelMapSpill%02u", uSpill),
814 Form(
"Map of hits on T0 detector in current spill %02u; Strip; "
822 "Hit count per spill; Spill; Hits Count []",
828 "Evolution of Hit & error msgs counts vs time in run; "
829 "Time in run [s]; Msgs Count []",
835 "Evolution of Hit counts vs time in run; Time in run [s]; Hits Count []",
841 "Evolution of Error counts vs time in run; Time in run [s]; Error Count []",
846 "Evolution of LostEvent counts vs time in run; "
847 "Time in run [s]; LostEvent Count []",
853 "Evolution of Error Fraction vs time in run; "
854 "Time in run [s]; Error Fract []",
859 "Evolution of LostEvent Fraction vs time in "
860 "run; Time in run [s]; LostEvent Fract []",
866 new TH2I(
"hMsgCntPerMsEvo",
867 "Evolution of Hit & error msgs counts, per MS vs time in run; "
868 "Time in run [s]; Hits Count/MS []; MS",
875 "Evolution of Hit counts, per MS vs time in run; "
876 "Time in run [s]; Hits Count/MS []; MS",
883 "Evolution of Error counts, per MS vs time in "
884 "run; Time in run [s]; Error Count/MS []; MS",
891 new TH2I(
"hLostEvtCntPerMsEvo",
892 "Evolution of LostEvent, per MS counts vs time in run; Time in "
893 "run [s]; LostEvent Count/MS []; MS",
901 new TH2I(
"hErrorFractPerMsEvo",
902 "Evolution of Error Fraction, per MS vs time in run; Time in run "
903 "[s]; Error Fract/MS []; MS",
911 new TH2I(
"hLostEvtFractPerMsEvo",
912 "Evolution of LostEvent Fraction, per MS vs time in run; Time in "
913 "run [s]; LostEvent Fract/MS []; MS",
922 new TH1I(
"fhChannelMapPulser",
923 "Map of pulser hits on T0 detector; Chan; Hits Count []",
928 "Map of hits on T0 detector vs time in run; "
929 "Chan; Time in run [s]; Hits Count []",
970 new TH1I(Form(
"hMsgCntEvoChan%02u", uChan),
971 Form(
"Evolution of Messages counts vs time in run for channel "
972 "%02u; Time in run [s]; Messages Count []",
978 new TH2I(Form(
"hMsgCntPerMsEvoChan%02u", uChan),
979 Form(
"Evolution of Hit counts per MS vs time in run for channel "
980 "%02u; Time in run [s]; Hits Count/MS []; MS",
989 new TH1I(Form(
"hHitCntEvoChan%02u", uChan),
990 Form(
"Evolution of Hit counts vs time in run for channel %02u; "
991 "Time in run [s]; Hits Count []",
997 new TH2I(Form(
"hHitCntPerMsEvoChan%02u", uChan),
998 Form(
"Evolution of Hit counts per MS vs time in run for channel "
999 "%02u; Time in run [s]; Hits Count/MS []; MS",
1008 new TH1I(Form(
"hErrorCntEvoChan%02u", uChan),
1009 Form(
"Evolution of Error counts vs time in run for channel "
1010 "%02u; Time in run [s]; Error Count []",
1016 new TH2I(Form(
"hErrorCntPerMsEvoChan%02u", uChan),
1017 Form(
"Evolution of Error counts per MS vs time in run for "
1018 "channel %02u; Time in run [s]; Error Count/MS []; MS",
1027 new TH1I(Form(
"hEvtLostCntEvoChan%02u", uChan),
1028 Form(
"Evolution of LostEvent counts vs time in run for channel "
1029 "%02u; Time in run [s]; LostEvent Count []",
1035 new TH2I(Form(
"hEvtLostCntPerMsEvoChan%02u", uChan),
1036 Form(
"Evolution of LostEvent counts per MS vs time in run for "
1037 "channel %02u; Time in run [s]; LostEvent Count/MS []; MS",
1046 new TProfile(Form(
"hErrorFractEvoChan%02u", uChan),
1047 Form(
"Evolution of Error Fraction vs time in run for "
1048 "channel %02u; Time in run [s]; Error Fract []",
1054 new TH2I(Form(
"hErrorFractPerMsEvoChan%02u", uChan),
1055 Form(
"Evolution of Error Fraction, per MS vs time in run for "
1056 "channel %02u; Time in run [s]; Error Fract/MS []; MS",
1066 new TProfile(Form(
"hEvtLostFractEvoChan%02u", uChan),
1067 Form(
"Evolution of LostEvent Fraction vs time in run for "
1068 "channel %02u; Time in run [s]; LostEvent Fract []",
1074 Form(
"hEvtLostFractPerMsEvoChan%02u", uChan),
1075 Form(
"Evolution of LostEvent Fraction, per MS vs time in run for channel "
1076 "%02u; Time in run [s]; LostEvent Fract/MS []; MS",
1111 fcHitMaps =
new TCanvas(
"cHitMaps",
"Hit maps", w,
h);
1132 new TCanvas(
"cSummary",
"Hit maps, Hit rate, Error fraction", w,
h);
1166 "Messages and hit cnt per MS, Error and Evt Loss Fract. per MS ",
1205 new TCanvas(
"cSpillCounts",
1206 "Counts per spill, last 5 spills including current one",
1234 new TCanvas(
"cSpillCountsHori",
1235 "Counts per spill, last 5 spills including current one",
1262 new TCanvas(
"cSpillDpbCountsHori",
1263 "Counts in DPB per spill, last 5 spills including current one",
1275 TPaveStats* st = (TPaveStats*)
fvhDpbMapSpill[uSpill]->FindObject(
"stats");
1276 st->SetOptStat(110);
1289 Double_t dMsgCountChan;
1290 Double_t dFractErrorsInMsChan;
1291 Double_t dFractLostEvtInMsChan;
1292 UInt_t uCountHitsInMs = 0;
1293 UInt_t uCountErrorsInMs = 0;
1294 UInt_t uCountLostEvtInMs = 0;
1300 dFractErrorsInMsChan /= dMsgCountChan;
1301 dFractLostEvtInMsChan /= dMsgCountChan;
1312 dFractErrorsInMsChan);
1314 dFractLostEvtInMsChan);
1324 Double_t dFractErrorsInMs = uCountErrorsInMs;
1325 Double_t dFractLostEvtInMs = uCountLostEvtInMs;
1326 dFractErrorsInMs /= (uCountHitsInMs + uCountErrorsInMs);
1327 dFractLostEvtInMs /= (uCountHitsInMs + uCountErrorsInMs);
1330 uCountHitsInMs + uCountErrorsInMs);
1388 if (kTRUE == bResetTime) {
UInt_t fuNrOfChannelsPerGet4
Number of GET4s per FEE.
TCanvas * fcSpillDpbCountsHori
std::vector< std::vector< gdpbv100::Message > > fvvmEpSupprBuffer
Buffers.
UInt_t fuNrOfChannelsPerFee
Number of channels in each GET4.
std::vector< TProfile * > fvhErrorFractEvoChan
Double_t fdMsSizeInNs
/** Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice **/
std::vector< ULong64_t > fvulCurrentEpochFull
Epoch cycle from the Ms Start message and Epoch counter flip.
std::vector< TH2 * > fvhErrorFractPerMsEvoChan
TCanvas * fcSummary
Canvases.
Double_t fdTsStopTimeCore
Time in ns of current TS from the index of the first MS first component.
Double_t fdMsTime
End Time in ns of current TS Core from the index of the first MS first component.
UInt_t fuOffSpillCountLimit
std::vector< TH2 * > fvhEvtLostFractPerMsEvoChan
UInt_t fuNrOfFeePerGdpb
gDPB ID to index map
UInt_t fuDiamChanMap[kuNbChanDiamond]
TCanvas * fcSpillCountsHori
std::vector< TH1 * > fvhHitCntEvoChan
static const UInt_t kuNbChanDiamond
static const UInt_t kuNbSpillPlots
std::vector< UInt_t > fvuErrorCntChanMs
TH2 * fhLostEvtCntPerMsEvo
Double_t fdLastSecondTime
UInt_t fuCountsLastSecond
Bool_t fbMonitorMode
Control flags.
UInt_t fuCurrentEquipmentId
std::vector< UInt_t > fvuEvtLostCntChanMs
uint8_t getMessageType() const
Returns the message type. Valid for all message types. 4 bit.
void AddHistoToVector(TNamed *pointer, std::string sFolder="")
For monitor algos.
std::vector< ULong64_t > fvulCurrentEpochCycle
Current epoch index, per DPB.
Bool_t ResetHistograms(Bool_t bResetTime=kTRUE)
uint16_t getGdpbSysSubType() const
TProfile * fhLostEvtFractEvo
UInt_t fuCurrentSpillPlot
bool isStarTrigger() const
Returns true is message type is MSG_STAR_TRI_A, _B, _C, _D (STAR Trigger message)
Bool_t ProcessMs(const fles::Timeslice &ts, size_t uMsCompIdx, size_t uMsIdx)
Double_t fdTsFullSizeInNs
Total size of the core MS in a TS, [nanoseconds].
uint16_t getGdpbSysErrData() const
TList * fParCList
Parameter management.
UInt_t fuNrOfGet4PerFee
Number of FEBs per GDPB.
std::vector< size_t > fvMsComponentsList
Parameters related to FLES containers.
UInt_t fuGet4Id
Bin size in s for the plots with date as X axis.
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
CbmMcbm2018TofPar * fUnpackPar
Settings from parameter file.
UInt_t fuMsIndex
Start Time in ns of current MS from its index field in header.
std::vector< TProfile * > fvhEvtLostFractEvoChan
std::vector< TH2 * > fvhEvtLostCntPerMsEvoChan
Int_t GetNrOfGdpbs()
FIXME: replace with method returning the correspondign constants! see Star2019 parameter.
std::vector< gdpbv100::FullMessage > fvmHitsInMs
[DPB]
std::vector< UInt_t > fvuHitCntChanMs
ULong64_t fulCurrentMsIdx
std::map< UInt_t, UInt_t > fGdpbIdIndexMap
Total number of GDPBs in the system.
Data class with information on a STS local track.
std::vector< TH1 * > fvhErrorCntEvoChan
Bool_t fbSpillOn
Channels map.
ULong64_t fulCurrentTsIdx
TH2 * fhLostEvtFractPerMsEvo
CbmMcbm2018MonitorAlgoT0()
static const UInt_t kuBytesPerMessage
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
UInt_t fuGet4Nr
running number (0 to fuNrOfGet4PerGdpb) of the Get4 chip of a unique GDPB for current message
TH1 * fhMsgCntEvo
Global Rate.
Bool_t ProcessTs(const fles::Timeslice &ts)
Double_t fdTsCoreSizeInNs
Size of a single MS, [nanoseconds].
const uint32_t kuChipIdMergedEpoch
Double_t fdStartTime
Epoch + Epoch Cycle.
UInt_t fuNrOfGet4PerGdpb
Total number of Get4 chips in the system.
~CbmMcbm2018MonitorAlgoT0()
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
TProfile * fhErrorFractEvo
std::vector< TH2 * > fvhMsgCntPerMsEvoChan
Int_t GetNrOfChannelsPerGet4()
std::vector< TH1 * > fvhDpbMapSpill
UInt_t fuMinTotPulser
Number of channels per GDPB.
uint16_t getGdpbHitIs24b() const
uint16_t getGdpbGenChipId() const
UInt_t fuNrOfChannelsPerGdpb
Number of GET4s per GDPB.
std::vector< TH1 * > fvhChannelMapSpill
UInt_t fuHistoryHistoSize
All hits (time in bins, TOT in bins, asic, channel) in last MS, sorted with "<" operator.
void AddCanvasToVector(TCanvas *pointer, std::string sFolder="")
Double_t fdStartTimeSpill
TH2 * fhErrorFractPerMsEvo
TH1 * fhChannelMapPulser
Pulser.
std::vector< ULong64_t > fvulCurrentEpoch
Data format control: Current time references for each GDPB: merged epoch marker, epoch cycle,...
UInt_t fuNrOfGdpbs
Readout chain dimensions and mapping.
TH1 * fhDpbMap
Map from electronics channel to Diamond strip.
std::vector< TH2 * > fvhErrorCntPerMsEvoChan
Int_t GetNrOfGet4PerFee()
Bool_t CreateHistograms()
std::vector< TH2 * > fvhHitCntPerMsEvoChan
uint16_t getGdpbHit32Tot() const
std::vector< TH1 * > fvhMsgCntEvoChan
std::vector< TH1 * > fvhEvtLostCntEvoChan
Int_t GetNrOfFeesPerGdpb()
std::vector< Bool_t > fvbMaskedComponents
Switch ON the filling of a additional set of histograms.
UInt_t fuNrOfGet4
Number of channels in each FEE.
Bool_t ReInitContainers()