CbmRoot
Loading...
Searching...
No Matches
CbmMcbm2018MonitorDataRates.h
Go to the documentation of this file.
1/* Copyright (C) 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// ----- CbmMcbm2018MonitorDataRates -----
8// ----- Created 26.03.2019 by P.-A. Loizeau -----
9// ----- -----
10// -----------------------------------------------------------------------------
11
12#ifndef CbmMcbm2018MonitorDataRates_H
13#define CbmMcbm2018MonitorDataRates_H
14
15#include "CbmMcbmUnpack.h"
16
17#include "Timeslice.hpp"
18
19#include "Rtypes.h"
20#include "TClonesArray.h"
21
22#include <chrono>
23#include <map>
24#include <vector>
25
27
28class TCanvas;
29class TH1;
30class TH2;
31class TProfile;
32class TProfile2D;
33
35public:
38
39 virtual Bool_t Init();
40
41 virtual Bool_t DoUnpack(const fles::Timeslice& ts, size_t component);
42
43 virtual void Reset();
44
45 virtual void Finish();
46
47 void SetParContainers();
48
49 Bool_t InitContainers();
50
51 Bool_t ReInitContainers();
52
53 void SetMsLimitLevel(size_t uAcceptBoundaryPct = 100) { fuMsAcceptsPercent = uAcceptBoundaryPct; }
55
56 virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId);
57 virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb);
58 void SetIgnoreOverlapMs(Bool_t bEnaFlag = kTRUE) { fbIgnoreOverlapMs = bEnaFlag; }
59 void SetMsOverlap(size_t uOverlapMsNb = 1) { fuOverlapMsNb = uOverlapMsNb; }
60 size_t GetMsOverlap() { return fuOverlapMsNb; }
61
62 inline void SetHistoFilename(TString sNameIn) { fsHistoFilename = sNameIn; }
63 inline void SetHistoryHistoSize(UInt_t inHistorySizeSec = 1800) { fuHistoryHistoSize = inHistorySizeSec; }
64
65 inline void AddEqIdChannelNumber(UInt_t uEqId, UInt_t uNbCh) { fmChannelsPerEqId[uEqId] = uNbCh; }
66
67 void SaveAllHistos(TString sFileName = "");
68 void ResetAllHistos();
70 void UseDaqBuffer(Bool_t) {};
71
72private:
74 std::vector<size_t> fvMsComponentsList;
78
81 size_t fuTotalMsNb;
83 size_t fuCoreMs;
84 Double_t fdMsSizeInNs;
86
90
92 std::map<UInt_t, UInt_t> fmChannelsPerEqId;
93
95 uint64_t fulCurrentTsIndex; // Idx of the current TS
96 size_t fuCurrentMs; // Idx of the current MS in TS (0 to fuTotalMsNb)
97 size_t fuCurrentMsSysId; // SysId of the current MS in TS (0 to fuTotalMsNb)
98 Double_t fdMsIndex; // Time in ns of current MS from its index
100
102 static const UInt_t kuSysIdSts = 10;
103 static const UInt_t kuSysIdRich = 30;
104 static const UInt_t kuSysIdMuch = 40;
105 static const UInt_t kuSysIdTof = 60;
106 static const UInt_t kuSysIdBmon = 90;
107 static const UInt_t kuBytesPerMessageSts = 4;
108 static const UInt_t kuBytesPerMessageRich = 4;
109 static const UInt_t kuBytesPerMessageMuch = 4;
110 static const UInt_t kuBytesPerMessageTof = 8;
111 static const UInt_t kuBytesPerMessageBmon = 8;
112
114 // Evolution plots control
117 // Counters
118 std::vector<UInt_t> fvuTsSzLink;
119 // Flesnet
121 TCanvas* fcTsSizeAll;
123 TCanvas* fcMsSizeAll;
125 TCanvas* fcMsMessAll;
130 std::vector<TH1*> fvhDataRateTimePerLink;
131 std::vector<TH1*> fvhTsSzPerLink;
132 std::vector<TProfile*> fvhTsSzTimePerLink;
133 std::vector<TH1*> fvhMsSzPerLink;
134 std::vector<TProfile*> fvhMsSzTimePerLink;
135 std::vector<TH1*> fvhMsMessPerLink;
136 std::vector<TProfile*> fvhMsMessTimePerLink;
137 std::vector<TH1*> fvhMsMeanChDataPerLink;
138 std::vector<TH1*> fvhMsMeanChDataTimePerLink;
139
140 void CreateHistograms();
141
144
145 ClassDef(CbmMcbm2018MonitorDataRates, 1)
146};
147
148#endif
virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
std::map< UInt_t, UInt_t > fmChannelsPerEqId
Parameters.
static const UInt_t kuSysIdSts
Constants.
void SetMsOverlap(size_t uOverlapMsNb=1)
std::vector< TProfile * > fvhTsSzTimePerLink
void SetMsLimitLevel(size_t uAcceptBoundaryPct=100)
std::vector< size_t > fvMsComponentsList
FLES containers.
CbmMcbm2018MonitorDataRates(const CbmMcbm2018MonitorDataRates &)
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId)
CbmMcbm2018MonitorDataRates operator=(const CbmMcbm2018MonitorDataRates &)
std::vector< TProfile * > fvhMsMessTimePerLink
Double_t fdStartTimeMsSz
Histograms and histogram control variables.
void SetIgnoreOverlapMs(Bool_t bEnaFlag=kTRUE)
std::vector< TProfile * > fvhMsSzTimePerLink
void SetHistoryHistoSize(UInt_t inHistorySizeSec=1800)
void AddEqIdChannelNumber(UInt_t uEqId, UInt_t uNbCh)
size_t fuMsAcceptsPercent
/‍** Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice **‍/