CMS 3D CMS Logo

GTSetup.cc
Go to the documentation of this file.
4 
10 
11 #include "GTSetup.h"
12 
13 namespace l1t {
14  namespace stage2 {
15  std::unique_ptr<PackerTokens> GTSetup::registerConsumes(const edm::ParameterSet& cfg, edm::ConsumesCollector& cc) {
16  return std::unique_ptr<PackerTokens>(new GTTokens(cfg, cc));
17  }
18 
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 GTSetup::getPackers(int fed, unsigned int fw) {
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  return res;
46  }
47 
49  prod.produces<MuonBxCollection>("Muon");
50  prod.produces<EGammaBxCollection>("EGamma");
51  prod.produces<EtSumBxCollection>("EtSum");
52  prod.produces<JetBxCollection>("Jet");
53  prod.produces<TauBxCollection>("Tau");
54  prod.produces<GlobalAlgBlkBxCollection>();
55  prod.produces<GlobalExtBlkBxCollection>();
56  for (int i = 2; i < 7; ++i) { // Collections from boards 2-6
57  prod.produces<MuonBxCollection>("Muon" + std::to_string(i));
58  prod.produces<EGammaBxCollection>("EGamma" + std::to_string(i));
59  prod.produces<EtSumBxCollection>("EtSum" + std::to_string(i));
60  prod.produces<JetBxCollection>("Jet" + std::to_string(i));
61  prod.produces<TauBxCollection>("Tau" + std::to_string(i));
62  }
63  }
64 
65  std::unique_ptr<UnpackerCollections> GTSetup::getCollections(edm::Event& e) {
66  return std::unique_ptr<UnpackerCollections>(new GTCollections(e));
67  }
68 
69  UnpackerMap GTSetup::getUnpackers(int fed, int board, int amc, unsigned int fw) {
70  auto muon_unp =
71  static_pointer_cast<l1t::stage2::MuonUnpacker>(UnpackerFactory::get()->make("stage2::MuonUnpacker"));
72  auto egamma_unp =
73  static_pointer_cast<l1t::stage2::EGammaUnpacker>(UnpackerFactory::get()->make("stage2::EGammaUnpacker"));
74  auto etsum_unp =
75  static_pointer_cast<l1t::stage2::EtSumUnpacker>(UnpackerFactory::get()->make("stage2::EtSumUnpacker"));
76  auto jet_unp = static_pointer_cast<l1t::stage2::JetUnpacker>(UnpackerFactory::get()->make("stage2::JetUnpacker"));
77  auto tau_unp = static_pointer_cast<l1t::stage2::TauUnpacker>(UnpackerFactory::get()->make("stage2::TauUnpacker"));
78 
79  if (fw >= 0x10f2) {
80  etsum_unp = static_pointer_cast<l1t::stage2::EtSumUnpacker>(
81  UnpackerFactory::get()->make("stage2::EtSumUnpacker_0x10010057"));
82  }
83 
84  auto alg_unp = UnpackerFactory::get()->make("stage2::GlobalAlgBlkUnpacker");
85  auto ext_unp = UnpackerFactory::get()->make("stage2::GlobalExtBlkUnpacker");
86 
87  muon_unp->setAlgoVersion(fw);
88  muon_unp->setFedNumber(fed);
89 
90  muon_unp->setMuonCopy(amc - 1);
91  egamma_unp->setEGammaCopy(amc - 1);
92  etsum_unp->setEtSumCopy(amc - 1);
93  jet_unp->setJetCopy(amc - 1);
94  tau_unp->setTauCopy(amc - 1);
95 
97 
98  if (fed == 1404) {
99  // From the rx buffers
100  res[0] = muon_unp;
101  res[2] = muon_unp;
102  res[4] = muon_unp;
103  res[6] = muon_unp;
104  res[8] = egamma_unp;
105  res[10] = egamma_unp;
106  res[12] = jet_unp;
107  res[14] = jet_unp;
108  res[16] = tau_unp;
109  res[18] = tau_unp;
110  res[20] = etsum_unp;
111 
112  if (amc == 1) { // only unpack first uGT board for the external signal inputs (single copy)
113  res[24] = ext_unp;
114  //res[22] = empty link no data
115  res[26] = ext_unp;
116  res[28] = ext_unp;
117  res[30] = ext_unp;
118  }
119 
120  //From tx buffers
121  res[33] = alg_unp;
122  res[35] = alg_unp;
123  res[37] = alg_unp;
124  res[39] = alg_unp;
125  res[41] = alg_unp;
126  res[43] = alg_unp;
127  res[45] = alg_unp;
128  res[47] = alg_unp;
129  res[49] = alg_unp;
130  }
131 
132  return res;
133  }
134  } // namespace stage2
135 } // namespace l1t
136 
l1t::stage2::GTSetup::getPackers
PackerMap getPackers(int fed, unsigned int fw) override
Definition: GTSetup.cc:29
JetUnpacker.h
mps_fire.i
i
Definition: mps_fire.py:355
PackerFactory.h
l1t::UnpackerMap
std::map< int, std::shared_ptr< Unpacker > > UnpackerMap
Definition: PackingSetup.h:25
PackingSetupFactory.h
l1t::stage2::GTSetup::getCollections
std::unique_ptr< UnpackerCollections > getCollections(edm::Event &e) override
Definition: GTSetup.cc:65
l1t::stage2::GTSetup::registerProducts
void registerProducts(edm::ProducesCollector) override
Definition: GTSetup.cc:48
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
l1t::PackerFactory::get
static const PackerFactory * get()
Definition: PackerFactory.h:14
edm::ParameterSetDescription::addOptional
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:105
GTSetup.h
BXVector
Definition: BXVector.h:15
l1t::PackerMap
std::map< std::pair< int, int >, Packers > PackerMap
Definition: PackingSetup.h:23
DEFINE_L1T_PACKING_SETUP
#define DEFINE_L1T_PACKING_SETUP(type)
Definition: PackingSetupFactory.h:24
EtSumUnpacker.h
l1t::UnpackerFactory::get
static const UnpackerFactory * get()
Definition: UnpackerFactory.h:14
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
l1t::stage2::GTSetup::fillDescription
void fillDescription(edm::ParameterSetDescription &desc) override
Definition: GTSetup.cc:19
TauUnpacker.h
l1t::stage2::GTCollections
Definition: GTCollections.h:18
l1t::stage2::GTSetup
Definition: GTSetup.h:15
UnpackerFactory.h
edm::ParameterSet
Definition: ParameterSet.h:36
l1t
delete x;
Definition: CaloConfig.h:22
fw
Definition: estimate_field.h:12
l1t::stage2::GTSetup::registerConsumes
std::unique_ptr< PackerTokens > registerConsumes(const edm::ParameterSet &cfg, edm::ConsumesCollector &cc) override
Definition: GTSetup.cc:15
EGammaUnpacker.h
l1t::stage2::GTSetup::getUnpackers
UnpackerMap getUnpackers(int fed, int board, int amc, unsigned int fw) override
Definition: GTSetup.cc:69
MuonUnpacker.h
cc
res
Definition: Electron.h:6
SiStripSourceConfigTier0_cff.stage2
stage2
Definition: SiStripSourceConfigTier0_cff.py:71
reco::modules::make
S make(const edm::ParameterSet &cfg)
Definition: ParameterAdapter.h:21
looper.cfg
cfg
Definition: looper.py:297
l1t::UnpackerFactory::make
std::shared_ptr< Unpacker > make(const std::string &) const
Definition: UnpackerFactory.cc:17
edm::ProducesCollector
Definition: ProducesCollector.h:43
amc
Definition: AMCSpec.h:8
l1t::PackerFactory::make
std::shared_ptr< Packer > make(const std::string &) const
Definition: PackerFactory.cc:10
l1t::stage2::GTTokens
Definition: GTTokens.h:16
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37