24 const unsigned int bxid = block.
amc().getBX();
27 if( (tmt-1) != ((bxid-1+3)%9) )
return true;
28 LogDebug(
"L1T") <<
"Unpacking TMT # " << tmt <<
" for BX " << bxid;
35 res1_->setBXRange(0,0);
36 res2_->setBXRange(0,0);
37 res3_->setBXRange(0,0);
38 res4_->setBXRange(0,0);
41 const int unsigned fet = 0;
42 const int unsigned fht = 2;
43 const int unsigned feg = 4;
44 const int unsigned ftau = 6;
45 const int unsigned fjet = 8;
46 const int unsigned faux = 10;
52 uint32_t raw_data = block.
payload()[fet];
59 ethf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFFFF) << 16 ) >> 16 );
63 ethf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
67 ethf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
71 ethf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFFFF) << 16 ) >> 16 );
75 ethf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
79 ethf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
87 res2_->push_back(0,ethf);
92 raw_data = block.
payload()[fet + 1];
99 etNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFFFF) << 16 ) >> 16 );
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 & 0xFFFFFF) << 16 ) >> 16 );
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);
132 raw_data = block.
payload()[fht];
139 hthf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFFFF) << 16 ) >> 16 );
143 hthf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
147 hthf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
151 hthf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFFFF) << 16 ) >> 16 );
155 hthf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
159 hthf.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
165 LogDebug(
"L1T") <<
"HTHF/MHTHFx/MHTHFy: pT " << hthf.
hwPt();
167 res2_->push_back(0,hthf);
172 raw_data = block.
payload()[fht+1];
179 htNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFFFF) << 16 ) >> 16 );
183 htNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
187 htNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
191 htNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data & 0xFFFFFF) << 16 ) >> 16 );
195 htNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
199 htNoHF.
setHwPt( static_cast<int32_t>( uint32_t(raw_data) ) );
206 LogDebug(
"L1T") <<
"HTNOHF/MHTNOHFx/MHTNOHFy: pT " << htNoHF.
hwPt();
208 res2_->push_back(0,htNoHF);
212 for (
unsigned nJet=0; nJet < 2; nJet++){
214 raw_data = block.
payload()[fjet+nJet];
230 int mpEta = etasign*(raw_data & 0x3F);
232 jet.
setHwPhi((raw_data >> 6) & 0x7F);
233 jet.
setHwPt((raw_data >> 13) & 0xFFFF);
236 if (jet.
hwPt()==0)
continue;
241 res1_->push_back(0,jet);
250 for (
unsigned nEG=0; nEG < 2; nEG++){
252 raw_data = block.
payload()[feg+nEG];
268 eg.
setHwEta(etasign*((raw_data >> 3) & 0x3F));
269 eg.
setHwPhi((raw_data >> 9) & 0x7F);
270 eg.
setHwPt((raw_data >> 20) & 0xFFF);
274 if (eg.
hwPt()==0)
continue;
279 res3_->push_back(0,eg);
287 for (
unsigned nTau=0; nTau < 2; nTau++){
289 raw_data = block.
payload()[ftau+nTau];
305 tau.
setHwEta(etasign*((raw_data >> 3) & 0x3F));
306 tau.
setHwPhi((raw_data >> 9) & 0x7F);
307 tau.
setHwPt((raw_data >> 20) & 0xFFF);
311 if (tau.
hwPt()==0)
continue;
316 res4_->push_back(0,tau);
320 raw_data = block.
payload()[faux];
332 mbp0.
setHwPt( ( raw_data >> 24 ) & 0xF );
336 mbm0.
setHwPt( ( raw_data >> 16 ) & 0xF );
340 mbp1.
setHwPt( ( raw_data >> 8 ) & 0xF );
344 mbm1.
setHwPt( raw_data & 0xF );
352 res2_->push_back(0,mbp0);
353 res2_->push_back(0,mbm0);
354 res2_->push_back(0,mbp1);
355 res2_->push_back(0,mbm1);
BlockHeader header() const
unsigned int offsetBoardId
std::vector< uint32_t > payload() const
void setType(EtSumType type)
virtual bool unpack(const Block &block, UnpackerCollections *coll) override
virtual void setP4(const LorentzVector &p4) final
set 4-momentum
#define DEFINE_L1T_UNPACKER(type)
void amc(const amc::Header &h)