CMS 3D CMS Logo

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