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 
l1t::Blocks
std::vector< Block > Blocks
Definition: Block.h:99
CaloTokens.h
mps_fire.i
i
Definition: mps_fire.py:428
PackerFactory.h
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
min
T min(T a, T b)
Definition: MathUtil.h:58
MissEtPacker.h
edm::Handle
Definition: AssociativeIterator.h:50
l1t::stage1::MissEtPacker::pack
Blocks pack(const edm::Event &, const PackerTokens *) override
Definition: MissEtPacker.cc:9
svgfig.load
def load(fileName)
Definition: svgfig.py:547
l1t::EtSum::kMissingEt
Definition: EtSum.h:25
DEFINE_L1T_PACKER
#define DEFINE_L1T_PACKER(type)
Definition: PackerFactory.h:23
Event.h
l1t
delete x;
Definition: CaloConfig.h:22
l1t::stage1::MissEtPacker
Definition: MissEtPacker.h:8
l1t::PackerTokens
Definition: PackerTokens.h:10
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
l1t::Block
Definition: Block.h:70