CbmRoot
Loading...
Searching...
No Matches
CbmStar2019MonitorAlgo.h
Go to the documentation of this file.
1/* Copyright (C) 2019-2020 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau [committer] */
4
5// -----------------------------------------------------------------------------
6// ----- -----
7// ----- CbmStar2019MonitorAlgo -----
8// ----- Created 12.10.2019 by P.-A. Loizeau -----
9// ----- -----
10// -----------------------------------------------------------------------------
11
12#ifndef CbmStar2019MonitorAlgo_H
13#define CbmStar2019MonitorAlgo_H
14
15#include "CbmStar2019Algo.h"
16
17// Data
18#include "CbmTofDigi.h"
19
20#include "gDpbMessv100.h"
21
22// CbmRoot
23
24// C++11
25#include <chrono>
26
27// C/C++
28#include <map>
29#include <vector>
30
32class TH1;
33class TH2;
34class TProfile;
35
36class CbmStar2019MonitorAlgo : public CbmStar2019Algo<CbmTofDigi> {
37public:
40
41 virtual Bool_t Init();
42 virtual void Reset();
43 virtual void Finish();
44
45 Bool_t InitContainers();
46 Bool_t ReInitContainers();
47 TList* GetParList();
48
49 Bool_t InitParameters();
50
51 Bool_t ProcessTs(const fles::Timeslice& ts);
52 Bool_t ProcessTs(const fles::Timeslice& ts, size_t /*component*/) { return ProcessTs(ts); }
53 Bool_t ProcessMs(const fles::Timeslice& ts, size_t uMsCompIdx, size_t uMsIdx);
54
55 void AddMsComponentToList(size_t component, UShort_t usDetectorId);
56
57 Bool_t CreateHistograms();
58 Bool_t FillHistograms();
59 Bool_t ResetHistograms();
61 Bool_t SaveLatencyHistograms(TString fsHistoFileName);
62
63 inline void SetDebugMonitorMode(Bool_t bFlagIn = kTRUE) { fbDebugMonitorMode = bFlagIn; }
64 inline void SetIgnoreCriticalErrors(Bool_t bFlagIn = kTRUE) { fbIgnoreCriticalErrors = bFlagIn; }
65 inline void SetHistoryHistoSize(UInt_t inHistorySizeSec = 1800) { fuHistoryHistoSize = inHistorySizeSec; }
66 inline void SetPulserTotLimits(UInt_t uMin, UInt_t uMax)
67 {
68 fuMinTotPulser = uMin;
69 fuMaxTotPulser = uMax;
70 }
71
72 inline void SetSectorIndex(Int_t iSector = -1) { fiSectorIndex = iSector; }
73
74private:
78 std::vector<Bool_t> fvbMaskedComponents;
80
84 UInt_t fuNrOfGdpbs;
85 std::map<UInt_t, UInt_t> fGdpbIdIndexMap;
90 UInt_t fuNrOfGet4;
93
97
99 static const Int_t kiMaxNbFlibLinks = 32;
100 static const UInt_t kuBytesPerMessage = 8;
101 static const UInt_t kuNbChanDiamond = 8;
102
107 Double_t fdTsStartTime;
109 Double_t fdMsTime;
110 UInt_t fuMsIndex;
112 std::map<gdpbv100::MessageTypes, UInt_t> fmMsgCounter;
114 UInt_t fuCurrDpbId;
119 UInt_t fuGet4Id;
120 UInt_t fuGet4Nr;
122 std::vector<ULong64_t> fvulCurrentEpoch;
123 std::vector<ULong64_t> fvulCurrentEpochCycle;
124 std::vector<ULong64_t> fvulCurrentEpochFull;
125
127 std::vector<gdpbv100::Message> fvmEpSupprBuffer;
128
130 ULong64_t fulStartTs;
131 Double_t fdStartTime;
133 std::chrono::steady_clock::time_point
137 std::vector<ULong64_t> fvulGdpbTsMsb;
138 std::vector<ULong64_t> fvulGdpbTsLsb;
139 std::vector<ULong64_t> fvulStarTsMsb;
140 std::vector<ULong64_t> fvulStarTsMid;
141 std::vector<ULong64_t> fvulGdpbTsFullLast;
142 std::vector<ULong64_t> fvulStarTsFullLast;
143 std::vector<UInt_t> fvuStarTokenLast;
144 std::vector<UInt_t> fvuStarDaqCmdLast;
145 std::vector<UInt_t> fvuStarTrigCmdLast;
146
151
154
176 std::vector<TH2*> fvhGdpbGet4MessType;
177 std::vector<TH2*> fvhGdpbGet4ChanScm;
178 std::vector<TH2*> fvhGdpbGet4ChanErrors;
184 TProfile* fhErrorFractEvo;
193 std::vector<TH2*> fvhRawFt_gDPB;
194 std::vector<TH2*> fvhRawCt_gDPB;
195 std::vector<TH2*> fvhRemapTot_gDPB;
196 std::vector<TH1*> fvhRemapChCount_gDPB;
197 std::vector<TH2*> fvhRemapChRate_gDPB;
200 std::vector<UInt_t> fuNbMissmatchPattern;
206 std::vector<TH2*> fvhGdpbPatternMissmatchEvo;
207 std::vector<TH2*> fvhGdpbPatternEnableEvo;
208 std::vector<TH2*> fvhGdpbPatternResyncEvo;
210 std::vector<std::vector<bool>> fvvbGdpbLastMissmatchPattern;
211 std::vector<std::vector<bool>> fvvbGdpbLastEnablePattern;
212 std::vector<std::vector<bool>> fvvbGdpbLastResyncPattern;
213 std::vector<TH2*> fvhGdpbMissmatchEvoPerTs;
214 std::vector<TH2*> fvhGdpbMissmatchEnaEvoPerTs;
215 std::vector<TH2*> fvhGdpbEnableEvoPerTs;
216 std::vector<TH2*> fvhGdpbResyncEvoPerTs;
217 std::vector<TH2*> fvhGdpbResyncEnaEvoPerTs;
218 std::vector<TH2*> fvhGdpbStateEvoPerTs;
220 std::vector<TH1*> fvhTokenMsgType;
221 std::vector<TH1*> fvhTriggerRate;
222 std::vector<TH2*> fvhCmdDaqVsTrig;
223 std::vector<TH2*> fvhStarTokenEvo;
224 std::vector<TProfile*> fvhStarTrigGdpbTsEvo;
225 std::vector<TProfile*> fvhStarTrigStarTsEvo;
227
229 TCanvas* fcSummary;
230 TCanvas* fcSummaryGdpb;
231 std::vector<TCanvas*> fvcSumGdpbGet4;
238
239 void ProcessEpochCycle(uint64_t ulCycleData);
241
243
245
249
251
253
256
257 ClassDef(CbmStar2019MonitorAlgo, 1)
258};
259
260#endif // CbmStar2019MonitorAlgo_H
UInt_t fuGet4Id
Bin size in s for the plots with date as X axis.
std::vector< ULong64_t > fvulCurrentEpochCycle
Current epoch index, per DPB.
void ProcessHit(gdpbv100::FullMessage mess)
std::vector< TH2 * > fvhRawCt_gDPB
Debug histo, only in DebugMonitorMode.
std::vector< std::vector< bool > > fvvbGdpbLastResyncPattern
Exclude from dictionnary.
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
UInt_t fuCurrSector
Index of the DPB from which the MS currently unpacked is coming.
void SetIgnoreCriticalErrors(Bool_t bFlagIn=kTRUE)
std::vector< TH2 * > fvhGdpbPatternMissmatchEvo
Double_t fdMsTime
End Time in ns of current TS Core from the index of the first MS first component.
std::vector< TH2 * > fvhRemapTot_gDPB
Debug histo, only in DebugMonitorMode.
void ProcessSlowCtrl(gdpbv100::Message mess)
std::vector< ULong64_t > fvulStarTsMid
Bool_t ProcessTs(const fles::Timeslice &ts)
std::vector< UInt_t > fvuStarTokenLast
TH2 * fhPatternResync
Debug histo, only in DebugMonitorMode.
UInt_t fuNrOfChannelsPerFee
Number of channels in each GET4.
std::vector< ULong64_t > fvulGdpbTsFullLast
void SetHistoryHistoSize(UInt_t inHistorySizeSec=1800)
Bool_t ProcessMs(const fles::Timeslice &ts, size_t uMsCompIdx, size_t uMsIdx)
Double_t fdTsStopTimeCore
Time in ns of current TS from the index of the first MS first component.
std::vector< TH2 * > fvhGdpbPatternResyncEvo
Debug histo, only in DebugMonitorMode.
CbmStar2019MonitorAlgo(const CbmStar2019MonitorAlgo &)
UInt_t fuNrOfGet4PerFee
Number of FEBs per GDPB.
Bool_t fbIgnoreCriticalErrors
Switch ON the filling of a additional set of histograms.
std::vector< gdpbv100::Message > fvmEpSupprBuffer
Epoch + Epoch Cycle.
std::vector< ULong64_t > fvulGdpbTsLsb
std::vector< TH2 * > fvhGdpbResyncEvoPerTs
Debug histo, only in DebugMonitorMode.
std::vector< TH2 * > fvhGdpbGet4ChanScm
std::vector< ULong64_t > fvulStarTsMsb
std::vector< TH2 * > fvhGdpbEnableEvoPerTs
Debug histo, only in DebugMonitorMode.
std::vector< std::vector< bool > > fvvbGdpbLastMissmatchPattern
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
std::vector< ULong64_t > fvulStarTsFullLast
CbmStar2019TofPar * fUnpackPar
Settings from parameter file.
UInt_t fuMinTotPulser
Number of channels per GDPB.
static const UInt_t kuBytesPerMessage
UInt_t fuNrOfChannelsPerGet4
Number of GET4s per FEE.
void ProcessSysMess(gdpbv100::FullMessage mess)
Bool_t fbDebugMonitorMode
Control flags.
Bool_t ProcessTs(const fles::Timeslice &ts, size_t)
std::map< gdpbv100::MessageTypes, UInt_t > fmMsgCounter
UInt_t fuHistoryHistoSize
Histograms related variables.
void ProcessPattern(gdpbv100::Message mess)
std::vector< ULong64_t > fvulGdpbTsMsb
STAR TRIGGER detection.
std::vector< std::vector< bool > > fvvbGdpbLastEnablePattern
Exclude from dictionnary.
void ProcessError(gdpbv100::FullMessage mess)
std::vector< TProfile * > fvhStarTrigGdpbTsEvo
std::vector< ULong64_t > fvulCurrentEpochFull
Epoch cycle from the Ms Start message and Epoch counter flip.
std::vector< UInt_t > fuNbMissmatchPattern
Int_t fiBinSizeDatePlots
Start of run time since "epoch" in s, for the plots with date as X axis.
std::vector< TH1 * > fvhTriggerRate
UInt_t fuNrOfChannelsPerGdpb
Number of GET4s per GDPB.
UInt_t fuMsIndex
Start Time in ns of current MS from its index field in header.
void ProcessStarTrig(gdpbv100::Message mess)
std::vector< TH1 * > fvhTokenMsgType
std::vector< TH2 * > fvhGdpbPatternEnableEvo
Debug histo, only in DebugMonitorMode.
std::vector< TH2 * > fvhGdpbMissmatchEvoPerTs
Exclude from dictionnary.
std::vector< TH2 * > fvhGdpbGet4MessType
std::vector< TH2 * > fvhStarTokenEvo
std::vector< TH2 * > fvhCmdDaqVsTrig
std::chrono::steady_clock::time_point ftStartTimeUnix
void SetPulserTotLimits(UInt_t uMin, UInt_t uMax)
std::vector< TCanvas * > fvcSumGdpbGet4
Bool_t SaveLatencyHistograms(TString fsHistoFileName)
std::vector< TH2 * > fvhGdpbMissmatchEnaEvoPerTs
Debug histo, only in DebugMonitorMode.
static const Int_t kiMaxNbFlibLinks
Constants.
CbmStar2019MonitorAlgo operator=(const CbmStar2019MonitorAlgo &)
std::vector< TH2 * > fvhRemapChRate_gDPB
std::vector< TH1 * > fvhRemapChCount_gDPB
TH2 * fhPatternEnable
Debug histo, only in DebugMonitorMode.
std::vector< ULong64_t > fvulCurrentEpoch
Data format control: Current time references for each GDPB: merged epoch marker, epoch cycle,...
TH1 * fhMessType
Size in seconds of the evolution histograms.
Bool_t fbEpochSinceLastHit
Duplicate Hits detection.
std::vector< UInt_t > fvuStarDaqCmdLast
void ProcessEpoch(gdpbv100::Message mess)
UInt_t fuNrOfGet4
Number of channels in each FEE.
std::vector< TProfile * > fvhStarTrigStarTsEvo
UInt_t fuGet4Nr
running number (0 to fuNrOfGet4PerGdpb) of the Get4 chip of a unique GDPB for current message
Int_t fiRunStartDateTimeSec
Index of the sector from which the MS currently unpacked is coming.
UInt_t fuNrOfGet4PerGdpb
Total number of Get4 chips in the system.
std::vector< TH2 * > fvhGdpbResyncEnaEvoPerTs
Debug histo, only in DebugMonitorMode.
static const UInt_t kuNbChanDiamond
TH2 * fhPatternMissmatch
Debug histo, only in DebugMonitorMode.
std::vector< TH2 * > fvhGdpbStateEvoPerTs
Debug histo, only in DebugMonitorMode.
std::vector< TH2 * > fvhGdpbGet4ChanErrors
std::map< UInt_t, UInt_t > fGdpbIdIndexMap
Total number of GDPBs in the system.
std::vector< TH2 * > fvhRawFt_gDPB
void ProcessEpochCycle(uint64_t ulCycleData)
void SetSectorIndex(Int_t iSector=-1)
std::vector< Bool_t > fvbMaskedComponents
If ON not printout at all for critical errors.
void SetDebugMonitorMode(Bool_t bFlagIn=kTRUE)
std::vector< UInt_t > fvuStarTrigCmdLast
ULong64_t fulStartTs
Starting state book-keeping.
UInt_t fuNrOfFeePerGdpb
gDPB ID to index map
void AddMsComponentToList(size_t component, UShort_t usDetectorId)