Implements l1t::Unpacker.
Definition at line 21 of file CaloTowerUnpacker.cc.
References coll, l1t::BlockHeader::getID(), l1t::BlockHeader::getSize(), l1t::Block::header(), l1t::L1Candidate::hwEta(), l1t::CaloTower::hwEtRatio(), l1t::L1Candidate::hwPhi(), l1t::L1Candidate::hwPt(), l1t::L1Candidate::hwQual(), i, MainPageGenerator::link, LogDebug, bookConverter::max, min(), l1t::Block::payload(), l1t::L1Candidate::setHwEta(), l1t::CaloTower::setHwEtRatio(), l1t::L1Candidate::setHwPhi(), l1t::L1Candidate::setHwPt(), and l1t::L1Candidate::setHwQual().
24 LogDebug(
"L1T") <<
"Block ID = " <<
block.header().getID() <<
" size = " <<
block.header().getSize();
26 int nBX = int(ceil(
block.header().getSize()/44.));
29 int firstBX = -(std::ceil((
double)nBX/2.)-1);
32 lastBX = std::ceil((
double)nBX/2.);
34 lastBX = std::ceil((
double)nBX/2.)-1;
37 auto res_ =
static_cast<CaloCollections*
>(
coll)->getTowers();
38 res_->setBXRange(
std::min(firstBX, res_->getFirstBX()),
std::max(lastBX, res_->getLastBX()));
40 LogDebug(
"L1T") <<
"nBX = " << nBX <<
" first BX = " << firstBX <<
" lastBX = " << lastBX;
49 unsigned link_phi = (link % 2 == 0) ? link : (link -1);
52 for (
int bx=firstBX; bx<=lastBX; bx++){
54 for (
unsigned frame=1; frame<42 && frame<(
block.header().getSize()+1); frame++){
56 uint32_t raw_data =
block.payload()[i++];
58 if ((raw_data & 0xFFFF) != 0) {
63 tower1.
setHwPt(raw_data & 0x1FF);
75 <<
" phi " << tower1.
hwPhi()
76 <<
" pT " << tower1.
hwPt()
78 <<
" qual " << tower1.
hwQual()
81 res_->push_back(bx,tower1);
84 if (((raw_data >> 16)& 0xFFFF) != 0) {
89 tower2.
setHwPt((raw_data >> 16) & 0x1FF);
90 tower2.
setHwQual((raw_data >> 28 ) & 0xF);
101 <<
" phi " << tower2.
hwPhi()
102 <<
" pT " << tower2.
hwPt()
103 <<
" frame " << frame
104 <<
" qual " << tower2.
hwQual()
107 res_->push_back(bx,tower2);
void setHwEtRatio(int ratio)