CMS 3D CMS Logo

BMTFSetup.cc
Go to the documentation of this file.
4 
5 #include "BMTFSetup.h"
6 
7 namespace l1t {
8  namespace stage2 {
9 
10  std::unique_ptr<PackerTokens> BMTFSetup::registerConsumes(const edm::ParameterSet& cfg,
12  return std::unique_ptr<PackerTokens>(new BMTFTokens(cfg, cc));
13  }
14 
16 
17  PackerMap BMTFSetup::getPackers(int fed, unsigned int fw) {
18  PackerMap res;
19  //res are in format res[amc_no, board_id]
20 
21  if (fed == 1376 || fed == 1377) {
22  for (auto board : boardIdPerSlot) {
23  auto packer_out = std::make_shared<BMTFPackerOutput>();
24  auto packer_in = PackerFactory::get()->make("stage2::BMTFPackerInputs");
25  if (fw >= firstKalmanFwVer) {
26  packer_out->setKalmanAlgoTrue();
27  }
28  res[{board.first, board.second}] = {packer_out, packer_in};
29  }
30  } //if BMTF feds
31 
32  return res;
33  } //getPackers
34 
36  prod.produces<RegionalMuonCandBxCollection>("BMTF");
37  prod.produces<RegionalMuonCandBxCollection>("BMTF2");
38  prod.produces<L1MuDTChambPhContainer>();
39  prod.produces<L1MuDTChambThContainer>();
40  }
41 
42  std::unique_ptr<UnpackerCollections> BMTFSetup::getCollections(edm::Event& e) {
43  return std::unique_ptr<UnpackerCollections>(new BMTFCollections(e));
44  }
45 
46  UnpackerMap BMTFSetup::getUnpackers(int fed, int board, int amc, unsigned int fw) {
47  auto inputMuonsOld = UnpackerFactory::get()->make("stage2::BMTFUnpackerInputsOldQual");
48  auto inputMuonsNew = UnpackerFactory::get()->make("stage2::BMTFUnpackerInputsNewQual");
49  auto outputMuon = std::make_shared<BMTFUnpackerOutput>(); // triggering collection
50  auto outputMuon2 = std::make_shared<BMTFUnpackerOutput>(false); // secondary coll
51  if (fw >= firstKalmanFwVer)
52  outputMuon->setKalmanAlgoTrue();
53  else
54  outputMuon2->setKalmanAlgoTrue();
55 
57  if (fed == 1376 || fed == 1377) {
58  // Input links
59  for (int iL = 0; iL <= 70; iL += 2) {
60  if (iL == 12 || iL == 14 || (iL > 26 && iL < 32) || iL == 60 || iL == 62)
61  continue;
62 
63  if (fw < firstNewInputsFwVer) {
64  res[iL] = inputMuonsOld;
65  } else {
66  res[iL] = inputMuonsNew;
67  }
68  }
69 
70  // Output links
71  res[123] = outputMuon;
72  res[125] = outputMuon2;
73  }
74 
75  return res;
76  };
77  }; // namespace stage2
78 } // namespace l1t
79 
PackerFactory.h
l1t::UnpackerMap
std::map< int, std::shared_ptr< Unpacker > > UnpackerMap
Definition: PackingSetup.h:25
l1t::stage2::BMTFSetup::registerConsumes
std::unique_ptr< PackerTokens > registerConsumes(const edm::ParameterSet &cfg, edm::ConsumesCollector &cc) override
Definition: BMTFSetup.cc:10
PackingSetupFactory.h
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
l1t::PackerFactory::get
static const PackerFactory * get()
Definition: PackerFactory.h:14
l1t::stage2::BMTFSetup::firstKalmanFwVer
const unsigned int firstKalmanFwVer
Definition: BMTFSetup.h:42
L1MuDTChambPhContainer
Definition: L1MuDTChambPhContainer.h:33
BXVector< RegionalMuonCand >
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
l1t::UnpackerFactory::get
static const UnpackerFactory * get()
Definition: UnpackerFactory.h:14
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
l1t::stage2::BMTFSetup::getPackers
PackerMap getPackers(int fed, unsigned int fw) override
Definition: BMTFSetup.cc:17
UnpackerFactory.h
edm::ParameterSet
Definition: ParameterSet.h:47
l1t
delete x;
Definition: CaloConfig.h:22
l1t::stage2::BMTFSetup
Definition: BMTFSetup.h:16
fw
Definition: estimate_field.h:12
l1t::stage2::BMTFSetup::fillDescription
void fillDescription(edm::ParameterSetDescription &desc) override
Definition: BMTFSetup.cc:15
cc
res
Definition: Electron.h:6
SiStripSourceConfigTier0_cff.stage2
stage2
Definition: SiStripSourceConfigTier0_cff.py:71
l1t::stage2::BMTFSetup::getCollections
std::unique_ptr< UnpackerCollections > getCollections(edm::Event &e) override
Definition: BMTFSetup.cc:42
looper.cfg
cfg
Definition: looper.py:296
l1t::stage2::BMTFSetup::boardIdPerSlot
const std::map< int, int > boardIdPerSlot
Definition: BMTFSetup.h:26
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
l1t::UnpackerFactory::make
std::shared_ptr< Unpacker > make(const std::string &) const
Definition: UnpackerFactory.cc:17
edm::ProducesCollector
Definition: ProducesCollector.h:43
l1t::stage2::BMTFSetup::getUnpackers
UnpackerMap getUnpackers(int fed, int board, int amc, unsigned int fw) override
Definition: BMTFSetup.cc:46
amc
Definition: AMCSpec.h:8
l1t::PackerFactory::make
std::shared_ptr< Packer > make(const std::string &) const
Definition: PackerFactory.cc:10
l1t::stage2::BMTFCollections
Definition: BMTFCollections.h:12
l1t::stage2::BMTFSetup::firstNewInputsFwVer
const unsigned int firstNewInputsFwVer
Definition: BMTFSetup.h:41
edm::Event
Definition: Event.h:73
L1MuDTChambThContainer
Definition: L1MuDTChambThContainer.h:33
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
BMTFSetup.h
l1t::stage2::BMTFSetup::registerProducts
void registerProducts(edm::ProducesCollector) override
Definition: BMTFSetup.cc:35
l1t::stage2::BMTFTokens
Definition: BMTFTokens.h:12
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37