CMS 3D CMS Logo

MuonNumberingESProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: DetectorDescription/MuonNumberingESProducer
4 // Class: MuonNumberingESProducer
5 //
13 //
14 // Original Author: Ianna Osborne
15 // Created: Tue, 15 Jan 2019 09:10:32 GMT
16 //
17 //
18 
19 #include <memory>
20 
28 
29 //#define EDM_ML_DEBUG
30 
32 public:
34  ~MuonNumberingESProducer() override;
35 
36  using ReturnType = std::unique_ptr<cms::MuonNumbering>;
37 
39 
40 private:
44 };
45 
47  : m_label(iConfig.getParameter<std::string>("label")),
48  m_key(iConfig.getParameter<std::string>("key")),
49  m_token(setWhatProduced(this).consumesFrom<cms::DDSpecParRegistry, DDSpecParRegistryRcd>(
50  edm::ESInputTag("", m_label))) {}
51 
53 
55 #ifdef EDM_ML_DEBUG
56  edm::LogVerbatim("MuonGeom") << "MuonNumberingESProducer::produce from " << m_label << " with " << m_key;
57 #endif
58  auto product = std::make_unique<cms::MuonNumbering>();
59 
60  cms::DDSpecParRegistry const& registry = iRecord.get(m_token);
61  auto it = registry.specpars.find(m_key);
62  if (it != end(registry.specpars)) {
63  for (const auto& l : it->second.spars) {
64  if (l.first == "OnlyForMuonNumbering") {
65  for (const auto& k : it->second.numpars) {
66  for (const auto& ik : k.second) {
67  product->put(k.first, static_cast<int>(ik)); //values.emplace(k.first, static_cast<int>(ik));
68  }
69  }
70  }
71  }
72  }
73  return product;
74 }
75 
DDSpecParRegistryRcd
Definition: DDSpecParRegistryRcd.h:8
MessageLogger.h
ESInputTag
edm
HLT enums.
Definition: AlignableModifier.h:19
MuonNumberingESProducer::m_label
const std::string m_label
Definition: MuonNumberingESProducer.cc:41
ESProducer.h
MuonNumberingESProducer::m_key
const std::string m_key
Definition: MuonNumberingESProducer.cc:42
MuonNumberingESProducer
Definition: MuonNumberingESProducer.cc:31
MuonNumberingRecord.h
cms::DDSpecParRegistry
dd4hep::SpecParRegistry DDSpecParRegistry
Definition: DDCompactView.h:28
mps_fire.end
end
Definition: mps_fire.py:242
dqmdumpme.k
k
Definition: dqmdumpme.py:60
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:109
DDSpecParRegistry.h
edm::ParameterSet
Definition: ParameterSet.h:47
MuonNumberingESProducer::MuonNumberingESProducer
MuonNumberingESProducer(const edm::ParameterSet &)
Definition: MuonNumberingESProducer.cc:46
MuonNumberingESProducer::m_token
const edm::ESGetToken< cms::DDSpecParRegistry, DDSpecParRegistryRcd > m_token
Definition: MuonNumberingESProducer.cc:43
MuonNumberingESProducer::ReturnType
std::unique_ptr< cms::MuonNumbering > ReturnType
Definition: MuonNumberingESProducer.cc:36
edm::ESGetToken< cms::DDSpecParRegistry, DDSpecParRegistryRcd >
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DD4hep_MuonNumbering.h
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
ModuleFactory.h
std
Definition: JetResolutionObject.h:76
DDSpecParRegistryRcd.h
MuonNumberingESProducer::produce
ReturnType produce(const MuonNumberingRecord &)
Definition: MuonNumberingESProducer.cc:54
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
edm::ESProducer
Definition: ESProducer.h:104
MuonNumberingRecord
Definition: MuonNumberingRecord.h:30
MuonNumberingESProducer::~MuonNumberingESProducer
~MuonNumberingESProducer() override
Definition: MuonNumberingESProducer.cc:52
cms
Namespace of DDCMS conversion namespace.
Definition: ProducerAnalyzer.cc:21