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->getAlgoDecisionPreScaled(bt+startAlg)) word |= (0x1 << bt);
57  } else {
58  if(j->getAlgoDecisionFinal(bt+startAlg)) word |= (0x1 << bt);
59  }
60  }
61 
62 
63  } else if(blk==8){
64 
65  if(wd == 4) {
66  if(j->getFinalOR()) word |= (0x1 << 16);
67  if(j->getFinalORVeto()) word |= (0x1 << 8);
68  if(j->getFinalORPreVeto()) word |= (0x1 << 0);
69  } else if (wd == 5) {
70  word |= (j->getPreScColumn() & 0xFF);
71  }
72  } //if on blk
73 
74 
75  load.push_back(word);
76  } //loop over words
77 
78  } //end loop over alg objects.(trivial one per BX)
79 
80  } //end loop over bx
81 
82  res.push_back(Block(blkID, load));
83 
84  } //loop over blks
85 
86  return res;
87  }
88 }
89 }
90 
int i
Definition: DBlmapReader.cc:9
virtual Blocks pack(const edm::Event &, const PackerTokens *) override
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
void load(int perCUT=90)
Definition: getMaxPt.h:59
#define DEFINE_L1T_PACKER(type)
Definition: Packer.h:36