15 unsigned int bxid = block.
amc().getBX();
17 LogDebug(
"L1T") <<
"Unpacking TMT # " << tmt <<
" for BX " << bxid;
23 unsigned link_phi = (link % 2 == 0) ? link : (link - 1);
26 unsigned nframes = 40;
33 int firstBX = -(
std::ceil((
double)nBX / 2.) - 1);
42 res_->setBXRange(
std::min(firstBX, res_->getFirstBX()),
std::max(lastBX, res_->getLastBX()));
45 <<
", link=" << link <<
", link_phi=" << link_phi <<
", nBX=" << nBX <<
", firstBX=" << firstBX
46 <<
", lastBX=" << lastBX;
49 for (
int bx = firstBX;
bx <= lastBX;
bx++) {
50 for (
unsigned iframe = 0; iframe < nframes && iframe < block.
header().
getSize(); ++iframe) {
51 uint32_t raw_data = block.
payload().at(iframe);
53 if ((raw_data & 0xFFFF) != 0) {
57 tower1.
setHwPt(raw_data & 0x1FF);
62 int ieta = iframe + 1;
68 LogDebug(
"L1T") <<
"Tower 1: Eta " << tower1.
hwEta() <<
" phi " << tower1.
hwPhi() <<
" pT " << tower1.
hwPt()
69 <<
" frame " << iframe <<
" qual " << tower1.
hwQual() <<
" EtRatio " << tower1.
hwEtRatio();
71 res_->push_back(
bx, tower1);
74 if (((raw_data >> 16) & 0xFFFF) != 0) {
78 tower2.
setHwPt((raw_data >> 16) & 0x1FF);
83 int ieta = iframe + 1;
88 LogDebug(
"L1T") <<
"Tower 2: Eta " << tower2.
hwEta() <<
" phi " << tower2.
hwPhi() <<
" pT " << tower2.
hwPt()
89 <<
" frame " << iframe <<
" qual " << tower2.
hwQual() <<
" EtRatio " << tower2.
hwEtRatio();
91 res_->push_back(
bx, tower2);
constexpr int32_t ceil(float num)
const std::vector< uint32_t > & payload() const
BlockHeader header() const
const unsigned int offsetBoardId
void setHwEtRatio(int ratio)
bool unpack(const Block &block, UnpackerCollections *coll) override
#define DEFINE_L1T_UNPACKER(type)
void amc(const amc::Header &h)