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
#include <unordered_map>
35
#include <vector>
36
37
using namespace
std
;
38
using namespace
cms
;
39
using namespace
edm
;
40
41
using
DDVectorsMap
= std::unordered_map<std::string, std::vector<double>>;
42
43
class
DDVectorRegistryESProducer
:
public
edm::ESProducer
{
44
public
:
45
DDVectorRegistryESProducer
(
const
edm::ParameterSet
&);
46
~
DDVectorRegistryESProducer
()
override
;
47
48
using
ReturnType
= unique_ptr<DDVectorRegistry>;
49
50
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
&);
51
52
ReturnType
produce(
const
DDVectorRegistryRcd
&);
53
54
private
:
55
const
edm::ESGetToken<DDDetector, IdealGeometryRecord>
m_token
;
56
};
57
58
DDVectorRegistryESProducer::DDVectorRegistryESProducer
(
const
edm::ParameterSet
& iConfig)
59
: m_token(setWhatProduced(this).consumes(
edm
::
ESInputTag
(
""
, iConfig.getParameter<
string
>(
"appendToDataLabel"
)))) {}
60
61
DDVectorRegistryESProducer::~DDVectorRegistryESProducer
() {}
62
63
void
DDVectorRegistryESProducer::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
64
edm::ParameterSetDescription
desc
;
65
descriptions.
addDefault
(
desc
);
66
}
67
68
DDVectorRegistryESProducer::ReturnType
DDVectorRegistryESProducer::produce
(
const
DDVectorRegistryRcd
& iRecord) {
69
LogDebug
(
"Geometry"
) <<
"DDVectorRegistryESProducer::produce\n"
;
70
const
auto
& registry = iRecord.
get
(
m_token
).vectors();
71
72
auto
product = std::make_unique<DDVectorRegistry>();
73
product->vectors.insert(registry.begin(), registry.end());
74
return
product;
75
}
76
77
DEFINE_FWK_EVENTSETUP_MODULE
(
DDVectorRegistryESProducer
);
ConfigurationDescriptions.h
DDVectorRegistryESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition:
DDVectorRegistryESProducer.cc:63
DDVectorRegistryESProducer::DDVectorRegistryESProducer
DDVectorRegistryESProducer(const edm::ParameterSet &)
Definition:
DDVectorRegistryESProducer.cc:58
DDVectorRegistryESProducer::~DDVectorRegistryESProducer
~DDVectorRegistryESProducer() override
Definition:
DDVectorRegistryESProducer.cc:61
edm::ESInputTag
Definition:
ESInputTag.h:87
MessageLogger.h
ESHandle.h
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
ESProducer.h
DDVectorRegistryRcd
Definition:
DDVectorRegistryRcd.h:8
DDVectorRegistryESProducer::m_token
const edm::ESGetToken< DDDetector, IdealGeometryRecord > m_token
Definition:
DDVectorRegistryESProducer.cc:55
DDDetector.h
DDVectorRegistryESProducer::ReturnType
unique_ptr< DDVectorRegistry > ReturnType
Definition:
DDVectorRegistryESProducer.cc:48
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:109
DDVectorRegistry.h
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
LogDebug
#define LogDebug(id)
Definition:
MessageLogger.h:233
edm::ParameterSet
Definition:
ParameterSet.h:47
IdealGeometryRecord.h
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ESGetToken< DDDetector, IdealGeometryRecord >
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
std
Definition:
JetResolutionObject.h:76
DDVectorRegistryESProducer
Definition:
DDVectorRegistryESProducer.cc:43
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
cms::DDVectorsMap
std::unordered_map< std::string, std::vector< double > > DDVectorsMap
Definition:
DDNamespace.h:20
edm::ESProducer
Definition:
ESProducer.h:104
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:99
DDVectorRegistryESProducer::produce
ReturnType produce(const DDVectorRegistryRcd &)
Definition:
DDVectorRegistryESProducer.cc:68
DDVectorRegistryRcd.h
cms
Namespace of DDCMS conversion namespace.
Definition:
ProducerAnalyzer.cc:21
Generated for CMSSW Reference Manual by
1.8.16