27 unsigned int amc = block.
amc().getAMCNumber();
28 unsigned int bxid = block.
amc().getBX();
30 if( (amc-1) != ((bxid-1+3)%9) )
return true;
31 LogDebug(
"L1T") <<
"Unpacking AMC " << amc <<
" for BX " << bxid;
37 unsigned link_phi = (link % 2 == 0) ? link : (link -1);
45 int firstBX = -(std::ceil((
double)nBX/2.)-1);
48 lastBX = std::ceil((
double)nBX/2.);
50 lastBX = std::ceil((
double)nBX/2.)-1;
54 res_->setBXRange(
std::min(firstBX, res_->getFirstBX()),
std::max(lastBX, res_->getLastBX()));
56 LogDebug(
"L1T") <<
"Block : id=" << block.
header().
getID() <<
", size=" << block.
header().
getSize() <<
", link=" << link <<
", link_phi=" << link_phi <<
", nBX=" << nBX <<
", firstBX=" << firstBX <<
", lastBX=" << lastBX;
59 for (
int bx=firstBX; bx<=lastBX; bx++){
61 for (
unsigned iframe=0; iframe<nframes && iframe<block.
header().
getSize(); ++iframe) {
63 uint32_t raw_data = block.
payload().at(iframe);
65 if ((raw_data & 0xFFFF) != 0) {
70 tower1.
setHwPt(raw_data & 0x1FF);
76 if (link % 2!=0) ieta = ieta * -1;
81 <<
" phi " << tower1.
hwPhi()
82 <<
" pT " << tower1.
hwPt()
83 <<
" frame " << iframe
84 <<
" qual " << tower1.
hwQual()
87 res_->push_back(bx,tower1);
90 if (((raw_data >> 16)& 0xFFFF) != 0) {
95 tower2.
setHwPt((raw_data >> 16) & 0x1FF);
96 tower2.
setHwQual((raw_data >> 28 ) & 0xF);
101 if (link % 2!=0) ieta = ieta * -1;
105 <<
" phi " << tower2.
hwPhi()
106 <<
" pT " << tower2.
hwPt()
107 <<
" frame " << iframe
108 <<
" qual " << tower2.
hwQual()
111 res_->push_back(bx,tower2);
BlockHeader header() const
std::vector< uint32_t > payload() const
#define DEFINE_L1T_UNPACKER(type)
void setHwEtRatio(int ratio)
virtual bool unpack(const Block &block, UnpackerCollections *coll) override
void amc(const amc::Header &h)