CbmRoot
CbmDeviceMonitorTof.h
Go to the documentation of this file.
1 
8 #ifndef CBMDEVICEMONITORTOF_H_
9 #define CBMDEVICEMONITORTOF_H_
10 
11 #include "FairMQDevice.h"
12 
13 #include "Timeslice.hpp"
14 
15 #include "Rtypes.h"
16 #include "TMessage.h"
17 #include "TObjArray.h"
18 
19 #include <chrono>
20 #include <map>
21 #include <vector>
22 
23 class TList;
25 
26 class CbmDeviceMonitorTof : public FairMQDevice {
27 public:
29  virtual ~CbmDeviceMonitorTof();
30 
31 protected:
32  virtual void InitTask();
33  bool HandleData(FairMQMessagePtr&, int);
34 
35 private:
37  static const uint16_t kusSysIdTof = 0x60;
38  static const uint16_t kusSysIdT0 = 0x90;
39 
42  kFALSE;
44  kFALSE;
46  kTRUE;
47  Bool_t fbComponentsAddedToList = kFALSE;
48 
50  std::string fsChannelNameDataInput = "tofcomponent";
51  std::string fsChannelNameHistosInput = "histogram-in";
52  std::string fsChannelNameHistosConfig = "histo-conf";
53  std::string fsChannelNameCanvasConfig = "canvas-conf";
54  uint32_t fuHistoryHistoSize = 3600;
55  uint32_t fuMinTotPulser = 185;
56  uint32_t fuMaxTotPulser = 195;
57  int32_t fiGdpbIndex = -1;
58  uint32_t fuPublishFreqTs = 100;
59  double_t fdMinPublishTime = 0.5;
60  double_t fdMaxPublishTime = 5.0;
61 
63  std::vector<std::string> fsAllowedChannels = {fsChannelNameDataInput};
64 
66  TList* fParCList = nullptr;
67 
69  uint64_t fulNumMessages = 0;
70  uint64_t fulTsCounter = 0;
71  std::chrono::system_clock::time_point fLastPublishTime =
72  std::chrono::system_clock::now();
73 
76 
78  TObjArray fArrayHisto = {};
80  std::vector<std::pair<std::string, std::string>> fvpsHistosFolder = {};
84  std::vector<std::pair<std::string, std::string>> fvpsCanvasConfig = {};
85 
86  bool IsChannelNameAllowed(std::string channelName);
87  Bool_t InitContainers();
88  Bool_t DoUnpack(const fles::Timeslice& ts, size_t component);
89  void Finish();
90  bool SendHistograms();
91 };
92 
93 // special class to expose protected TMessage constructor
94 class CbmMQTMessage : public TMessage {
95 public:
96  CbmMQTMessage(void* buf, Int_t len) : TMessage(buf, len) {
97  ResetBit(kIsOwner);
98  }
99 };
100 
101 
102 #endif /* CBMDEVICEMONITORTOF_H_ */
CbmDeviceMonitorTof::fulNumMessages
uint64_t fulNumMessages
Statistics & first TS rejection.
Definition: CbmDeviceMonitorTof.h:69
CbmDeviceMonitorTof::fvpsHistosFolder
std::vector< std::pair< std::string, std::string > > fvpsHistosFolder
Vector of string pairs with ( HistoName, FolderPath ) to send to the histogram server.
Definition: CbmDeviceMonitorTof.h:80
CbmDeviceMonitorTof::kusSysIdT0
static const uint16_t kusSysIdT0
Definition: CbmDeviceMonitorTof.h:38
CbmDeviceMonitorTof::fsChannelNameHistosInput
std::string fsChannelNameHistosInput
Definition: CbmDeviceMonitorTof.h:51
CbmDeviceMonitorTof::fParCList
TList * fParCList
Parameters management.
Definition: CbmDeviceMonitorTof.h:66
CbmDeviceMonitorTof::fiGdpbIndex
int32_t fiGdpbIndex
Definition: CbmDeviceMonitorTof.h:57
CbmDeviceMonitorTof::DoUnpack
Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
Definition: CbmDeviceMonitorTof.cxx:323
CbmDeviceMonitorTof::HandleData
bool HandleData(FairMQMessagePtr &, int)
Definition: CbmDeviceMonitorTof.cxx:248
CbmDeviceMonitorTof::CbmDeviceMonitorTof
CbmDeviceMonitorTof()
Definition: CbmDeviceMonitorTof.cxx:44
CbmMcbm2018MonitorAlgoTof
Definition: CbmMcbm2018MonitorAlgoTof.h:32
CbmDeviceMonitorTof::InitTask
virtual void InitTask()
Definition: CbmDeviceMonitorTof.cxx:47
CbmMQTMessage
Definition: CbmDeviceEventBuilderEtofStar2019.h:96
CbmDeviceMonitorTof
Definition: CbmDeviceMonitorTof.h:26
CbmMQTMessage::CbmMQTMessage
CbmMQTMessage(void *buf, Int_t len)
Definition: CbmDeviceMonitorTof.h:96
CbmDeviceMonitorTof::fuMinTotPulser
uint32_t fuMinTotPulser
Definition: CbmDeviceMonitorTof.h:55
CbmDeviceMonitorTof::fsChannelNameDataInput
std::string fsChannelNameDataInput
User settings parameters.
Definition: CbmDeviceMonitorTof.h:50
CbmDeviceMonitorTof::Finish
void Finish()
Definition: CbmDeviceMonitorTof.cxx:360
CbmDeviceMonitorTof::fArrayHisto
TObjArray fArrayHisto
Array of histograms to send to the histogram server.
Definition: CbmDeviceMonitorTof.h:78
CbmDeviceMonitorTof::fuPublishFreqTs
uint32_t fuPublishFreqTs
Definition: CbmDeviceMonitorTof.h:58
CbmDeviceMonitorTof::fuMaxTotPulser
uint32_t fuMaxTotPulser
Definition: CbmDeviceMonitorTof.h:56
CbmDeviceMonitorTof::fbDebugMonitorMode
Bool_t fbDebugMonitorMode
Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice.
Definition: CbmDeviceMonitorTof.h:43
CbmDeviceMonitorTof::fMonitorAlgo
CbmMcbm2018MonitorAlgoTof * fMonitorAlgo
Processing algo.
Definition: CbmDeviceMonitorTof.h:75
CbmDeviceMonitorTof::fdMinPublishTime
double_t fdMinPublishTime
Definition: CbmDeviceMonitorTof.h:59
CbmDeviceMonitorTof::fdMaxPublishTime
double_t fdMaxPublishTime
Definition: CbmDeviceMonitorTof.h:60
CbmDeviceMonitorTof::fbComponentsAddedToList
Bool_t fbComponentsAddedToList
If ON not printout at all for critical errors.
Definition: CbmDeviceMonitorTof.h:47
CbmDeviceMonitorTof::fuHistoryHistoSize
uint32_t fuHistoryHistoSize
Definition: CbmDeviceMonitorTof.h:54
CbmDeviceMonitorTof::fsAllowedChannels
std::vector< std::string > fsAllowedChannels
List of MQ channels names.
Definition: CbmDeviceMonitorTof.h:63
CbmDeviceMonitorTof::fbIgnoreOverlapMs
Bool_t fbIgnoreOverlapMs
Control flags.
Definition: CbmDeviceMonitorTof.h:41
CbmDeviceMonitorTof::fbIgnoreCriticalErrors
Bool_t fbIgnoreCriticalErrors
Switch ON the filling of a additional set of histograms.
Definition: CbmDeviceMonitorTof.h:45
CbmDeviceMonitorTof::fvpsCanvasConfig
std::vector< std::pair< std::string, std::string > > fvpsCanvasConfig
Definition: CbmDeviceMonitorTof.h:84
CbmDeviceMonitorTof::~CbmDeviceMonitorTof
virtual ~CbmDeviceMonitorTof()
Definition: CbmDeviceMonitorTof.cxx:320
CbmDeviceMonitorTof::kusSysIdTof
static const uint16_t kusSysIdTof
Constants.
Definition: CbmDeviceMonitorTof.h:37
CbmDeviceMonitorTof::fsChannelNameHistosConfig
std::string fsChannelNameHistosConfig
Definition: CbmDeviceMonitorTof.h:52
CbmDeviceMonitorTof::fLastPublishTime
std::chrono::system_clock::time_point fLastPublishTime
Definition: CbmDeviceMonitorTof.h:71
CbmDeviceMonitorTof::fsChannelNameCanvasConfig
std::string fsChannelNameCanvasConfig
Definition: CbmDeviceMonitorTof.h:53
CbmDeviceMonitorTof::IsChannelNameAllowed
bool IsChannelNameAllowed(std::string channelName)
Definition: CbmDeviceMonitorTof.cxx:104
CbmDeviceMonitorTof::fulTsCounter
uint64_t fulTsCounter
Definition: CbmDeviceMonitorTof.h:70
CbmDeviceMonitorTof::SendHistograms
bool SendHistograms()
Definition: CbmDeviceMonitorTof.cxx:284
CbmDeviceMonitorTof::InitContainers
Bool_t InitContainers()
Definition: CbmDeviceMonitorTof.cxx:125