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;
27 auto res1_ = static_cast<CaloCollections*>(coll)->getMPJets();
28 auto res2_ = static_cast<CaloCollections*>(coll)->getMPEtSums();
29 auto res3_ = static_cast<CaloCollections*>(coll)->getMPEGammas();
30 auto res4_ = static_cast<CaloCollections*>(coll)->getMPTaus();
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];
93 switch (
block.header().getID()) {
96 etNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data & 0xFFFF)));
100 etNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
104 etNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
108 etNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data & 0xFFFF)));
112 etNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
116 etNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
122 LogDebug(
"L1T") <<
"ET/METx/METy (no HF): pT " << etNoHF.
hwPt();
124 res2_->push_back(0, etNoHF);
127 if (
block.header().getID() == 123 ||
block.header().getID() == 125) {
129 etEm.
setHwPt(static_cast<int32_t>(uint32_t((raw_data >> 16) & 0xFFFF)));
130 res2_->push_back(0, etEm);
135 raw_data =
block.payload()[fht];
139 switch (
block.header().getID()) {
142 hthf.
setHwPt(static_cast<int32_t>(uint32_t(raw_data & 0xFFFF)));
146 hthf.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
150 hthf.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
154 hthf.
setHwPt(static_cast<int32_t>(uint32_t(raw_data & 0xFFFF)));
158 hthf.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
162 hthf.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
168 LogDebug(
"L1T") <<
"HTHF/MHTHFx/MHTHFy: pT " << hthf.
hwPt();
170 res2_->push_back(0, hthf);
174 raw_data =
block.payload()[fht + 1];
178 switch (
block.header().getID()) {
181 htNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data & 0xFFFF)));
185 htNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
189 htNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
193 htNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data & 0xFFFF)));
197 htNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
201 htNoHF.
setHwPt(static_cast<int32_t>(uint32_t(raw_data)));
207 LogDebug(
"L1T") <<
"HTNOHF/MHTNOHFx/MHTNOHFy: pT " << htNoHF.
hwPt();
209 res2_->push_back(0, htNoHF);
212 for (
unsigned nJet = 0; nJet < 2; nJet++) {
213 raw_data =
block.payload()[fjet + nJet];
221 if ((
block.header().getID() == 125) || (
block.header().getID() == 131) || (
block.header().getID() == 129)) {
225 LogDebug(
"L1") <<
"block ID=" <<
block.header().getID() <<
" etasign=" << etasign;
227 int mpEta = etasign * (raw_data & 0x3F);
229 jet.setHwPhi((raw_data >> 6) & 0x7F);
230 jet.setHwPt((raw_data >> 13) & 0xFFFF);
231 jet.setHwQual((raw_data >> 29) & 0
x1);
236 LogDebug(
"L1T") <<
"Jet: eta " <<
jet.hwEta() <<
" phi " <<
jet.hwPhi() <<
" pT " <<
jet.hwPt() <<
" qual "
240 res1_->push_back(0,
jet);
247 for (
unsigned nEG = 0; nEG < 2; nEG++) {
248 raw_data =
block.payload()[feg + nEG];
256 if ((
block.header().getID() == 125) || (
block.header().getID() == 131) || (
block.header().getID() == 129)) {
260 LogDebug(
"L1") <<
"block ID=" <<
block.header().getID() <<
" etasign=" << etasign;
262 eg.
setHwEta(etasign * ((raw_data >> 3) & 0x3F));
263 eg.
setHwPhi((raw_data >> 9) & 0x7F);
264 eg.
setHwPt((raw_data >> 20) & 0xFFF);
271 LogDebug(
"L1T") <<
"Egamma: eta " << eg.
hwEta() <<
" phi " << eg.
hwPhi() <<
" pT " << eg.
hwPt() <<
" qual "
275 res3_->push_back(0, eg);
282 for (
unsigned nTau = 0; nTau < 2; nTau++) {
283 raw_data =
block.payload()[ftau + nTau];
291 if ((
block.header().getID() == 125) || (
block.header().getID() == 131) || (
block.header().getID() == 129)) {
295 LogDebug(
"L1") <<
"block ID=" <<
block.header().getID() <<
" etasign=" << etasign;
297 tau.setHwEta(etasign * ((raw_data >> 3) & 0x3F));
298 tau.setHwPhi((raw_data >> 9) & 0x7F);
299 tau.setHwPt((raw_data >> 20) & 0xFFF);
300 tau.setHwIso((raw_data >> 1) & 0x3);
301 tau.setHwQual((raw_data >> 16) & 0xf);
306 LogDebug(
"L1T") <<
"Tau: eta " <<
tau.hwEta() <<
" phi " <<
tau.hwPhi() <<
" pT " <<
tau.hwPt() <<
" qual "
310 res4_->push_back(0,
tau);
314 raw_data =
block.payload()[faux];
324 switch (
block.header().getID()) {
327 mbp0.
setHwPt((raw_data >> 24) & 0xF);
331 mbm0.
setHwPt((raw_data >> 16) & 0xF);
335 mbp1.
setHwPt((raw_data >> 8) & 0xF);
347 res2_->push_back(0, mbp0);
348 res2_->push_back(0, mbm0);
349 res2_->push_back(0, mbp1);
350 res2_->push_back(0, mbm1);
353 towCount.
setHwPt(raw_data & 0x1FFF);
355 res2_->push_back(0, towCount);