1 #ifndef EventFilter_L1TRawToDigi_AMC_SPEC__h 2 #define EventFilter_L1TRawToDigi_AMC_SPEC__h 19 BlockHeader(
unsigned int amc_no,
unsigned int board_id,
unsigned int size,
unsigned int block=0);
63 Header(
unsigned int amc_no,
unsigned int lv1_id,
unsigned int bx_id,
unsigned int size,
64 unsigned int or_n,
unsigned int board_id,
unsigned int user);
68 inline unsigned int getLV1ID()
const {
return (data0_ >> LV1ID_shift) & LV1ID_mask; };
69 inline unsigned int getBX()
const {
return (data0_ >> BX_shift) & BX_mask; };
70 inline unsigned int getOrbitNumber()
const {
return (data1_ >> OrN_shift) & OrN_mask; };
72 inline unsigned int getUserData()
const {
return (data1_ >> User_shift) & User_mask; };
74 std::vector<uint64_t>
raw()
const {
return {data0_, data1_}; };
79 static const unsigned int BX_shift = 20;
80 static const unsigned int BX_mask = 0xfff;
81 static const unsigned int LV1ID_shift = 32;
82 static const unsigned int LV1ID_mask = 0xffffff;
88 static const unsigned int OrN_shift = 16;
89 static const unsigned int OrN_mask = 0xffff;
90 static const unsigned int User_shift = 32;
91 static const unsigned int User_mask = 0xffffffff;
101 Trailer(
unsigned int crc,
unsigned int lv1_id,
unsigned int size);
103 inline unsigned int getCRC()
const {
return (
data_ >> CRC_shift) & CRC_mask; };
104 inline unsigned int getLV1ID()
const {
return (
data_ >> LV1ID_shift) & LV1ID_mask; };
108 bool check(
unsigned int crc,
unsigned int lv1_id,
unsigned int size,
bool mtf7_mode=
false)
const;
115 static const unsigned int LV1ID_shift = 24;
116 static const unsigned int LV1ID_mask = 0xff;
117 static const unsigned int CRC_shift = 32;
118 static const unsigned int CRC_mask = 0xffffffff;
126 Packet(
unsigned int amc,
unsigned int board,
unsigned int lv1id,
unsigned int orbit,
unsigned int bx,
const std::vector<uint64_t>&
load,
unsigned int user=0);
129 void addPayload(
const uint64_t*,
unsigned int);
133 void finalize(
unsigned int lv1,
unsigned int bx,
bool legacy_mc=
false,
bool mtf7_mode=
false);
135 std::vector<uint64_t>
block(
unsigned int id)
const;
136 std::unique_ptr<uint64_t[]>
data();
141 inline unsigned int blocks()
const {
return block_header_.getBlocks(); };
143 inline unsigned int size()
const {
return payload_.size() - 3; };
unsigned int getLV1ID() const
unsigned int getSize() const
unsigned int getCRC() const
static const unsigned int split_block_size
BlockHeader blockHeader(unsigned int block=0) const
unsigned int size() const
unsigned long long uint64_t
char data[epos_bytes_allocation]
Trailer(const uint64_t *data)
Packet(const uint64_t *d)
unsigned int blocks() const
std::vector< uint64_t > payload_