CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GlobalExtBlkPacker.cc
Go to the documentation of this file.
3 
4 #include "GTTokens.h"
5 #include "GlobalExtBlkPacker.h"
6 
7 namespace l1t {
8  namespace stage2 {
11  event.getByToken(static_cast<const GTTokens*>(toks)->getExtToken(), exts);
12 
13  unsigned int wdPerBX = 6; //should this be configured someplace else?
14 
15  Blocks res;
16 
17  for (int blk = 0; blk < 4; blk++) {
18  unsigned int blkID = blk * 2 + 24;
19 
20  unsigned int extOffset = blk * 64;
21 
22  //vector of words
23  std::vector<uint32_t> load;
24 
25  for (int i = exts->getFirstBX(); i <= exts->getLastBX(); ++i) {
26  for (auto j = exts->begin(i); j != exts->end(i); ++j) {
27  for (unsigned int wd = 0; wd < wdPerBX; wd++) {
28  uint32_t word = 0;
29 
30  if (wd < 2) {
31  unsigned int startExt = wd * 32 + extOffset;
32  for (unsigned bt = 0; bt < 32; bt++) {
33  if (j->getExternalDecision(bt + startExt))
34  word |= (0x1 << bt);
35 
36  } //end loop over bits
37  } //endif wrd < 2
38 
39  load.push_back(word);
40  } //loop over words
41 
42  } //end loop over alg objects.(trivial one per BX)
43 
44  } //end loop over bx
45 
46  res.push_back(Block(blkID, load));
47 
48  } //loop over blks
49 
50  return res;
51  }
52  } // namespace stage2
53 } // namespace l1t
54 
Blocks pack(const edm::Event &, const PackerTokens *) override
uint64_t word
def load
Definition: svgfig.py:547
std::vector< Block > Blocks
Definition: Block.h:99
#define DEFINE_L1T_PACKER(type)
Definition: PackerFactory.h:23