10#include <framework/pcore/zmq/connections/ZMQConnection.h>
11#include <daq/hbasf2/utils/HistogramMapping.h>
13#include <framework/pcore/zmq/connections/ZMQNullConnection.h>
14#include <framework/pcore/zmq/connections/ZMQConfirmedConnection.h>
15#include <framework/pcore/zmq/connections/ZMQRawConnection.h>
17#include <framework/pcore/zmq/messages/ZMQIdMessage.h>
19#include <framework/pcore/EvtMessage.h>
20#include <daq/dqm/DqmSharedMem.h>
55 const std::string& dqmFileName,
56 const std::string& rootFileName);
59 void mergeAndSend(
const std::map<std::string, HistogramMapping>& storedMessages,
const std::optional<unsigned int>& experiment,
60 const std::optional<unsigned int>& run,
66 std::vector<zmq::socket_t*>
getSockets()
const final;
94 void mergeAndSend(
const std::map<std::string, HistogramMapping>& storedMessages,
const std::optional<unsigned int>& experiment,
95 const std::optional<unsigned int>& run,
133 void mergeAndSend(
const std::map<std::string, HistogramMapping>& storedMessages,
const std::optional<unsigned int>& experiment,
134 const std::optional<unsigned int>& run,
Output part of a confirmed connection.
void handleIncomingData()
Blocks until it can receive the (hopefully confirmation) message from the output.
std::string getEndPoint() const
Return the connection string for this socket.
std::vector< zmq::socket_t * > getSockets() const final
The socket used for polling is just the stored socket.
Base class for every connection with virtual functions to be implemented:
virtual bool isReady() const
Return true of this connection is able to send messages right now. Can be overloaded in derived class...
Output histograms into a ROOT file and shared memory after merging.
std::string m_rootFileName
Output file name (possible with placeholders)
DqmSharedMem * m_sharedMemory
The SHM file. Please note that we do not call its destructor on purpose.
std::string getEndPoint() const
Return the connection string.
void handleIncomingData()
There should be never incoming data, so raise an exception if called anyways.
std::string m_dqmMemFileName
Name of the shared memory.
void mergeAndSend(const std::map< std::string, HistogramMapping > &storedMessages, const std::optional< unsigned int > &experiment, const std::optional< unsigned int > &run, EMessageTypes messageType)
Merge the given histograms into a single set of histograms and store them to file/shm.
void clear()
Clear the shared memory.
std::vector< zmq::socket_t * > getSockets() const final
No sockets to poll on, so return an empty list.
Same as ZMQHistoServerToZMQOutput just send uncompressed to a raw output.
std::string getEndPoint() const
Return the connection string.
void handleIncomingData()
The input data handling is passed from the ZMQRawOutput.
ZMQRawOutput m_output
The output connection used for sending the histograms.
void mergeAndSend(const std::map< std::string, HistogramMapping > &storedMessages, const std::optional< unsigned int > &experiment, const std::optional< unsigned int > &run, EMessageTypes messageType)
Merge the histograms and send them via the connection. Stop/Terminate messages are not sent.
bool isReady() const override
The is ready is passed from the ZMQRawOutput.
std::string getMonitoringJSON() const final
The monitoring JSON is just passed from the ZMQRawOutput.
void clear()
Nothing to do on clear.
std::vector< zmq::socket_t * > getSockets() const final
The sockets are passed from ZMQRawOutput.
Send the histograms as compressed byte stream via a ZMQConfirmedOutput connection after merging with ...
ZMQConfirmedOutput m_output
The output connection used for sending the histograms.
std::string getEndPoint() const
Return the connection string.
std::vector< char > m_outputBuffer
Buffer used for compression.
void handleIncomingData()
The input data handling is passed from the ZMQConfirmedOutput.
void mergeAndSend(const std::map< std::string, HistogramMapping > &storedMessages, const std::optional< unsigned int > &experiment, const std::optional< unsigned int > &run, EMessageTypes messageType)
Merge the histograms and send them via the connection. Stop/Terminate messages are sent after that.
unsigned int m_maximalCompressedSize
Maximal size of the compression buffer.
bool isReady() const override
The is ready is passed from the ZMQConfirmedOutput.
std::string getMonitoringJSON() const final
The monitoring JSON is just passed from the ZMQConfirmedOutput.
void clear()
Nothing to do on clear.
std::vector< zmq::socket_t * > getSockets() const final
The sockets are passed from ZMQConfirmedOutput.
virtual std::string getMonitoringJSON() const
Convert the stored monitoring values to a JSON string ready for sending out via a message.
Output connection to speak to non-zmq sockets via a ZMQ_STREAM socket.
void handleIncomingData()
Handle incoming data: a socket (dis)connect.
bool isReady() const final
If no socket is connected, this connection is not ready.
EMessageTypes
Type the messages can have.
Abstract base class for different kinds of events.