CbmRoot
Loading...
Searching...
No Matches
CbmMcbmSpillFindAlgo.h
Go to the documentation of this file.
1/* Copyright (C) 2019-2021 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// ----- CbmMcbmSpillFindAlgo -----
8// ----- Created 10.02.2019 by P.-A. Loizeau -----
9// ----- -----
10// -----------------------------------------------------------------------------
11
12#ifndef CbmMcbmSpillFindAlgo_H
13#define CbmMcbmSpillFindAlgo_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
32/*
33class TCanvas;
34class THttpServer;
35*/
36class TH1;
37class TH2;
38class TProfile;
39
40class CbmMcbmSpillFindAlgo : public CbmStar2019Algo<CbmTofDigi> {
41public:
44
45 virtual Bool_t Init();
46 virtual void Reset();
47 virtual void Finish();
48
49 Bool_t InitContainers();
50 Bool_t ReInitContainers();
51 TList* GetParList();
52
53 Bool_t InitParameters();
54
55 Bool_t ProcessTs(const fles::Timeslice& ts);
56 Bool_t ProcessTs(const fles::Timeslice& ts, size_t /*component*/) { return ProcessTs(ts); }
57 Bool_t ProcessMs(const fles::Timeslice& ts, size_t uMsCompIdx, size_t uMsIdx);
58
59 void AddMsComponentToList(size_t component, UShort_t usDetectorId);
60
61 Bool_t CreateHistograms();
62 Bool_t FillHistograms();
63 Bool_t ResetHistograms(Bool_t bResetTime = kTRUE);
64
65 inline void SetMonitorMode(Bool_t bFlagIn = kTRUE) { fbMonitorMode = bFlagIn; }
66 inline void SetHistoryHistoSize(UInt_t inHistorySizeSec = 1800) { fuHistoryHistoSize = inHistorySizeSec; }
67 inline void SetPulserTotLimits(UInt_t uMin, UInt_t uMax)
68 {
69 fuMinTotPulser = uMin;
70 fuMaxTotPulser = uMax;
71 }
72 inline void SetSpillThreshold(UInt_t uCntLimit) { fuOffSpillCountLimit = uCntLimit; }
73 inline void SetSpillCheckIntervalSec(Double_t dInterval) { fdSpillCheckInterval = dInterval; }
74
75private:
77 Bool_t fbMonitorMode = kFALSE;
78 Bool_t fbDebugMonitorMode = kFALSE;
79 std::vector<Bool_t> fvbMaskedComponents = {};
80
84 UInt_t fuNrOfGdpbs = 0;
85 std::map<UInt_t, UInt_t> fGdpbIdIndexMap = {};
86 UInt_t fuNrOfFeePerGdpb = 0;
87 UInt_t fuNrOfGet4PerFee = 0;
90 UInt_t fuNrOfGet4 = 0;
91 UInt_t fuNrOfGet4PerGdpb = 0;
93
95 UInt_t fuMinTotPulser = 90;
96 UInt_t fuMaxTotPulser = 100;
98 Double_t fdSpillCheckInterval = 0.5;
99
101 static const Int_t kiMaxNbFlibLinks = 32;
102 static const UInt_t kuBytesPerMessage = 8;
103 static const UInt_t kuNbChanDiamond = 8;
104
107 ULong64_t fulFirstTsIdx = 9999999999999;
108 ULong64_t fulCurrentTsIdx = 0;
109 ULong64_t fulCurrentMsIdx = 0;
110 Double_t fdTsStartTime = -1.0;
112 -1.0;
113 Double_t fdMsTime = -1.0;
114 UInt_t fuMsIndex = 0;
116 std::map<gdpbv100::MessageTypes, UInt_t> fmMsgCounter = {};
118 UInt_t fuCurrDpbId = 0;
119 UInt_t fuCurrDpbIdx = 0;
122 UInt_t fuGet4Id =
123 0;
124 UInt_t fuGet4Nr = 0;
125
127 Double_t fdStartTime = -1.0;
128 Double_t fdStartTimeMsSz = 0.0;
129 std::chrono::steady_clock::time_point ftStartTimeUnix = std::chrono::steady_clock::
130 now();
131
133 Bool_t fbSpillOn = kTRUE;
135 Double_t fdStartTimeSpill = -1.0;
136 Double_t fdLastSecondTime = -1.0;
139 std::vector<ULong64_t> fvuSpillBreakBegTs = {};
140 std::vector<ULong64_t> fvuSpillBreakEndTs = {};
141 std::vector<ULong64_t> fvuSpillBreakMidTs = {};
142
144 UInt_t fuHistoryHistoSize = 3600;
147 TH1* fhHitsEvo = nullptr;
148 TH1* fhHitsPerSpill = nullptr;
149 TH1* fhSpillBreakDuration = nullptr;
150 TH1* fhSpillDuration = nullptr;
151
153 /*
154 TCanvas* fcSummary = nullptr;
155 TCanvas* fcHitMaps = nullptr;
156 TCanvas* fcGenCntsPerMs = nullptr;
157 TCanvas* fcSpillCounts = nullptr;
158 TCanvas* fcSpillCountsHori = nullptr;
159 TCanvas* fcSpillDpbCountsHori = nullptr;
160*/
161
164
165 ClassDef(CbmMcbmSpillFindAlgo, 1)
166};
167
168#endif
void SetSpillCheckIntervalSec(Double_t dInterval)
void SetPulserTotLimits(UInt_t uMin, UInt_t uMax)
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
ULong64_t fulCurrentTsIdx
First TS index, forward point set ~30 years...
UInt_t fuGet4Id
Bin size in s for the plots with date as X axis.
Bool_t ProcessMs(const fles::Timeslice &ts, size_t uMsCompIdx, size_t uMsIdx)
UInt_t fuNrOfGdpbs
Readout chain dimensions and mapping.
Double_t fdTsStopTimeCore
Time in ns of current TS from the index of the first MS first component.
Bool_t fbDebugMonitorMode
Switch ON the filling of a minimal set of histograms.
std::vector< Bool_t > fvbMaskedComponents
Switch ON the filling of a additional set of histograms.
Bool_t ProcessTs(const fles::Timeslice &ts)
std::map< UInt_t, UInt_t > fGdpbIdIndexMap
Total number of GDPBs in the system.
UInt_t fuNrOfChannelsPerGdpb
Number of GET4s per GDPB.
std::chrono::steady_clock::time_point ftStartTimeUnix
Time of first microslice, used as reference for evolution plots.
static const Int_t kiMaxNbFlibLinks
Constants.
Double_t fdStartTimeMsSz
Time of first valid hit (epoch available), used as reference for evolution plots.
UInt_t fuNrOfGet4
Number of channels in each FEE.
UInt_t fuMinTotPulser
Number of channels per GDPB.
Bool_t ProcessTs(const fles::Timeslice &ts, size_t)
UInt_t fuNrOfGet4PerGdpb
Total number of Get4 chips in the system.
Bool_t fbMonitorMode
Control flags.
void SetHistoryHistoSize(UInt_t inHistorySizeSec=1800)
Int_t fiBinSizeDatePlots
Start of run time since "epoch" in s, for the plots with date as X axis.
UInt_t fuGet4Nr
running number (0 to fuNrOfGet4PerGdpb) of the Get4 chip of a unique GDPB for current message
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Double_t fdMsTime
End Time in ns of current TS Core from the index of the first MS first component.
static const UInt_t kuNbChanDiamond
std::vector< ULong64_t > fvuSpillBreakMidTs
UInt_t fuNrOfGet4PerFee
Number of FEBs per GDPB.
CbmMcbmSpillFindAlgo(const CbmMcbmSpillFindAlgo &)
Canvases.
Int_t fiRunStartDateTimeSec
Index of the DPB from which the MS currently unpacked is coming.
Bool_t ResetHistograms(Bool_t bResetTime=kTRUE)
Bool_t fbSpillOn
Time of run Start from UNIX system, used as reference for long evolution plots against reception time...
CbmMcbm2018TofPar * fUnpackPar
Settings from parameter file.
UInt_t fuNrOfChannelsPerGet4
Number of GET4s per FEE.
UInt_t fuHistoryHistoSize
Histograms related variables.
void SetSpillThreshold(UInt_t uCntLimit)
std::vector< ULong64_t > fvuSpillBreakBegTs
std::vector< ULong64_t > fvuSpillBreakEndTs
Double_t fdStartTime
running number (0 to fuNrOfGet4) of the Get4 chip in the system for current message
CbmMcbmSpillFindAlgo operator=(const CbmMcbmSpillFindAlgo &)
static const UInt_t kuBytesPerMessage
std::map< gdpbv100::MessageTypes, UInt_t > fmMsgCounter
void SetMonitorMode(Bool_t bFlagIn=kTRUE)
UInt_t fuNrOfFeePerGdpb
gDPB ID to index map
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
UInt_t fuMsIndex
Start Time in ns of current MS from its index field in header.
UInt_t fuNrOfChannelsPerFee
Number of channels in each GET4.