CMS 3D CMS Logo

GMTSetup.cc
Go to the documentation of this file.
3 
7 
13 
14 #include "GMTSetup.h"
15 
16 #include <array>
17 #include <string>
18 
19 namespace l1t {
20  namespace stage2 {
21  std::unique_ptr<PackerTokens> GMTSetup::registerConsumes(const edm::ParameterSet& cfg, edm::ConsumesCollector& cc) {
22  return std::unique_ptr<PackerTokens>(new GMTTokens(cfg, cc));
23  }
24 
26  desc.addOptional<edm::InputTag>("BMTFInputLabel")->setComment("for stage2");
27  desc.addOptional<edm::InputTag>("OMTFInputLabel")->setComment("for stage2");
28  desc.addOptional<edm::InputTag>("EMTFInputLabel")->setComment("for stage2");
29  desc.addOptional<edm::InputTag>("ImdInputLabelBMTF")
30  ->setComment("uGMT intermediate muon from BMTF after first sorting stage");
31  desc.addOptional<edm::InputTag>("ImdInputLabelEMTFNeg")
32  ->setComment("uGMT intermediate muon from neg. EMTF side after first sorting stage");
33  desc.addOptional<edm::InputTag>("ImdInputLabelEMTFPos")
34  ->setComment("uGMT intermediate muon from pos. EMTF side after first sorting stage");
35  desc.addOptional<edm::InputTag>("ImdInputLabelOMTFNeg")
36  ->setComment("uGMT intermediate muon from neg. OMTF side after first sorting stage");
37  desc.addOptional<edm::InputTag>("ImdInputLabelOMTFPos")
38  ->setComment("uGMT intermediate muon from pos. OMTF side after first sorting stage");
39  }
40 
41  PackerMap GMTSetup::getPackers(int fed, unsigned int fw) {
42  PackerMap res;
43  if (fed == 1402) {
44  auto gmt_in_packer = static_pointer_cast<l1t::stage2::RegionalMuonGMTPacker>(
45  PackerFactory::get()->make("stage2::RegionalMuonGMTPacker"));
46  if (fw >= 0x6000000) {
47  gmt_in_packer->setKalmanAlgoTrue();
48  }
49  auto gmt_out_packer =
50  static_pointer_cast<l1t::stage2::GMTMuonPacker>(PackerFactory::get()->make("stage2::GMTMuonPacker"));
51  gmt_out_packer->setFed(fed);
52  gmt_out_packer->setFwVersion(fw);
53  // Use amc_no and board id 1 for packing
54  res[{1, 1}] = {
55  gmt_in_packer,
56  gmt_out_packer,
57  PackerFactory::get()->make("stage2::IntermediateMuonPacker"),
58  };
59  }
60  return res;
61  }
62 
64  prod.produces<RegionalMuonCandBxCollection>("BMTF");
65  prod.produces<RegionalMuonCandBxCollection>("OMTF");
66  prod.produces<RegionalMuonCandBxCollection>("EMTF");
67  prod.produces<MuonBxCollection>("Muon");
68  for (int i = 1; i < 6; ++i) {
69  prod.produces<MuonBxCollection>("MuonCopy" + std::to_string(i));
70  }
71  prod.produces<MuonBxCollection>("imdMuonsBMTF");
72  prod.produces<MuonBxCollection>("imdMuonsEMTFNeg");
73  prod.produces<MuonBxCollection>("imdMuonsEMTFPos");
74  prod.produces<MuonBxCollection>("imdMuonsOMTFNeg");
75  prod.produces<MuonBxCollection>("imdMuonsOMTFPos");
76  }
77 
78  std::unique_ptr<UnpackerCollections> GMTSetup::getCollections(edm::Event& e) {
79  return std::unique_ptr<UnpackerCollections>(new GMTCollections(e));
80  }
81 
82  UnpackerMap GMTSetup::getUnpackers(int fed, int board, int amc, unsigned int fw) {
84 
85  // MP7 input link numbers are represented by even numbers starting from 0 (iLink=link*2)
86  // input muons on links 36-71
87  auto gmt_in_unp = static_pointer_cast<l1t::stage2::RegionalMuonGMTUnpacker>(
88  UnpackerFactory::get()->make("stage2::RegionalMuonGMTUnpacker"));
89  if (fw >= 0x6000000) {
90  gmt_in_unp->setKalmanAlgoTrue();
91  }
92 
93  for (int iLink = 72; iLink < 144; iLink += 2) {
94  res[iLink] = gmt_in_unp;
95  }
96 
97  // MP7 output link numbers are represented by odd numbers (oLink=link*2+1)
98  // internal muons on links 24-31
99  auto gmt_imd_unp = static_pointer_cast<l1t::stage2::IntermediateMuonUnpacker>(
100  UnpackerFactory::get()->make("stage2::IntermediateMuonUnpacker"));
101  gmt_imd_unp->setAlgoVersion(fw);
102  for (int oLink = 49; oLink < 65; oLink += 2)
103  res[oLink] = gmt_imd_unp;
104 
105  // output muons on links 0-23 (6 copies on 4 links each)
106  std::array<std::shared_ptr<l1t::stage2::MuonUnpacker>, 6> gmt_out_unps;
107  int i = 0;
108  for (auto gmt_out_unp : gmt_out_unps) {
109  gmt_out_unp =
110  static_pointer_cast<l1t::stage2::MuonUnpacker>(UnpackerFactory::get()->make("stage2::MuonUnpacker"));
111  gmt_out_unp->setAlgoVersion(fw);
112  gmt_out_unp->setFedNumber(fed);
113  gmt_out_unp->setMuonCopy(i);
114 
115  int oLinkMin = i * 8 + 1;
116  for (int oLink = oLinkMin; oLink < oLinkMin + 8; oLink += 2)
117  res[oLink] = gmt_out_unp;
118 
119  ++i;
120  }
121 
122  return res;
123  }
124  } // namespace stage2
125 } // namespace l1t
126 
mps_fire.i
i
Definition: mps_fire.py:428
PackerFactory.h
RegionalMuonGMTPacker.h
RegionalMuonGMTUnpacker.h
l1t::UnpackerMap
std::map< int, std::shared_ptr< Unpacker > > UnpackerMap
Definition: PackingSetup.h:25
PackingSetupFactory.h
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
MuonPacker.h
l1t::PackerFactory::get
static const PackerFactory * get()
Definition: PackerFactory.h:14
l1t::stage2::GMTSetup::getUnpackers
UnpackerMap getUnpackers(int fed, int board, int amc, unsigned int fw) override
Definition: GMTSetup.cc:82
BXVector< RegionalMuonCand >
l1t::stage2::GMTSetup::getCollections
std::unique_ptr< UnpackerCollections > getCollections(edm::Event &e) override
Definition: GMTSetup.cc:78
l1t::stage2::GMTSetup::getPackers
PackerMap getPackers(int fed, unsigned int fw) override
Definition: GMTSetup.cc:41
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:47
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:25
l1t::stage2::GMTSetup::registerConsumes
std::unique_ptr< PackerTokens > registerConsumes(const edm::ParameterSet &cfg, edm::ConsumesCollector &cc) override
Definition: GMTSetup.cc:21
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
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
l1t::stage2::GMTSetup::registerProducts
void registerProducts(edm::ProducesCollector) override
Definition: GMTSetup.cc:63
edm::ProducesCollector
Definition: ProducesCollector.h:43
EDProducerBase.h
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:45
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37