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  virtual Blocks pack(const edm::Event&, const PackerTokens*) override;
13  private:
14  typedef std::map<unsigned int, std::vector<uint32_t>> PayloadMap;
15  };
16  }
17 }
18 
19 // Implementation
20 namespace l1t {
21  namespace stage2 {
22  Blocks
24  {
26  event.getByToken(static_cast<const GMTTokens*>(toks)->getMuonToken(), muons);
27 
28  PayloadMap payloadMap;
29 
30  for (int i = muons->getFirstBX(); i <= muons->getLastBX(); ++i) {
31  // the first muon in every BX and every block id is 0
32  for (unsigned int blkId = 1; blkId < 8; blkId += 2) {
33  payloadMap[blkId].push_back(0);
34  payloadMap[blkId].push_back(0);
35  }
36 
37  unsigned int blkId = 1;
38  int muCtr = 1;
39  for (auto mu = muons->begin(i); mu != muons->end(i) && muCtr <= 8; ++mu, ++muCtr) {
40  uint32_t msw = 0;
41  uint32_t lsw = 0;
42 
44 
45  payloadMap[blkId].push_back(lsw);
46  payloadMap[blkId].push_back(msw);
47 
48  // go to next block id after two muons
49  if (muCtr%2 == 0) {
50  blkId += 2;
51  }
52  }
53 
54  // padding empty muons to reach 3 muons per block id per BX
55  for (auto &kv : payloadMap) {
56  while (kv.second.size()%6 != 0) {
57  kv.second.push_back(0);
58  }
59  }
60  }
61 
62  Blocks blocks;
63  // push everything in the blocks vector
64  for (auto &kv : payloadMap) {
65  blocks.push_back(Block(kv.first, kv.second));
66  }
67  return blocks;
68  }
69  }
70 }
71 
int i
Definition: DBlmapReader.cc:9
std::map< unsigned int, std::vector< uint32_t > > PayloadMap
Definition: MuonPacker.cc:14
virtual Blocks pack(const edm::Event &, const PackerTokens *) override
Definition: MuonPacker.cc:23
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