23 unsigned int bxid = block.
amc().getBX();
26 if( (tmt-1) != ((bxid-1+3)%9) )
return true;
27 LogDebug(
"L1T") <<
"Unpacking TMT # " << tmt <<
" for BX " << bxid;
34 res1_->setBXRange(0,0);
35 res2_->setBXRange(0,0);
36 res3_->setBXRange(0,0);
37 res4_->setBXRange(0,0);
43 int unsigned ftau = 6;
44 int unsigned fjet = 8;
45 int unsigned faux = 10;
51 uint32_t raw_data = block.
payload()[fet];
58 ethf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFF)) );
62 ethf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
66 ethf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
70 ethf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFF)) );
74 ethf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
78 ethf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
86 res2_->push_back(0,ethf);
91 raw_data = block.
payload()[fet + 1];
99 etNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFF)) );
103 etNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
107 etNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
111 etNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFF)) );
115 etNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
119 etNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
125 LogDebug(
"L1T") <<
"ET/METx/METy (no HF): pT " << etNoHF.
hwPt();
127 res2_->push_back(0,etNoHF);
133 etEm.
setHwPt( static_cast<int32_t>( uint32_t( ( raw_data >> 16 ) & 0xFFFF )) );
134 res2_->push_back(0,etEm);
141 raw_data = block.
payload()[fht];
148 hthf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFF)) );
152 hthf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
156 hthf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
160 hthf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFF)) );
164 hthf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
168 hthf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
174 LogDebug(
"L1T") <<
"HTHF/MHTHFx/MHTHFy: pT " << hthf.
hwPt();
176 res2_->push_back(0,hthf);
181 raw_data = block.
payload()[fht+1];
188 htNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFF)) );
192 htNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
196 htNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
200 htNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFF)) );
204 htNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
208 htNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
215 LogDebug(
"L1T") <<
"HTNOHF/MHTNOHFx/MHTNOHFy: pT " << htNoHF.
hwPt();
217 res2_->push_back(0,htNoHF);
221 for (
unsigned nJet=0; nJet < 2; nJet++){
223 raw_data = block.
payload()[fjet+nJet];
239 int mpEta = etasign*(raw_data & 0x3F);
241 jet.
setHwPhi((raw_data >> 6) & 0x7F);
242 jet.
setHwPt((raw_data >> 13) & 0xFFFF);
245 if (jet.
hwPt()==0)
continue;
250 res1_->push_back(0,jet);
259 for (
unsigned nEG=0; nEG < 2; nEG++){
261 raw_data = block.
payload()[feg+nEG];
277 eg.
setHwEta(etasign*((raw_data >> 3) & 0x3F));
278 eg.
setHwPhi((raw_data >> 9) & 0x7F);
279 eg.
setHwPt((raw_data >> 20) & 0xFFF);
283 if (eg.
hwPt()==0)
continue;
288 res3_->push_back(0,eg);
296 for (
unsigned nTau=0; nTau < 2; nTau++){
298 raw_data = block.
payload()[ftau+nTau];
314 tau.
setHwEta(etasign*((raw_data >> 3) & 0x3F));
315 tau.
setHwPhi((raw_data >> 9) & 0x7F);
316 tau.
setHwPt((raw_data >> 20) & 0xFFF);
320 if (tau.
hwPt()==0)
continue;
325 res4_->push_back(0,tau);
329 raw_data = block.
payload()[faux];
342 mbp0.
setHwPt( ( raw_data >> 24 ) & 0xF );
346 mbm0.
setHwPt( ( raw_data >> 16 ) & 0xF );
350 mbp1.
setHwPt( ( raw_data >> 8 ) & 0xF );
354 mbm1.
setHwPt( raw_data & 0xF );
362 res2_->push_back(0,mbp0);
363 res2_->push_back(0,mbm0);
364 res2_->push_back(0,mbp1);
365 res2_->push_back(0,mbm1);
368 towCount.
setHwPt( raw_data & 0x1FFF );
370 res2_->push_back(0,towCount);
virtual bool unpack(const Block &block, UnpackerCollections *coll) override
BlockHeader header() const
unsigned int offsetBoardId
std::vector< uint32_t > payload() const
void setType(EtSumType type)
virtual void setP4(const LorentzVector &p4) final
set 4-momentum
#define DEFINE_L1T_UNPACKER(type)
void amc(const amc::Header &h)