25 unsigned int amc = block.
amc().getAMCNumber();
26 unsigned int bxid = block.
amc().getBX();
28 if( (amc-1) != ((bxid-1+3)%9) )
return true;
29 LogDebug(
"L1T") <<
"Unpacking AMC " << amc <<
" for BX " << bxid;
35 unsigned link_phi = (link % 2 == 0) ? link : (link -1);
43 int firstBX = -(std::ceil((
double)nBX/2.)-1);
46 lastBX = std::ceil((
double)nBX/2.);
48 lastBX = std::ceil((
double)nBX/2.)-1;
52 res_->setBXRange(
std::min(firstBX, res_->getFirstBX()),
std::max(lastBX, res_->getLastBX()));
54 LogDebug(
"L1T") <<
"Block : id=" << block.
header().
getID() <<
", size=" << block.
header().
getSize() <<
", link=" << link <<
", link_phi=" << link_phi <<
", nBX=" << nBX <<
", firstBX=" << firstBX <<
", lastBX=" << lastBX;
57 for (
int bx=firstBX; bx<=lastBX; bx++){
59 for (
unsigned iframe=0; iframe<nframes && iframe<block.
header().
getSize(); ++iframe) {
61 uint32_t raw_data = block.
payload().at(iframe);
63 if ((raw_data & 0xFFFF) != 0) {
68 tower1.
setHwPt(raw_data & 0x1FF);
80 <<
" phi " << tower1.
hwPhi()
81 <<
" pT " << tower1.
hwPt()
82 <<
" frame " << iframe
83 <<
" qual " << tower1.
hwQual()
86 res_->push_back(bx,tower1);
89 if (((raw_data >> 16)& 0xFFFF) != 0) {
94 tower2.
setHwPt((raw_data >> 16) & 0x1FF);
95 tower2.
setHwQual((raw_data >> 28 ) & 0xF);
106 <<
" phi " << tower2.
hwPhi()
107 <<
" pT " << tower2.
hwPt()
108 <<
" frame " << iframe
109 <<
" qual " << tower2.
hwQual()
112 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)