CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 {
9  Blocks
11  {
13  event.getByToken(static_cast<const GTTokens*>(toks)->getAlgToken(), algs);
14 
15  unsigned int wdPerBX = 6; //should this be configured someplace else?
16 
17  Blocks res;
18 
19  for(int blk=0; blk<9; blk++) {
20 
21  unsigned int blkID = blk*2+33;
22 
23  unsigned int algOffset = (2*blk+1)/2;
24  algOffset = (algOffset%3)*192;
25 
26  //vector of words
27  std::vector<uint32_t> load;
28 
29  for (int i = algs->getFirstBX(); i <= algs->getLastBX(); ++i) {
30 
31  for (auto j = algs->begin(i); j != algs->end(i); ++j) {
32 
33  for(unsigned int wd=0; wd<wdPerBX; wd++) {
34 
35  uint32_t word = 0;
36 
37  if( (blk+1)%3 > 0 || wd<4 ) {
38 
39  unsigned int startAlg = wd*32+algOffset;
40  for(unsigned bt=0; bt<32; bt++) {
41 
42  if(blk<3) {
43  if(j->getAlgoDecisionInitial(bt+startAlg)) word |= (0x1 << bt);
44  } else if(blk<6) {
45  if(j->getAlgoDecisionInterm(bt+startAlg)) word |= (0x1 << bt);
46  } else {
47  if(j->getAlgoDecisionFinal(bt+startAlg)) word |= (0x1 << bt);
48  }
49  }
50 
51  } else if(blk==2 && (wd==4 || wd==5) ) {
52 
53  //putting hashed values of the menu name and firmware uuid into record.
54  if(wd==4) word |= (j->getL1MenuUUID() & 0xFFFFFFFF);
55  if(wd==5) word |= (j->getL1FirmwareUUID() & 0xFFFFFFFF);
56 
57  } else if(blk==8){
58 
59  if(wd == 4) {
60  if(j->getFinalOR()) word |= (0x1 << 16);
61  if(j->getFinalORVeto()) word |= (0x1 << 8);
62  if(j->getFinalORPreVeto()) word |= (0x1 << 0);
63  } else if (wd == 5) {
64  word |= (j->getPreScColumn() & 0xFF);
65  }
66  } //if on blk
67 
68 
69  load.push_back(word);
70  } //loop over words
71 
72  } //end loop over alg objects.(trivial one per BX)
73 
74  } //end loop over bx
75 
76  res.push_back(Block(blkID, load));
77 
78  } //loop over blks
79 
80  return res;
81  }
82 }
83 }
84 
int i
Definition: DBlmapReader.cc:9
virtual Blocks pack(const edm::Event &, const PackerTokens *) override
def load
Definition: svgfig.py:546
std::vector< Block > Blocks
Definition: Block.h:68
int j
Definition: DBlmapReader.cc:9
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
#define DEFINE_L1T_PACKER(type)
Definition: PackerFactory.h:22