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