DetectorDescription
DDCMS
plugins
DDVectorRegistryESProducer.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: DetectorDescription/DDCMS
4
// Class: DDVectorRegistryESProducer
5
//
13
//
14
// Original Author: Ianna Osborne
15
// Created: Fri, 07 Dec 2018 11:20:52 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
26
#include "
FWCore/ParameterSet/interface/ConfigurationDescriptions.h
"
27
#include "
FWCore/ParameterSet/interface/ParameterSetDescription.h
"
28
#include "
Geometry/Records/interface/DDVectorRegistryRcd.h
"
29
#include "
DetectorDescription/DDCMS/interface/DDVectorRegistry.h
"
30
#include "
Geometry/Records/interface/IdealGeometryRecord.h
"
31
#include "
DetectorDescription/DDCMS/interface/DDDetector.h
"
32
#include "DD4hep/Detector.h"
33
34
using namespace
std
;
35
using namespace
cms
;
36
using namespace
edm
;
37
38
class
DDVectorRegistryESProducer
:
public
edm::ESProducer
{
39
public
:
40
DDVectorRegistryESProducer
(
const
edm::ParameterSet
&);
41
~
DDVectorRegistryESProducer
()
override
;
42
43
using
ReturnType
= unique_ptr<DDVectorRegistry>;
44
45
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
&);
46
47
ReturnType
produce(
const
DDVectorRegistryRcd
&);
48
49
private
:
50
edm::ESGetToken<DDDetector, IdealGeometryRecord>
m_token
;
51
};
52
53
DDVectorRegistryESProducer::DDVectorRegistryESProducer
(
const
edm::ParameterSet
& iConfig) {
54
setWhatProduced(
this
).setConsumes(m_token,
edm::ESInputTag
(
""
, iConfig.
getParameter
<
string
>(
"appendToDataLabel"
)));
55
}
56
57
DDVectorRegistryESProducer::~DDVectorRegistryESProducer
() {}
58
59
void
DDVectorRegistryESProducer::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
60
edm::ParameterSetDescription
desc;
61
descriptions.
addDefault
(desc);
62
}
63
64
DDVectorRegistryESProducer::ReturnType
DDVectorRegistryESProducer::produce
(
const
DDVectorRegistryRcd
& iRecord) {
65
LogDebug
(
"Geometry"
) <<
"DDVectorRegistryESProducer::produce\n"
;
66
const
DDVectorsMap
& registry = iRecord.
get
(m_token).vectors();
67
68
auto
product = std::make_unique<DDVectorRegistry>();
69
product->vectors.insert(registry.begin(), registry.end());
70
return
product;
71
}
72
73
DEFINE_FWK_EVENTSETUP_MODULE
(
DDVectorRegistryESProducer
);
ConfigurationDescriptions.h
DDVectorRegistryESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition:
DDVectorRegistryESProducer.cc:59
DDVectorRegistryESProducer::DDVectorRegistryESProducer
DDVectorRegistryESProducer(const edm::ParameterSet &)
Definition:
DDVectorRegistryESProducer.cc:53
DDVectorRegistryESProducer::~DDVectorRegistryESProducer
~DDVectorRegistryESProducer() override
Definition:
DDVectorRegistryESProducer.cc:57
edm::ESInputTag
Definition:
ESInputTag.h:87
MessageLogger.h
ESHandle.h
cms::DDVectorsMap
tbb::concurrent_unordered_map< std::string, tbb::concurrent_vector< double > > DDVectorsMap
Definition:
DDNamespace.h:14
edm
HLT enums.
Definition:
AlignableModifier.h:19
DDVectorRegistryESProducer::m_token
edm::ESGetToken< DDDetector, IdealGeometryRecord > m_token
Definition:
DDVectorRegistryESProducer.cc:50
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
ESProducer.h
DDVectorRegistryRcd
Definition:
DDVectorRegistryRcd.h:8
DDDetector.h
DDVectorRegistryESProducer::ReturnType
unique_ptr< DDVectorRegistry > ReturnType
Definition:
DDVectorRegistryESProducer.cc:43
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
DDVectorRegistry.h
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
LogDebug
#define LogDebug(id)
Definition:
MessageLogger.h:670
edm::ParameterSet
Definition:
ParameterSet.h:36
IdealGeometryRecord.h
edm::ESGetToken< DDDetector, IdealGeometryRecord >
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
ModuleFactory.h
std
Definition:
JetResolutionObject.h:76
DDVectorRegistryESProducer
Definition:
DDVectorRegistryESProducer.cc:38
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
edm::ESProducer
Definition:
ESProducer.h:101
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:99
DDVectorRegistryESProducer::produce
ReturnType produce(const DDVectorRegistryRcd &)
Definition:
DDVectorRegistryESProducer.cc:64
DDVectorRegistryRcd.h
cms
Namespace of DDCMS conversion namespace.
Definition:
ProducerAnalyzer.cc:21
Generated for CMSSW Reference Manual by
1.8.16