18 unsigned int bxid = block.
amc().getBX();
21 if( (tmt-1) != ((bxid-1+3)%9) )
return true;
22 LogDebug(
"L1T") <<
"Unpacking TMT # " << tmt <<
" for BX " << bxid;
28 unsigned link_phi = (link % 2 == 0) ? link : (link -1);
36 int firstBX = -(std::ceil((
double)nBX/2.)-1);
39 lastBX = std::ceil((
double)nBX/2.);
41 lastBX = std::ceil((
double)nBX/2.)-1;
45 res_->setBXRange(
std::min(firstBX, res_->getFirstBX()),
std::max(lastBX, res_->getLastBX()));
47 LogDebug(
"L1T") <<
"Block : id=" << block.
header().
getID() <<
", size=" << block.
header().
getSize() <<
", link=" << link <<
", link_phi=" << link_phi <<
", nBX=" << nBX <<
", firstBX=" << firstBX <<
", lastBX=" << lastBX;
50 for (
int bx=firstBX; bx<=lastBX; bx++){
52 for (
unsigned iframe=0; iframe<nframes && iframe<block.
header().
getSize(); ++iframe) {
54 uint32_t raw_data = block.
payload().at(iframe);
56 if ((raw_data & 0xFFFF) != 0) {
61 tower1.
setHwPt(raw_data & 0x1FF);
67 if (link % 2!=0) ieta = ieta * -1;
72 <<
" phi " << tower1.
hwPhi()
73 <<
" pT " << tower1.
hwPt()
74 <<
" frame " << iframe
75 <<
" qual " << tower1.
hwQual()
78 res_->push_back(bx,tower1);
81 if (((raw_data >> 16)& 0xFFFF) != 0) {
86 tower2.
setHwPt((raw_data >> 16) & 0x1FF);
87 tower2.
setHwQual((raw_data >> 28 ) & 0xF);
92 if (link % 2!=0) ieta = ieta * -1;
96 <<
" phi " << tower2.
hwPhi()
97 <<
" pT " << tower2.
hwPt()
98 <<
" frame " << iframe
99 <<
" qual " << tower2.
hwQual()
102 res_->push_back(bx,tower2);
BlockHeader header() const
unsigned int offsetBoardId
std::vector< uint32_t > payload() const
void setHwEtRatio(int ratio)
virtual bool unpack(const Block &block, UnpackerCollections *coll) override
#define DEFINE_L1T_UNPACKER(type)
void amc(const amc::Header &h)