DetectorDescription
DDCMS
plugins
DDSpecParRegistryESProducer.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: DetectorDescription/DDCMS
4
// Class: DDSpecParRegistryESProducer
5
//
13
//
14
// Original Author: Ianna Osborne
15
// Created: Wed, 09 Jan 2019 16:04:31 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
25
#include "
FWCore/ParameterSet/interface/ConfigurationDescriptions.h
"
26
#include "
FWCore/ParameterSet/interface/ParameterSetDescription.h
"
27
#include "
Geometry/Records/interface/DDSpecParRegistryRcd.h
"
28
#include "
DetectorDescription/DDCMS/interface/DDSpecParRegistry.h
"
29
#include "
Geometry/Records/interface/IdealGeometryRecord.h
"
30
#include "
DetectorDescription/DDCMS/interface/DDDetector.h
"
31
#include "DD4hep/Detector.h"
32
33
using namespace
std
;
34
using namespace
cms
;
35
36
class
DDSpecParRegistryESProducer
:
public
edm::ESProducer
{
37
public
:
38
DDSpecParRegistryESProducer
(
const
edm::ParameterSet
&);
39
~
DDSpecParRegistryESProducer
()
override
;
40
41
using
ReturnType
= unique_ptr<DDSpecParRegistry>;
42
43
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
&);
44
45
ReturnType
produce(
const
DDSpecParRegistryRcd
&);
46
47
private
:
48
edm::ESGetToken<DDDetector, IdealGeometryRecord>
m_token
;
49
};
50
51
DDSpecParRegistryESProducer::DDSpecParRegistryESProducer
(
const
edm::ParameterSet
& iConfig) {
52
setWhatProduced(
this
).setConsumes(m_token,
53
edm::ESInputTag
(
""
, iConfig.
getParameter
<
std::string
>(
"appendToDataLabel"
)));
54
}
55
56
DDSpecParRegistryESProducer::~DDSpecParRegistryESProducer
() {}
57
58
void
DDSpecParRegistryESProducer::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
59
edm::ParameterSetDescription
desc;
60
descriptions.
addDefault
(desc);
61
}
62
63
DDSpecParRegistryESProducer::ReturnType
DDSpecParRegistryESProducer::produce
(
const
DDSpecParRegistryRcd
& iRecord) {
64
const
DDSpecParRegistry
& registry = iRecord.
get
(m_token).specpars();
65
auto
product = std::make_unique<DDSpecParRegistry>();
66
product->specpars.insert(registry.
specpars
.begin(), registry.
specpars
.end());
67
return
product;
68
}
69
70
DEFINE_FWK_EVENTSETUP_MODULE
(
DDSpecParRegistryESProducer
);
ConfigurationDescriptions.h
DDSpecParRegistryRcd
Definition:
DDSpecParRegistryRcd.h:8
edm::ESInputTag
Definition:
ESInputTag.h:87
DDSpecParRegistryESProducer::m_token
edm::ESGetToken< DDDetector, IdealGeometryRecord > m_token
Definition:
DDSpecParRegistryESProducer.cc:48
DDSpecParRegistryESProducer::ReturnType
unique_ptr< DDSpecParRegistry > ReturnType
Definition:
DDSpecParRegistryESProducer.cc:41
ESHandle.h
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
ESProducer.h
cms::DDSpecParRegistry
Definition:
DDSpecParRegistry.h:32
DDSpecParRegistryESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition:
DDSpecParRegistryESProducer.cc:58
DDDetector.h
fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ParameterSetDescription.h
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition:
DependentRecordImplementation.h:112
DDSpecParRegistryESProducer::DDSpecParRegistryESProducer
DDSpecParRegistryESProducer(const edm::ParameterSet &)
Definition:
DDSpecParRegistryESProducer.cc:51
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
DDSpecParRegistry.h
edm::ParameterSet
Definition:
ParameterSet.h:36
DDSpecParRegistryESProducer::produce
ReturnType produce(const DDSpecParRegistryRcd &)
Definition:
DDSpecParRegistryESProducer.cc:63
IdealGeometryRecord.h
edm::ESGetToken< DDDetector, IdealGeometryRecord >
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
ModuleFactory.h
std
Definition:
JetResolutionObject.h:76
DDSpecParRegistryRcd.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
DDSpecParRegistryESProducer::~DDSpecParRegistryESProducer
~DDSpecParRegistryESProducer() override
Definition:
DDSpecParRegistryESProducer.cc:56
cms::DDSpecParRegistry::specpars
DDSpecParMap specpars
Definition:
DDSpecParRegistry.h:39
edm::ESProducer
Definition:
ESProducer.h:101
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:99
DDSpecParRegistryESProducer
Definition:
DDSpecParRegistryESProducer.cc:36
cms
Namespace of DDCMS conversion namespace.
Definition:
ProducerAnalyzer.cc:21
Generated for CMSSW Reference Manual by
1.8.16