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 & 0xFFFFFF) << 16 ) >> 16 );
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 & 0xFFFFFF) << 16 ) >> 16 );
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];
100 etNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFFFF) << 16 ) >> 16 );
104 etNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
108 etNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
112 etNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFFFF) << 16 ) >> 16 );
116 etNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
120 etNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
126 LogDebug(
"L1T") <<
"ET/METx/METy (no HF): pT " << etNoHF.
hwPt();
128 res2_->push_back(0,etNoHF);
133 raw_data = block.
payload()[fht];
140 hthf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFFFF) << 16 ) >> 16 );
144 hthf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
148 hthf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
152 hthf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFFFF) << 16 ) >> 16 );
156 hthf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
160 hthf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
166 LogDebug(
"L1T") <<
"HTHF/MHTHFx/MHTHFy: pT " << hthf.
hwPt();
168 res2_->push_back(0,hthf);
173 raw_data = block.
payload()[fht+1];
180 htNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFFFF) << 16 ) >> 16 );
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 & 0xFFFFFF) << 16 ) >> 16 );
196 htNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
200 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);
213 for (
unsigned nJet=0; nJet < 2; nJet++){
215 raw_data = block.
payload()[fjet+nJet];
231 int mpEta = etasign*(raw_data & 0x3F);
233 jet.
setHwPhi((raw_data >> 6) & 0x7F);
234 jet.
setHwPt((raw_data >> 13) & 0xFFFF);
237 if (jet.
hwPt()==0)
continue;
242 res1_->push_back(0,jet);
251 for (
unsigned nEG=0; nEG < 2; nEG++){
253 raw_data = block.
payload()[feg+nEG];
269 eg.
setHwEta(etasign*((raw_data >> 3) & 0x3F));
270 eg.
setHwPhi((raw_data >> 9) & 0x7F);
271 eg.
setHwPt((raw_data >> 20) & 0xFFF);
275 if (eg.
hwPt()==0)
continue;
280 res3_->push_back(0,eg);
288 for (
unsigned nTau=0; nTau < 2; nTau++){
290 raw_data = block.
payload()[ftau+nTau];
306 tau.
setHwEta(etasign*((raw_data >> 3) & 0x3F));
307 tau.
setHwPhi((raw_data >> 9) & 0x7F);
308 tau.
setHwPt((raw_data >> 20) & 0xFFF);
312 if (tau.
hwPt()==0)
continue;
317 res4_->push_back(0,tau);
321 raw_data = block.
payload()[faux];
334 mbp0.
setHwPt( ( raw_data >> 24 ) & 0xF );
338 mbm0.
setHwPt( ( raw_data >> 16 ) & 0xF );
342 mbp1.
setHwPt( ( raw_data >> 8 ) & 0xF );
346 mbm1.
setHwPt( raw_data & 0xF );
354 res2_->push_back(0,mbp0);
355 res2_->push_back(0,mbm0);
356 res2_->push_back(0,mbp1);
357 res2_->push_back(0,mbm1);
360 towCount.
setHwPt( raw_data & 0x1FFF );
362 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)