CMS 3D CMS Logo

GlobalAlgBlkPacker.cc
Go to the documentation of this file.
3 
4 #include "GTTokens.h"
5 #include "GlobalAlgBlkPacker.h"
6 
7 namespace l1t {
8  namespace stage2 {
11  event.getByToken(static_cast<const GTTokens*>(toks)->getAlgToken(), algs);
12 
13  unsigned int wdPerBX = 6; //should this be configured someplace else?
14 
15  Blocks res;
16 
17  for (int blk = 0; blk < 9; blk++) {
18  unsigned int blkID = blk * 2 + 33;
19 
20  unsigned int algOffset = (2 * blk + 1) / 2;
21  algOffset = (algOffset % 3) * 192;
22 
23  //vector of words
24  std::vector<uint32_t> load;
25 
26  for (int i = algs->getFirstBX(); i <= algs->getLastBX(); ++i) {
27  for (auto j = algs->begin(i); j != algs->end(i); ++j) {
28  for (unsigned int wd = 0; wd < wdPerBX; wd++) {
29  uint32_t word = 0;
30 
31  if ((blk + 1) % 3 > 0 || wd < 4) {
32  unsigned int startAlg = wd * 32 + algOffset;
33  for (unsigned bt = 0; bt < 32; bt++) {
34  if (blk < 3) {
35  if (j->getAlgoDecisionInitial(bt + startAlg))
36  word |= (0x1 << bt);
37  } else if (blk < 6) {
38  if (j->getAlgoDecisionInterm(bt + startAlg))
39  word |= (0x1 << bt);
40  } else {
41  if (j->getAlgoDecisionFinal(bt + startAlg))
42  word |= (0x1 << bt);
43  }
44  }
45 
46  } else if (blk == 2 && (wd == 4 || wd == 5)) {
47  //putting hashed values of the menu name and firmware uuid into record.
48  if (wd == 4)
49  word |= (j->getL1MenuUUID() & 0xFFFFFFFF);
50  if (wd == 5)
51  word |= (j->getL1FirmwareUUID() & 0xFFFFFFFF);
52 
53  } else if (blk == 8) {
54  if (wd == 4) {
55  if (j->getFinalOR())
56  word |= (0x1 << 16);
57  if (j->getFinalORVeto())
58  word |= (0x1 << 8);
59  if (j->getFinalORPreVeto())
60  word |= (0x1 << 0);
61  } else if (wd == 5) {
62  word |= (j->getPreScColumn() & 0xFF);
63  }
64  } //if on blk
65 
66  load.push_back(word);
67  } //loop over words
68 
69  } //end loop over alg objects.(trivial one per BX)
70 
71  } //end loop over bx
72 
73  res.push_back(Block(blkID, load));
74 
75  } //loop over blks
76 
77  return res;
78  }
79  } // namespace stage2
80 } // namespace l1t
81 
l1t::Blocks
std::vector< Block > Blocks
Definition: Block.h:99
mps_fire.i
i
Definition: mps_fire.py:428
PackerFactory.h
l1t::stage2::GlobalAlgBlkPacker::pack
Blocks pack(const edm::Event &, const PackerTokens *) override
Definition: GlobalAlgBlkPacker.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
l1t::stage2::GlobalAlgBlkPacker
Definition: GlobalAlgBlkPacker.h:8
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
l1t::PackerTokens
Definition: PackerTokens.h:10
res
Definition: Electron.h:6
SiStripSourceConfigTier0_cff.stage2
stage2
Definition: SiStripSourceConfigTier0_cff.py:71
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
GlobalAlgBlkPacker.h