CMS 3D CMS Logo

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 
25 
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 
44 public:
46  ~DDVectorRegistryESProducer() override;
47 
48  using ReturnType = unique_ptr<DDVectorRegistry>;
49 
51 
52  ReturnType produce(const DDVectorRegistryRcd&);
53 
54 private:
56 };
57 
59  : m_token(setWhatProduced(this).consumes(edm::ESInputTag("", iConfig.getParameter<string>("appendToDataLabel")))) {}
60 
62 
65  descriptions.addDefault(desc);
66 }
67 
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 
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