CbmRoot
Loading...
Searching...
No Matches
CbmDeviceBuildRawEvents.h
Go to the documentation of this file.
1/* Copyright (C) 2020-2021 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau, Dominik Smith [committer] */
4
12#ifndef CBMDEVICEBUILDRAWEVENTS_H_
13#define CBMDEVICEBUILDRAWEVENTS_H_
14
17#include "CbmBmonDigi.h"
18#include "CbmMuchBeamTimeDigi.h"
19#include "CbmPsdDigi.h"
20#include "CbmRichDigi.h"
21#include "CbmStsDigi.h"
22#include "CbmTofDigi.h"
23#include "CbmTrdDigi.h"
24
26#include "FairMQDevice.h"
27
29#include "Rtypes.h"
30#include "TObjArray.h"
31
33#include <chrono>
34#include <map>
35#include <vector>
36
37class TList;
38class TClonesArray;
39class FairRunOnline;
41
42class CbmDeviceBuildRawEvents : public FairMQDevice {
43public:
46
47protected:
48 virtual void InitTask();
49 bool HandleData(FairMQParts&, int);
50 bool HandleCommand(FairMQMessagePtr&, int);
51
52private:
54
56 Bool_t fbIgnoreTsOverlap = kFALSE;
57 Bool_t fbFillHistos = kTRUE;
58
61 std::string fsEvtOverMode = "NoOverlap";
62 std::string fsRefDet = "kBmon";
63 std::vector<std::string> fvsAddDet = {};
64 std::vector<std::string> fvsDelDet = {};
65 std::vector<std::string> fvsSetTrigWin = {};
66 std::vector<std::string> fvsSetTrigMinNb = {};
68 std::string fsChannelNameDataInput = "unpts_0";
69 std::string fsChannelNameDataOutput = "events";
70 std::string fsChannelNameCommands = "commands";
71 std::string fsChannelNameHistosInput = "histogram-in";
72 std::string fsChannelNameHistosConfig = "histo-conf";
73 std::string fsChannelNameCanvasConfig = "canvas-conf";
75 uint32_t fuPublishFreqTs = 100;
76 double_t fdMinPublishTime = 0.5;
77 double_t fdMaxPublishTime = 5.0;
78
80 std::vector<std::string> fsAllowedChannels = {fsChannelNameDataInput};
81
83 uint64_t fulNumMessages = 0;
84 uint64_t fulTsCounter = 0;
85 std::chrono::system_clock::time_point fLastPublishTime = std::chrono::system_clock::now();
86
89
91 size_t fuNbCoreMsPerTs = 0;
92 size_t fuNbOverMsPerTs = 0;
93 Double_t fdMsSizeInNs = 1280000;
94 Double_t fdTsCoreSizeInNs = -1.0;
95 Double_t fdTsOverSizeInNs = -1.0;
96 Double_t fdTsFullSizeInNs = -1.0;
97
100 TClonesArray* fTimeSliceMetaDataArray = nullptr;
103 std::vector<CbmBmonDigi>* fvDigiBmon = nullptr;
104 std::vector<CbmStsDigi>* fvDigiSts = nullptr;
105 std::vector<CbmMuchBeamTimeDigi>* fvDigiMuch = nullptr;
106 std::vector<CbmTrdDigi>* fvDigiTrd = nullptr;
107 std::vector<CbmTofDigi>* fvDigiTof = nullptr;
108 std::vector<CbmRichDigi>* fvDigiRich = nullptr;
109 std::vector<CbmPsdDigi>* fvDigiPsd = nullptr;
111 TClonesArray* fEvents = nullptr;
112 // std::vector< CbmEvent * > & fEventVector; //! vector with all created events
113
115 FairRunOnline* fpRun = nullptr;
116
118 TObjArray fArrayHisto = {};
120 std::vector<std::pair<std::string, std::string>> fvpsHistosFolder = {};
124 std::vector<std::pair<std::string, std::string>> fvpsCanvasConfig = {};
125
126 bool IsChannelNameAllowed(std::string channelName);
127 void Finish();
128 bool SendEvents(FairMQParts& partsIn);
129 bool SendHistograms();
130};
131
132#endif /* CBMDEVICEBUILDRAWEVENTS_H_ */
std::string fsEvtOverMode
Switch ON/OFF filling of histograms.
std::vector< CbmTofDigi > * fvDigiTof
TClonesArray * fEvents
Data emission.
Double_t fdTsOverSizeInNs
Total size of the core MS in a TS, [nanoseconds].
bool HandleData(FairMQParts &, int)
Double_t fdTsFullSizeInNs
Total size of the overlap MS in a TS, [nanoseconds].
std::vector< CbmMuchBeamTimeDigi > * fvDigiMuch
std::vector< std::string > fvsSetTrigMinNb
std::vector< CbmStsDigi > * fvDigiSts
std::string fsChannelNameDataInput
message queues
std::vector< std::string > fvsAddDet
std::vector< std::string > fsAllowedChannels
List of MQ channels names.
std::vector< std::string > fvsDelDet
std::vector< std::pair< std::string, std::string > > fvpsCanvasConfig
Bool_t fbFillHistos
Ignore data in Overlap part of the TS.
uint32_t fuPublishFreqTs
Histograms management.
bool SendEvents(FairMQParts &partsIn)
TClonesArray * fTimeSliceMetaDataArray
Total size of all MS in a TS, [nanoseconds].
std::vector< CbmPsdDigi > * fvDigiPsd
std::vector< std::pair< std::string, std::string > > fvpsHistosFolder
Vector of string pairs with ( HistoName, FolderPath ) to send to the histogram server.
std::vector< CbmBmonDigi > * fvDigiBmon
Digis storage.
std::vector< CbmRichDigi > * fvDigiRich
bool IsChannelNameAllowed(std::string channelName)
TObjArray fArrayHisto
Array of histograms to send to the histogram server.
bool HandleCommand(FairMQMessagePtr &, int)
std::chrono::system_clock::time_point fLastPublishTime
FairRunOnline * fpRun
output container of CbmEvents
std::vector< std::string > fvsSetTrigWin
Double_t fdTsCoreSizeInNs
Size of a single MS, [nanoseconds].
std::vector< CbmTrdDigi > * fvDigiTrd
size_t fuNbCoreMsPerTs
TS MetaData stable values storage.
CbmAlgoBuildRawEvents * fpAlgo
Processing algos.
uint64_t fulNumMessages
Statistics & first TS rejection.