test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuonPacker.cc
Go to the documentation of this file.
2 
4 
6 #include "GMTTokens.h"
7 
8 namespace l1t {
9  namespace stage2 {
10  class MuonPacker : public Packer {
11  public:
12  MuonPacker(unsigned b1) : b1_(b1) {}
13  virtual Blocks pack(const edm::Event&, const PackerTokens*) override;
14  unsigned b1_;
15  private:
16  typedef std::map<unsigned int, std::vector<uint32_t>> PayloadMap;
17  };
18 
19  class GTMuonPacker : public MuonPacker {
20  public:
22  };
23  class GMTMuonPacker : public MuonPacker {
24  public:
26  };
27 
28 
29 
30 
31  }
32 }
33 
34 // Implementation
35 namespace l1t {
36  namespace stage2 {
37  Blocks
39  {
41  event.getByToken(static_cast<const CommonTokens*>(toks)->getMuonToken(), muons);
42 
43  PayloadMap payloadMap;
44 
45  for (int i = muons->getFirstBX(); i <= muons->getLastBX(); ++i) {
46  // the first muon in every BX and every block id is 0
47  for (unsigned int blkId = b1_; blkId < b1_+7; blkId += 2) {
48  payloadMap[blkId].push_back(0);
49  payloadMap[blkId].push_back(0);
50  }
51 
52  unsigned int blkId = b1_;
53  int muCtr = 1;
54  for (auto mu = muons->begin(i); mu != muons->end(i) && muCtr <= 8; ++mu, ++muCtr) {
55  uint32_t msw = 0;
56  uint32_t lsw = 0;
57 
59 
60  payloadMap[blkId].push_back(lsw);
61  payloadMap[blkId].push_back(msw);
62 
63  // go to next block id after two muons
64  if (muCtr%2 == 0) {
65  blkId += 2;
66  }
67  }
68 
69  // padding empty muons to reach 3 muons per block id per BX
70  for (auto &kv : payloadMap) {
71  while (kv.second.size()%6 != 0) {
72  kv.second.push_back(0);
73  }
74  }
75  }
76 
77  Blocks blocks;
78  // push everything in the blocks vector
79  for (auto &kv : payloadMap) {
80  //cout << kv.first << ": " << kv.second.size() << kv.second[0] << "\n";
81  blocks.push_back(Block(kv.first, kv.second));
82  }
83  return blocks;
84  }
85  }
86 }
87 
int i
Definition: DBlmapReader.cc:9
std::map< unsigned int, std::vector< uint32_t > > PayloadMap
Definition: MuonPacker.cc:16
MuonPacker(unsigned b1)
Definition: MuonPacker.cc:12
virtual Blocks pack(const edm::Event &, const PackerTokens *) override
Definition: MuonPacker.cc:38
std::vector< Block > Blocks
Definition: Block.h:68
const int mu
Definition: Constants.h:22
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
list blocks
Definition: gather_cfg.py:90
static void generatePackedDataWords(const Muon &, uint32_t &, uint32_t &)
tuple muons
Definition: patZpeak.py:38
#define DEFINE_L1T_PACKER(type)
Definition: Packer.h:36