CMS 3D CMS Logo

GTSetup.cc
Go to the documentation of this file.
2 
6 
7 #include "GTSetup.h"
8 
9 namespace l1t {
10  namespace stage2 {
11  std::unique_ptr<PackerTokens>
13  {
14  return std::unique_ptr<PackerTokens>(new GTTokens(cfg, cc));
15  }
16 
17  void
19  {
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  PackerMap
30  GTSetup::getPackers(int fed, unsigned int fw)
31  {
32  PackerMap res;
33 
34  if (fed == 1404) {
35  // Use board id 1 for packing
36  res[{1, 1}] = {
37 
38  PackerFactory::get()->make("stage2::GTMuonPacker"),
39  PackerFactory::get()->make("stage2::GTEGammaPacker"),
40  PackerFactory::get()->make("stage2::GTEtSumPacker"),
41  PackerFactory::get()->make("stage2::GTJetPacker"),
42  PackerFactory::get()->make("stage2::GTTauPacker"),
43  PackerFactory::get()->make("stage2::GlobalAlgBlkPacker"),
44  PackerFactory::get()->make("stage2::GlobalExtBlkPacker")
45  };
46 
47  }
48 
49  return res;
50  }
51 
52  void
54  {
55 
56  prod.produces<MuonBxCollection>("Muon");
57  prod.produces<EGammaBxCollection>("EGamma");
58  prod.produces<EtSumBxCollection>("EtSum");
59  prod.produces<JetBxCollection>("Jet");
60  prod.produces<TauBxCollection>("Tau");
61  prod.produces<GlobalAlgBlkBxCollection>();
62  prod.produces<GlobalExtBlkBxCollection>();
63 
64  }
65 
66  std::unique_ptr<UnpackerCollections>
68  {
69  return std::unique_ptr<UnpackerCollections>(new GTCollections(e));
70  }
71 
73  GTSetup::getUnpackers(int fed, int board, int amc, unsigned int fw)
74  {
75 
76  auto muon_unp = UnpackerFactory::get()->make("stage2::MuonUnpacker");
77  auto egamma_unp = UnpackerFactory::get()->make("stage2::EGammaUnpacker");
78  auto etsum_unp = UnpackerFactory::get()->make("stage2::EtSumUnpacker");
79  auto jet_unp = UnpackerFactory::get()->make("stage2::JetUnpacker");
80  auto tau_unp = UnpackerFactory::get()->make("stage2::TauUnpacker");
81  auto alg_unp = UnpackerFactory::get()->make("stage2::GlobalAlgBlkUnpacker");
82  auto ext_unp = UnpackerFactory::get()->make("stage2::GlobalExtBlkUnpacker");
83 
84 
86 
87  if (fed == 1404) {
88 
89  //only unpack first uGT board for the inputs (single copy)
90  if(amc == 1) {
91  // From the rx buffers
92  res[0] = muon_unp;
93  res[2] = muon_unp;
94  res[4] = muon_unp;
95  res[6] = muon_unp;
96  res[8] = egamma_unp;
97  res[10] = egamma_unp;
98  res[12] = jet_unp;
99  res[14] = jet_unp;
100  res[16] = tau_unp;
101  res[18] = tau_unp;
102  res[20] = etsum_unp;
103  res[24] = ext_unp;
104  //res[22] = empty link no data
105  res[26] = ext_unp;
106  res[28] = ext_unp;
107  res[30] = ext_unp;
108  }
109 
110  //From tx buffers
111  res[33] = alg_unp;
112  res[35] = alg_unp;
113  res[37] = alg_unp;
114  res[39] = alg_unp;
115  res[41] = alg_unp;
116  res[43] = alg_unp;
117  res[45] = alg_unp;
118  res[47] = alg_unp;
119  res[49] = alg_unp;
120 
121  }
122 
123  return res;
124  }
125  }
126 }
127 
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
std::shared_ptr< Packer > make(const std::string &) const
virtual UnpackerMap getUnpackers(int fed, int board, int amc, unsigned int fw) override
Definition: GTSetup.cc:73
delete x;
Definition: CaloConfig.h:22
virtual std::unique_ptr< PackerTokens > registerConsumes(const edm::ParameterSet &cfg, edm::ConsumesCollector &cc) override
Definition: GTSetup.cc:12
Definition: Electron.h:4
static const PackerFactory * get()
Definition: PackerFactory.h:14
std::map< int, std::shared_ptr< Unpacker > > UnpackerMap
Definition: PackingSetup.h:27
std::shared_ptr< Unpacker > make(const std::string &) const
virtual PackerMap getPackers(int fed, unsigned int fw) override
Definition: GTSetup.cc:30
#define DEFINE_L1T_PACKING_SETUP(type)
virtual std::unique_ptr< UnpackerCollections > getCollections(edm::Event &e) override
Definition: GTSetup.cc:67
static const UnpackerFactory * get()
std::map< std::pair< int, int >, Packers > PackerMap
Definition: PackingSetup.h:25
Definition: AMCSpec.h:8
virtual void registerProducts(edm::stream::EDProducerBase &prod) override
Definition: GTSetup.cc:53
virtual void fillDescription(edm::ParameterSetDescription &desc) override
Definition: GTSetup.cc:18