4 #ifndef MVTXDECODER_UTILS_H
5 #define MVTXDECODER_UTILS_H
13 #define clean_errno() (errno == 0 ? "None" : strerror(errno))
14 #define log_error std::cerr << "[ERROR] (" << __FILE__ << ":" << __LINE__ << ":errno: " << clean_errno()
46 flxId = *(
reinterpret_cast<const uint8_t*
>(rdh_ptr + 23) ) & 0xFF;
47 pageSize = *(
reinterpret_cast<const uint16_t*
>(rdh_ptr + 25) ) & 0x7FF;
48 gbtLink = *(
reinterpret_cast<const uint16_t*
>(rdh_ptr + 28) ) & 0x7FF;
49 flxHdrSize = *(
reinterpret_cast<const uint16_t*
>(rdh_ptr + 29) ) & 0x7FF;
50 flxHdrVersion = *(
reinterpret_cast<const uint16_t*
>(rdh_ptr + 30) ) & 0xFFFF;
52 rdhVersion = *(
reinterpret_cast<const uint8_t*
>(rdh_ptr + 32) ) & 0xFF;
53 rdhSize = *(
reinterpret_cast<const uint8_t*
>(rdh_ptr + 33) ) & 0xFF;
54 feeId = *(
reinterpret_cast<const uint16_t*
>(rdh_ptr + 34) ) & 0xFFFF;
55 sourceId = *(
reinterpret_cast<const uint8_t*
>(rdh_ptr + 36) ) & 0xFF;
56 detectorField = *(
reinterpret_cast<const uint32_t*
>(rdh_ptr + 37) ) & 0xFFFFFFFF;
57 bc = *(
reinterpret_cast<const uint16_t*
>(rdh_ptr + 42) ) & 0xFFF;
58 orbit = *(
reinterpret_cast<const uint64_t*
>(rdh_ptr + 46) ) & 0xFFFFFFFFFF;
59 trgType = *(
reinterpret_cast<const uint32_t*
>(rdh_ptr + 52) ) & 0xFFFFFFFF;
60 packetCounter = *(
reinterpret_cast<const uint16_t*
>(rdh_ptr + 56) ) & 0xFFFF;
61 stopBit = *(
reinterpret_cast<const uint8_t*
>(rdh_ptr + 58) ) & 0xFF;
62 priority = *(
reinterpret_cast<const uint8_t*
>(rdh_ptr + 59) ) & 0xFF;
63 rdhGBTcounter = *(
reinterpret_cast<const uint16_t*
>(rdh_ptr + 62) ) & 0xFFFF;
67 template <
typename A,
typename B >
70 return a.second < b.second;