25 unsigned int bxid = block.
amc().getBX();
28 if( (tmt-1) != ((bxid-1+3)%9) )
return true;
29 LogDebug(
"L1T") <<
"Unpacking TMT # " << tmt <<
" for BX " << bxid;
36 res1_->setBXRange(0,0);
37 res2_->setBXRange(0,0);
38 res3_->setBXRange(0,0);
39 res4_->setBXRange(0,0);
45 int unsigned ftau = 6;
46 int unsigned fjet = 8;
47 int unsigned faux = 10;
53 uint32_t raw_data = block.
payload()[fet];
60 ethf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFF)) );
64 ethf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
68 ethf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
72 ethf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFF)) );
76 ethf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
80 ethf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
88 res2_->push_back(0,ethf);
93 raw_data = block.
payload()[fet + 1];
101 etNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFF)) );
105 etNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
109 etNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
113 etNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFF)) );
117 etNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
121 etNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
127 LogDebug(
"L1T") <<
"ET/METx/METy (no HF): pT " << etNoHF.
hwPt();
129 res2_->push_back(0,etNoHF);
135 etEm.
setHwPt( static_cast<int32_t>( uint32_t( ( raw_data >> 16 ) & 0xFFFF )) );
136 res2_->push_back(0,etEm);
143 raw_data = block.
payload()[fht];
150 hthf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFF)) );
154 hthf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
158 hthf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
162 hthf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFF)) );
166 hthf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
170 hthf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
176 LogDebug(
"L1T") <<
"HTHF/MHTHFx/MHTHFy: pT " << hthf.
hwPt();
178 res2_->push_back(0,hthf);
183 raw_data = block.
payload()[fht+1];
190 htNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFF)) );
194 htNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
198 htNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
202 htNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFF)) );
206 htNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
210 htNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
217 LogDebug(
"L1T") <<
"HTNOHF/MHTNOHFx/MHTNOHFy: pT " << htNoHF.
hwPt();
219 res2_->push_back(0,htNoHF);
223 for (
unsigned nJet=0; nJet < 2; nJet++){
225 raw_data = block.
payload()[fjet+nJet];
241 int mpEta = etasign*(raw_data & 0x3F);
243 jet.
setHwPhi((raw_data >> 6) & 0x7F);
244 jet.
setHwPt((raw_data >> 13) & 0xFFFF);
247 if (jet.
hwPt()==0)
continue;
252 res1_->push_back(0,jet);
261 for (
unsigned nEG=0; nEG < 2; nEG++){
263 raw_data = block.
payload()[feg+nEG];
279 eg.
setHwEta(etasign*((raw_data >> 3) & 0x3F));
280 eg.
setHwPhi((raw_data >> 9) & 0x7F);
281 eg.
setHwPt((raw_data >> 20) & 0xFFF);
285 if (eg.
hwPt()==0)
continue;
290 res3_->push_back(0,eg);
298 for (
unsigned nTau=0; nTau < 2; nTau++){
300 raw_data = block.
payload()[ftau+nTau];
316 tau.
setHwEta(etasign*((raw_data >> 3) & 0x3F));
317 tau.
setHwPhi((raw_data >> 9) & 0x7F);
318 tau.
setHwPt((raw_data >> 20) & 0xFFF);
322 if (tau.
hwPt()==0)
continue;
327 res4_->push_back(0,tau);
331 raw_data = block.
payload()[faux];
344 mbp0.
setHwPt( ( raw_data >> 24 ) & 0xF );
348 mbm0.
setHwPt( ( raw_data >> 16 ) & 0xF );
352 mbp1.
setHwPt( ( raw_data >> 8 ) & 0xF );
356 mbm1.
setHwPt( raw_data & 0xF );
364 res2_->push_back(0,mbp0);
365 res2_->push_back(0,mbm0);
366 res2_->push_back(0,mbp1);
367 res2_->push_back(0,mbm1);
370 towCount.
setHwPt( raw_data & 0x1FFF );
372 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)