11 #include <tracking/dataobjects/ROIpayload.h>
12 #include <arpa/inet.h>
13 #include <boost/crc.hpp>
15 #include <framework/logging/Logger.h>
17 #define MAGIC_WORD (0xBE12DA7A)
20 using boost::crc_optimal;
24 init(HEADER_SIZE_WITH_LENGTH + 2 * rois + 1);
41 m_data32[OFFSET_MAGIC] = htonl(MAGIC_WORD);
42 m_data32[OFFSET_LENGTH] = htonl(length);
48 unsigned int lengthInBytes =
55 m_data32[OFFSET_MAGIC] = htonl(MAGIC_WORD);
56 m_data32[OFFSET_LENGTH] = htonl(lengthInBytes);
62 unsigned int h = 0xCAFE0000;
63 if (Accepted) h |= 0x8000;
73 m_data32[OFFSET_TRIGNR] = htonl(triggerNumber);
79 rseNumber = (exp & 0x3FF) << 22 | (run & 0x3FFF) << 8 | (subrun & 0xFF) ;
80 m_data32[OFFSET_RUNNR] = htonl(rseNumber);
87 B2ERROR(
"Adding too many ROIs to the ROIpayload." << std::endl <<
88 "Something really fishy is going on");
101 B2ERROR(
"No space left on the ROI payload to write the CRC." << std::endl);
105 crc_optimal<32, 0x04C11DB7, 0, 0, false, false> dhh_crc_32;
107 dhh_crc_32.process_bytes((
void*)(
m_rootdata + OFFSET_HEADER),
108 HEADER_SIZE_WO_LENGTH *
sizeof(uint32_t) +
m_index *
sizeof(uint64_t));