12#include <fairlogger/Logger.h>
14#define ASIO_CATCH(customMessage) \
15 catch (boost::system::system_error & err) \
17 auto msg = std::string{err.what()}; \
18 auto code = std::to_string(err.code().value()); \
19 throw std::runtime_error{"Exception in DataInspector (boost_code=" + code + ", boost_msg=" + msg + ") - " + customMessage}; \
22DIMessage::Header::Type DIMessage::Header::type()
const
24 return static_cast<DIMessage::Header::Type
>(boost::endian::little_to_native(typeLE));
27uint64_t DIMessage::Header::payloadSize()
const
29 return boost::endian::little_to_native(payloadSizeLE);
34 this->payload =
new char[
other.header.payloadSize()];
35 std::memcpy(this->payload,
other.payload,
other.header.payloadSize());
47 this->payload =
new char[
other.header.payloadSize()];
48 std::memcpy(this->payload,
other.payload,
other.header.payloadSize());
55 other.payload =
nullptr;
62 payload =
other.payload;
64 other.payload =
nullptr;
76 auto ip_address = boost::asio::ip::make_address(
address);
77 socket.connect(boost::asio::ip::tcp::endpoint(ip_address, port));
89 return socket.available() >=
sizeof(DIMessage::Header);
95 socket.send(std::array<boost::asio::const_buffer, 2>{
96 boost::asio::buffer(&
message.header,
sizeof(DIMessage::Header)),
97 boost::asio::buffer(
message.payload,
message.header.payloadSize())});
106 socket.receive(boost::asio::buffer(&
message.header,
sizeof(DIMessage::Header)));
108 if (
message.header.payloadSize() > 0) {
110 socket.receive(boost::asio::buffer(
message.payload,
message.header.payloadSize()));
#define ASIO_CATCH(customMessage)
std::vector< std::string > header
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events Show standalone event Run event generator maximum time bin of continuous for triggered for automatic continuous for automatic continuous triggered uint64_t
bool isMessageAvailable()
void send(const DIMessage &message)
DISocket(const std::string &address, int port)
GLuint GLuint64EXT address
GLuint GLsizei const GLchar * message
DIMessage & operator=(const DIMessage &other) noexcept
VectorOfTObjectPtrs other