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  desc.addOptional<edm::InputTag>("GtInputLabel")->setComment("for stage2");
21  desc.addOptional<edm::InputTag>("ExtInputLabel")->setComment("for stage2");
22  desc.addOptional<edm::InputTag>("GmtInputLabel")->setComment("for stage2");
23  desc.addOptional<edm::InputTag>("CaloInputLabel")->setComment("for stage2");
24  };
25 
26  virtual PackerMap getPackers(int fed, unsigned int fw) override {
27  PackerMap res;
28 
29  if (fed == 1404) {
30  // Use board id 1 for packing
31  res[{1, 1}] = {
32 
33  PackerFactory::get()->make("stage2::GTMuonPacker"),
34  PackerFactory::get()->make("stage2::GTEGammaPacker"),
35  PackerFactory::get()->make("stage2::GTEtSumPacker"),
36  PackerFactory::get()->make("stage2::GTJetPacker"),
37  PackerFactory::get()->make("stage2::GTTauPacker"),
38  PackerFactory::get()->make("stage2::GlobalAlgBlkPacker"),
39  //PackerFactory::get()->make("stage2::GlobalExtBlkPacker")
40  };
41  }
42 
43  return res;
44  };
45 
47 
48  prod.produces<MuonBxCollection>("Muon");
49  prod.produces<EGammaBxCollection>("EGamma");
50  prod.produces<EtSumBxCollection>("EtSum");
51  prod.produces<JetBxCollection>("Jet");
52  prod.produces<TauBxCollection>("Tau");
53  prod.produces<GlobalAlgBlkBxCollection>();
54  prod.produces<GlobalExtBlkBxCollection>();
55 
56  };
57 
58  virtual std::unique_ptr<UnpackerCollections> getCollections(edm::Event& e) override {
59  return std::unique_ptr<UnpackerCollections>(new GTCollections(e));
60  };
61 
62  virtual UnpackerMap getUnpackers(int fed, int board, int amc, unsigned int fw) override {
63 
64  auto muon_unp = UnpackerFactory::get()->make("stage2::MuonUnpacker");
65  auto egamma_unp = UnpackerFactory::get()->make("stage2::EGammaUnpacker");
66  auto etsum_unp = UnpackerFactory::get()->make("stage2::EtSumUnpacker");
67  auto jet_unp = UnpackerFactory::get()->make("stage2::JetUnpacker");
68  auto tau_unp = UnpackerFactory::get()->make("stage2::TauUnpacker");
69  auto alg_unp = UnpackerFactory::get()->make("stage2::GlobalAlgBlkUnpacker");
70  auto ext_unp = UnpackerFactory::get()->make("stage2::GlobalExtBlkUnpacker");
71 
72 
73  UnpackerMap res;
74 
75  if (fed == 1404) {
76 
77  // From the rx buffers
78  res[0] = muon_unp;
79  res[2] = muon_unp;
80  res[4] = muon_unp;
81  res[6] = muon_unp;
82  res[8] = egamma_unp;
83  res[10] = egamma_unp;
84  res[12] = jet_unp;
85  res[14] = jet_unp;
86  res[16] = tau_unp;
87  res[18] = tau_unp;
88  res[20] = etsum_unp;
89  res[24] = ext_unp;
90  //res[22] = empty link no data
91  res[26] = ext_unp;
92  res[28] = ext_unp;
93  res[30] = ext_unp;
94 
95 
96  //From tx buffers
97  res[33] = alg_unp;
98  res[35] = alg_unp;
99  res[37] = alg_unp;
100  res[39] = alg_unp;
101  res[41] = alg_unp;
102  res[43] = alg_unp;
103  res[45] = alg_unp;
104  res[47] = alg_unp;
105  res[49] = alg_unp;
106 
107  }
108 
109  return res;
110  };
111  };
112  }
113 }
114 
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
virtual void registerProducts(edm::stream::EDProducerBase &prod) override
Definition: GTSetup.cc:46
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:21
virtual std::unique_ptr< UnpackerCollections > getCollections(edm::Event &e) override
Definition: GTSetup.cc:58
static const UnpackerFactory * get()
Definition: Unpacker.h:23
virtual UnpackerMap getUnpackers(int fed, int board, int amc, unsigned int fw) override
Definition: GTSetup.cc:62
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:26