11#ifndef O2_DISOCKET_HPP
12#define O2_DISOCKET_HPP
16#include "boost/asio.hpp"
17#include "boost/endian/conversion.hpp"
32 Header(Type
type,
uint64_t payloadSize) : typeLE(boost::endian::native_to_little(
static_cast<uint32_t>(
type))), payloadSizeLE(boost::endian::native_to_little(payloadSize)) {}
33 Header(Type
type) : Header(
type, 0) {}
34 Header() : Header(Type::INVALID, 0) {}
48 if constexpr (std::is_base_of_v<std::string, T>) {
50 this->payload =
new char[payloadSize];
51 std::memcpy(this->payload,
payload.data(), payloadSize);
52 }
else if constexpr (std::is_integral_v<T>) {
53 payloadSize =
sizeof(T);
55 this->payload =
new char[payloadSize];
56 std::memcpy(this->payload, &
payload, payloadSize);
58 static_assert(o2::framework::always_static_assert_v<T>,
"DISocket: Cannot create message of this type.");
76 if constexpr (std::is_same_v<std::string, T>) {
78 }
else if constexpr (std::is_integral_v<T>) {
79 return boost::endian::little_to_native(*((T*)
payload));
81 static_assert(o2::framework::always_static_assert_v<T>,
"DISocket: Cannot create object of this type.");
100 boost::asio::io_context ioContext;
101 boost::asio::ip::tcp::socket socket;
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)
GLuint GLuint64EXT address
GLint GLint GLsizei GLint GLenum GLenum type
GLuint GLsizei const GLchar * message
DIMessage(Header::Type type, const T &payload)
DIMessage & operator=(const DIMessage &other) noexcept
VectorOfTObjectPtrs other