13 event.getByToken(static_cast<const CaloTokens*>(toks)->getEtSumToken(), etSums);
16 event.getByToken(static_cast<const CaloTokens*>(toks)->getCaloSpareHFBitCountsToken(), calosparesHFBitCounts);
19 event.getByToken(static_cast<const CaloTokens*>(toks)->getCaloSpareHFRingSumsToken(), calosparesHFRingSums);
21 std::vector<uint32_t>
load;
23 for (
int i = etSums->getFirstBX();
i <= etSums->getLastBX(); ++
i) {
33 for (
auto j = etSums->begin(
i); j != etSums->end(
i) && n < 4; ++j, ++
n) {
36 flaghtmiss=j->hwQual() & 0x1;
44 for (
auto j = calosparesHFBitCounts->begin(
i); j != calosparesHFBitCounts->end(
i) && n < 2; ++j, ++
n) {
45 hfbitcount=
std::min(j->hwPt(),0xFFF);
50 for (
auto j = calosparesHFRingSums->begin(
i); j != calosparesHFRingSums->end(
i) && n < 2; ++j, ++
n) {
54 uint16_t
object[4]={0,0,0,0};
56 object[0]=hfbitcount|((hfringsum & 0x7) << 12);
57 object[1]=htmissphi|((htmiss & 0x7F) << 5 ) |(flaghtmiss<<12)|(0
x1 << 14);
58 object[2]=((hfringsum>>3) & 0x1FF) |(0x1)<<10 | (0
x1)<<12 | (0x1)<<14;
59 object[3]= 0x1 | (0x1 << 2) | (0
x1 << 4) | (0x1 << 6) |(0
x1 << 8) | (0x1 << 10) | (0
x1 << 12) | (0x1 << 14);
61 uint32_t word0=(
object[0] & 0xFFFF) | ((
object[1] & 0xFFFF) << 16);
62 uint32_t word1=(
object[2] & 0xFFFF) | ((
object[3] & 0xFFFF) << 16);
64 word0 |= (1 << 31) | (1 << 15);
65 word1 |= ((
i == 0) << 31) | ((
i == 0) << 15);
67 load.push_back(word0);
68 load.push_back(word1);
71 return {
Block(7, load)};
std::vector< Block > Blocks
Blocks pack(const edm::Event &, const PackerTokens *) override
#define DEFINE_L1T_PACKER(type)