CbmRoot
CbmStar2019MonitorPulserAlgo.h
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 // ----- -----
3 // ----- CbmStar2019MonitorPulserAlgo -----
4 // ----- Created 12.10.2019 by P.-A. Loizeau -----
5 // ----- -----
6 // -----------------------------------------------------------------------------
7 
8 #ifndef CbmStar2019MonitorPulserAlgo_H
9 #define CbmStar2019MonitorPulserAlgo_H
10 
11 #include "CbmStar2019Algo.h"
12 
13 // Data
14 #include "CbmTofDigi.h"
15 #include "gDpbMessv100.h"
16 
17 // CbmRoot
18 
19 // C++11
20 #include <chrono>
21 
22 // C/C++
23 #include <map>
24 #include <vector>
25 
26 class CbmStar2019TofPar;
27 class TH1;
28 class TH2;
29 class TProfile;
30 
31 class CbmStar2019MonitorPulserAlgo : public CbmStar2019Algo<CbmTofDigi> {
32 public:
35 
36  virtual Bool_t Init();
37  virtual void Reset();
38  virtual void Finish();
39 
40  Bool_t InitContainers();
41  Bool_t ReInitContainers();
42  TList* GetParList();
43 
44  Bool_t InitParameters();
45 
46  Bool_t ProcessTs(const fles::Timeslice& ts);
47  Bool_t ProcessTs(const fles::Timeslice& ts, size_t /*component*/) {
48  return ProcessTs(ts);
49  }
50  Bool_t ProcessMs(const fles::Timeslice& ts, size_t uMsCompIdx, size_t uMsIdx);
51 
52  void AddMsComponentToList(size_t component, UShort_t usDetectorId);
53 
54  Bool_t CreateHistograms();
55  Bool_t FillHistograms();
56  Bool_t UpdateStats();
57  Bool_t ResetHistograms();
58 
59  inline void SetEtofFeeIndexing(Bool_t bFlagIn = kTRUE) {
60  fbEtofFeeIndexing = bFlagIn;
61  }
62  inline void SetSectorIndex(Int_t iSector = -1) { fiSectorIndex = iSector; }
63  inline void SetUpdateFreqTs(UInt_t uFreq = 100) { fuUpdateFreqTs = uFreq; }
64  inline void SetPulserTotLimits(UInt_t uMin, UInt_t uMax) {
65  fuPulserMinTot = uMin;
66  fuPulserMaxTot = uMax;
67  }
68  inline void SetPulserChannel(UInt_t uChan) { fuPulserChannel = uChan; }
69  inline void SetHistoryHistoSize(UInt_t inHistorySizeSec = 1800) {
70  fuHistoryHistoSize = inHistorySizeSec;
71  }
72 
73 private:
76  std::vector<Bool_t> fvbMaskedComponents;
79 
82  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 
104  ULong64_t fulCurrentTsIdx;
105  ULong64_t fulCurrentMsIdx;
106  Double_t
108  Double_t
110  Double_t
112  UInt_t fuMsIndex;
113  UInt_t
116  UInt_t
118  UInt_t
120  UInt_t
122  UInt_t
124  std::vector<ULong64_t> fvulCurrentEpoch;
126  std::vector<ULong64_t>
128  std::vector<ULong64_t> fvulCurrentEpochFull;
129 
131  std::vector<gdpbv100::Message> fvmEpSupprBuffer;
132 
134  std::vector<std::vector<Bool_t>> fvvbFeeHitFound;
135  std::vector<std::vector<Double_t>> fvvdFeeHits;
136 
139  const Double_t kdMaxDtPulserPs = 300e3;
140  const UInt_t kuNbBinsDt = 2000;
141  Double_t dMinDt;
142  Double_t dMaxDt;
143  const Double_t kdFitZoomWidthPs = 500.0;
145  Double_t fdStartTime;
147 
150  std::vector<std::vector<TH1*>>
157 
159  TCanvas* fcSummary;
160 
161  void ProcessEpochCycle(uint64_t ulCycleData);
162  void ProcessEpoch(gdpbv100::Message mess);
163 
164  void ProcessEpSupprBuffer();
165 
167 
170 
171  ClassDef(CbmStar2019MonitorPulserAlgo, 1)
172 };
173 
174 #endif // CbmStar2019MonitorPulserAlgo_H
gdpbv100::Message
Definition: gDpbMessv100.h:133
CbmStar2019MonitorPulserAlgo::fUnpackPar
CbmStar2019TofPar * fUnpackPar
Settings from parameter file.
Definition: CbmStar2019MonitorPulserAlgo.h:81
CbmStar2019MonitorPulserAlgo::Init
virtual Bool_t Init()
Definition: CbmStar2019MonitorPulserAlgo.cxx:88
CbmStar2019MonitorPulserAlgo::fhPulserRmsGdpbToRefEvo
TH2 * fhPulserRmsGdpbToRefEvo
Definition: CbmStar2019MonitorPulserAlgo.h:155
CbmStar2019MonitorPulserAlgo::fiSectorIndex
Int_t fiSectorIndex
Definition: CbmStar2019MonitorPulserAlgo.h:77
CbmStar2019MonitorPulserAlgo::fGdpbIdIndexMap
std::map< UInt_t, UInt_t > fGdpbIdIndexMap
Total number of GDPBs in the system.
Definition: CbmStar2019MonitorPulserAlgo.h:84
CbmStar2019MonitorPulserAlgo::fvulCurrentEpoch
std::vector< ULong64_t > fvulCurrentEpoch
Data format control: Current time references for each GDPB: merged epoch marker, epoch cycle,...
Definition: CbmStar2019MonitorPulserAlgo.h:125
CbmStar2019MonitorPulserAlgo::AddMsComponentToList
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Definition: CbmStar2019MonitorPulserAlgo.cxx:196
CbmStar2019MonitorPulserAlgo::fvvdFeeHits
std::vector< std::vector< Double_t > > fvvdFeeHits
[ Sector ][ FEE ]
Definition: CbmStar2019MonitorPulserAlgo.h:135
CbmStar2019MonitorPulserAlgo::fuCurrDpbId
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
Definition: CbmStar2019MonitorPulserAlgo.h:117
CbmStar2019MonitorPulserAlgo::fuCurrentEquipmentId
UInt_t fuCurrentEquipmentId
Definition: CbmStar2019MonitorPulserAlgo.h:115
CbmStar2019MonitorPulserAlgo::fdTsStopTimeCore
Double_t fdTsStopTimeCore
Time in ns of current TS from the index of the first MS first component.
Definition: CbmStar2019MonitorPulserAlgo.h:109
CbmStar2019MonitorPulserAlgo::SetUpdateFreqTs
void SetUpdateFreqTs(UInt_t uFreq=100)
Definition: CbmStar2019MonitorPulserAlgo.h:63
CbmStar2019MonitorPulserAlgo::fvbMaskedComponents
std::vector< Bool_t > fvbMaskedComponents
Definition: CbmStar2019MonitorPulserAlgo.h:76
CbmStar2019MonitorPulserAlgo::operator=
CbmStar2019MonitorPulserAlgo operator=(const CbmStar2019MonitorPulserAlgo &)
CbmStar2019MonitorPulserAlgo::fuNrOfChannelsPerFee
UInt_t fuNrOfChannelsPerFee
Number of channels in each GET4.
Definition: CbmStar2019MonitorPulserAlgo.h:88
CbmStar2019MonitorPulserAlgo::fuGet4Id
UInt_t fuGet4Id
Index of the DPB from which the MS currently unpacked is coming.
Definition: CbmStar2019MonitorPulserAlgo.h:121
CbmStar2019MonitorPulserAlgo::fuPulserMinTot
UInt_t fuPulserMinTot
Number of channels per GDPB.
Definition: CbmStar2019MonitorPulserAlgo.h:94
CbmStar2019MonitorPulserAlgo::~CbmStar2019MonitorPulserAlgo
~CbmStar2019MonitorPulserAlgo()
Definition: CbmStar2019MonitorPulserAlgo.cxx:82
CbmStar2019MonitorPulserAlgo::ProcessMs
Bool_t ProcessMs(const fles::Timeslice &ts, size_t uMsCompIdx, size_t uMsIdx)
Definition: CbmStar2019MonitorPulserAlgo.cxx:261
CbmStar2019MonitorPulserAlgo::SetHistoryHistoSize
void SetHistoryHistoSize(UInt_t inHistorySizeSec=1800)
Definition: CbmStar2019MonitorPulserAlgo.h:69
CbmStar2019MonitorPulserAlgo::Reset
virtual void Reset()
Definition: CbmStar2019MonitorPulserAlgo.cxx:93
CbmStar2019MonitorPulserAlgo::fuNrOfGet4
UInt_t fuNrOfGet4
Number of channels in each FEE.
Definition: CbmStar2019MonitorPulserAlgo.h:89
CbmTofDigi.h
CbmStar2019MonitorPulserAlgo::ProcessHit
void ProcessHit(gdpbv100::FullMessage mess)
Definition: CbmStar2019MonitorPulserAlgo.cxx:487
CbmStar2019MonitorPulserAlgo::GetParList
TList * GetParList()
Definition: CbmStar2019MonitorPulserAlgo.cxx:118
CbmStar2019MonitorPulserAlgo::fuNrOfGdpbs
UInt_t fuNrOfGdpbs
Definition: CbmStar2019MonitorPulserAlgo.h:83
CbmStar2019MonitorPulserAlgo::ReInitContainers
Bool_t ReInitContainers()
Definition: CbmStar2019MonitorPulserAlgo.cxx:107
CbmStar2019MonitorPulserAlgo::fvmEpSupprBuffer
std::vector< gdpbv100::Message > fvmEpSupprBuffer
Epoch + Epoch Cycle.
Definition: CbmStar2019MonitorPulserAlgo.h:131
CbmStar2019MonitorPulserAlgo::fbEtofFeeIndexing
Bool_t fbEtofFeeIndexing
Control flags.
Definition: CbmStar2019MonitorPulserAlgo.h:75
CbmStar2019MonitorPulserAlgo::fuNrOfGet4PerGdpb
UInt_t fuNrOfGet4PerGdpb
Total number of Get4 chips in the system.
Definition: CbmStar2019MonitorPulserAlgo.h:90
CbmStar2019MonitorPulserAlgo::fuPulserChannel
UInt_t fuPulserChannel
Definition: CbmStar2019MonitorPulserAlgo.h:96
CbmStar2019MonitorPulserAlgo::fvulCurrentEpochCycle
std::vector< ULong64_t > fvulCurrentEpochCycle
Current epoch index, per DPB.
Definition: CbmStar2019MonitorPulserAlgo.h:127
CbmStar2019MonitorPulserAlgo::kuBytesPerMessage
static const UInt_t kuBytesPerMessage
Definition: CbmStar2019MonitorPulserAlgo.h:100
CbmStar2019MonitorPulserAlgo::CbmStar2019MonitorPulserAlgo
CbmStar2019MonitorPulserAlgo()
Definition: CbmStar2019MonitorPulserAlgo.cxx:34
CbmStar2019MonitorPulserAlgo::fulCurrentTsIdx
ULong64_t fulCurrentTsIdx
Definition: CbmStar2019MonitorPulserAlgo.h:104
CbmStar2019MonitorPulserAlgo::kdMaxDtPulserPs
const Double_t kdMaxDtPulserPs
[ Sector ][ FEE ]
Definition: CbmStar2019MonitorPulserAlgo.h:139
CbmStar2019MonitorPulserAlgo::dMaxDt
Double_t dMaxDt
Definition: CbmStar2019MonitorPulserAlgo.h:142
CbmStar2019Algo.h
CbmStar2019MonitorPulserAlgo::ResetHistograms
Bool_t ResetHistograms()
Definition: CbmStar2019MonitorPulserAlgo.cxx:935
CbmStar2019Algo
Definition: CbmStar2019Algo.h:43
CbmStar2019MonitorPulserAlgo::SetPulserTotLimits
void SetPulserTotLimits(UInt_t uMin, UInt_t uMax)
Definition: CbmStar2019MonitorPulserAlgo.h:64
CbmStar2019MonitorPulserAlgo::fvulCurrentEpochFull
std::vector< ULong64_t > fvulCurrentEpochFull
Epoch cycle from the Ms Start message and Epoch counter flip.
Definition: CbmStar2019MonitorPulserAlgo.h:128
CbmStar2019MonitorPulserAlgo::ProcessTs
Bool_t ProcessTs(const fles::Timeslice &ts)
Definition: CbmStar2019MonitorPulserAlgo.cxx:212
CbmStar2019MonitorPulserAlgo::fuHistoryHistoSize
UInt_t fuHistoryHistoSize
Time of first MS.
Definition: CbmStar2019MonitorPulserAlgo.h:146
CbmStar2019MonitorPulserAlgo::ProcessEpoch
void ProcessEpoch(gdpbv100::Message mess)
Definition: CbmStar2019MonitorPulserAlgo.cxx:412
CbmStar2019MonitorPulserAlgo::InitParameters
Bool_t InitParameters()
Definition: CbmStar2019MonitorPulserAlgo.cxx:125
CbmStar2019MonitorPulserAlgo::fuNrOfChannelsPerGdpb
UInt_t fuNrOfChannelsPerGdpb
Number of GET4s per GDPB.
Definition: CbmStar2019MonitorPulserAlgo.h:91
CbmStar2019MonitorPulserAlgo::InitContainers
Bool_t InitContainers()
Definition: CbmStar2019MonitorPulserAlgo.cxx:101
CbmStar2019MonitorPulserAlgo::ProcessTs
Bool_t ProcessTs(const fles::Timeslice &ts, size_t)
Definition: CbmStar2019MonitorPulserAlgo.h:47
CbmStar2019MonitorPulserAlgo::fuGet4Nr
UInt_t fuGet4Nr
running number (0 to fuNrOfGet4PerGdpb) of the Get4 chip of a unique GDPB for current message
Definition: CbmStar2019MonitorPulserAlgo.h:123
CbmStar2019MonitorPulserAlgo::fuMsIndex
UInt_t fuMsIndex
Start Time in ns of current MS from its index field in header.
Definition: CbmStar2019MonitorPulserAlgo.h:112
CbmStar2019MonitorPulserAlgo::fuNrOfChannelsPerGet4
UInt_t fuNrOfChannelsPerGet4
Number of GET4s per FEE.
Definition: CbmStar2019MonitorPulserAlgo.h:87
CbmStar2019MonitorPulserAlgo::fhPulserTimeDiffRmsZoom
TH2 * fhPulserTimeDiffRmsZoom
Definition: CbmStar2019MonitorPulserAlgo.h:154
CbmStar2019MonitorPulserAlgo::fhPulserRmsGbtxToRefEvo
TH2 * fhPulserRmsGbtxToRefEvo
Definition: CbmStar2019MonitorPulserAlgo.h:156
CbmStar2019MonitorPulserAlgo::fhPulserTimeDiffMean
TH2 * fhPulserTimeDiffMean
[ FEE A ][ FEE B ]
Definition: CbmStar2019MonitorPulserAlgo.h:152
CbmStar2019MonitorPulserAlgo::fuUpdateFreqTs
UInt_t fuUpdateFreqTs
Definition: CbmStar2019MonitorPulserAlgo.h:78
CbmStar2019TofPar
Definition: CbmStar2019TofPar.h:18
CbmStar2019MonitorPulserAlgo::dMinDt
Double_t dMinDt
Definition: CbmStar2019MonitorPulserAlgo.h:141
gDpbMessv100.h
CbmStar2019MonitorPulserAlgo::CbmStar2019MonitorPulserAlgo
CbmStar2019MonitorPulserAlgo(const CbmStar2019MonitorPulserAlgo &)
CbmStar2019MonitorPulserAlgo::fuCurrDpbIdx
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
Definition: CbmStar2019MonitorPulserAlgo.h:119
CbmStar2019MonitorPulserAlgo::UpdateStats
Bool_t UpdateStats()
Definition: CbmStar2019MonitorPulserAlgo.cxx:853
CbmStar2019MonitorPulserAlgo::CreateHistograms
Bool_t CreateHistograms()
Definition: CbmStar2019MonitorPulserAlgo.cxx:525
CbmStar2019MonitorPulserAlgo::SetSectorIndex
void SetSectorIndex(Int_t iSector=-1)
Definition: CbmStar2019MonitorPulserAlgo.h:62
CbmStar2019MonitorPulserAlgo::fcSummary
TCanvas * fcSummary
Canvases.
Definition: CbmStar2019MonitorPulserAlgo.h:159
CbmStar2019MonitorPulserAlgo::SetPulserChannel
void SetPulserChannel(UInt_t uChan)
Definition: CbmStar2019MonitorPulserAlgo.h:68
gdpbv100::FullMessage
Definition: gDpbMessv100.h:362
CbmStar2019MonitorPulserAlgo::fuPulserMaxTot
UInt_t fuPulserMaxTot
Definition: CbmStar2019MonitorPulserAlgo.h:95
CbmStar2019MonitorPulserAlgo::fvvbFeeHitFound
std::vector< std::vector< Bool_t > > fvvbFeeHitFound
Storing the time of the last hit for each MS in each of the FEE.
Definition: CbmStar2019MonitorPulserAlgo.h:134
CbmStar2019MonitorPulserAlgo::ProcessEpSupprBuffer
void ProcessEpSupprBuffer()
Definition: CbmStar2019MonitorPulserAlgo.cxx:429
CbmStar2019MonitorPulserAlgo::kdFitZoomWidthPs
const Double_t kdFitZoomWidthPs
Definition: CbmStar2019MonitorPulserAlgo.h:143
CbmStar2019MonitorPulserAlgo::fuNrOfGet4PerFee
UInt_t fuNrOfGet4PerFee
Number of FEBs per GDPB.
Definition: CbmStar2019MonitorPulserAlgo.h:86
CbmStar2019MonitorPulserAlgo::fvvhFeePairPulserTimeDiff
std::vector< std::vector< TH1 * > > fvvhFeePairPulserTimeDiff
Size in seconds of the evolution histograms.
Definition: CbmStar2019MonitorPulserAlgo.h:151
CbmStar2019MonitorPulserAlgo::fuNrOfFeePerGdpb
UInt_t fuNrOfFeePerGdpb
gDPB ID to index map
Definition: CbmStar2019MonitorPulserAlgo.h:85
CbmStar2019MonitorPulserAlgo::FillHistograms
Bool_t FillHistograms()
Definition: CbmStar2019MonitorPulserAlgo.cxx:756
CbmStar2019MonitorPulserAlgo
Definition: CbmStar2019MonitorPulserAlgo.h:31
CbmStar2019MonitorPulserAlgo::SetEtofFeeIndexing
void SetEtofFeeIndexing(Bool_t bFlagIn=kTRUE)
Definition: CbmStar2019MonitorPulserAlgo.h:59
CbmStar2019MonitorPulserAlgo::ProcessEpochCycle
void ProcessEpochCycle(uint64_t ulCycleData)
Definition: CbmStar2019MonitorPulserAlgo.cxx:387
CbmStar2019MonitorPulserAlgo::fdTsStartTime
Double_t fdTsStartTime
Definition: CbmStar2019MonitorPulserAlgo.h:107
CbmStar2019MonitorPulserAlgo::fulCurrentMsIdx
ULong64_t fulCurrentMsIdx
Definition: CbmStar2019MonitorPulserAlgo.h:105
CbmStar2019MonitorPulserAlgo::fhPulserTimeDiffRms
TH2 * fhPulserTimeDiffRms
Definition: CbmStar2019MonitorPulserAlgo.h:153
CbmStar2019MonitorPulserAlgo::kiMaxNbFlibLinks
static const Int_t kiMaxNbFlibLinks
Constants.
Definition: CbmStar2019MonitorPulserAlgo.h:99
CbmStar2019MonitorPulserAlgo::kuNbBinsDt
const UInt_t kuNbBinsDt
Definition: CbmStar2019MonitorPulserAlgo.h:140
CbmStar2019MonitorPulserAlgo::fdStartTime
Double_t fdStartTime
Starting time and time evolution book-keeping.
Definition: CbmStar2019MonitorPulserAlgo.h:145
CbmStar2019MonitorPulserAlgo::fdMsTime
Double_t fdMsTime
End Time in ns of current TS Core from the index of the first MS first component.
Definition: CbmStar2019MonitorPulserAlgo.h:111
CbmStar2019MonitorPulserAlgo::Finish
virtual void Finish()
Definition: CbmStar2019MonitorPulserAlgo.cxx:94