 |
Belle II Software
release-05-01-25
|
12 #include <daq/hbasf2/connections/ZMQHistogramConnection.h>
13 #include <daq/hbasf2/utils/HistogramMapping.h>
15 #include <framework/pcore/zmq/messages/ZMQIdMessage.h>
17 #include <framework/pcore/EvtMessage.h>
18 #include <daq/dqm/DqmMemFile.h>
20 #include <TBufferJSON.h>
57 template<
class AConnectionClass>
58 class ZMQHistogramOutput :
public AConnectionClass {
61 template<
class... Args>
65 void handleEvent(std::unique_ptr<ZMQIdMessage> message);
86 template<
class AConnectionClass>
87 template<
class... Args>
89 Args&& ... args) : AConnectionClass(std::forward<Args>(args)...), m_maximalUncompressedBufferSize(
90 maximalUncompressedBufferSize)
92 m_uncompressedBuffer.reserve(m_maximalUncompressedBufferSize);
94 AConnectionClass::log(
"uncompressed_size", 0.0);
95 AConnectionClass::log(
"stored_identities", 0l);
96 AConnectionClass::log(
"histogram_clears", 0l);
97 AConnectionClass::log(
"last_clear",
"");
std::vector< char > m_uncompressedBuffer
The buffer used during decompression.
EMessageTypes
Type the messages can have.
Abstract base class for different kinds of events.
std::map< std::string, HistogramMapping > m_storedMessages
The stored histograms for each sender identity.
std::optional< unsigned int > m_storedExperiment
If already received: the experiment number of the data (on mismatch, everything is cleared)
unsigned int m_maximalUncompressedBufferSize
Paramter for the buffer size (needed during decompression)
void handleEvent(std::unique_ptr< ZMQIdMessage > message)
Handle a new message to be "sent" (what this means is up to the base class) as described above.
std::optional< unsigned int > m_storedRun
If already received: the run number of the data (on mismatch, everything is cleared)
ZMQHistogramOutput(unsigned int maximalUncompressedBufferSize, Args &&... args)
Perfectly forward the given arguments to the base class initializer (and init the buffer size)
void mergeAndSend(EMessageTypes messageType=EMessageTypes::c_eventMessage)
Forward a merge call to the base class handing over the stored messages.
void clear()
Forward a clear call to the base class and clear the stored messages. Should be called on run start.
Add the common functionality to the histogram output classes.