 |
Belle II Software
release-05-01-25
|
10 #include <daq/hbasf2/apps/ZMQHistogramServer.h>
11 #include <framework/pcore/zmq/connections/ZMQConfirmedConnection.h>
12 #include <daq/hbasf2/connections/ZMQHistogramConnection.h>
29 (
"input", boost::program_options::value<std::string>(&
m_inputAddress)->required(),
30 "where to read the events from")
33 "name of the shared memory")
34 (
"rootFileName", boost::program_options::value<std::string>(&
m_rootFileName)->required(),
35 "name of the ROOT file - can include {run_number} or {experiment_number}")
36 (
"timeout", boost::program_options::value<unsigned int>(&
m_timeout)->default_value(
m_timeout),
37 "how many seconds to wait between histogram dumps")
38 (
"maximalUncompressedBufferSize",
41 "size of the uncompress buffer");
46 if (type == EMessageTypes::c_newRunMessage) {
50 }
else if (type == EMessageTypes::c_lastEventMessage) {
51 auto message =
m_input->overwriteStopMessage();
53 m_output->handleEvent(std::move(message));
61 auto message =
m_input->handleIncomingData();
63 if (message->isMessage(EMessageTypes::c_terminateMessage)) {
67 m_output->handleEvent(std::move(message));
87 (
"input", boost::program_options::value<std::string>(&
m_inputAddress)->required(),
88 "where to read the events from")
89 (
"output", boost::program_options::value<std::string>(&
m_outputAddress)->required(),
90 "where to send the events to")
91 (
"timeout", boost::program_options::value<unsigned int>(&
m_timeout)->default_value(30),
92 "how many seconds to wait between histogram dumps")
93 (
"maximalUncompressedBufferSize",
96 "size of the uncompress buffer");
101 if (type == EMessageTypes::c_newRunMessage) {
105 }
else if (type == EMessageTypes::c_lastEventMessage) {
106 auto message =
m_input->overwriteStopMessage();
108 m_output->handleEvent(std::move(message));
116 auto message =
m_input->handleIncomingData();
118 if (message->isMessage(EMessageTypes::c_terminateMessage)) {
122 m_output->handleEvent(std::move(message));
142 (
"input", boost::program_options::value<std::string>(&
m_inputAddress)->required(),
143 "where to read the events from")
144 (
"output", boost::program_options::value<std::string>(&
m_outputAddress)->required(),
145 "where to send the events to")
146 (
"timeout", boost::program_options::value<unsigned int>(&
m_timeout)->default_value(30),
147 "how many seconds to wait between histogram dumps")
148 (
"maximalUncompressedBufferSize",
151 "size of the uncompress buffer");
156 if (type == EMessageTypes::c_newRunMessage) {
160 }
else if (type == EMessageTypes::c_lastEventMessage) {
161 auto message =
m_input->overwriteStopMessage();
163 m_output->handleEvent(std::move(message));
171 auto message =
m_input->handleIncomingData();
173 if (message->isMessage(EMessageTypes::c_terminateMessage)) {
177 m_output->handleEvent(std::move(message));
unsigned int m_maximalUncompressedBufferSize
Parameter: size of the temporary internal compression buffer.
std::string m_sharedMemoryName
Parameter: name of the shared memory (or empty)
std::string m_inputAddress
Parameter: input address.
std::unique_ptr< ZMQHistoServerToFile > m_output
Pointer to the output connection. Should be set in initialize.
void handleExternalSignal(EMessageTypes type) final
Merge on stop (even if not all clients have stopped) or clear the counters on start from the monitori...
EMessageTypes
Type the messages can have.
std::string m_rootFileName
Parameter: name of the root file - can include {run_number} or {experiment_number}.
void initialize() final
Initialize the two connections using the command line arguments.
void initialize() final
Initialize the two connections using the command line arguments.
std::string m_outputAddress
Parameter: output address.
void handleTimeout() final
Call the mergeAndSend function on timeout.
void initialize() final
Initialize the two connections using the command line arguments.
bool m_terminate
Can be set by functions to terminate the main loop at the next possibility.
void handleInput() final
Pass the message from the input connection to the histogram storage.
std::shared_ptr< ZMQParent > m_parent
Pointer to the ZMQParent to be used as base for all connections.
void handleExternalSignal(EMessageTypes type) final
Merge on stop (even if not all clients have stopped) or clear the counters on start from the monitori...
void handleTimeout() final
Call the mergeAndSend function on timeout.
virtual void addOptions(po::options_description &desc)
Override in a derived class to add the command line arguments. Do not forget to call this base functi...
void handleExternalSignal(EMessageTypes type) final
Merge on stop (even if not all clients have stopped) or clear the counters on start from the monitori...
Abstract base class for different kinds of events.
void handleTimeout() final
Call the mergeAndSend function on timeout.
std::string m_inputAddress
Parameter: input address.
unsigned int m_maximalUncompressedBufferSize
Parameter: size of the temporary internal compression buffer.
void addOptions(po::options_description &desc) final
Add the parameters to the cmd line arguments.
unsigned int m_maximalUncompressedBufferSize
Parameter: size of the temporary internal compression buffer.
void addOptions(po::options_description &desc) final
Add the parameters to the cmd line arguments.
void handleInput() final
Pass the message from the input connection to the histogram storage.
std::string m_inputAddress
Parameter: input address.
void handleInput() final
Pass the message from the input connection to the histogram storage.
void addOptions(po::options_description &desc) final
Add the parameters to the cmd line arguments.
virtual void initialize()
Override in a derived class to initialize the connections from the given command line arguments....
unsigned int m_timeout
If set to a value != 0, will call handleTimeout with this frequency (in seconds).
std::unique_ptr< ZMQConfirmedInput > m_input
Pointer to the input connection. Should be set in initialize.
Add the common functionality to the histogram output classes.
std::string m_outputAddress
Parameter: output address.