CbmRoot
Loading...
Searching...
No Matches
CbmStar2019MonitorPulserAlgo.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// ----- CbmStar2019MonitorPulserAlgo -----
8// ----- Created 12.10.2019 by P.-A. Loizeau -----
9// ----- -----
10// -----------------------------------------------------------------------------
11
12#ifndef CbmStar2019MonitorPulserAlgo_H
13#define CbmStar2019MonitorPulserAlgo_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 SetEtofFeeIndexing(Bool_t bFlagIn = kTRUE) { fbEtofFeeIndexing = bFlagIn; }
63 inline void SetSectorIndex(Int_t iSector = -1) { fiSectorIndex = iSector; }
64 inline void SetUpdateFreqTs(UInt_t uFreq = 100) { fuUpdateFreqTs = uFreq; }
65 inline void SetPulserTotLimits(UInt_t uMin, UInt_t uMax)
66 {
67 fuPulserMinTot = uMin;
68 fuPulserMaxTot = uMax;
69 }
70 inline void SetPulserChannel(UInt_t uChan) { fuPulserChannel = uChan; }
71 inline void SetHistoryHistoSize(UInt_t inHistorySizeSec = 1800) { fuHistoryHistoSize = inHistorySizeSec; }
72
73private:
76 std::vector<Bool_t> fvbMaskedComponents;
79
83 UInt_t fuNrOfGdpbs;
84 std::map<UInt_t, UInt_t> fGdpbIdIndexMap;
89 UInt_t fuNrOfGet4;
92
97
99 static const Int_t kiMaxNbFlibLinks = 32;
100 static const UInt_t kuBytesPerMessage = 8;
101
106 Double_t fdTsStartTime;
108 Double_t fdMsTime;
109 UInt_t fuMsIndex;
112 UInt_t fuCurrDpbId;
114 UInt_t fuGet4Id;
115 UInt_t fuGet4Nr;
117 std::vector<ULong64_t> fvulCurrentEpoch;
118 std::vector<ULong64_t> fvulCurrentEpochCycle;
119 std::vector<ULong64_t> fvulCurrentEpochFull;
120
122 std::vector<gdpbv100::Message> fvmEpSupprBuffer;
123
125 std::vector<std::vector<Bool_t>> fvvbFeeHitFound;
126 std::vector<std::vector<Double_t>> fvvdFeeHits;
127
130 const Double_t kdMaxDtPulserPs = 300e3;
131 const UInt_t kuNbBinsDt = 2000;
132 Double_t dMinDt;
133 Double_t dMaxDt;
134 const Double_t kdFitZoomWidthPs = 500.0;
136 Double_t fdStartTime;
138
141 std::vector<std::vector<TH1*>> fvvhFeePairPulserTimeDiff;
147
149 TCanvas* fcSummary;
150
151 void ProcessEpochCycle(uint64_t ulCycleData);
153
155
157
160
162};
163
164#endif // CbmStar2019MonitorPulserAlgo_H
CbmStar2019MonitorPulserAlgo(const CbmStar2019MonitorPulserAlgo &)
std::vector< std::vector< TH1 * > > fvvhFeePairPulserTimeDiff
Size in seconds of the evolution histograms.
UInt_t fuNrOfFeePerGdpb
gDPB ID to index map
Bool_t ProcessTs(const fles::Timeslice &ts)
void SetHistoryHistoSize(UInt_t inHistorySizeSec=1800)
void ProcessEpoch(gdpbv100::Message mess)
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
UInt_t fuGet4Nr
running number (0 to fuNrOfGet4PerGdpb) of the Get4 chip of a unique GDPB for current message
const Double_t kdMaxDtPulserPs
[ Sector ][ FEE ]
CbmStar2019MonitorPulserAlgo operator=(const CbmStar2019MonitorPulserAlgo &)
void ProcessHit(gdpbv100::FullMessage mess)
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
std::vector< ULong64_t > fvulCurrentEpoch
Data format control: Current time references for each GDPB: merged epoch marker, epoch cycle,...
std::vector< ULong64_t > fvulCurrentEpochFull
Epoch cycle from the Ms Start message and Epoch counter flip.
std::vector< std::vector< Double_t > > fvvdFeeHits
[ Sector ][ FEE ]
Double_t fdStartTime
Starting time and time evolution book-keeping.
Bool_t ProcessTs(const fles::Timeslice &ts, size_t)
static const Int_t kiMaxNbFlibLinks
Constants.
std::vector< ULong64_t > fvulCurrentEpochCycle
Current epoch index, per DPB.
UInt_t fuNrOfGet4PerGdpb
Total number of Get4 chips in the system.
std::vector< gdpbv100::Message > fvmEpSupprBuffer
Epoch + Epoch Cycle.
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
UInt_t fuNrOfChannelsPerFee
Number of channels in each GET4.
void SetEtofFeeIndexing(Bool_t bFlagIn=kTRUE)
Double_t fdMsTime
End Time in ns of current TS Core from the index of the first MS first component.
std::vector< std::vector< Bool_t > > fvvbFeeHitFound
Storing the time of the last hit for each MS in each of the FEE.
UInt_t fuNrOfChannelsPerGet4
Number of GET4s per FEE.
Double_t fdTsStopTimeCore
Time in ns of current TS from the index of the first MS first component.
UInt_t fuGet4Id
Index of the DPB from which the MS currently unpacked is coming.
UInt_t fuNrOfGet4
Number of channels in each FEE.
UInt_t fuNrOfGet4PerFee
Number of FEBs per GDPB.
CbmStar2019TofPar * fUnpackPar
Settings from parameter file.
UInt_t fuNrOfChannelsPerGdpb
Number of GET4s per GDPB.
std::map< UInt_t, UInt_t > fGdpbIdIndexMap
Total number of GDPBs in the system.
Bool_t ProcessMs(const fles::Timeslice &ts, size_t uMsCompIdx, size_t uMsIdx)
void SetPulserTotLimits(UInt_t uMin, UInt_t uMax)
UInt_t fuMsIndex
Start Time in ns of current MS from its index field in header.
UInt_t fuPulserMinTot
Number of channels per GDPB.