Files
sf_daq_buffer/sf-stream/include/ZmqPulseSyncReceiver.hpp
babic_a 2937326dbf Return n_lost_pulses in sync from receiver
In order to have proper statistics we need to return the
number of lost pulses from the receiver. We cannot just count
the gap in pulse_id as the beam might be operated at
different frequencies.
2021-01-15 10:59:43 +01:00

35 lines
636 B
C++

#ifndef SF_DAQ_BUFFER_ZMQPULSESYNCRECEIVER_HPP
#define SF_DAQ_BUFFER_ZMQPULSESYNCRECEIVER_HPP
#include <cstddef>
#include <string>
#include <vector>
#include "formats.hpp"
struct PulseAndSync {
const uint64_t pulse_id;
const uint32_t n_lost_pulses;
};
class ZmqPulseSyncReceiver {
void* ctx_;
const int n_modules_;
std::vector<void*> sockets_;
public:
ZmqPulseSyncReceiver(
void* ctx,
const std::string& detector_name,
const int n_modules);
~ZmqPulseSyncReceiver();
PulseAndSync get_next_pulse_id() const;
};
#endif //SF_DAQ_BUFFER_ZMQPULSESYNCRECEIVER_HPP