CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RegionalMuonGMTPacker.cc
Go to the documentation of this file.
3 
5 #include "GMTTokens.h"
7 
8 namespace l1t {
9  namespace stage2 {
10  Blocks
12  {
13 
14  //auto bmtfToken = static_cast<const GMTTokens*>(toks)->getRegionalMuonCandTokenBMTF();
15  //auto omtfToken = static_cast<const GMTTokens*>(toks)->getRegionalMuonCandTokenOMTF();
16  //auto emtfToken = static_cast<const GMTTokens*>(toks)->getRegionalMuonCandTokenEMTF();
17 
18  Blocks blocks;
19 
20  // link ids for the different TFs
21  //std::vector<unsigned int> bmtfLinks {48,49,50,51,52,53,54,55,56,57,58,59};
22  //std::vector<unsigned int> omtfLinks {42,43,44,45,46,47,60,61,62,63,64,65};
23  //std::vector<unsigned int> emtfLinks {36,37,38,39,40,41,66,67,68,69,70,71};
24 
25  // pack the muons for each TF in blocks
26  //packTF(event, bmtfToken, blocks, bmtfLinks);
27  //packTF(event, omtfToken, blocks, omtfLinks);
28  //packTF(event, emtfToken, blocks, emtfLinks);
29 
30  return blocks;
31  }
32 
33  void
35  {
37  event.getByToken(tfToken, muons);
38 
39  PayloadMap payloadMap;
40 
41  unsigned bxCtr = 0;
42  for (int i = muons->getFirstBX(); i <= muons->getLastBX(); ++i, ++bxCtr) {
43  for (auto mu = muons->begin(i); mu != muons->end(i); ++mu) {
44  uint32_t msw = 0;
45  uint32_t lsw = 0;
46 
48 
49  payloadMap[mu->link()*2].push_back(lsw);
50  payloadMap[mu->link()*2].push_back(msw);
51  }
52 
53  // muons are expected to come on a range of links depending on the the TF
54  // but even if there was no muon coming from a processor the block should be generated
55  // so add these links without muons to the map as well so that they will be filled with zeros
56  for (const auto &link : links) {
57  if (payloadMap.count(link*2) == 0) {
58  payloadMap[link*2].push_back(0);
59  } else {
60  // if the key was already created in a previous BX then seed an entry for the padding if nothing was filled in this bx
61  if (payloadMap[link*2].size() == bxCtr * 6) {
62  payloadMap[link*2].push_back(0);
63  }
64  }
65  }
66 
67  // padding to 3 muons per block id (link) per BX
68  for (auto &kv : payloadMap) {
69  while (kv.second.size() % 6 != 0) {
70  kv.second.push_back(0);
71  }
72  }
73  }
74 
75  // push everything in the blocks vector
76  for (auto &kv : payloadMap) {
77  blocks.push_back(Block(kv.first, kv.second));
78  }
79  }
80  }
81 }
82 
int i
Definition: DBlmapReader.cc:9
std::map< unsigned int, std::vector< uint32_t > > PayloadMap
static void generatePackedDataWords(const RegionalMuonCand &, uint32_t &, uint32_t &)
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
tuple muons
Definition: patZpeak.py:38
virtual Blocks pack(const edm::Event &, const PackerTokens *) override
void packTF(const edm::Event &, const edm::EDGetTokenT< RegionalMuonCandBxCollection > &, Blocks &, const std::vector< unsigned int > &)
tuple size
Write out results.