Geometry
MuonNumbering
plugins
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
21
#include "
FWCore/Framework/interface/ModuleFactory.h
"
22
#include "
FWCore/Framework/interface/ESProducer.h
"
23
#include "
FWCore/Framework/interface/ESHandle.h
"
24
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
25
#include "
Geometry/Records/interface/MuonNumberingRecord.h
"
26
#include "
Geometry/MuonNumbering/interface/DD4hep_MuonNumbering.h
"
27
#include "
Geometry/Records/interface/DDSpecParRegistryRcd.h
"
28
#include "
DetectorDescription/DDCMS/interface/DDSpecParRegistry.h
"
29
30
class
MuonNumberingESProducer
:
public
edm::ESProducer
{
31
public
:
32
MuonNumberingESProducer
(
const
edm::ParameterSet
&);
33
~MuonNumberingESProducer
()
override
;
34
35
using
ReturnType
= std::unique_ptr<cms::MuonNumbering>;
36
37
ReturnType
produce
(
const
MuonNumberingRecord
&);
38
39
private
:
40
const
std::string
m_label
;
41
const
std::string
m_key
;
42
const
edm::ESGetToken<cms::DDSpecParRegistry, DDSpecParRegistryRcd>
m_token
;
43
};
44
45
MuonNumberingESProducer::MuonNumberingESProducer
(
const
edm::ParameterSet
& iConfig)
46
: m_label(iConfig.getParameter<
std
::
string
>(
"label"
)),
47
m_key(iConfig.getParameter<
std
::
string
>(
"key"
)),
48
m_token(setWhatProduced(this).consumesFrom<
cms
::
DDSpecParRegistry
,
DDSpecParRegistryRcd
>(
49
edm
::
ESInputTag
(
""
, m_label))) {}
50
51
MuonNumberingESProducer::~MuonNumberingESProducer
() {}
52
53
MuonNumberingESProducer::ReturnType
MuonNumberingESProducer::produce
(
const
MuonNumberingRecord
& iRecord) {
54
LogDebug
(
"Geometry"
) <<
"MuonNumberingESProducer::produce from "
<<
m_label
<<
" with "
<<
m_key
;
55
auto
product = std::make_unique<cms::MuonNumbering>();
56
57
cms::DDSpecParRegistry
const
& registry = iRecord.
get
(
m_token
);
58
auto
it = registry.specpars.find(
m_key
);
59
if
(it !=
end
(registry.specpars)) {
60
for
(
const
auto
&
l
: it->second.spars) {
61
if
(
l
.first ==
"OnlyForMuonNumbering"
) {
62
for
(
const
auto
&
k
: it->second.numpars) {
63
for
(
const
auto
& ik :
k
.second) {
64
product->put(
k
.first, static_cast<int>(ik));
//values.emplace(k.first, static_cast<int>(ik));
65
}
66
}
67
}
68
}
69
}
70
return
product;
71
}
72
73
DEFINE_FWK_EVENTSETUP_MODULE
(
MuonNumberingESProducer
);
DDSpecParRegistryRcd
Definition:
DDSpecParRegistryRcd.h:8
MessageLogger.h
ESHandle.h
ESInputTag
edm
HLT enums.
Definition:
AlignableModifier.h:19
MuonNumberingESProducer::m_label
const std::string m_label
Definition:
MuonNumberingESProducer.cc:40
ESProducer.h
MuonNumberingESProducer::m_key
const std::string m_key
Definition:
MuonNumberingESProducer.cc:41
MuonNumberingESProducer
Definition:
MuonNumberingESProducer.cc:30
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
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
DDSpecParRegistry.h
LogDebug
#define LogDebug(id)
Definition:
MessageLogger.h:233
edm::ParameterSet
Definition:
ParameterSet.h:47
MuonNumberingESProducer::MuonNumberingESProducer
MuonNumberingESProducer(const edm::ParameterSet &)
Definition:
MuonNumberingESProducer.cc:45
MuonNumberingESProducer::m_token
const edm::ESGetToken< cms::DDSpecParRegistry, DDSpecParRegistryRcd > m_token
Definition:
MuonNumberingESProducer.cc:42
MuonNumberingESProducer::ReturnType
std::unique_ptr< cms::MuonNumbering > ReturnType
Definition:
MuonNumberingESProducer.cc:35
edm::ESGetToken< cms::DDSpecParRegistry, DDSpecParRegistryRcd >
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:53
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
edm::ESProducer
Definition:
ESProducer.h:104
MuonNumberingRecord
Definition:
MuonNumberingRecord.h:30
MuonNumberingESProducer::~MuonNumberingESProducer
~MuonNumberingESProducer() override
Definition:
MuonNumberingESProducer.cc:51
cms
Namespace of DDCMS conversion namespace.
Definition:
ProducerAnalyzer.cc:21
Generated for CMSSW Reference Manual by
1.8.16