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