CMS 3D CMS Logo

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 {
9  Blocks
11  {
13  event.getByToken(static_cast<const GTTokens*>(toks)->getExtToken(), exts);
14 
15  unsigned int wdPerBX = 6; //should this be configured someplace else?
16 
17  Blocks res;
18 
19  for(int blk=0; blk<4; blk++) {
20 
21  unsigned int blkID = blk*2+24;
22 
23  unsigned int extOffset = blk*64;
24 
25  //vector of words
26  std::vector<uint32_t> load;
27 
28  for (int i = exts->getFirstBX(); i <= exts->getLastBX(); ++i) {
29 
30  for (auto j = exts->begin(i); j != exts->end(i); ++j) {
31 
32  for(unsigned int wd=0; wd<wdPerBX; wd++) {
33 
34  uint32_t word = 0;
35 
36  if( wd<2 ) {
37 
38  unsigned int startExt = wd*32+extOffset;
39  for(unsigned bt=0; bt<32; bt++) {
40 
41  if(j->getExternalDecision(bt+startExt)) word |= (0x1 << bt);
42 
43  } //end loop over bits
44  } //endif wrd < 2
45 
46  load.push_back(word);
47  } //loop over words
48 
49  } //end loop over alg objects.(trivial one per BX)
50 
51  } //end loop over bx
52 
53  res.push_back(Block(blkID, load));
54 
55  } //loop over blks
56 
57  return res;
58  }
59 }
60 }
61 
const_iterator end(int bx) const
Blocks pack(const edm::Event &, const PackerTokens *) override
delete x;
Definition: CaloConfig.h:22
Definition: Electron.h:6
std::vector< Block > Blocks
Definition: Block.h:72
int getFirstBX() const
#define DEFINE_L1T_PACKER(type)
Definition: PackerFactory.h:22
def load(fileName)
Definition: svgfig.py:547
int getLastBX() const
const_iterator begin(int bx) const
Definition: event.py:1