18 unsigned int bxid = block.
amc().getBX();
20 LogDebug(
"L1T") <<
"Unpacking TMT # " << tmt <<
" for BX " << bxid;
26 unsigned link_phi = (link % 2 == 0) ? link : (link -1);
34 int firstBX = -(std::ceil((
double)nBX/2.)-1);
37 lastBX = std::ceil((
double)nBX/2.);
39 lastBX = std::ceil((
double)nBX/2.)-1;
43 res_->setBXRange(
std::min(firstBX, res_->getFirstBX()),
std::max(lastBX, res_->getLastBX()));
45 LogDebug(
"L1T") <<
"Block : id=" << block.
header().
getID() <<
", size=" << block.
header().
getSize() <<
", link=" << link <<
", link_phi=" << link_phi <<
", nBX=" << nBX <<
", firstBX=" << firstBX <<
", lastBX=" << lastBX;
48 for (
int bx=firstBX; bx<=lastBX; bx++){
50 for (
unsigned iframe=0; iframe<nframes && iframe<block.
header().
getSize(); ++iframe) {
52 uint32_t raw_data = block.
payload().at(iframe);
54 if ((raw_data & 0xFFFF) != 0) {
59 tower1.
setHwPt(raw_data & 0x1FF);
65 if (link % 2!=0) ieta = ieta * -1;
70 <<
" phi " << tower1.
hwPhi()
71 <<
" pT " << tower1.
hwPt()
72 <<
" frame " << iframe
73 <<
" qual " << tower1.
hwQual()
76 res_->push_back(bx,tower1);
79 if (((raw_data >> 16)& 0xFFFF) != 0) {
84 tower2.
setHwPt((raw_data >> 16) & 0x1FF);
85 tower2.
setHwQual((raw_data >> 28 ) & 0xF);
90 if (link % 2!=0) ieta = ieta * -1;
94 <<
" phi " << tower2.
hwPhi()
95 <<
" pT " << tower2.
hwPt()
96 <<
" frame " << iframe
97 <<
" qual " << tower2.
hwQual()
100 res_->push_back(bx,tower2);
BlockHeader header() const
unsigned int offsetBoardId
std::vector< uint32_t > payload() const
void setHwEtRatio(int ratio)
bool unpack(const Block &block, UnpackerCollections *coll) override
#define DEFINE_L1T_UNPACKER(type)
void amc(const amc::Header &h)