Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/**
* CbmDeviceMonitorT0.h
*
* @since 2019-03-26
* @author F. Uhlig
*/
#ifndef CBMDEVICEMONITORT0_H_
#define CBMDEVICEMONITORT0_H_
#include "FairMQDevice.h"
#include "Timeslice.hpp"
#include "TMessage.h"
#include "Rtypes.h"
#include "TObjArray.h"
#include <vector>
#include <map>
#include <chrono>
class TList;
class CbmMcbm2018MonitorAlgoT0;
class CbmDeviceMonitorT0: public FairMQDevice
{
public:
CbmDeviceMonitorT0();
virtual ~CbmDeviceMonitorT0();
protected:
virtual void InitTask();
bool HandleData(FairMQMessagePtr&, int);
private:
/// Constants
static const uint16_t kusSysId = 0x90;
/// Control flags
Bool_t fbIgnoreOverlapMs; //! Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice
Bool_t fbComponentsAddedToList = kFALSE;
/// User settings parameters
std::string fsChannelNameDataInput;
std::string fsChannelNameHistosInput;
std::string fsChannelNameHistosConfig;
std::string fsChannelNameCanvasConfig;
uint32_t fuHistoryHistoSize;
uint32_t fuMinTotPulser;
uint32_t fuMaxTotPulser;
uint32_t fuOffSpillCountLimit;
uint32_t fuPublishFreqTs;
double_t fdMinPublishTime;
double_t fdMaxPublishTime;
/// List of MQ channels names
std::vector< std::string > fsAllowedChannels;
/// Parameters management
TList* fParCList;
/// Statistics & first TS rejection
uint64_t fulNumMessages;
uint64_t fulTsCounter;
std::chrono::system_clock::time_point fLastPublishTime;
/// Processing algo
CbmMcbm2018MonitorAlgoT0 * fMonitorAlgo;
/// Array of histograms to send to the histogram server
TObjArray fArrayHisto;
/// Vector of string pairs with ( HistoName, FolderPath ) to send to the histogram server
std::vector< std::pair< std::string, std::string > > fvpsHistosFolder;
/// Vector of string pairs with ( CanvasName, CanvasConfig ) to send to the histogram server
/// Format of Can config is "NbPadX(U);NbPadY(U);ConfigPad1(s);....;ConfigPadXY(s)"
/// Format of Pad config is "GrixX(b),GridY(b),LogX(b),LogY(b),LogZ(b),HistoName(s),DrawOptions(s)"
std::vector< std::pair< std::string, std::string > > fvpsCanvasConfig;
bool IsChannelNameAllowed(std::string channelName);
Bool_t InitContainers();
Bool_t DoUnpack(const fles::Timeslice& ts, size_t component);
void Finish();
bool SendHistograms();
};
// special class to expose protected TMessage constructor
class CbmMQTMessage : public TMessage
{
public:
CbmMQTMessage(void* buf, Int_t len)
: TMessage(buf, len)
{
ResetBit(kIsOwner);
}
};
#endif /* CBMDEVICEMONITORT0_H_ */