Skip to content

Commit

Permalink
Merge pull request #26706 from Dr15Jones/consumesMuonNumberingESProducer
Browse files Browse the repository at this point in the history
Added EventSetup consumes calls to MuonNumberingESProducer
  • Loading branch information
cmsbuild committed May 15, 2019
2 parents b597eae + 6f631f9 commit fbbbc70
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions Geometry/MuonNumbering/plugins/MuonNumberingESProducer.cc
Expand Up @@ -39,15 +39,14 @@ class MuonNumberingESProducer : public edm::ESProducer {
private:
const std::string m_label;
const std::string m_key;
const edm::ESGetToken<cms::DDSpecParRegistry,DDSpecParRegistryRcd> m_token;
};

MuonNumberingESProducer::MuonNumberingESProducer(const edm::ParameterSet& iConfig)
: m_label(iConfig.getParameter<std::string>("label")),
m_key(iConfig.getParameter<std::string>("key"))

{
setWhatProduced(this);
}
m_key(iConfig.getParameter<std::string>("key")),
m_token( setWhatProduced(this).consumesFrom<cms::DDSpecParRegistry,DDSpecParRegistryRcd>(edm::ESInputTag("",m_label)) )
{}

MuonNumberingESProducer::~MuonNumberingESProducer()
{}
Expand All @@ -58,10 +57,9 @@ MuonNumberingESProducer::produce(const MuonNumberingRecord& iRecord)
LogDebug("Geometry") << "MuonNumberingESProducer::produce from " << m_label << " with " << m_key;
auto product = std::make_unique<cms::MuonNumbering>();

edm::ESHandle<cms::DDSpecParRegistry> registry;
iRecord.getRecord<DDSpecParRegistryRcd>().get(m_label, registry);
auto it = registry->specpars.find(m_key);
if(it != end(registry->specpars)) {
cms::DDSpecParRegistry const& registry = iRecord.get( m_token );
auto it = registry.specpars.find(m_key);
if(it != end(registry.specpars)) {
for(const auto& l : it->second.spars) {
if(l.first == "OnlyForMuonNumbering") {
for(const auto& k : it->second.numpars) {
Expand Down

0 comments on commit fbbbc70

Please sign in to comment.