CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GTSetup.cc
Go to the documentation of this file.
2 
5 
7 
8 #include "GTCollections.h"
9 #include "GTTokens.h"
10 
11 namespace l1t {
12  namespace stage2 {
13  class GTSetup : public PackingSetup {
14  public:
15  virtual std::unique_ptr<PackerTokens> registerConsumes(const edm::ParameterSet& cfg, edm::ConsumesCollector& cc) override {
16  return std::unique_ptr<PackerTokens>(new GTTokens(cfg, cc));
17  };
18 
19  virtual void fillDescription(edm::ParameterSetDescription& desc) override {};
20 
21  virtual PackerMap getPackers(int fed, unsigned int fw) override {
22  PackerMap res;
23 
24  if (fed == 1404) {
25  // Use board id 1 for packing
26  res[{1, 1}] = {
27 
28  PackerFactory::get()->make("stage2::EGammaPacker"),
29  PackerFactory::get()->make("stage2::EtSumPacker"),
30  PackerFactory::get()->make("stage2::JetPacker"),
31  PackerFactory::get()->make("stage2::TauPacker"),
32  PackerFactory::get()->make("stage2::GlobalAlgBlkPacker"),
33  PackerFactory::get()->make("stage2::GlobalExtBlkPacker")
34  };
35  }
36 
37  return res;
38  };
39 
41 
42  prod.produces<EGammaBxCollection>("GT");
43  prod.produces<EtSumBxCollection>("GT");
44  prod.produces<JetBxCollection>("GT");
45  prod.produces<TauBxCollection>("GT");
46  prod.produces<GlobalAlgBlkBxCollection>();
47  prod.produces<GlobalExtBlkBxCollection>();
48 
49  };
50 
51  virtual std::unique_ptr<UnpackerCollections> getCollections(edm::Event& e) override {
52  return std::unique_ptr<UnpackerCollections>(new GTCollections(e));
53  };
54 
55  virtual UnpackerMap getUnpackers(int fed, int board, int amc, unsigned int fw) override {
56 
57  auto egamma_unp = UnpackerFactory::get()->make("stage2::EGammaUnpacker");
58  auto etsum_unp = UnpackerFactory::get()->make("stage2::EtSumUnpacker");
59  auto jet_unp = UnpackerFactory::get()->make("stage2::JetUnpacker");
60  auto tau_unp = UnpackerFactory::get()->make("stage2::TauUnpacker");
61  auto alg_unp = UnpackerFactory::get()->make("stage2::GlobalAlgBlkUnpacker");
62  auto ext_unp = UnpackerFactory::get()->make("stage2::GlobalExtBlkUnpacker");
63 
64 
65  UnpackerMap res;
66 
67  if (fed == 1404) {
68 
69  // Need to fill other input collections
70  res[12] = jet_unp;
71  res[14] = jet_unp;
72  res[20] = etsum_unp;
73 
74  res[1] = alg_unp;
75  res[3] = alg_unp;
76  res[5] = alg_unp;
77 
78  }
79 
80  return res;
81  };
82  };
83  }
84 }
85 
tuple cfg
Definition: looper.py:293
std::shared_ptr< Packer > make(const std::string &) const
Definition: Packer.cc:12
virtual void registerProducts(edm::stream::EDProducerBase &prod) override
Definition: GTSetup.cc:40
virtual std::unique_ptr< PackerTokens > registerConsumes(const edm::ParameterSet &cfg, edm::ConsumesCollector &cc) override
Definition: GTSetup.cc:15
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 void fillDescription(edm::ParameterSetDescription &desc) override
Definition: GTSetup.cc:19
std::shared_ptr< Unpacker > make(const std::string &) const
Definition: Unpacker.cc:19
virtual std::unique_ptr< UnpackerCollections > getCollections(edm::Event &e) override
Definition: GTSetup.cc:51
static const UnpackerFactory * get()
Definition: Unpacker.h:23
virtual UnpackerMap getUnpackers(int fed, int board, int amc, unsigned int fw) override
Definition: GTSetup.cc:55
std::map< std::pair< int, int >, Packers > PackerMap
Definition: PackingSetup.h:25
#define DEFINE_L1T_PACKING_SETUP(type)
Definition: PackingSetup.h:61
virtual PackerMap getPackers(int fed, unsigned int fw) override
Definition: GTSetup.cc:21