CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GMTSetup.cc
Go to the documentation of this file.
3 
6 
8 
9 #include "GMTCollections.h"
10 #include "GMTTokens.h"
11 
12 namespace l1t {
13  namespace stage2 {
14  class GMTSetup : public PackingSetup {
15  public:
16  virtual std::unique_ptr<PackerTokens> registerConsumes(const edm::ParameterSet& cfg, edm::ConsumesCollector& cc) override {
17  return std::unique_ptr<PackerTokens>(new GMTTokens(cfg, cc));
18  };
19 
20  virtual void fillDescription(edm::ParameterSetDescription& desc) override {
21  desc.addOptional<edm::InputTag>("BMTFInputLabel")->setComment("for stage2");
22  desc.addOptional<edm::InputTag>("OMTFInputLabel")->setComment("for stage2");
23  desc.addOptional<edm::InputTag>("EMTFInputLabel")->setComment("for stage2");
24  };
25 
26  virtual PackerMap getPackers(int fed, unsigned int fw) override {
27  PackerMap res;
28 
29  if (fed == 1402) {
30  // Use amc_no and board id 1 for packing
31  res[{1, 1}] = {
32  PackerFactory::get()->make("stage2::RegionalMuonGMTPacker"),
33  PackerFactory::get()->make("stage2::MuonPacker"),
34  };
35  }
36 
37  return res;
38  };
39 
41  prod.produces<RegionalMuonCandBxCollection>("BMTF");
42  prod.produces<RegionalMuonCandBxCollection>("OMTF");
43  prod.produces<RegionalMuonCandBxCollection>("EMTF");
44  prod.produces<MuonBxCollection>("Muon");
45  };
46 
47  virtual std::unique_ptr<UnpackerCollections> getCollections(edm::Event& e) override {
48  return std::unique_ptr<UnpackerCollections>(new GMTCollections(e));
49  };
50 
51  virtual UnpackerMap getUnpackers(int fed, int board, int amc, unsigned int fw) override {
52  UnpackerMap res;
53 
54  auto gmt_in_unp = UnpackerFactory::get()->make("stage2::RegionalMuonGMTUnpacker");
55  auto gmt_out_unp = UnpackerFactory::get()->make("stage2::MuonUnpacker");
56 
57  // input muons
58  for (int iLink = 72; iLink < 144; iLink += 2)
59  res[iLink] = gmt_in_unp;
60  // output muons
61  for (int oLink = 1; oLink < 9; oLink += 2)
62  res[oLink] = gmt_out_unp;
63  // internal muons
64  //for (int oLink = 9; oLink < 24; oLink += 2)
65  // res[oLink] = gmt_out_unp;
66 
67  return res;
68  };
69  };
70  }
71 }
72 
virtual void fillDescription(edm::ParameterSetDescription &desc) override
Definition: GMTSetup.cc:20
virtual void registerProducts(edm::stream::EDProducerBase &prod) override
Definition: GMTSetup.cc:40
virtual std::unique_ptr< PackerTokens > registerConsumes(const edm::ParameterSet &cfg, edm::ConsumesCollector &cc) override
Definition: GMTSetup.cc:16
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
tuple cfg
Definition: looper.py:293
std::shared_ptr< Packer > make(const std::string &) const
Definition: Packer.cc:12
static const PackerFactory * get()
Definition: Packer.h:28
std::map< int, std::shared_ptr< Unpacker > > UnpackerMap
Definition: PackingSetup.h:27
double amc
Definition: hdecay.h:20
virtual std::unique_ptr< UnpackerCollections > getCollections(edm::Event &e) override
Definition: GMTSetup.cc:47
std::shared_ptr< Unpacker > make(const std::string &) const
Definition: Unpacker.cc:21
static const UnpackerFactory * get()
Definition: Unpacker.h:23
virtual UnpackerMap getUnpackers(int fed, int board, int amc, unsigned int fw) override
Definition: GMTSetup.cc:51
virtual PackerMap getPackers(int fed, unsigned int fw) override
Definition: GMTSetup.cc:26
std::map< std::pair< int, int >, Packers > PackerMap
Definition: PackingSetup.h:25
#define DEFINE_L1T_PACKING_SETUP(type)
Definition: PackingSetup.h:61