CbmRoot
CbmDeviceMcbmEventBuilderWin.h
Go to the documentation of this file.
1 
8 #ifndef CBMDEVICEMCBMEVTBUILDERWIN_H_
9 #define CBMDEVICEMCBMEVTBUILDERWIN_H_
10 
13 #include "CbmMuchBeamTimeDigi.h"
14 #include "CbmPsdDigi.h"
15 #include "CbmRichDigi.h"
16 #include "CbmStsDigi.h"
17 #include "CbmTofDigi.h"
18 #include "CbmTrdDigi.h"
19 
21 #include "FairMQDevice.h"
22 
24 #include "Rtypes.h"
25 #include "TMessage.h"
26 #include "TObjArray.h"
27 
29 #include <chrono>
30 #include <map>
31 #include <vector>
32 
33 class TList;
34 class TClonesArray;
35 class FairRunOnline;
36 class TimesliceMetaData;
37 
38 class CbmDeviceMcbmEventBuilderWin : public FairMQDevice {
39 public:
42 
43 protected:
44  virtual void InitTask();
45  bool HandleData(FairMQParts&, int);
46  bool HandleCommand(FairMQMessagePtr&, int);
47 
48 private:
50 
52  Bool_t fbIgnoreTsOverlap = kFALSE;
53  Bool_t fbFillHistos = kTRUE;
54 
57  std::string fsEvtOverMode = "NoOverlap";
58  std::string fsRefDet = "kT0";
59  std::vector<std::string> fvsAddDet = {};
60  std::vector<std::string> fvsDelDet = {};
61  std::vector<std::string> fvsSetTrigWin = {};
62  std::vector<std::string> fvsSetTrigMinNb = {};
64  std::string fsChannelNameDataInput = "unpts_0";
65  std::string fsChannelNameDataOutput = "events";
66  std::string fsChannelNameCommands = "commands";
67  std::string fsChannelNameHistosInput = "histogram-in";
68  std::string fsChannelNameHistosConfig = "histo-conf";
69  std::string fsChannelNameCanvasConfig = "canvas-conf";
71  uint32_t fuPublishFreqTs = 100;
72  double_t fdMinPublishTime = 0.5;
73  double_t fdMaxPublishTime = 5.0;
74 
76  std::vector<std::string> fsAllowedChannels = {fsChannelNameDataInput};
77 
79  // TList* fParCList = nullptr;
80  // Bool_t InitParameters( TList* fParCList );
81 
83  uint64_t fulNumMessages = 0;
84  uint64_t fulTsCounter = 0;
85  std::chrono::system_clock::time_point fLastPublishTime =
86  std::chrono::system_clock::now();
87 
90 
92  size_t fuNbCoreMsPerTs = 0;
93  size_t fuNbOverMsPerTs = 0;
94  Double_t fdMsSizeInNs = 1280000;
95  Double_t fdTsCoreSizeInNs =
96  -1.0;
97  Double_t fdTsOverSizeInNs =
98  -1.0;
99  Double_t fdTsFullSizeInNs =
100  -1.0;
101 
104  TClonesArray* fTimeSliceMetaDataArray = nullptr;
107  std::vector<CbmTofDigi>* fvDigiT0 = nullptr;
108  std::vector<CbmStsDigi>* fvDigiSts = nullptr;
109  std::vector<CbmMuchBeamTimeDigi>* fvDigiMuch = nullptr;
110  std::vector<CbmTrdDigi>* fvDigiTrd = nullptr;
111  std::vector<CbmTofDigi>* fvDigiTof = nullptr;
112  std::vector<CbmRichDigi>* fvDigiRich = nullptr;
113  std::vector<CbmPsdDigi>* fvDigiPsd = nullptr;
115  TClonesArray* fEvents = nullptr;
116  // std::vector< CbmEvent * > & fEventVector; //! vector with all created events
117 
119  FairRunOnline* fpRun = nullptr;
120 
122  TObjArray fArrayHisto = {};
124  std::vector<std::pair<std::string, std::string>> fvpsHistosFolder = {};
128  std::vector<std::pair<std::string, std::string>> fvpsCanvasConfig = {};
129 
130  bool IsChannelNameAllowed(std::string channelName);
131  // Bool_t InitContainers();
132  void Finish();
133  bool SendEvents(FairMQParts& partsIn);
134  bool SendHistograms();
135 };
136 
137 // special class to expose protected TMessage constructor
138 class CbmMQTMessage : public TMessage {
139 public:
140  CbmMQTMessage(void* buf, Int_t len) : TMessage(buf, len) {
141  ResetBit(kIsOwner);
142  }
143 };
144 
145 
146 #endif /* CBMDEVICEMCBMEVTBUILDERWIN_H_ */
CbmDeviceMcbmEventBuilderWin::CbmDeviceMcbmEventBuilderWin
CbmDeviceMcbmEventBuilderWin()
Definition: CbmDeviceMcbmEventBuilderWin.cxx:51
CbmDeviceMcbmEventBuilderWin::fsChannelNameCanvasConfig
std::string fsChannelNameCanvasConfig
Definition: CbmDeviceMcbmEventBuilderWin.h:69
CbmDeviceMcbmEventBuilderWin::fuPublishFreqTs
uint32_t fuPublishFreqTs
Histograms management.
Definition: CbmDeviceMcbmEventBuilderWin.h:71
CbmDeviceMcbmEventBuilderWin::fbFillHistos
Bool_t fbFillHistos
Ignore data in Overlap part of the TS.
Definition: CbmDeviceMcbmEventBuilderWin.h:53
CbmDeviceMcbmEventBuilderWin::fvDigiMuch
std::vector< CbmMuchBeamTimeDigi > * fvDigiMuch
Definition: CbmDeviceMcbmEventBuilderWin.h:109
CbmDeviceMcbmEventBuilderWin::InitTask
virtual void InitTask()
Definition: CbmDeviceMcbmEventBuilderWin.cxx:55
CbmPsdDigi.h
CbmDeviceMcbmEventBuilderWin::fpAlgo
CbmMcbm2019TimeWinEventBuilderAlgo * fpAlgo
Processing algos.
Definition: CbmDeviceMcbmEventBuilderWin.h:89
CbmDeviceMcbmEventBuilderWin::fpRun
FairRunOnline * fpRun
output container of CbmEvents
Definition: CbmDeviceMcbmEventBuilderWin.h:119
CbmDeviceMcbmEventBuilderWin::fbIgnoreTsOverlap
Bool_t fbIgnoreTsOverlap
Constants.
Definition: CbmDeviceMcbmEventBuilderWin.h:52
CbmDeviceMcbmEventBuilderWin::fsEvtOverMode
std::string fsEvtOverMode
Switch ON/OFF filling of histograms.
Definition: CbmDeviceMcbmEventBuilderWin.h:57
CbmDeviceMcbmEventBuilderWin::fsAllowedChannels
std::vector< std::string > fsAllowedChannels
List of MQ channels names.
Definition: CbmDeviceMcbmEventBuilderWin.h:76
CbmDeviceMcbmEventBuilderWin::fdMsSizeInNs
Double_t fdMsSizeInNs
Definition: CbmDeviceMcbmEventBuilderWin.h:94
CbmDeviceMcbmEventBuilderWin::fulNumMessages
uint64_t fulNumMessages
Parameters management.
Definition: CbmDeviceMcbmEventBuilderWin.h:83
TimesliceMetaData
Definition: TimesliceMetaData.h:11
CbmDeviceMcbmEventBuilderWin::fsChannelNameHistosConfig
std::string fsChannelNameHistosConfig
Definition: CbmDeviceMcbmEventBuilderWin.h:68
CbmDeviceMcbmEventBuilderWin::fdTsFullSizeInNs
Double_t fdTsFullSizeInNs
Total size of the overlap MS in a TS, [nanoseconds].
Definition: CbmDeviceMcbmEventBuilderWin.h:99
CbmDeviceMcbmEventBuilderWin::fdTsOverSizeInNs
Double_t fdTsOverSizeInNs
Total size of the core MS in a TS, [nanoseconds].
Definition: CbmDeviceMcbmEventBuilderWin.h:97
CbmDeviceMcbmEventBuilderWin::fvDigiTrd
std::vector< CbmTrdDigi > * fvDigiTrd
Definition: CbmDeviceMcbmEventBuilderWin.h:110
CbmMcbm2019TimeWinEventBuilderAlgo.h
CbmMQTMessage
Definition: CbmDeviceEventBuilderEtofStar2019.h:96
CbmDeviceMcbmEventBuilderWin::fvDigiSts
std::vector< CbmStsDigi > * fvDigiSts
Definition: CbmDeviceMcbmEventBuilderWin.h:108
CbmTofDigi.h
CbmMQTMessage::CbmMQTMessage
CbmMQTMessage(void *buf, Int_t len)
Definition: CbmDeviceMcbmEventBuilderWin.h:140
CbmDeviceMcbmEventBuilderWin::fuNbOverMsPerTs
size_t fuNbOverMsPerTs
Definition: CbmDeviceMcbmEventBuilderWin.h:93
CbmDeviceMcbmEventBuilderWin::HandleCommand
bool HandleCommand(FairMQMessagePtr &, int)
CbmDeviceMcbmEventBuilderWin::fsChannelNameHistosInput
std::string fsChannelNameHistosInput
Definition: CbmDeviceMcbmEventBuilderWin.h:67
CbmRichDigi.h
CbmDeviceMcbmEventBuilderWin::fsChannelNameDataOutput
std::string fsChannelNameDataOutput
Definition: CbmDeviceMcbmEventBuilderWin.h:65
CbmTrdDigi.h
CbmStsDigi.h
CbmDeviceMcbmEventBuilderWin::fdTsCoreSizeInNs
Double_t fdTsCoreSizeInNs
Size of a single MS, [nanoseconds].
Definition: CbmDeviceMcbmEventBuilderWin.h:95
CbmDeviceMcbmEventBuilderWin::fvDigiTof
std::vector< CbmTofDigi > * fvDigiTof
Definition: CbmDeviceMcbmEventBuilderWin.h:111
CbmDeviceMcbmEventBuilderWin::SendHistograms
bool SendHistograms()
Definition: CbmDeviceMcbmEventBuilderWin.cxx:660
CbmDeviceMcbmEventBuilderWin::~CbmDeviceMcbmEventBuilderWin
virtual ~CbmDeviceMcbmEventBuilderWin()
Definition: CbmDeviceMcbmEventBuilderWin.cxx:677
CbmDeviceMcbmEventBuilderWin::fvsDelDet
std::vector< std::string > fvsDelDet
Definition: CbmDeviceMcbmEventBuilderWin.h:60
CbmDeviceMcbmEventBuilderWin::fArrayHisto
TObjArray fArrayHisto
Array of histograms to send to the histogram server.
Definition: CbmDeviceMcbmEventBuilderWin.h:122
CbmDeviceMcbmEventBuilderWin::fuNbCoreMsPerTs
size_t fuNbCoreMsPerTs
TS MetaData stable values storage.
Definition: CbmDeviceMcbmEventBuilderWin.h:92
CbmDeviceMcbmEventBuilderWin::fvDigiT0
std::vector< CbmTofDigi > * fvDigiT0
Digis storage.
Definition: CbmDeviceMcbmEventBuilderWin.h:107
CbmDeviceMcbmEventBuilderWin::fsChannelNameCommands
std::string fsChannelNameCommands
Definition: CbmDeviceMcbmEventBuilderWin.h:66
CbmDeviceMcbmEventBuilderWin::SendEvents
bool SendEvents(FairMQParts &partsIn)
Definition: CbmDeviceMcbmEventBuilderWin.cxx:607
CbmDeviceMcbmEventBuilderWin::fvDigiPsd
std::vector< CbmPsdDigi > * fvDigiPsd
Definition: CbmDeviceMcbmEventBuilderWin.h:113
CbmMuchBeamTimeDigi.h
CbmDeviceMcbmEventBuilderWin::fdMaxPublishTime
double_t fdMaxPublishTime
Definition: CbmDeviceMcbmEventBuilderWin.h:73
CbmDeviceMcbmEventBuilderWin::fvsSetTrigWin
std::vector< std::string > fvsSetTrigWin
Definition: CbmDeviceMcbmEventBuilderWin.h:61
CbmDeviceMcbmEventBuilderWin::fvDigiRich
std::vector< CbmRichDigi > * fvDigiRich
Definition: CbmDeviceMcbmEventBuilderWin.h:112
CbmDeviceMcbmEventBuilderWin::fsChannelNameDataInput
std::string fsChannelNameDataInput
message queues
Definition: CbmDeviceMcbmEventBuilderWin.h:64
CbmDeviceMcbmEventBuilderWin::Finish
void Finish()
Definition: CbmDeviceMcbmEventBuilderWin.cxx:702
CbmDeviceMcbmEventBuilderWin
Definition: CbmDeviceMcbmEventBuilderWin.h:38
CbmDeviceMcbmEventBuilderWin::fEvents
TClonesArray * fEvents
Data emission.
Definition: CbmDeviceMcbmEventBuilderWin.h:115
CbmDeviceMcbmEventBuilderWin::fvpsHistosFolder
std::vector< std::pair< std::string, std::string > > fvpsHistosFolder
Vector of string pairs with ( HistoName, FolderPath ) to send to the histogram server.
Definition: CbmDeviceMcbmEventBuilderWin.h:124
CbmDeviceMcbmEventBuilderWin::fvsSetTrigMinNb
std::vector< std::string > fvsSetTrigMinNb
Definition: CbmDeviceMcbmEventBuilderWin.h:62
CbmDeviceMcbmEventBuilderWin::fvpsCanvasConfig
std::vector< std::pair< std::string, std::string > > fvpsCanvasConfig
Definition: CbmDeviceMcbmEventBuilderWin.h:128
CbmDeviceMcbmEventBuilderWin::fulTsCounter
uint64_t fulTsCounter
Definition: CbmDeviceMcbmEventBuilderWin.h:84
CbmDeviceMcbmEventBuilderWin::fsRefDet
std::string fsRefDet
Definition: CbmDeviceMcbmEventBuilderWin.h:58
CbmDeviceMcbmEventBuilderWin::IsChannelNameAllowed
bool IsChannelNameAllowed(std::string channelName)
Definition: CbmDeviceMcbmEventBuilderWin.cxx:392
CbmDeviceMcbmEventBuilderWin::fLastPublishTime
std::chrono::system_clock::time_point fLastPublishTime
Definition: CbmDeviceMcbmEventBuilderWin.h:85
CbmDeviceMcbmEventBuilderWin::fTimeSliceMetaDataArray
TClonesArray * fTimeSliceMetaDataArray
Total size of all MS in a TS, [nanoseconds].
Definition: CbmDeviceMcbmEventBuilderWin.h:104
CbmDeviceMcbmEventBuilderWin::HandleData
bool HandleData(FairMQParts &, int)
Definition: CbmDeviceMcbmEventBuilderWin.cxx:476
CbmDeviceMcbmEventBuilderWin::fTsMetaData
TimesliceMetaData * fTsMetaData
Definition: CbmDeviceMcbmEventBuilderWin.h:105
CbmDeviceMcbmEventBuilderWin::fdMinPublishTime
double_t fdMinPublishTime
Definition: CbmDeviceMcbmEventBuilderWin.h:72
CbmMcbm2019TimeWinEventBuilderAlgo
Definition: CbmMcbm2019TimeWinEventBuilderAlgo.h:106
CbmDeviceMcbmEventBuilderWin::fvsAddDet
std::vector< std::string > fvsAddDet
Definition: CbmDeviceMcbmEventBuilderWin.h:59