CbmRoot
CbmMcbm2018MonitorDataRates.h
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 // ----- -----
3 // ----- CbmMcbm2018MonitorDataRates -----
4 // ----- Created 26.03.2019 by P.-A. Loizeau -----
5 // ----- -----
6 // -----------------------------------------------------------------------------
7 
8 #ifndef CbmMcbm2018MonitorDataRates_H
9 #define CbmMcbm2018MonitorDataRates_H
10 
11 #include "Timeslice.hpp"
12 
13 #include "CbmMcbmUnpack.h"
14 
15 #include "Rtypes.h"
16 #include "TClonesArray.h"
17 
18 #include <chrono>
19 #include <map>
20 #include <vector>
21 
22 class CbmMcbm2018TofPar;
23 
24 class TCanvas;
25 class TH1;
26 class TH2;
27 class TProfile;
28 class TProfile2D;
29 
31 public:
34 
35  virtual Bool_t Init();
36 
37  virtual Bool_t DoUnpack(const fles::Timeslice& ts, size_t component);
38 
39  virtual void Reset();
40 
41  virtual void Finish();
42 
43  void SetParContainers();
44 
45  Bool_t InitContainers();
46 
47  Bool_t ReInitContainers();
48 
49  void SetMsLimitLevel(size_t uAcceptBoundaryPct = 100) {
50  fuMsAcceptsPercent = uAcceptBoundaryPct;
51  }
52  size_t GetMsLimitLevel() { return fuMsAcceptsPercent; }
53 
54  virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId);
55  virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb);
56  void SetIgnoreOverlapMs(Bool_t bEnaFlag = kTRUE) {
57  fbIgnoreOverlapMs = bEnaFlag;
58  }
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) {
64  fuHistoryHistoSize = inHistorySizeSec;
65  }
66 
67  inline void AddEqIdChannelNumber(UInt_t uEqId, UInt_t uNbCh) {
68  fmChannelsPerEqId[uEqId] = uNbCh;
69  }
70 
71  void SaveAllHistos(TString sFileName = "");
72  void ResetAllHistos();
74  void UseDaqBuffer(Bool_t) {};
75 
76 private:
78  std::vector<size_t> fvMsComponentsList;
79  size_t fuNbCoreMsPerTs;
80  size_t fuNbOverMsPerTs;
81  Bool_t
83 
85  size_t
87  size_t fuTotalMsNb;
88  size_t
90  size_t fuCoreMs;
91  Double_t fdMsSizeInNs;
92  Double_t fdTsCoreSizeInNs;
93 
95  TString fsHistoFilename;
96  UInt_t fuNbFlimLinks;
97 
99  std::map<UInt_t, UInt_t> fmChannelsPerEqId;
100 
102  uint64_t fulCurrentTsIndex; // Idx of the current TS
103  size_t fuCurrentMs; // Idx of the current MS in TS (0 to fuTotalMsNb)
104  size_t fuCurrentMsSysId; // SysId of the current MS in TS (0 to fuTotalMsNb)
105  Double_t fdMsIndex; // Time in ns of current MS from its index
107 
109  static const UInt_t kuSysIdSts = 10;
110  static const UInt_t kuSysIdRich = 30;
111  static const UInt_t kuSysIdMuch = 40;
112  static const UInt_t kuSysIdTof = 60;
113  static const UInt_t kuSysIdT0 = 90;
114  static const UInt_t kuBytesPerMessageSts = 4;
115  static const UInt_t kuBytesPerMessageRich = 4;
116  static const UInt_t kuBytesPerMessageMuch = 4;
117  static const UInt_t kuBytesPerMessageTof = 8;
118  static const UInt_t kuBytesPerMessageT0 = 8;
119 
121  // Evolution plots control
122  Double_t
125  // Counters
126  std::vector<UInt_t> fvuTsSzLink;
127  // Flesnet
129  TCanvas* fcTsSizeAll;
130  TCanvas* fcTsSizeTimeAll;
131  TCanvas* fcMsSizeAll;
132  TCanvas* fcMsSizeTimeAll;
133  TCanvas* fcMsMessAll;
134  TCanvas* fcMsMessTimeAll;
135  TCanvas* fcMsDataChAll;
138  std::vector<TH1*> fvhDataRateTimePerLink;
139  std::vector<TH1*> fvhTsSzPerLink;
140  std::vector<TProfile*> fvhTsSzTimePerLink;
141  std::vector<TH1*> fvhMsSzPerLink;
142  std::vector<TProfile*> fvhMsSzTimePerLink;
143  std::vector<TH1*> fvhMsMessPerLink;
144  std::vector<TProfile*> fvhMsMessTimePerLink;
145  std::vector<TH1*> fvhMsMeanChDataPerLink;
146  std::vector<TH1*> fvhMsMeanChDataTimePerLink;
147 
148  void CreateHistograms();
149 
152 
153  ClassDef(CbmMcbm2018MonitorDataRates, 1)
154 };
155 
156 #endif
CbmMcbm2018MonitorDataRates::fvhMsSzPerLink
std::vector< TH1 * > fvhMsSzPerLink
Definition: CbmMcbm2018MonitorDataRates.h:141
CbmMcbm2018MonitorDataRates::fvMsComponentsList
std::vector< size_t > fvMsComponentsList
FLES containers.
Definition: CbmMcbm2018MonitorDataRates.h:74
CbmMcbm2018MonitorDataRates::fvhMsMessTimePerLink
std::vector< TProfile * > fvhMsMessTimePerLink
Definition: CbmMcbm2018MonitorDataRates.h:144
CbmMcbm2018MonitorDataRates::fuMsAcceptsPercent
size_t fuMsAcceptsPercent
/‍** Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice **‍/
Definition: CbmMcbm2018MonitorDataRates.h:86
CbmMcbm2018MonitorDataRates::kuSysIdT0
static const UInt_t kuSysIdT0
Definition: CbmMcbm2018MonitorDataRates.h:113
CbmMcbm2018MonitorDataRates::ResetAllHistos
void ResetAllHistos()
Definition: CbmMcbm2018MonitorDataRates.cxx:652
CbmMcbm2018MonitorDataRates::fvhMsMessPerLink
std::vector< TH1 * > fvhMsMessPerLink
Definition: CbmMcbm2018MonitorDataRates.h:143
CbmMcbm2018MonitorDataRates::fuTotalMsNb
size_t fuTotalMsNb
Definition: CbmMcbm2018MonitorDataRates.h:87
CbmMcbm2018MonitorDataRates::SaveAllHistos
void SaveAllHistos(TString sFileName="")
Definition: CbmMcbm2018MonitorDataRates.cxx:602
CbmMcbmUnpack.h
CbmMcbm2018MonitorDataRates::fmChannelsPerEqId
std::map< UInt_t, UInt_t > fmChannelsPerEqId
Parameters.
Definition: CbmMcbm2018MonitorDataRates.h:99
CbmMcbm2018MonitorDataRates::CbmMcbm2018MonitorDataRates
CbmMcbm2018MonitorDataRates()
Definition: CbmMcbm2018MonitorDataRates.cxx:45
CbmMcbm2018MonitorDataRates::SetNbMsInTs
virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
Definition: CbmMcbm2018MonitorDataRates.cxx:223
CbmMcbm2018MonitorDataRates::UseDaqBuffer
void UseDaqBuffer(Bool_t)
Definition: CbmMcbm2018MonitorDataRates.h:74
CbmMcbm2018MonitorDataRates::~CbmMcbm2018MonitorDataRates
virtual ~CbmMcbm2018MonitorDataRates()
Definition: CbmMcbm2018MonitorDataRates.cxx:79
CbmMcbm2018MonitorDataRates::SetHistoFilename
void SetHistoFilename(TString sNameIn)
Definition: CbmMcbm2018MonitorDataRates.h:62
CbmMcbm2018MonitorDataRates::fbIgnoreOverlapMs
Bool_t fbIgnoreOverlapMs
Definition: CbmMcbm2018MonitorDataRates.h:82
CbmMcbm2018MonitorDataRates::fhDataRateTimeAllLinks
TH1 * fhDataRateTimeAllLinks
Definition: CbmMcbm2018MonitorDataRates.h:137
CbmMcbm2018MonitorDataRates::fcMsDataChTimeAll
TCanvas * fcMsDataChTimeAll
Definition: CbmMcbm2018MonitorDataRates.h:136
CbmMcbm2018MonitorDataRates::fcTsSizeTimeAll
TCanvas * fcTsSizeTimeAll
Definition: CbmMcbm2018MonitorDataRates.h:130
CbmMcbm2018MonitorDataRates::fuCurrentMsSysId
size_t fuCurrentMsSysId
Definition: CbmMcbm2018MonitorDataRates.h:104
CbmMcbm2018MonitorDataRates::GetMsLimitLevel
size_t GetMsLimitLevel()
Definition: CbmMcbm2018MonitorDataRates.h:52
CbmMcbm2018MonitorDataRates::fuNbCoreMsPerTs
size_t fuNbCoreMsPerTs
Definition: CbmMcbm2018MonitorDataRates.h:79
CbmMcbm2018MonitorDataRates::GetMsOverlap
size_t GetMsOverlap()
Definition: CbmMcbm2018MonitorDataRates.h:60
CbmMcbm2018MonitorDataRates::Init
virtual Bool_t Init()
Definition: CbmMcbm2018MonitorDataRates.cxx:81
CbmMcbm2018MonitorDataRates::fcDataRateTimeAll
TCanvas * fcDataRateTimeAll
Definition: CbmMcbm2018MonitorDataRates.h:128
CbmMcbm2018MonitorDataRates::fulCurrentTsIndex
uint64_t fulCurrentTsIndex
Definition: CbmMcbm2018MonitorDataRates.h:102
CbmMcbm2018MonitorDataRates::ReInitContainers
Bool_t ReInitContainers()
Definition: CbmMcbm2018MonitorDataRates.cxx:105
CbmMcbm2018MonitorDataRates::fuNbFlimLinks
UInt_t fuNbFlimLinks
Definition: CbmMcbm2018MonitorDataRates.h:96
CbmMcbm2018MonitorDataRates::SetIgnoreOverlapMs
void SetIgnoreOverlapMs(Bool_t bEnaFlag=kTRUE)
Definition: CbmMcbm2018MonitorDataRates.h:56
CbmMcbm2018MonitorDataRates::fvhTsSzPerLink
std::vector< TH1 * > fvhTsSzPerLink
Definition: CbmMcbm2018MonitorDataRates.h:139
CbmMcbm2018MonitorDataRates::kuBytesPerMessageSts
static const UInt_t kuBytesPerMessageSts
Definition: CbmMcbm2018MonitorDataRates.h:114
CbmMcbm2018MonitorDataRates::fsHistoFilename
TString fsHistoFilename
Definition: CbmMcbm2018MonitorDataRates.h:95
CbmMcbm2018MonitorDataRates::kuBytesPerMessageT0
static const UInt_t kuBytesPerMessageT0
Definition: CbmMcbm2018MonitorDataRates.h:118
CbmMcbm2018MonitorDataRates::kuBytesPerMessageMuch
static const UInt_t kuBytesPerMessageMuch
Definition: CbmMcbm2018MonitorDataRates.h:116
CbmMcbm2018MonitorDataRates::fcMsDataChAll
TCanvas * fcMsDataChAll
Definition: CbmMcbm2018MonitorDataRates.h:135
CbmMcbm2018MonitorDataRates::fvhMsMeanChDataPerLink
std::vector< TH1 * > fvhMsMeanChDataPerLink
Definition: CbmMcbm2018MonitorDataRates.h:145
CbmMcbm2018MonitorDataRates::kuSysIdRich
static const UInt_t kuSysIdRich
Definition: CbmMcbm2018MonitorDataRates.h:110
CbmMcbm2018MonitorDataRates::fuOverlapMsNb
size_t fuOverlapMsNb
Definition: CbmMcbm2018MonitorDataRates.h:89
CbmMcbm2018MonitorDataRates::kuSysIdTof
static const UInt_t kuSysIdTof
Definition: CbmMcbm2018MonitorDataRates.h:112
CbmMcbm2018MonitorDataRates::Reset
virtual void Reset()
Definition: CbmMcbm2018MonitorDataRates.cxx:598
CbmMcbm2018MonitorDataRates::SetMsOverlap
void SetMsOverlap(size_t uOverlapMsNb=1)
Definition: CbmMcbm2018MonitorDataRates.h:59
CbmMcbm2018MonitorDataRates::fvuTsSzLink
std::vector< UInt_t > fvuTsSzLink
Definition: CbmMcbm2018MonitorDataRates.h:126
CbmMcbm2018MonitorDataRates::fcMsSizeTimeAll
TCanvas * fcMsSizeTimeAll
Definition: CbmMcbm2018MonitorDataRates.h:132
CbmMcbm2018MonitorDataRates::SetParContainers
void SetParContainers()
Definition: CbmMcbm2018MonitorDataRates.cxx:92
CbmMcbm2018MonitorDataRates::fvhDataRateTimePerLink
std::vector< TH1 * > fvhDataRateTimePerLink
Definition: CbmMcbm2018MonitorDataRates.h:138
CbmMcbm2018MonitorDataRates::fiEquipmentId
Int_t fiEquipmentId
Definition: CbmMcbm2018MonitorDataRates.h:106
CbmMcbm2018MonitorDataRates::ResetEvolutionHistograms
void ResetEvolutionHistograms()
CbmMcbm2018MonitorDataRates
Definition: CbmMcbm2018MonitorDataRates.h:30
CbmMcbm2018MonitorDataRates::fdStartTimeMsSz
Double_t fdStartTimeMsSz
Histograms and histogram control variables.
Definition: CbmMcbm2018MonitorDataRates.h:123
CbmMcbm2018MonitorDataRates::SetMsLimitLevel
void SetMsLimitLevel(size_t uAcceptBoundaryPct=100)
Definition: CbmMcbm2018MonitorDataRates.h:49
CbmMcbm2018MonitorDataRates::fcMsSizeAll
TCanvas * fcMsSizeAll
Definition: CbmMcbm2018MonitorDataRates.h:131
CbmMcbm2018MonitorDataRates::fdMsSizeInNs
Double_t fdMsSizeInNs
Definition: CbmMcbm2018MonitorDataRates.h:91
CbmMcbm2018MonitorDataRates::fuNbOverMsPerTs
size_t fuNbOverMsPerTs
Definition: CbmMcbm2018MonitorDataRates.h:80
CbmMcbm2018MonitorDataRates::fcMsMessAll
TCanvas * fcMsMessAll
Definition: CbmMcbm2018MonitorDataRates.h:133
CbmMcbm2018MonitorDataRates::operator=
CbmMcbm2018MonitorDataRates operator=(const CbmMcbm2018MonitorDataRates &)
CbmMcbm2018TofPar
Definition: CbmMcbm2018TofPar.h:18
CbmMcbm2018MonitorDataRates::fuCurrentMs
size_t fuCurrentMs
Definition: CbmMcbm2018MonitorDataRates.h:103
CbmMcbm2018MonitorDataRates::kuBytesPerMessageRich
static const UInt_t kuBytesPerMessageRich
Definition: CbmMcbm2018MonitorDataRates.h:115
CbmMcbm2018MonitorDataRates::AddMsComponentToList
virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Definition: CbmMcbm2018MonitorDataRates.cxx:111
CbmMcbm2018MonitorDataRates::fuCoreMs
size_t fuCoreMs
Definition: CbmMcbm2018MonitorDataRates.h:90
CbmMcbm2018MonitorDataRates::fvhTsSzTimePerLink
std::vector< TProfile * > fvhTsSzTimePerLink
Definition: CbmMcbm2018MonitorDataRates.h:140
CbmMcbm2018MonitorDataRates::fuHistoryHistoSize
UInt_t fuHistoryHistoSize
Definition: CbmMcbm2018MonitorDataRates.h:124
CbmMcbm2018MonitorDataRates::Finish
virtual void Finish()
Definition: CbmMcbm2018MonitorDataRates.cxx:600
CbmMcbm2018MonitorDataRates::CbmMcbm2018MonitorDataRates
CbmMcbm2018MonitorDataRates(const CbmMcbm2018MonitorDataRates &)
CbmMcbm2018MonitorDataRates::InitContainers
Bool_t InitContainers()
Definition: CbmMcbm2018MonitorDataRates.cxx:96
CbmMcbm2018MonitorDataRates::fcMsMessTimeAll
TCanvas * fcMsMessTimeAll
Definition: CbmMcbm2018MonitorDataRates.h:134
CbmMcbm2018MonitorDataRates::fdTsCoreSizeInNs
Double_t fdTsCoreSizeInNs
Definition: CbmMcbm2018MonitorDataRates.h:92
CbmMcbm2018MonitorDataRates::DoUnpack
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
Definition: CbmMcbm2018MonitorDataRates.cxx:458
CbmMcbm2018MonitorDataRates::fcTsSizeAll
TCanvas * fcTsSizeAll
Definition: CbmMcbm2018MonitorDataRates.h:129
CbmMcbm2018MonitorDataRates::fvhMsSzTimePerLink
std::vector< TProfile * > fvhMsSzTimePerLink
Definition: CbmMcbm2018MonitorDataRates.h:142
CbmMcbm2018MonitorDataRates::AddEqIdChannelNumber
void AddEqIdChannelNumber(UInt_t uEqId, UInt_t uNbCh)
Definition: CbmMcbm2018MonitorDataRates.h:67
CbmMcbm2018MonitorDataRates::fvhMsMeanChDataTimePerLink
std::vector< TH1 * > fvhMsMeanChDataTimePerLink
Definition: CbmMcbm2018MonitorDataRates.h:146
CbmMcbm2018MonitorDataRates::SetHistoryHistoSize
void SetHistoryHistoSize(UInt_t inHistorySizeSec=1800)
Definition: CbmMcbm2018MonitorDataRates.h:63
CbmMcbmUnpack
Definition: CbmMcbmUnpack.h:15
CbmMcbm2018MonitorDataRates::kuBytesPerMessageTof
static const UInt_t kuBytesPerMessageTof
Definition: CbmMcbm2018MonitorDataRates.h:117
CbmMcbm2018MonitorDataRates::fdMsIndex
Double_t fdMsIndex
Definition: CbmMcbm2018MonitorDataRates.h:105
CbmMcbm2018MonitorDataRates::CreateHistograms
void CreateHistograms()
Definition: CbmMcbm2018MonitorDataRates.cxx:231
CbmMcbm2018MonitorDataRates::kuSysIdSts
static const UInt_t kuSysIdSts
Constants.
Definition: CbmMcbm2018MonitorDataRates.h:109
CbmMcbm2018MonitorDataRates::kuSysIdMuch
static const UInt_t kuSysIdMuch
Definition: CbmMcbm2018MonitorDataRates.h:111