14 unsigned int max_block_no = 0;
16 max_block_no = (size - 1023) / 4096;
18 if (block != max_block_no)
41 }
else if (block == 0) {
61 return (size - 1023) / 4096 + 1;
77 unsigned int or_n,
unsigned int board_id,
unsigned int user) :
79 (
uint64_t(amc_no & AmcNo_mask) << AmcNo_shift) |
80 (
uint64_t(lv1_id & LV1ID_mask) << LV1ID_shift) |
81 (
uint64_t(bx_id & BX_mask) << BX_shift) |
82 (
uint64_t(size & Size_mask) << Size_shift)
85 (
uint64_t(or_n & OrN_mask) << OrN_shift) |
86 (
uint64_t(board_id & BoardID_mask) << BoardID_shift) |
87 (
uint64_t(user & User_mask) << User_shift)
94 (
uint64_t(crc & CRC_mask) << CRC_shift) |
95 (
uint64_t(lv1_id & LV1ID_mask) << LV1ID_shift) |
96 (
uint64_t(size & Size_mask) << Size_shift)
106 <<
"Found AMC trailer with:"
108 <<
", CRC " << std::hex << std::setw(8) << std::setfill(
'0') <<
getCRC() <<
std::dec
110 <<
"\n\tLV1 ID " << (lv1_id &
LV1ID_mask) <<
", size " << size
111 <<
", CRC " << std::hex << std::setw(8) << std::setfill(
'0') << crc;
120 std::string dstring(reinterpret_cast<const char*>(start), reinterpret_cast<const char*>(end) + 4);
126 Packet::Packet(
unsigned int amc,
unsigned int board,
unsigned int lv1id,
unsigned int orbit,
unsigned int bx,
const std::vector<uint64_t>&
load) :
127 block_header_(amc, board, load.
size() + 3),
128 header_(amc, lv1id, bx, load.
size() + 3, orbit, board, 0),
129 trailer_(0, lv1id, load.
size() + 3)
166 std::vector<uint64_t>
178 std::unique_ptr<uint64_t[]>
183 for (
unsigned int i = 0;
i <
payload_.size() - 3; ++
i)
unsigned int getLV1ID() const
static const unsigned int CRC_mask
tuple start
Check for commandline option errors.
unsigned int getSize() const
static void writeCRC(const uint64_t *start, uint64_t *end)
unsigned int getCRC() const
BlockHeader block_header_
std::vector< uint64_t > block(unsigned int id) const
static const unsigned int CRC_shift
void addPayload(const uint64_t *, unsigned int)
bool check(const std::string &)
static const unsigned int split_block_size
unsigned int size() const
static const unsigned int LV1ID_mask
unsigned long long uint64_t
char data[epos_bytes_allocation]
std::unique_ptr< uint64_t[]> data()
void finalize(unsigned int lv1, unsigned int bx, bool legacy_mc=false)
Packet(const uint64_t *d)
tuple size
Write out results.
bool check(unsigned int crc, unsigned int lv1_id, unsigned int size) const
std::vector< uint64_t > payload_