CMS 3D CMS Logo

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