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