CbmRoot
Loading...
Searching...
No Matches
CbmDeviceBuildDigiEvents.h
Go to the documentation of this file.
1/* Copyright (C) 2021 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau[committer] */
4
12#ifndef CBMDEVICEBUILDDIGIEVENTS_H_
13#define CBMDEVICEBUILDDIGIEVENTS_H_
14
17#include "CbmBmonDigi.h"
18#include "CbmMuchDigi.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 CbmDeviceBuildDigiEvents : 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 = {};
67 std::vector<std::string> fvsSetTrigMaxNb = {};
68 std::vector<std::string> fvsSetTrigMinLayersNb = {};
69 std::vector<std::string> fvsSetHistMaxDigiNb = {};
71 bool fbDoNotSend = false;
72 bool fbDigiEventOutput = false;
74 std::string fsChannelNameDataInput = "unpts_0";
75 std::string fsChannelNameDataOutput = "events";
76 std::string fsChannelNameCommands = "commands";
77 std::string fsChannelNameHistosInput = "histogram-in";
79 uint32_t fuPublishFreqTs = 100;
80 double_t fdMinPublishTime = 0.5;
81 double_t fdMaxPublishTime = 5.0;
82
84 std::vector<std::string> fsAllowedChannels = {fsChannelNameDataInput};
85
87 uint64_t fulNumMessages = 0;
88 uint64_t fulTsCounter = 0;
89 std::chrono::system_clock::time_point fLastPublishTime = std::chrono::system_clock::now();
90
93
95 size_t fuNbCoreMsPerTs = 0;
96 size_t fuNbOverMsPerTs = 0;
97 Double_t fdMsSizeInNs = 1280000;
98 Double_t fdTsCoreSizeInNs = -1.0;
99 Double_t fdTsOverSizeInNs = -1.0;
100 Double_t fdTsFullSizeInNs = -1.0;
101
106 std::vector<CbmBmonDigi>* fvDigiBmon = nullptr;
107 std::vector<CbmStsDigi>* fvDigiSts = nullptr;
108 std::vector<CbmMuchDigi>* fvDigiMuch = nullptr;
109 std::vector<CbmTrdDigi>* fvDigiTrd = nullptr;
110 std::vector<CbmTofDigi>* fvDigiTof = nullptr;
111 std::vector<CbmRichDigi>* fvDigiRich = nullptr;
112 std::vector<CbmPsdDigi>* fvDigiPsd = nullptr;
114 TClonesArray* fTimeSliceMetaDataArray = 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 = {};
126 bool fbConfigSent = false;
127
129 bool IsChannelNameAllowed(std::string channelName);
133 ECbmModuleId GetDetectorId(std::string detName);
134
135 bool InitHistograms();
136 void Finish();
137 bool SendEvents(FairMQParts& partsIn);
138 bool SendDigiEvents(FairMQParts& partsIn);
140 bool SendHistograms();
141};
142
143#endif /* CBMDEVICEBUILDDIGIEVENTS_H_ */
ECbmModuleId
Definition CbmDefs.h:39
Bool_t fbFillHistos
Ignore data in Overlap part of the TS.
ECbmModuleId GetDetectorId(std::string detName)
Get detector type from string containing name.
std::vector< std::string > fvsSetTrigMinNb
std::string fsEvtOverMode
Switch ON/OFF filling of histograms.
std::vector< std::string > fvsAddDet
bool HandleData(FairMQParts &, int)
bool SendDigiEvents(FairMQParts &partsIn)
std::vector< std::string > fvsSetTrigWin
uint32_t fuPublishFreqTs
Histograms management.
std::vector< CbmMuchDigi > * fvDigiMuch
std::vector< std::string > fvsSetTrigMinLayersNb
std::vector< std::string > fvsSetHistMaxDigiNb
CbmAlgoBuildRawEvents * fpAlgo
Processing algos.
std::vector< CbmTrdDigi > * fvDigiTrd
std::vector< CbmPsdDigi > * fvDigiPsd
std::string fsChannelNameDataInput
message queues
std::vector< CbmBmonDigi > * fvDigiBmon
Digis storage.
size_t fuNbCoreMsPerTs
TS MetaData stable values storage.
std::vector< CbmRichDigi > * fvDigiRich
std::vector< CbmStsDigi > * fvDigiSts
std::vector< std::pair< std::string, std::string > > fvpsCanvasConfig
std::vector< CbmTofDigi > * fvDigiTof
bool HandleCommand(FairMQMessagePtr &, int)
TObjArray fArrayHisto
Array of histograms to send to the histogram server.
std::vector< std::string > fsAllowedChannels
List of MQ channels names.
CbmTsEventHeader * fCbmTsEventHeader
Total size of all MS in a TS, [nanoseconds].
Double_t fdTsFullSizeInNs
Total size of the overlap MS in a TS, [nanoseconds].
std::vector< std::pair< std::string, std::string > > fvpsHistosFolder
Vector of string pairs with ( HistoName, FolderPath ) to send to the histogram server.
TClonesArray * fTimeSliceMetaDataArray
TS MetaData storage.
std::chrono::system_clock::time_point fLastPublishTime
std::vector< std::string > fvsSetTrigMaxNb
Double_t fdTsOverSizeInNs
Total size of the core MS in a TS, [nanoseconds].
uint64_t fulNumMessages
Statistics & first TS rejection.
std::vector< std::string > fvsDelDet
bool fbConfigSent
Flag indicating whether the histograms and canvases configurations were already published.
RawEventBuilderDetector GetDetectorBuilderCfg(std::string detName)
Get detector event builder config from string containing name.
bool SendEvents(FairMQParts &partsIn)
Double_t fdTsCoreSizeInNs
Size of a single MS, [nanoseconds].
bool IsChannelNameAllowed(std::string channelName)
Check wether an MQ channel name is among those expected for this device.