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