CMS 3D CMS Logo

MissEtPacker.cc
Go to the documentation of this file.
3 
4 #include "CaloTokens.h"
5 #include "MissEtPacker.h"
6 
7 namespace l1t {
8  namespace stage1 {
11  event.getByToken(static_cast<const CaloTokens*>(toks)->getEtSumToken(), etSums);
12 
13  std::vector<uint32_t> load;
14 
15  for (int i = etSums->getFirstBX(); i <= etSums->getLastBX(); ++i) {
16  int n = 0;
17 
18  uint16_t objectMissingEt = 0;
19  uint16_t objectMissingEtPhi = 0;
20 
21  int flagMissingEt = 0;
22 
23  for (auto j = etSums->begin(i); j != etSums->end(i) && n < 4; ++j, ++n) {
24  if (j->getType() == l1t::EtSum::kMissingEt) {
25  flagMissingEt = j->hwQual() & 0x1;
26  objectMissingEt = std::min(j->hwPt(), 0xFFF) | (flagMissingEt << 12);
27  objectMissingEtPhi = std::min(j->hwPhi(), 0x7F);
28  }
29  }
30 
31  uint32_t word0 = (objectMissingEt & 0xFFFF);
32  uint32_t word1 = (objectMissingEtPhi & 0xFFFF);
33 
34  word0 |= (1 << 15);
35  word1 |= ((i == 0) << 15);
36 
37  load.push_back(word0);
38  load.push_back(word1);
39  }
40 
41  return {Block(95, load)};
42  }
43  } // namespace stage1
44 } // namespace l1t
45 
delete x;
Definition: CaloConfig.h:22
Blocks pack(const edm::Event &, const PackerTokens *) override
Definition: MissEtPacker.cc:9
std::vector< Block > Blocks
Definition: Block.h:99
#define DEFINE_L1T_PACKER(type)
Definition: PackerFactory.h:23
def load(fileName)
Definition: svgfig.py:547
Definition: event.py:1