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 {
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 
l1t::Blocks
std::vector< Block > Blocks
Definition: Block.h:99
mps_fire.i
i
Definition: mps_fire.py:428
PackerFactory.h
l1t::stage2::GlobalExtBlkPacker::pack
Blocks pack(const edm::Event &, const PackerTokens *) override
Definition: GlobalExtBlkPacker.cc:9
GTTokens.h
edm::Handle
Definition: AssociativeIterator.h:50
word
uint64_t word
Definition: CTPPSTotemDataFormatter.cc:29
BXVector::getFirstBX
int getFirstBX() const
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
svgfig.load
def load(fileName)
Definition: svgfig.py:547
BXVector::begin
const_iterator begin(int bx) const
DEFINE_L1T_PACKER
#define DEFINE_L1T_PACKER(type)
Definition: PackerFactory.h:23
BXVector::end
const_iterator end(int bx) const
Event.h
l1t
delete x;
Definition: CaloConfig.h:22
GlobalExtBlkPacker.h
l1t::PackerTokens
Definition: PackerTokens.h:10
res
Definition: Electron.h:6
SiStripSourceConfigTier0_cff.stage2
stage2
Definition: SiStripSourceConfigTier0_cff.py:71
l1t::stage2::GlobalExtBlkPacker
Definition: GlobalExtBlkPacker.h:8
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
l1t::Block
Definition: Block.h:70
BXVector::getLastBX
int getLastBX() const