CbmRoot
Loading...
Searching...
No Matches
CbmMcbm2018MonitorTof.h
Go to the documentation of this file.
1/* Copyright (C) 2018-2019 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// ----- CbmMcbm2018MonitorTof -----
8// ----- Created 10.07.2018 by P.-A. Loizeau -----
9// ----- -----
10// -----------------------------------------------------------------------------
11
12#ifndef CbmMcbm2018MonitorTof_H
13#define CbmMcbm2018MonitorTof_H
14
15#include "Timeslice.hpp"
16
17#include "gDpbMessv100.h"
18//#include "CbmTofStarData.h"
19//#include "CbmTofStarData2018.h"
20
21#include "CbmMcbmUnpack.h"
22
23#include "Rtypes.h"
24#include "TClonesArray.h"
25
26#include <chrono>
27#include <map>
28#include <vector>
29
31
32class TCanvas;
33class TH1;
34class TH2;
35class TProfile;
36class TProfile2D;
37
39public:
41 virtual ~CbmMcbm2018MonitorTof();
42
43 virtual Bool_t Init();
44
45 virtual Bool_t DoUnpack(const fles::Timeslice& ts, size_t component);
46
47 virtual void Reset();
48
49 virtual void Finish();
50
51 void SetParContainers();
52
53 Bool_t InitContainers();
54
55 Bool_t ReInitContainers();
56
57 void SetMsLimitLevel(size_t uAcceptBoundaryPct = 100) { fuMsAcceptsPercent = uAcceptBoundaryPct; }
59
60 virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId);
61 virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb);
62 void SetIgnoreMsOverlap(Bool_t bEnaFlag = kTRUE) { fbIgnoreOverlapMs = bEnaFlag; }
63 void SetMsOverlap(size_t uOverlapMsNb = 1) { fuOverlapMsNb = uOverlapMsNb; }
64 size_t GetMsOverlap() { return fuOverlapMsNb; }
65
66 inline void SetFitZoomWidthPs(Double_t inZoomWidth = 1000.0) { fdFitZoomWidthPs = inZoomWidth; }
67 inline void SetHistoryHistoSize(UInt_t inHistorySizeSec = 1800) { fuHistoryHistoSize = inHistorySizeSec; }
68 inline void SetHistoryHistoSizeLong(UInt_t inHistorySizeMin = 1800) { fuHistoryHistoSizeLong = inHistorySizeMin; }
69
70 inline void EnablePulserMode(Bool_t bEnaFlag = kTRUE) { fbPulserModeEnable = bEnaFlag; }
71 inline void EnableCoincidenceMaps(Bool_t bEnaFlag = kTRUE) { fbCoincMapsEnable = bEnaFlag; }
72
73 inline void EnableOldFwData(Bool_t bEnaFlag = kTRUE) { fbOldFwData = bEnaFlag; }
74
75 inline void SetDiamondDpbIdx(UInt_t uIdx = 2) { fuDiamondDpbIdx = uIdx; }
76
77 inline void SetHistoFilename(TString sNameIn) { fsHistoFilename = sNameIn; }
78
79 void SaveAllHistos(TString sFileName = "");
80 void ResetAllHistos();
84 void UpdateZoomedFit();
85
86 void UseDaqBuffer(Bool_t) {};
87
88private:
90 std::vector<size_t> fvMsComponentsList;
94
97 size_t fuTotalMsNb;
99 size_t fuCoreMs;
100 Double_t fdMsSizeInNs;
104
107 UInt_t fuNrOfGdpbs; // Total number of GDPBs in the system
108 UInt_t fuNrOfFeePerGdpb; // Number of FEBs per GDPB
109 UInt_t fuNrOfGet4PerFee; // Number of GET4s per FEE
110 UInt_t fuNrOfChannelsPerGet4; // Number of channels in each GET4
111
112 UInt_t fuNrOfChannelsPerFee; // Number of channels in each FEE
113 UInt_t fuNrOfGet4; // Total number of Get4 chips in the system
114 UInt_t fuNrOfGet4PerGdpb; // Number of GET4s per GDPB
115 UInt_t fuNrOfChannelsPerGdpb; // Number of channels per GDPB
116
119 std::vector<Int_t> fviNrOfRpc;
120 std::vector<Int_t> fviRpcType;
121 std::vector<Int_t> fviRpcSide;
122 std::vector<Int_t> fviModuleId;
123
124 const UInt_t kuNbFeePerGbtx = 5;
125 const UInt_t kuNbGbtxPerGdpb = 6;
126
137
139 uint64_t fulCurrentTsIndex; // Idx of the current TS
140 size_t fuCurrentMs; // Idx of the current MS in TS (0 to fuTotalMsNb)
141 size_t fuCurrentMsSysId; // SysId of the current MS in TS (0 to fuTotalMsNb)
142 Double_t fdMsIndex; // Time in ns of current MS from its index
143 UInt_t fuGdpbId; // Id (hex number) of the GDPB for current message
144 UInt_t fuGdpbNr; // running number (0 to fuNrOfGdpbs) of the GDPB for current message
145 UInt_t fuGet4Id; // running number (0 to fuNrOfGet4PerGdpb) of the Get4 chip of a unique GDPB for current message
146 UInt_t fuGet4Nr; // running number (0 to fuNrOfGet4) of the Get4 chip in the system for current message
148 std::vector<int> fviMsgCounter;
149
151 std::vector<ULong64_t> fvulGdpbTsMsb;
152 std::vector<ULong64_t> fvulGdpbTsLsb;
153 std::vector<ULong64_t> fvulStarTsMsb;
154 std::vector<ULong64_t> fvulStarTsMid;
155 std::vector<ULong64_t> fvulGdpbTsFullLast;
156 std::vector<ULong64_t> fvulStarTsFullLast;
157 std::vector<UInt_t> fvuStarTokenLast;
158 std::vector<UInt_t> fvuStarDaqCmdLast;
159 std::vector<UInt_t> fvuStarTrigCmdLast;
160
167 std::vector<ULong64_t> fvulCurrentEpoch;
168 std::vector<Bool_t> fvbFirstEpochSeen;
169 std::vector<ULong64_t> fvulCurrentEpochCycle;
170 std::vector<ULong64_t> fvulCurrentEpochFull;
171
175 std::map<UInt_t, UInt_t> fGdpbIdIndexMap;
176
178 std::vector<std::vector<gdpbv100::Message>> fvmEpSupprBuffer;
179
181 std::vector<UInt_t> fvuFeeNbHitsLastMs;
182 std::vector<Double_t> fdTsLastPulserHit;
183
185 std::vector<std::vector<UInt_t>> fvuCoincNbHitsLastMs;
186 std::vector<std::vector<Double_t>> fvdCoincTsLastHit;
187
189 // Default value for nb bins in Pulser time difference histos
190 const UInt_t kuNbBinsDt = 2000;
191 Double_t dMinDt;
192 Double_t dMaxDt;
193 // Default number of FEE per channels histograms
196 // Evolution plots control
197 Double_t fdStartTime;
202 // Pulser plots
205 // Flesnet
206 TCanvas* fcMsSizeAll;
207 std::vector<TH1*> fvhMsSzPerLink;
208 std::vector<TProfile*> fvhMsSzTimePerLink;
209
210 // Messages types and flags
227 std::vector<TH2*> fvhGdpbGet4MessType;
228 std::vector<TH2*> fvhGdpbGet4ChanScm;
229 std::vector<TH2*> fvhGdpbGet4ChanErrors;
240 std::vector<TH2*> fvhGdpbPatternMissmatchEvo;
241 std::vector<TH2*> fvhGdpbPatternEnableEvo;
242 std::vector<TH2*> fvhGdpbPatternResyncEvo;
243
244 std::vector<std::vector<bool>> fvvbGdpbLastMissmatchPattern;
245 std::vector<std::vector<bool>> fvvbGdpbLastEnablePattern;
246 std::vector<std::vector<bool>> fvvbGdpbLastResyncPattern;
247 std::vector<TH2*> fvhGdpbMissmatchEvoPerTs;
249 std::vector<TH2*> fvhGdpbEnableEvoPerTs;
250 std::vector<TH2*> fvhGdpbResyncEvoPerTs;
251 std::vector<TH2*> fvhGdpbResyncEnaEvoPerTs;
252 std::vector<TH2*> fvhGdpbStateEvoPerTs;
253
254 // Hit messages
256 std::vector<TH2*> fvhRawFt_gDPB;
257 std::vector<TH2*> fvhRawTot_gDPB;
258 std::vector<TH1*> fvhChCount_gDPB;
259 std::vector<TH2*> fvhChannelRate_gDPB;
260 std::vector<TH2*> fvhRemapTot_gDPB;
261 std::vector<TH1*> fvhRemapChCount_gDPB;
262 std::vector<TH2*> fvhRemapChRate_gDPB;
263 std::vector<TH1*> fvhFeeRate_gDPB;
264 std::vector<TH1*> fvhFeeErrorRate_gDPB;
265 std::vector<TProfile*> fvhFeeErrorRatio_gDPB;
266 std::vector<TH1*> fvhFeeRateLong_gDPB;
267 std::vector<TH1*> fvhFeeErrorRateLong_gDPB;
268 std::vector<TProfile*> fvhFeeErrorRatioLong_gDPB;
269 /*
270 const UInt_t kuNbFeeSide = 5;
271 std::vector< TH2 * > fvhRemapTotSideA_mod;
272 std::vector< TH2 * > fvhRemapTotSideB_mod;
274 std::vector< TH1 * > fvhModRate;
275 std::vector< TH1 * > fvhModErrorRate;
276 std::vector< TProfile * > fvhModErrorRatio;
277*/
278 std::vector<std::vector<UInt_t>> fvvuChanNbHitsPerMs;
279 std::vector<TH2*> fhHitsPerMsFirstChan_gDPB;
280 std::vector<TProfile2D*> fvhChannelRatePerMs_gDPB;
282 std::vector<TH1*> fvhTokenMsgType;
283 std::vector<TH1*> fvhTriggerRate;
284 std::vector<TH2*> fvhCmdDaqVsTrig;
285 std::vector<TH2*> fvhStarTokenEvo;
286 std::vector<TProfile*> fvhStarTrigGdpbTsEvo;
287 std::vector<TProfile*> fvhStarTrigStarTsEvo;
288
290 const Double_t kdMaxDtPulserPs = 300e3;
291 std::vector<std::vector<TH1*>> fvhTimeDiffPulser;
296 std::vector<TProfile*> fvhPulserTimeDiffEvoGbtxGbtx;
297 std::vector<std::vector<TProfile*>> fvvhPulserTimeDiffEvoGdpbGdpb;
298
300 std::vector<TH2*> fvhCoincMapAllChanGdpb;
301 std::vector<TProfile2D*> fvhCoincMeanAllChanGdpb;
302
304 TCanvas* fcSummary = nullptr;
305 TCanvas* fcSummaryGdpb = nullptr;
306 TCanvas* fcGdpbChannelCount = nullptr;
307 TCanvas* fcGdpbRemapChCount = nullptr;
308 TCanvas* fcGdpbChannelRate = nullptr;
309 TCanvas* fcGdpbRemapChRate = nullptr;
310
311
312 void CreateHistograms();
313
314 void ProcessEpochCycle(uint64_t ulCycleData);
322
323 inline Int_t GetArrayIndex(Int_t gdpbId, Int_t get4Id) { return gdpbId * fuNrOfGet4PerGdpb + get4Id; }
324
326 std::vector<UInt_t> fvuPadiToGet4;
327 std::vector<UInt_t> fvuGet4ToPadi;
328
330 static const UInt_t kuNbGet4PerGbtx = 5 * 8;
331 std::vector<UInt_t> fvuElinkToGet4;
332 std::vector<UInt_t> fvuGet4ToElink;
333 inline UInt_t ConvertElinkToGet4(UInt_t uElinkIdx)
334 {
335 return fvuElinkToGet4[uElinkIdx % kuNbGet4PerGbtx] + kuNbGet4PerGbtx * (uElinkIdx / kuNbGet4PerGbtx);
336 }
337 inline UInt_t ConvertGet4ToElink(UInt_t uGet4Idx)
338 {
339 return fvuGet4ToElink[uGet4Idx % kuNbGet4PerGbtx] + kuNbGet4PerGbtx * (uGet4Idx / kuNbGet4PerGbtx);
340 }
341
343 std::chrono::time_point<std::chrono::system_clock> fTimeLastHistoSaving;
344
347
348 ClassDef(CbmMcbm2018MonitorTof, 1)
349};
350
351#endif
void FillStarTrigInfo(gdpbv100::Message)
std::vector< ULong64_t > fvulStarTsMsb
std::vector< TH2 * > fvhRemapTot_gDPB
std::vector< TProfile2D * > fvhChannelRatePerMs_gDPB
std::vector< TH1 * > fvhRemapChCount_gDPB
std::vector< TH2 * > fvhCmdDaqVsTrig
std::vector< TH2 * > fvhGdpbResyncEnaEvoPerTs
std::vector< UInt_t > fvuPadiToGet4
TH2 * fhGet4MessType
Per GET4 in system.
void SetIgnoreMsOverlap(Bool_t bEnaFlag=kTRUE)
void SaveAllHistos(TString sFileName="")
std::vector< TProfile * > fvhPulserTimeDiffEvoGbtxGbtx
std::vector< TProfile2D * > fvhCoincMeanAllChanGdpb
virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId)
void SetHistoFilename(TString sNameIn)
std::vector< TH1 * > fvhMsSzPerLink
std::vector< TH2 * > fvhGdpbResyncEvoPerTs
const UInt_t kuNbBinsDt
[ fuNrOfGdpbs ][ fuNrOfChannelsPerGdpb ]
std::vector< int > fviMsgCounter
std::vector< TH2 * > fvhGdpbGet4MessType
Per GET4 in gDPB.
void SetMsLimitLevel(size_t uAcceptBoundaryPct=100)
std::vector< Int_t > fviNrOfRpc
std::vector< Bool_t > fvbFirstEpochSeen
std::vector< UInt_t > fvuStarDaqCmdLast
CbmMcbm2018TofPar * fUnpackPar
std::vector< Double_t > fdTsLastPulserHit
[ fuFeeNr ]
void EnableCoincidenceMaps(Bool_t bEnaFlag=kTRUE)
void SetMsOverlap(size_t uOverlapMsNb=1)
size_t fuMsAcceptsPercent
/‍** Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice **‍/
std::vector< size_t > fvMsComponentsList
FLES containers.
std::vector< TH2 * > fvhGdpbPatternResyncEvo
Int_t GetArrayIndex(Int_t gdpbId, Int_t get4Id)
std::vector< TH2 * > fvhStarTokenEvo
std::vector< ULong64_t > fvulStarTsFullLast
std::vector< TH2 * > fhHitsPerMsFirstChan_gDPB
UInt_t ConvertElinkToGet4(UInt_t uElinkIdx)
std::vector< std::vector< gdpbv100::Message > > fvmEpSupprBuffer
Buffer for suppressed epoch processing.
std::vector< ULong64_t > fvulCurrentEpochFull
Epoch cycle from the Ms Start message and Epoch counter flip.
std::vector< ULong64_t > fvulGdpbTsMsb
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
std::vector< UInt_t > fvuGet4ToElink
std::chrono::time_point< std::chrono::system_clock > fTimeLastHistoSaving
std::vector< std::vector< bool > > fvvbGdpbLastMissmatchPattern
void PrintGenInfo(gdpbv100::Message)
std::vector< TProfile * > fvhStarTrigStarTsEvo
std::vector< UInt_t > fvuElinkToGet4
5 FEE with 8 GET4 each
std::vector< UInt_t > fvuStarTrigCmdLast
void SetHistoryHistoSizeLong(UInt_t inHistorySizeMin=1800)
std::vector< TH2 * > fvhRemapChRate_gDPB
CbmMcbm2018MonitorTof operator=(const CbmMcbm2018MonitorTof &)
std::vector< TH1 * > fvhFeeRateLong_gDPB
void PrintSlcInfo(gdpbv100::Message)
void PrintSysInfo(gdpbv100::Message)
ULong64_t fulCurrentEpochTime
Epoch + Epoch Cycle.
std::vector< TH2 * > fvhChannelRate_gDPB
virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
std::vector< ULong64_t > fvulGdpbTsLsb
void FillPattInfo(gdpbv100::Message)
std::vector< std::vector< bool > > fvvbGdpbLastEnablePattern
Exclude from dictionnary.
UInt_t ConvertGet4ToElink(UInt_t uGet4Idx)
std::vector< std::vector< bool > > fvvbGdpbLastResyncPattern
Exclude from dictionnary.
std::vector< TH2 * > fvhRawFt_gDPB
TODO: Channel rate plots!
std::vector< TH1 * > fvhFeeRate_gDPB
void SetHistoryHistoSize(UInt_t inHistorySizeSec=1800)
std::vector< Int_t > fviRpcSide
void ProcessEpochCycle(uint64_t ulCycleData)
std::vector< Int_t > fviRpcType
std::vector< TH2 * > fvhGdpbEnableEvoPerTs
std::vector< TH2 * > fvhGdpbMissmatchEnaEvoPerTs
std::vector< Int_t > fviModuleId
std::vector< ULong64_t > fvulCurrentEpoch
void SetFitZoomWidthPs(Double_t inZoomWidth=1000.0)
std::vector< TH1 * > fvhTriggerRate
CbmMcbm2018MonitorTof(const CbmMcbm2018MonitorTof &)
std::vector< std::vector< TH1 * > > fvhTimeDiffPulser
std::vector< TH2 * > fvhGdpbStateEvoPerTs
std::vector< std::vector< UInt_t > > fvuCoincNbHitsLastMs
[ fuFeeNr ]
std::vector< TH1 * > fvhFeeErrorRateLong_gDPB
void FillHitInfo(gdpbv100::Message)
std::vector< std::vector< UInt_t > > fvvuChanNbHitsPerMs
std::vector< UInt_t > fvuStarTokenLast
std::vector< TH1 * > fvhTokenMsgType
std::vector< TH2 * > fvhRawTot_gDPB
std::vector< TProfile * > fvhFeeErrorRatio_gDPB
void EnablePulserMode(Bool_t bEnaFlag=kTRUE)
std::vector< TH2 * > fvhGdpbPatternEnableEvo
std::vector< TH2 * > fvhGdpbMissmatchEvoPerTs
Exclude from dictionnary.
void EnableOldFwData(Bool_t bEnaFlag=kTRUE)
std::vector< TH1 * > fvhChCount_gDPB
std::vector< TProfile * > fvhFeeErrorRatioLong_gDPB
static const UInt_t kuNbGet4PerGbtx
void SetDiamondDpbIdx(UInt_t uIdx=2)
std::vector< UInt_t > fvuGet4ToPadi
std::vector< TH2 * > fvhGdpbPatternMissmatchEvo
Per MS in gDPB.
TH2 * fhScmScalerCounters
Slow control messages.
std::vector< std::vector< Double_t > > fvdCoincTsLastHit
[ fuNrOfGdpbs ][ fuNrOfChannelsPerGdpb ]
std::vector< TProfile * > fvhMsSzTimePerLink
std::vector< TH1 * > fvhFeeErrorRate_gDPB
std::map< UInt_t, UInt_t > fGdpbIdIndexMap
Map of ID to index for the gDPBs.
std::vector< TH2 * > fvhGdpbGet4ChanErrors
TH2 * fhPatternMissmatch
Pattern messages per gDPB.
std::vector< UInt_t > fvuFeeNbHitsLastMs
Buffer for pulser channels.
std::vector< ULong64_t > fvulStarTsMid
std::vector< TH2 * > fvhCoincMapAllChanGdpb
std::vector< TProfile * > fvhStarTrigGdpbTsEvo
std::vector< TH2 * > fvhGdpbGet4ChanScm
std::vector< std::vector< TProfile * > > fvvhPulserTimeDiffEvoGdpbGdpb
std::vector< ULong64_t > fvulGdpbTsFullLast
std::vector< ULong64_t > fvulCurrentEpochCycle
void FillEpochInfo(gdpbv100::Message)