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  std::array<int, 12> board_out = {{1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 6, 12}}; //these are board_ids per amc_no-1
23 
24  for (unsigned int i = 1; i <= board_out.size(); i++) {
25  if (i % 2 != 0) { //maybe this check is not needed
26  res[{i, board_out[i - 1]}] = {PackerFactory::get()->make("stage2::BMTFPackerOutput"),
27  PackerFactory::get()->make("stage2::BMTFPackerInputs")};
28  } else {
29  res[{i, board_out[i - 1]}] = {PackerFactory::get()->make("stage2::BMTFPackerOutput"),
30  PackerFactory::get()->make("stage2::BMTFPackerInputs")};
31  }
32  }
33  } //if feds
34 
35  /*
36  if (fed == 1376) {
37  std::cout << "fed is 1376" << std::endl;
38  for (int i=1; i <= 12; i = i+2){//itr for amc_no = 1,3,5,7,9,11
39  res[{i,board_out[i-1]}] = {PackerFactory::get()->make("stage2::BMTFPackerOutput"),
40  PackerFactory::get()->make("stage2::BMTFPackerInputs")};
41  }
42 
43  }
44  else if (fed == 1377) {
45  std::cout << "fed is 1377" << std::endl;
46  for (int i=2; i <=12; i = i+2){//itr for amc_no = 2,4,6,8,10,12
47  res[{i,board_out[i-1]}] = {PackerFactory::get()->make("stage2::BMTFPackerOutput"),
48  PackerFactory::get()->make("stage2::BMTFPackerInputs")};
49  }
50 
51  }
52  else{
53  std::cout << std::endl;
54  std::cout << "The given fed is not a BMTF fed (1376 or 1377)" << std::endl;
55  std::cout << std::endl;
56  }//if feds
57  */
58 
59  return res;
60  } //getPackers
61 
63  prod.produces<RegionalMuonCandBxCollection>("BMTF");
64  prod.produces<RegionalMuonCandBxCollection>("BMTF2");
65  prod.produces<L1MuDTChambPhContainer>();
66  prod.produces<L1MuDTChambThContainer>();
67 
68  // Depricated
69  //prod.produces<L1MuDTChambPhContainer>("PhiDigis");
70  //prod.produces<L1MuDTChambThContainer>("TheDigis");
71  }
72 
73  std::unique_ptr<UnpackerCollections> BMTFSetup::getCollections(edm::Event& e) {
74  return std::unique_ptr<UnpackerCollections>(new BMTFCollections(e));
75  }
76 
77  UnpackerMap BMTFSetup::getUnpackers(int fed, int board, int amc, unsigned int fw) {
78  auto inputMuonsOld = UnpackerFactory::get()->make("stage2::BMTFUnpackerInputsOldQual");
79  auto inputMuonsNew = UnpackerFactory::get()->make("stage2::BMTFUnpackerInputsNewQual");
80 
81  auto outputMuon = std::make_shared<BMTFUnpackerOutput>(); //here is the triggering collection
82  auto outputMuon2 = std::make_shared<BMTFUnpackerOutput>(false); //here is the secondary
83  if (fw >= 2499805536) //this is in HEX '95000160'
84  outputMuon->setKalmanAlgoTrue();
85  else
86  outputMuon2->setKalmanAlgoTrue();
87 
89  if (fed == 1376 || fed == 1377) {
90  // Input links
91  for (int iL = 0; iL <= 70; iL += 2) {
92  if (iL == 12 || iL == 14 || (iL > 26 && iL < 32) || iL == 60 || iL == 62)
93  continue;
94 
95  if (fw < 2452619552) {
96  res[iL] = inputMuonsOld;
97  } else {
98  res[iL] = inputMuonsNew;
99  }
100  }
101 
102  // Output links
103  res[123] = outputMuon;
104  res[125] = outputMuon2;
105  }
106 
107  return res;
108  };
109  }; // namespace stage2
110 } // namespace l1t
111 
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
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
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:36
l1t
delete x;
Definition: CaloConfig.h:22
l1t::stage2::BMTFSetup
Definition: BMTFSetup.h:15
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:73
looper.cfg
cfg
Definition: looper.py:297
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:77
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
edm::Event
Definition: Event.h:73
L1MuDTChambThContainer
Definition: L1MuDTChambThContainer.h:33
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
BMTFSetup.h
l1t::stage2::BMTFSetup::registerProducts
void registerProducts(edm::ProducesCollector) override
Definition: BMTFSetup.cc:62
l1t::stage2::BMTFTokens
Definition: BMTFTokens.h:12
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37