16 LogDebug(
"L1T") <<
"Block ID = " <<
block.header().getID() <<
" size = " <<
block.header().getSize()
17 <<
" AMC = " <<
block.amc().getAMCNumber();
21 const 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);
38 const int unsigned fet = 0;
39 const int unsigned fht = 2;
40 const int unsigned feg = 4;
41 const int unsigned ftau = 6;
42 const int unsigned fjet = 8;
43 const 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);
127 raw_data =
block.payload()[fht];
131 switch (
block.header().getID()) {
134 hthf.
setHwPt(static_cast<int32_t>(uint32_t(raw_data & 0xFFFF)));
138 hthf.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
142 hthf.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
146 hthf.
setHwPt(static_cast<int32_t>(uint32_t(raw_data & 0xFFFF)));
150 hthf.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
154 hthf.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
160 LogDebug(
"L1T") <<
"HTHF/MHTHFx/MHTHFy: pT " << hthf.
hwPt();
162 res2_->push_back(0, hthf);
166 raw_data =
block.payload()[fht + 1];
170 switch (
block.header().getID()) {
173 htNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data & 0xFFFF)));
177 htNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
181 htNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
185 htNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data & 0xFFFF)));
189 htNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
193 htNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
199 LogDebug(
"L1T") <<
"HTNOHF/MHTNOHFx/MHTNOHFy: pT " << htNoHF.
hwPt();
201 res2_->push_back(0, htNoHF);
204 for (
unsigned nJet = 0; nJet < 2; nJet++) {
205 raw_data =
block.payload()[fjet + nJet];
213 if ((
block.header().getID() == 125) || (
block.header().getID() == 131) || (
block.header().getID() == 129)) {
217 LogDebug(
"L1") <<
"block ID=" <<
block.header().getID() <<
" etasign=" << etasign;
219 int mpEta = etasign * (raw_data & 0x3F);
221 jet.setHwPhi((raw_data >> 6) & 0x7F);
222 jet.setHwPt((raw_data >> 13) & 0xFFFF);
223 jet.setHwQual((raw_data >> 29) & 0x1);
228 LogDebug(
"L1T") <<
"Jet: eta " <<
jet.hwEta() <<
" phi " <<
jet.hwPhi() <<
" pT " <<
jet.hwPt() <<
" qual " 232 res1_->push_back(0,
jet);
239 for (
unsigned nEG = 0; nEG < 2; nEG++) {
240 raw_data =
block.payload()[feg + nEG];
248 if ((
block.header().getID() == 125) || (
block.header().getID() == 131) || (
block.header().getID() == 129)) {
252 LogDebug(
"L1") <<
"block ID=" <<
block.header().getID() <<
" etasign=" << etasign;
254 eg.
setHwEta(etasign * ((raw_data >> 3) & 0x3F));
255 eg.
setHwPhi((raw_data >> 9) & 0x7F);
256 eg.
setHwPt((raw_data >> 20) & 0xFFF);
263 LogDebug(
"L1T") <<
"Egamma: eta " << eg.
hwEta() <<
" phi " << eg.
hwPhi() <<
" pT " << eg.
hwPt() <<
" qual " 267 res3_->push_back(0, eg);
274 for (
unsigned nTau = 0; nTau < 2; nTau++) {
275 raw_data =
block.payload()[ftau + nTau];
283 if ((
block.header().getID() == 125) || (
block.header().getID() == 131) || (
block.header().getID() == 129)) {
287 LogDebug(
"L1") <<
"block ID=" <<
block.header().getID() <<
" etasign=" << etasign;
289 tau.setHwEta(etasign * ((raw_data >> 3) & 0x3F));
290 tau.setHwPhi((raw_data >> 9) & 0x7F);
291 tau.setHwPt((raw_data >> 20) & 0xFFF);
292 tau.setHwIso((raw_data >> 1) & 0x3);
293 tau.setHwQual((raw_data >> 16) & 0xf);
298 LogDebug(
"L1T") <<
"Tau: eta " <<
tau.hwEta() <<
" phi " <<
tau.hwPhi() <<
" pT " <<
tau.hwPt() <<
" qual " 302 res4_->push_back(0,
tau);
308 if (
block.header().getSize() > faux) {
310 raw_data =
block.payload()[faux];
313 switch (
block.header().getID()) {
318 mbp0.setHwPt((raw_data >> 24) & 0xF);
322 mbm0.setHwPt((raw_data >> 16) & 0xF);
326 mbp1.setHwPt((raw_data >> 8) & 0xF);
330 mbm1.setHwPt(raw_data & 0xF);
332 LogDebug(
"L1T") <<
"mbp0 HF sum: " << mbp0.hwPt();
333 LogDebug(
"L1T") <<
"mbm0 HF sum: " << mbm0.hwPt();
334 LogDebug(
"L1T") <<
"mbp1 HF sum: " << mbp1.hwPt();
335 LogDebug(
"L1T") <<
"mbm1 HF sum: " << mbm1.hwPt();
337 res2_->push_back(0, mbp0);
338 res2_->push_back(0, mbm0);
339 res2_->push_back(0, mbp1);
340 res2_->push_back(0, mbm1);
void setType(EtSumType type)
const unsigned int offsetBoardId
bool unpack(const Block &block, UnpackerCollections *coll) override
#define DEFINE_L1T_UNPACKER(type)
void setP4(const LorentzVector &p4) final
set 4-momentum