CbmRoot
Loading...
Searching...
No Matches
CbmMcbm2018MonitorAlgoTofPulser.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// ----- CbmMcbm2018MonitorAlgoTofPulser -----
8// ----- Created 12.10.2019 by P.-A. Loizeau -----
9// ----- -----
10// -----------------------------------------------------------------------------
11
12#ifndef CbmMcbm2018MonitorAlgoTofPulser_H
13#define CbmMcbm2018MonitorAlgoTofPulser_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
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 UpdateStats();
60 Bool_t ResetHistograms();
61
62 inline void SetGdpbIndex(Int_t iGdpb = -1) { fiGdpbIndex = iGdpb; }
63 inline void SetUpdateFreqTs(UInt_t uFreq = 100) { fuUpdateFreqTs = uFreq; }
64 inline void SetPulserTotLimits(UInt_t uMin, UInt_t uMax)
65 {
66 fuPulserMinTot = uMin;
67 fuPulserMaxTot = uMax;
68 }
69 inline void SetPulserChannel(UInt_t uChan) { fuPulserChannel = uChan; }
70 inline void SetHistoryHistoSize(UInt_t inHistorySizeSec = 1800) { fuHistoryHistoSize = inHistorySizeSec; }
71
72private:
74 std::vector<Bool_t> fvbMaskedComponents;
77
81 UInt_t fuNrOfGdpbs;
82 std::map<UInt_t, UInt_t> fGdpbIdIndexMap;
87 UInt_t fuNrOfGet4;
90
95
97 static const Int_t kiMaxNbFlibLinks = 32;
98 static const UInt_t kuBytesPerMessage = 8;
99
105 Double_t fdTsStartTime;
107 Double_t fdMsTime;
108 UInt_t fuMsIndex;
111 UInt_t fuCurrDpbId;
113 UInt_t fuGet4Id;
114 UInt_t fuGet4Nr;
116 std::vector<ULong64_t> fvulCurrentEpoch;
117 std::vector<ULong64_t> fvulCurrentEpochCycle;
118 std::vector<ULong64_t> fvulCurrentEpochFull;
119
121 std::vector<gdpbv100::Message> fvmEpSupprBuffer;
122
124 std::vector<std::vector<Bool_t>> fvvbFeeHitFound;
125 std::vector<std::vector<Double_t>> fvvdFeeHits;
126
129 const Double_t kdMaxDtPulserPs = 300e3;
130 const UInt_t kuNbBinsDt = 2000;
131 Double_t dMinDt;
132 Double_t dMaxDt;
133 const Double_t kdFitZoomWidthPs = 500.0;
135 Double_t fdStartTime;
137
140 std::vector<std::vector<TH1*>> fvvhFeePairPulserTimeDiff;
146
148 TCanvas* fcSummary;
149
150 void ProcessEpochCycle(uint64_t ulCycleData);
152
154
156
159
161};
162
163#endif // CbmMcbm2018MonitorAlgoTofPulser_H
std::vector< std::vector< Double_t > > fvvdFeeHits
[ gDPB ][ FEE ]
UInt_t fuGet4Nr
running number (0 to fuNrOfGet4PerGdpb) of the Get4 chip of a unique GDPB for current message
std::vector< Bool_t > fvbMaskedComponents
Control flags.
UInt_t fuGet4Id
Index of the DPB from which the MS currently unpacked is coming.
UInt_t fuNrOfChannelsPerFee
Number of channels in each GET4.
std::vector< std::vector< TH1 * > > fvvhFeePairPulserTimeDiff
Size in seconds of the evolution histograms.
CbmMcbm2018TofPar * fUnpackPar
Settings from parameter file.
std::map< UInt_t, UInt_t > fGdpbIdIndexMap
Total number of GDPBs in the system.
std::vector< gdpbv100::Message > fvmEpSupprBuffer
Epoch + Epoch Cycle.
UInt_t fuNrOfChannelsPerGet4
Number of GET4s per FEE.
std::vector< ULong64_t > fvulCurrentEpochFull
Epoch cycle from the Ms Start message and Epoch counter flip.
CbmMcbm2018MonitorAlgoTofPulser operator=(const CbmMcbm2018MonitorAlgoTofPulser &)
UInt_t fuNrOfGet4PerFee
Number of FEBs per GDPB.
Bool_t ProcessMs(const fles::Timeslice &ts, size_t uMsCompIdx, size_t uMsIdx)
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
UInt_t fuPulserMinTot
Number of channels per GDPB.
std::vector< ULong64_t > fvulCurrentEpoch
Data format control: Current time references for each GDPB: merged epoch marker, epoch cycle,...
Bool_t ProcessTs(const fles::Timeslice &ts)
void SetHistoryHistoSize(UInt_t inHistorySizeSec=1800)
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
Bool_t ProcessTs(const fles::Timeslice &ts, size_t)
Double_t fdTsStopTimeCore
Time in ns of current TS from the index of the first MS first component.
std::vector< ULong64_t > fvulCurrentEpochCycle
Current epoch index, per DPB.
Double_t fdStartTime
Starting time and time evolution book-keeping.
UInt_t fuNrOfGet4PerGdpb
Total number of Get4 chips in the system.
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Double_t fdTsStartTime
SysId of the current MS in TS (0 to fuTotalMsNb)
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.
CbmMcbm2018MonitorAlgoTofPulser(const CbmMcbm2018MonitorAlgoTofPulser &)
Double_t fdMsTime
End Time in ns of current TS Core from the index of the first MS first component.
void SetPulserTotLimits(UInt_t uMin, UInt_t uMax)
UInt_t fuNrOfChannelsPerGdpb
Number of GET4s per GDPB.
std::vector< std::vector< Bool_t > > fvvbFeeHitFound
Storing the time of the last hit for each MS in each of the FEE.