CbmRoot
Loading...
Searching...
No Matches
CbmMcbm2018MonitorAlgoTof.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// ----- CbmMcbm2018MonitorAlgoTof -----
8// ----- Created 27.11.2019 by P.-A. Loizeau -----
9// ----- -----
10// -----------------------------------------------------------------------------
11
12#ifndef CbmMcbm2018MonitorAlgoTof_H
13#define CbmMcbm2018MonitorAlgoTof_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;
35class TProfile2D;
36
37class CbmMcbm2018MonitorAlgoTof : public CbmStar2019Algo<CbmTofDigi> {
38public:
41
42 virtual Bool_t Init();
43 virtual void Reset();
44 virtual void Finish();
45
46 Bool_t InitContainers();
47 Bool_t ReInitContainers();
48 TList* GetParList();
49
50 Bool_t InitParameters();
51
52 Bool_t ProcessTs(const fles::Timeslice& ts);
53 Bool_t ProcessTs(const fles::Timeslice& ts, size_t /*component*/) { return ProcessTs(ts); }
54 Bool_t ProcessMs(const fles::Timeslice& ts, size_t uMsCompIdx, size_t uMsIdx);
55
56 void AddMsComponentToList(size_t component, UShort_t usDetectorId);
57
58 Bool_t CreateHistograms();
59 Bool_t FillHistograms();
60 Bool_t ResetHistograms(Bool_t bResetTime = kTRUE);
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 SetGdpbIndex(Int_t iGdpb = -1) { fiGdpbIndex = iGdpb; }
73
74 inline void UseAbsoluteTime(Bool_t bFlagIn = kTRUE) { fbUseAbsoluteTime = bFlagIn; }
75
76private:
80 std::vector<Bool_t> fvbMaskedComponents;
82 Bool_t fbUseAbsoluteTime = kFALSE;
83
87 UInt_t fuNrOfGdpbs;
88 std::map<UInt_t, UInt_t> fGdpbIdIndexMap;
93 UInt_t fuNrOfGet4;
96
100
102 static const Int_t kiMaxNbFlibLinks = 32;
103 static const UInt_t kuBytesPerMessage = 8;
104 static const UInt_t kuNbChanDiamond = 8;
105
111 Double_t fdTsStartTime;
113 Double_t fdMsTime;
114 UInt_t fuMsIndex;
116 std::map<gdpbv100::MessageTypes, UInt_t> fmMsgCounter;
118 UInt_t fuCurrDpbId;
122 UInt_t fuGet4Id;
123 UInt_t fuGet4Nr;
125 std::vector<ULong64_t> fvulCurrentEpoch;
126 std::vector<ULong64_t> fvulCurrentEpochCycle;
127 std::vector<ULong64_t> fvulCurrentEpochFull;
128
130 std::vector<gdpbv100::Message> fvmEpSupprBuffer;
131
133 Double_t fdStartTime;
135 std::chrono::steady_clock::time_point
139 std::vector<ULong64_t> fvulGdpbTsMsb;
140 std::vector<ULong64_t> fvulGdpbTsLsb;
141 std::vector<ULong64_t> fvulStarTsMsb;
142 std::vector<ULong64_t> fvulStarTsMid;
143 std::vector<ULong64_t> fvulGdpbTsFullLast;
144 std::vector<ULong64_t> fvulStarTsFullLast;
145 std::vector<UInt_t> fvuStarTokenLast;
146 std::vector<UInt_t> fvuStarDaqCmdLast;
147 std::vector<UInt_t> fvuStarTrigCmdLast;
148
153
156
179 std::vector<TH2*> fvhGdpbGet4MessType;
180 std::vector<TH2*> fvhGdpbGet4ChanScm;
181 std::vector<TH2*> fvhGdpbGet4ChanErrors;
187 TProfile* fhErrorFractEvo;
196 std::vector<TH2*> fvhRawFt_gDPB;
197 std::vector<TH2*> fvhRawCt_gDPB;
198 std::vector<TH2*> fvhRemapTot_gDPB;
199 std::vector<TH1*> fvhRemapChCount_gDPB;
200 std::vector<TH2*> fvhRemapChRate_gDPB;
201 std::vector<TProfile2D*> fvhRemapChErrFract_gDPB;
204 std::vector<UInt_t> fuNbMissmatchPattern;
210 std::vector<TH2*> fvhGdpbPatternMissmatchEvo;
211 std::vector<TH2*> fvhGdpbPatternEnableEvo;
212 std::vector<TH2*> fvhGdpbPatternResyncEvo;
214 std::vector<std::vector<bool>> fvvbGdpbLastMissmatchPattern;
215 std::vector<std::vector<bool>> fvvbGdpbLastEnablePattern;
216 std::vector<std::vector<bool>> fvvbGdpbLastResyncPattern;
217 std::vector<TH2*> fvhGdpbMissmatchEvoPerTs;
218 std::vector<TH2*> fvhGdpbMissmatchEnaEvoPerTs;
219 std::vector<TH2*> fvhGdpbEnableEvoPerTs;
220 std::vector<TH2*> fvhGdpbResyncEvoPerTs;
221 std::vector<TH2*> fvhGdpbResyncEnaEvoPerTs;
222 std::vector<TH2*> fvhGdpbStateEvoPerTs;
224 std::vector<TH1*> fvhTokenMsgType;
225 std::vector<TH1*> fvhTriggerRate;
226 std::vector<TH2*> fvhCmdDaqVsTrig;
227 std::vector<TH2*> fvhStarTokenEvo;
228 std::vector<TProfile*> fvhStarTrigGdpbTsEvo;
229 std::vector<TProfile*> fvhStarTrigStarTsEvo;
231
233 TCanvas* fcSummary;
234 TCanvas* fcSummaryGdpb;
235 std::vector<TCanvas*> fvcSumGdpbGet4;
242
243 void ProcessEpochCycle(uint64_t ulCycleData);
245
247
249
253
255
257
260
261 ClassDef(CbmMcbm2018MonitorAlgoTof, 1)
262};
263
264#endif // CbmMcbm2018MonitorAlgoTof_H
std::vector< Bool_t > fvbMaskedComponents
If ON not printout at all for critical errors.
std::vector< TH2 * > fvhGdpbEnableEvoPerTs
Debug histo, only in DebugMonitorMode.
UInt_t fuGet4Id
Bin size in s for the plots with date as X axis.
UInt_t fuNrOfChannelsPerFee
Number of channels in each GET4.
CbmMcbm2018TofPar * fUnpackPar
Switch ON the usage of abolute time scale for the evo histo (no start time)
UInt_t fuNrOfChannelsPerGdpb
Number of GET4s per GDPB.
static const Int_t kiMaxNbFlibLinks
Constants.
std::vector< gdpbv100::Message > fvmEpSupprBuffer
Epoch + Epoch Cycle.
void ProcessEpoch(gdpbv100::Message mess)
void SetHistoryHistoSize(UInt_t inHistorySizeSec=1800)
std::vector< UInt_t > fvuStarDaqCmdLast
std::vector< TH2 * > fvhGdpbPatternEnableEvo
Debug histo, only in DebugMonitorMode.
std::vector< TH2 * > fvhGdpbMissmatchEvoPerTs
Exclude from dictionnary.
std::vector< ULong64_t > fvulStarTsMsb
std::vector< TH2 * > fvhGdpbMissmatchEnaEvoPerTs
Debug histo, only in DebugMonitorMode.
std::vector< TH1 * > fvhRemapChCount_gDPB
std::vector< ULong64_t > fvulGdpbTsFullLast
Int_t fiRunStartDateTimeSec
Index of the DPB from which the MS currently unpacked is coming.
void SetPulserTotLimits(UInt_t uMin, UInt_t uMax)
void UseAbsoluteTime(Bool_t bFlagIn=kTRUE)
std::vector< TH2 * > fvhGdpbGet4ChanErrors
std::map< gdpbv100::MessageTypes, UInt_t > fmMsgCounter
std::vector< std::vector< bool > > fvvbGdpbLastMissmatchPattern
UInt_t fuNrOfGet4PerGdpb
Total number of Get4 chips in the system.
std::vector< TProfile2D * > fvhRemapChErrFract_gDPB
std::vector< TH2 * > fvhGdpbStateEvoPerTs
Debug histo, only in DebugMonitorMode.
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
std::vector< TCanvas * > fvcSumGdpbGet4
UInt_t fuHistoryHistoSize
Histograms related variables.
std::vector< ULong64_t > fvulCurrentEpochFull
Epoch cycle from the Ms Start message and Epoch counter flip.
TH2 * fhPatternEnable
Debug histo, only in DebugMonitorMode.
UInt_t fuMinTotPulser
Number of channels per GDPB.
std::vector< TH2 * > fvhGdpbPatternResyncEvo
Debug histo, only in DebugMonitorMode.
TH2 * fhPatternResync
Debug histo, only in DebugMonitorMode.
Int_t fiBinSizeDatePlots
Start of run time since "epoch" in s, for the plots with date as X axis.
std::map< UInt_t, UInt_t > fGdpbIdIndexMap
Total number of GDPBs in the system.
std::vector< ULong64_t > fvulStarTsFullLast
Bool_t ResetHistograms(Bool_t bResetTime=kTRUE)
Bool_t fbEpochSinceLastHit
Duplicate Hits detection.
std::vector< TH2 * > fvhGdpbResyncEnaEvoPerTs
Debug histo, only in DebugMonitorMode.
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
std::chrono::steady_clock::time_point ftStartTimeUnix
Double_t fdTsStartTime
SysId of the current MS in TS (0 to fuTotalMsNb)
std::vector< ULong64_t > fvulCurrentEpochCycle
Current epoch index, per DPB.
std::vector< ULong64_t > fvulGdpbTsMsb
STAR TRIGGER detection.
CbmMcbm2018MonitorAlgoTof(const CbmMcbm2018MonitorAlgoTof &)
void ProcessHit(gdpbv100::FullMessage mess)
std::vector< TH2 * > fvhRawCt_gDPB
Debug histo, only in DebugMonitorMode.
UInt_t fuGet4Nr
running number (0 to fuNrOfGet4PerGdpb) of the Get4 chip of a unique GDPB for current message
void ProcessEpochCycle(uint64_t ulCycleData)
void ProcessError(gdpbv100::FullMessage mess)
UInt_t fuNrOfGet4
Number of channels in each FEE.
UInt_t fuMsIndex
Start Time in ns of current MS from its index field in header.
std::vector< ULong64_t > fvulCurrentEpoch
Data format control: Current time references for each GDPB: merged epoch marker, epoch cycle,...
void SetIgnoreCriticalErrors(Bool_t bFlagIn=kTRUE)
std::vector< ULong64_t > fvulStarTsMid
std::vector< TH2 * > fvhRemapTot_gDPB
Debug histo, only in DebugMonitorMode.
std::vector< UInt_t > fuNbMissmatchPattern
Pattern messages per gDPB.
TH2 * fhPatternMissmatch
Debug histo, only in DebugMonitorMode.
void ProcessSysMess(gdpbv100::FullMessage mess)
Bool_t fbIgnoreCriticalErrors
Switch ON the filling of a additional set of histograms.
Bool_t ProcessTs(const fles::Timeslice &ts)
TH1 * fhMessType
Size in seconds of the evolution histograms.
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
std::vector< TH2 * > fvhGdpbResyncEvoPerTs
Debug histo, only in DebugMonitorMode.
void SetDebugMonitorMode(Bool_t bFlagIn=kTRUE)
Double_t fdStartTime
Starting state book-keeping.
std::vector< std::vector< bool > > fvvbGdpbLastEnablePattern
Exclude from dictionnary.
void ProcessPattern(gdpbv100::Message mess)
void ProcessSlowCtrl(gdpbv100::Message mess)
UInt_t fuNrOfFeePerGdpb
gDPB ID to index map
std::vector< ULong64_t > fvulGdpbTsLsb
UInt_t fuNrOfGet4PerFee
Number of FEBs per GDPB.
CbmMcbm2018MonitorAlgoTof operator=(const CbmMcbm2018MonitorAlgoTof &)
std::vector< UInt_t > fvuStarTrigCmdLast
Bool_t fbDebugMonitorMode
Control flags.
Double_t fdTsStopTimeCore
Time in ns of current TS from the index of the first MS first component.
Bool_t ProcessTs(const fles::Timeslice &ts, size_t)
Double_t fdMsTime
End Time in ns of current TS Core from the index of the first MS first component.
std::vector< TProfile * > fvhStarTrigStarTsEvo
UInt_t fuNrOfChannelsPerGet4
Number of GET4s per FEE.
std::vector< TProfile * > fvhStarTrigGdpbTsEvo
std::vector< std::vector< bool > > fvvbGdpbLastResyncPattern
Exclude from dictionnary.
void ProcessStarTrig(gdpbv100::Message mess)
std::vector< TH2 * > fvhGdpbPatternMissmatchEvo
Bool_t ProcessMs(const fles::Timeslice &ts, size_t uMsCompIdx, size_t uMsIdx)