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.
3 
5 #include "GMTTokens.h"
6 #include "MuonPacker.h"
7 
8 namespace l1t {
9  namespace stage2 {
10  Blocks
12  {
14  event.getByToken(static_cast<const CommonTokens*>(toks)->getMuonToken(), muons);
15 
16  PayloadMap payloadMap;
17 
18  for (int i = muons->getFirstBX(); i <= muons->getLastBX(); ++i) {
19  // the first muon in every BX and every block id is 0
20  for (unsigned int blkId = b1_; blkId < b1_+7; blkId += 2) {
21  payloadMap[blkId].push_back(0);
22  payloadMap[blkId].push_back(0);
23  }
24 
25  unsigned int blkId = b1_;
26  int muCtr = 1;
27  for (auto mu = muons->begin(i); mu != muons->end(i) && muCtr <= 8; ++mu, ++muCtr) {
28  uint32_t msw = 0;
29  uint32_t lsw = 0;
30 
32 
33  payloadMap[blkId].push_back(lsw);
34  payloadMap[blkId].push_back(msw);
35 
36  // go to next block id after two muons
37  if (muCtr%2 == 0) {
38  blkId += 2;
39  }
40  }
41 
42  // padding empty muons to reach 3 muons per block id per BX
43  for (auto &kv : payloadMap) {
44  while (kv.second.size()%6 != 0) {
45  kv.second.push_back(0);
46  }
47  }
48  }
49 
50  Blocks blocks;
51  // push everything in the blocks vector
52  for (auto &kv : payloadMap) {
53  //cout << kv.first << ": " << kv.second.size() << kv.second[0] << "\n";
54  blocks.push_back(Block(kv.first, kv.second));
55  }
56  return blocks;
57  }
58  }
59 }
60 
int i
Definition: DBlmapReader.cc:9
std::map< unsigned int, std::vector< uint32_t > > PayloadMap
Definition: MuonPacker.h:14
virtual Blocks pack(const edm::Event &, const PackerTokens *) override
Definition: MuonPacker.cc:11
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
#define DEFINE_L1T_PACKER(type)
Definition: PackerFactory.h:22
list blocks
Definition: gather_cfg.py:90
static void generatePackedDataWords(const Muon &, uint32_t &, uint32_t &)
tuple muons
Definition: patZpeak.py:38