CMS 3D CMS Logo

GMTSetup.cc
Go to the documentation of this file.
2 
6 
9 
10 #include "GMTSetup.h"
11 
12 #include <array>
13 #include <string>
14 
15 namespace l1t {
16  namespace stage2 {
17  std::unique_ptr<PackerTokens> GMTSetup::registerConsumes(const edm::ParameterSet& cfg, edm::ConsumesCollector& cc) {
18  return std::unique_ptr<PackerTokens>(new GMTTokens(cfg, cc));
19  }
20 
22  desc.addOptional<edm::InputTag>("BMTFInputLabel")->setComment("for stage2");
23  desc.addOptional<edm::InputTag>("OMTFInputLabel")->setComment("for stage2");
24  desc.addOptional<edm::InputTag>("EMTFInputLabel")->setComment("for stage2");
25  desc.addOptional<edm::InputTag>("ImdInputLabelBMTF")
26  ->setComment("uGMT intermediate muon from BMTF after first sorting stage");
27  desc.addOptional<edm::InputTag>("ImdInputLabelEMTFNeg")
28  ->setComment("uGMT intermediate muon from neg. EMTF side after first sorting stage");
29  desc.addOptional<edm::InputTag>("ImdInputLabelEMTFPos")
30  ->setComment("uGMT intermediate muon from pos. EMTF side after first sorting stage");
31  desc.addOptional<edm::InputTag>("ImdInputLabelOMTFNeg")
32  ->setComment("uGMT intermediate muon from neg. OMTF side after first sorting stage");
33  desc.addOptional<edm::InputTag>("ImdInputLabelOMTFPos")
34  ->setComment("uGMT intermediate muon from pos. OMTF side after first sorting stage");
35  }
36 
37  PackerMap GMTSetup::getPackers(int fed, unsigned int fw) {
38  PackerMap res;
39  if (fed == 1402) {
40  // Use amc_no and board id 1 for packing
41  res[{1, 1}] = {
42  PackerFactory::get()->make("stage2::RegionalMuonGMTPacker"),
43  PackerFactory::get()->make("stage2::GMTMuonPacker"),
44  PackerFactory::get()->make("stage2::IntermediateMuonPacker"),
45  };
46  }
47  return res;
48  }
49 
51  prod.produces<RegionalMuonCandBxCollection>("BMTF");
52  prod.produces<RegionalMuonCandBxCollection>("OMTF");
53  prod.produces<RegionalMuonCandBxCollection>("EMTF");
54  prod.produces<MuonBxCollection>("Muon");
55  for (int i = 1; i < 6; ++i) {
56  prod.produces<MuonBxCollection>("MuonCopy" + std::to_string(i));
57  }
58  prod.produces<MuonBxCollection>("imdMuonsBMTF");
59  prod.produces<MuonBxCollection>("imdMuonsEMTFNeg");
60  prod.produces<MuonBxCollection>("imdMuonsEMTFPos");
61  prod.produces<MuonBxCollection>("imdMuonsOMTFNeg");
62  prod.produces<MuonBxCollection>("imdMuonsOMTFPos");
63  }
64 
65  std::unique_ptr<UnpackerCollections> GMTSetup::getCollections(edm::Event& e) {
66  return std::unique_ptr<UnpackerCollections>(new GMTCollections(e));
67  }
68 
69  UnpackerMap GMTSetup::getUnpackers(int fed, int board, int amc, unsigned int fw) {
71 
72  // MP7 input link numbers are represented by even numbers starting from 0 (iLink=link*2)
73  // input muons on links 36-71
74  auto gmt_in_unp = UnpackerFactory::get()->make("stage2::RegionalMuonGMTUnpacker");
75  for (int iLink = 72; iLink < 144; iLink += 2)
76  res[iLink] = gmt_in_unp;
77 
78  // MP7 output link numbers are represented by odd numbers (oLink=link*2+1)
79  // internal muons on links 24-31
80  auto gmt_imd_unp = static_pointer_cast<l1t::stage2::IntermediateMuonUnpacker>(
81  UnpackerFactory::get()->make("stage2::IntermediateMuonUnpacker"));
82  gmt_imd_unp->setAlgoVersion(fw);
83  for (int oLink = 49; oLink < 65; oLink += 2)
84  res[oLink] = gmt_imd_unp;
85 
86  // output muons on links 0-23 (6 copies on 4 links each)
87  std::array<std::shared_ptr<l1t::stage2::MuonUnpacker>, 6> gmt_out_unps;
88  int i = 0;
89  for (auto gmt_out_unp : gmt_out_unps) {
90  gmt_out_unp =
91  static_pointer_cast<l1t::stage2::MuonUnpacker>(UnpackerFactory::get()->make("stage2::MuonUnpacker"));
92  gmt_out_unp->setAlgoVersion(fw);
93  gmt_out_unp->setFedNumber(fed);
94  gmt_out_unp->setMuonCopy(i);
95 
96  int oLinkMin = i * 8 + 1;
97  for (int oLink = oLinkMin; oLink < oLinkMin + 8; oLink += 2)
98  res[oLink] = gmt_out_unp;
99 
100  ++i;
101  }
102 
103  return res;
104  }
105  } // namespace stage2
106 } // namespace l1t
107 
mps_fire.i
i
Definition: mps_fire.py:355
PackerFactory.h
l1t::UnpackerMap
std::map< int, std::shared_ptr< Unpacker > > UnpackerMap
Definition: PackingSetup.h:25
PackingSetupFactory.h
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
l1t::PackerFactory::get
static const PackerFactory * get()
Definition: PackerFactory.h:14
edm::ParameterSetDescription::addOptional
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:105
l1t::stage2::GMTSetup::getUnpackers
UnpackerMap getUnpackers(int fed, int board, int amc, unsigned int fw) override
Definition: GMTSetup.cc:69
BXVector< RegionalMuonCand >
l1t::stage2::GMTSetup::getCollections
std::unique_ptr< UnpackerCollections > getCollections(edm::Event &e) override
Definition: GMTSetup.cc:65
l1t::stage2::GMTSetup::getPackers
PackerMap getPackers(int fed, unsigned int fw) override
Definition: GMTSetup.cc:37
l1t::PackerMap
std::map< std::pair< int, int >, Packers > PackerMap
Definition: PackingSetup.h:23
DEFINE_L1T_PACKING_SETUP
#define DEFINE_L1T_PACKING_SETUP(type)
Definition: PackingSetupFactory.h:24
GMTSetup.h
l1t::UnpackerFactory::get
static const UnpackerFactory * get()
Definition: UnpackerFactory.h:14
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
UnpackerFactory.h
edm::ParameterSet
Definition: ParameterSet.h:36
l1t
delete x;
Definition: CaloConfig.h:22
l1t::stage2::GMTTokens
Definition: GMTTokens.h:11
fw
Definition: estimate_field.h:12
l1t::stage2::GMTSetup::fillDescription
void fillDescription(edm::ParameterSetDescription &desc) override
Definition: GMTSetup.cc:21
l1t::stage2::GMTSetup::registerConsumes
std::unique_ptr< PackerTokens > registerConsumes(const edm::ParameterSet &cfg, edm::ConsumesCollector &cc) override
Definition: GMTSetup.cc:17
l1t::stage2::GMTSetup
Definition: GMTSetup.h:15
MuonUnpacker.h
cc
res
Definition: Electron.h:6
SiStripSourceConfigTier0_cff.stage2
stage2
Definition: SiStripSourceConfigTier0_cff.py:71
reco::modules::make
S make(const edm::ParameterSet &cfg)
Definition: ParameterAdapter.h:21
InputTag.h
looper.cfg
cfg
Definition: looper.py:297
l1t::stage2::GMTCollections
Definition: GMTCollections.h:13
l1t::stage2::GMTSetup::registerProducts
void registerProducts(edm::ProducesCollector) override
Definition: GMTSetup.cc:50
l1t::UnpackerFactory::make
std::shared_ptr< Unpacker > make(const std::string &) const
Definition: UnpackerFactory.cc:17
edm::ProducesCollector
Definition: ProducesCollector.h:43
amc
Definition: AMCSpec.h:8
l1t::PackerFactory::make
std::shared_ptr< Packer > make(const std::string &) const
Definition: PackerFactory.cc:10
edm::Event
Definition: Event.h:73
IntermediateMuonUnpacker.h
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37