16 using namespace l1t::stage2::layer2;
25 int firstBX = -(
ceil((
double)nBX / 2.) - 1);
28 lastBX =
ceil((
double)nBX / 2.);
30 lastBX =
ceil((
double)nBX / 2.) - 1;
34 res_->setBXRange(firstBX, lastBX);
36 LogDebug(
"L1T") <<
"nBX = " << nBX <<
" first BX = " << firstBX <<
" lastBX = " << lastBX;
39 for (
int bx = firstBX;
bx <= lastBX;
bx++) {
43 uint32_t raw_data = block.
payload().at(iFrame);
53 res_->push_back(
bx, et);
59 etem.
setHwPt((raw_data >> 12) & 0xFFF);
65 res_->push_back(
bx, etem);
70 mbp0.
setHwPt((raw_data >> 28) & 0xf);
73 res_->push_back(
bx, mbp0);
77 raw_data = block.
payload()[iFrame + 1];
87 res_->push_back(
bx, ht);
92 mbm0.
setHwPt((raw_data >> 28) & 0xf);
95 res_->push_back(
bx, mbm0);
99 raw_data = block.
payload()[iFrame + 2];
104 met.
setHwPhi((raw_data >> 12) & 0xFF);
110 res_->push_back(
bx, met);
115 mbp1.
setHwPt((raw_data >> 28) & 0xf);
118 res_->push_back(
bx, mbp1);
123 etAsym.
setHwPt((raw_data >> 20) & 0xFF);
126 res_->push_back(
bx, etAsym);
130 raw_data = block.
payload()[iFrame + 3];
135 mht.
setHwPhi((raw_data >> 12) & 0xFF);
141 res_->push_back(
bx, mht);
146 mbm1.
setHwPt((raw_data >> 28) & 0xf);
149 res_->push_back(
bx, mbm1);
154 htAsym.
setHwPt((raw_data >> 20) & 0xFF);
157 res_->push_back(
bx, htAsym);
161 raw_data = block.
payload()[iFrame + 4];
165 methf.
setHwPt(raw_data & 0xFFF);
166 methf.
setHwPhi((raw_data >> 12) & 0xFF);
170 LogDebug(
"L1T") <<
"METHF: phi " << methf.
hwPhi() <<
" pT " << methf.
hwPt() <<
" bx " <<
bx;
172 res_->push_back(
bx, methf);
177 etHFAsym.
setHwPt((raw_data >> 20) & 0xFF);
180 res_->push_back(
bx, etHFAsym);
184 uint32_t centLN = ((raw_data >> 28) & 0xF);
188 raw_data = block.
payload()[iFrame + 5];
192 mhthf.
setHwPt(raw_data & 0xFFF);
193 mhthf.
setHwPhi((raw_data >> 12) & 0xFF);
197 LogDebug(
"L1T") <<
"MHThf: phi " << mhthf.
hwPhi() <<
" pT " << mhthf.
hwPt() <<
" bx " <<
bx;
199 res_->push_back(
bx, mhthf);
204 htHFAsym.
setHwPt((raw_data >> 20) & 0xFF);
207 res_->push_back(
bx, htHFAsym);
211 uint32_t centUN = ((raw_data >> 28) & 0xF);
214 cent.
setHwPt((centUN << 4) | centLN);
217 res_->push_back(
bx, cent);
221 raw_data = block.
payload()[iFrame + 1];
224 towCount.
setHwPt((raw_data >> 12) & 0x1FFF);
228 res_->push_back(
bx, towCount);
constexpr int32_t ceil(float num)
const std::vector< uint32_t > & payload() const
const unsigned int nOutputFramePerBX
BlockHeader header() const
EtSumUnpacker_0x10010057()
void setType(EtSumType type)
bool unpack(const Block &block, UnpackerCollections *coll) override
#define DEFINE_L1T_UNPACKER(type)
void setP4(const LorentzVector &p4) final
set 4-momentum