CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GMTSetup.cc
Go to the documentation of this file.
3 
7 
8 #include "GMTSetup.h"
9 
10 namespace l1t {
11  namespace stage2 {
12  std::unique_ptr<PackerTokens>
14  {
15  return std::unique_ptr<PackerTokens>(new GMTTokens(cfg, cc));
16  }
17 
18  void
20  {
21  desc.addOptional<edm::InputTag>("BMTFInputLabel")->setComment("for stage2");
22  desc.addOptional<edm::InputTag>("OMTFInputLabel")->setComment("for stage2");
23  desc.addOptional<edm::InputTag>("EMTFInputLabel")->setComment("for stage2");
24  desc.addOptional<edm::InputTag>("ImdInputLabelBMTF")->setComment("uGMT intermediate muon from BMTF after first sorting stage");
25  desc.addOptional<edm::InputTag>("ImdInputLabelEMTFNeg")->setComment("uGMT intermediate muon from neg. EMTF side after first sorting stage");
26  desc.addOptional<edm::InputTag>("ImdInputLabelEMTFPos")->setComment("uGMT intermediate muon from pos. EMTF side after first sorting stage");
27  desc.addOptional<edm::InputTag>("ImdInputLabelOMTFNeg")->setComment("uGMT intermediate muon from neg. OMTF side after first sorting stage");
28  desc.addOptional<edm::InputTag>("ImdInputLabelOMTFPos")->setComment("uGMT intermediate muon from pos. OMTF side after first sorting stage");
29  }
30 
31  PackerMap
32  GMTSetup::getPackers(int fed, unsigned int fw)
33  {
34  PackerMap res;
35 
36  if (fed == 1402) {
37  // Use amc_no and board id 1 for packing
38  res[{1, 1}] = {
39  PackerFactory::get()->make("stage2::RegionalMuonGMTPacker"),
40  PackerFactory::get()->make("stage2::GMTMuonPacker"),
41  PackerFactory::get()->make("stage2::IntermediateMuonPacker"),
42  };
43  }
44 
45  return res;
46  }
47 
48  void
50  {
51  prod.produces<RegionalMuonCandBxCollection>("BMTF");
52  prod.produces<RegionalMuonCandBxCollection>("OMTF");
53  prod.produces<RegionalMuonCandBxCollection>("EMTF");
54  prod.produces<MuonBxCollection>("Muon");
55  prod.produces<MuonBxCollection>("imdMuonsBMTF");
56  prod.produces<MuonBxCollection>("imdMuonsEMTFNeg");
57  prod.produces<MuonBxCollection>("imdMuonsEMTFPos");
58  prod.produces<MuonBxCollection>("imdMuonsOMTFNeg");
59  prod.produces<MuonBxCollection>("imdMuonsOMTFPos");
60  }
61 
62  std::unique_ptr<UnpackerCollections>
64  {
65  return std::unique_ptr<UnpackerCollections>(new GMTCollections(e));
66  }
67 
69  GMTSetup::getUnpackers(int fed, int board, int amc, unsigned int fw)
70  {
71  UnpackerMap res;
72 
73  auto gmt_in_unp = UnpackerFactory::get()->make("stage2::RegionalMuonGMTUnpacker");
74  auto gmt_out_unp = UnpackerFactory::get()->make("stage2::MuonUnpacker");
75  auto gmt_imd_unp = UnpackerFactory::get()->make("stage2::IntermediateMuonUnpacker");
76 
77  // input muons
78  for (int iLink = 72; iLink < 144; iLink += 2)
79  res[iLink] = gmt_in_unp;
80  // output muons
81  for (int oLink = 1; oLink < 9; oLink += 2)
82  res[oLink] = gmt_out_unp;
83  // internal muons
84  for (int oLink = 49; oLink < 63; oLink += 2)
85  res[oLink] = gmt_imd_unp;
86 
87  return res;
88  }
89  }
90 }
91 
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
tuple cfg
Definition: looper.py:293
virtual std::unique_ptr< UnpackerCollections > getCollections(edm::Event &e) override
Definition: GMTSetup.cc:63
std::shared_ptr< Packer > make(const std::string &) const
virtual void registerProducts(edm::stream::EDProducerBase &prod) override
Definition: GMTSetup.cc:49
static const PackerFactory * get()
Definition: PackerFactory.h:14
std::map< int, std::shared_ptr< Unpacker > > UnpackerMap
Definition: PackingSetup.h:27
double amc
Definition: hdecay.h:20
virtual void fillDescription(edm::ParameterSetDescription &desc) override
Definition: GMTSetup.cc:19
virtual PackerMap getPackers(int fed, unsigned int fw) override
Definition: GMTSetup.cc:32
std::shared_ptr< Unpacker > make(const std::string &) const
virtual UnpackerMap getUnpackers(int fed, int board, int amc, unsigned int fw) override
Definition: GMTSetup.cc:69
#define DEFINE_L1T_PACKING_SETUP(type)
virtual std::unique_ptr< PackerTokens > registerConsumes(const edm::ParameterSet &cfg, edm::ConsumesCollector &cc) override
Definition: GMTSetup.cc:13
static const UnpackerFactory * get()
std::map< std::pair< int, int >, Packers > PackerMap
Definition: PackingSetup.h:25