CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
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 
56  UnpackerMap res;
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 
tuple cfg
Definition: looper.py:296
std::unique_ptr< PackerTokens > registerConsumes(const edm::ParameterSet &cfg, edm::ConsumesCollector &cc) override
Definition: BMTFSetup.cc:10
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
std::shared_ptr< Packer > make(const std::string &) const
const unsigned int firstKalmanFwVer
Definition: BMTFSetup.h:42
PackerMap getPackers(int fed, unsigned int fw) override
Definition: BMTFSetup.cc:17
static const PackerFactory * get()
Definition: PackerFactory.h:14
std::map< int, std::shared_ptr< Unpacker > > UnpackerMap
Definition: PackingSetup.h:25
double amc
Definition: hdecay.h:20
std::shared_ptr< Unpacker > make(const std::string &) const
void fillDescription(edm::ParameterSetDescription &desc) override
Definition: BMTFSetup.cc:15
#define DEFINE_L1T_PACKING_SETUP(type)
std::unique_ptr< UnpackerCollections > getCollections(edm::Event &e) override
Definition: BMTFSetup.cc:42
static const UnpackerFactory * get()
const std::map< int, int > boardIdPerSlot
Definition: BMTFSetup.h:26
UnpackerMap getUnpackers(int fed, int board, int amc, unsigned int fw) override
Definition: BMTFSetup.cc:46
std::map< std::pair< int, int >, Packers > PackerMap
Definition: PackingSetup.h:23
const unsigned int firstNewInputsFwVer
Definition: BMTFSetup.h:41
void registerProducts(edm::ProducesCollector) override
Definition: BMTFSetup.cc:35