16 LogDebug(
"L1T") <<
"Block ID = " <<
block.header().getID() <<
" size = " <<
block.header().getSize()
17 <<
" AMC = " <<
block.amc().getAMCNumber();
21 unsigned int bxid =
block.amc().getBX();
25 LogDebug(
"L1T") <<
"Unpacking TMT # " << tmt <<
" for BX " << bxid;
32 res1_->setBXRange(0, 0);
33 res2_->setBXRange(0, 0);
34 res3_->setBXRange(0, 0);
35 res4_->setBXRange(0, 0);
41 int unsigned ftau = 6;
42 int unsigned fjet = 8;
43 int unsigned faux = 10;
49 uint32_t raw_data =
block.payload()[fet];
53 switch (
block.header().getID()) {
56 ethf.
setHwPt(static_cast<int32_t>(uint32_t(raw_data & 0xFFFF)));
60 ethf.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
64 ethf.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
68 ethf.
setHwPt(static_cast<int32_t>(uint32_t(raw_data & 0xFFFF)));
72 ethf.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
76 ethf.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
84 res2_->push_back(0, ethf);
88 raw_data =
block.payload()[fet + 1];
92 switch (
block.header().getID()) {
95 etNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data & 0xFFFF)));
99 etNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
103 etNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
107 etNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data & 0xFFFF)));
111 etNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
115 etNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
121 LogDebug(
"L1T") <<
"ET/METx/METy (no HF): pT " << etNoHF.
hwPt();
123 res2_->push_back(0, etNoHF);
126 if (
block.header().getID() == 123 ||
block.header().getID() == 125) {
128 etEm.setHwPt(static_cast<int32_t>(uint32_t((raw_data >> 16) & 0xFFFF)));
129 res2_->push_back(0, etEm);
134 raw_data =
block.payload()[fht];
138 switch (
block.header().getID()) {
141 hthf.
setHwPt(static_cast<int32_t>(uint32_t(raw_data & 0xFFFF)));
145 hthf.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
149 hthf.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
153 hthf.
setHwPt(static_cast<int32_t>(uint32_t(raw_data & 0xFFFF)));
157 hthf.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
161 hthf.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
167 LogDebug(
"L1T") <<
"HTHF/MHTHFx/MHTHFy: pT " << hthf.
hwPt();
169 res2_->push_back(0, hthf);
173 raw_data =
block.payload()[fht + 1];
177 switch (
block.header().getID()) {
180 htNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data & 0xFFFF)));
184 htNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
188 htNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
192 htNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data & 0xFFFF)));
196 htNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
200 htNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
206 LogDebug(
"L1T") <<
"HTNOHF/MHTNOHFx/MHTNOHFy: pT " << htNoHF.
hwPt();
208 res2_->push_back(0, htNoHF);
211 for (
unsigned nJet = 0; nJet < 2; nJet++) {
212 raw_data =
block.payload()[fjet + nJet];
220 if ((
block.header().getID() == 125) || (
block.header().getID() == 131) || (
block.header().getID() == 129)) {
224 LogDebug(
"L1") <<
"block ID=" <<
block.header().getID() <<
" etasign=" << etasign;
226 int mpEta = etasign * (raw_data & 0x3F);
228 jet.setHwPhi((raw_data >> 6) & 0x7F);
229 jet.setHwPt((raw_data >> 13) & 0xFFFF);
230 jet.setHwQual((raw_data >> 29) & 0x1);
235 LogDebug(
"L1T") <<
"Jet: eta " <<
jet.hwEta() <<
" phi " <<
jet.hwPhi() <<
" pT " <<
jet.hwPt() <<
" qual " 239 res1_->push_back(0,
jet);
246 for (
unsigned nEG = 0; nEG < 2; nEG++) {
247 raw_data =
block.payload()[feg + nEG];
255 if ((
block.header().getID() == 125) || (
block.header().getID() == 131) || (
block.header().getID() == 129)) {
259 LogDebug(
"L1") <<
"block ID=" <<
block.header().getID() <<
" etasign=" << etasign;
261 eg.
setHwEta(etasign * ((raw_data >> 3) & 0x3F));
262 eg.
setHwPhi((raw_data >> 9) & 0x7F);
263 eg.
setHwPt((raw_data >> 20) & 0xFFF);
270 LogDebug(
"L1T") <<
"Egamma: eta " << eg.
hwEta() <<
" phi " << eg.
hwPhi() <<
" pT " << eg.
hwPt() <<
" qual " 274 res3_->push_back(0, eg);
281 for (
unsigned nTau = 0; nTau < 2; nTau++) {
282 raw_data =
block.payload()[ftau + nTau];
290 if ((
block.header().getID() == 125) || (
block.header().getID() == 131) || (
block.header().getID() == 129)) {
294 LogDebug(
"L1") <<
"block ID=" <<
block.header().getID() <<
" etasign=" << etasign;
296 tau.setHwEta(etasign * ((raw_data >> 3) & 0x3F));
297 tau.setHwPhi((raw_data >> 9) & 0x7F);
298 tau.setHwPt((raw_data >> 20) & 0xFFF);
299 tau.setHwIso((raw_data >> 1) & 0x3);
300 tau.setHwQual((raw_data >> 16) & 0xf);
305 LogDebug(
"L1T") <<
"Tau: eta " <<
tau.hwEta() <<
" phi " <<
tau.hwPhi() <<
" pT " <<
tau.hwPt() <<
" qual " 309 res4_->push_back(0,
tau);
313 raw_data =
block.payload()[faux];
318 switch (
block.header().getID()) {
323 mbp0.setHwPt((raw_data >> 24) & 0xF);
327 mbm0.setHwPt((raw_data >> 16) & 0xF);
331 mbp1.setHwPt((raw_data >> 8) & 0xF);
335 mbm1.setHwPt(raw_data & 0xF);
337 LogDebug(
"L1T") <<
"mbp0 HF sum: " << mbp0.hwPt();
338 LogDebug(
"L1T") <<
"mbm0 HF sum: " << mbm0.hwPt();
339 LogDebug(
"L1T") <<
"mbp1 HF sum: " << mbp1.hwPt();
340 LogDebug(
"L1T") <<
"mbm1 HF sum: " << mbm1.hwPt();
342 res2_->push_back(0, mbp0);
343 res2_->push_back(0, mbm0);
344 res2_->push_back(0, mbp1);
345 res2_->push_back(0, mbm1);
350 towCount.setHwPt(raw_data & 0x1FFF);
351 res2_->push_back(0, towCount);
bool unpack(const Block &block, UnpackerCollections *coll) override
void setType(EtSumType type)
const unsigned int offsetBoardId
#define DEFINE_L1T_UNPACKER(type)
void setP4(const LorentzVector &p4) final
set 4-momentum