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 
unique_ptr< DDVectorRegistry > ReturnType
static void fillDescriptions(edm::ConfigurationDescriptions &)
const edm::ESGetToken< DDDetector, IdealGeometryRecord > m_token
std::unordered_map< std::string, std::vector< double > > DDVectorsMap
Definition: DDNamespace.h:20
void addDefault(ParameterSetDescription const &psetDescription)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61
Namespace of DDCMS conversion namespace.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
DDVectorRegistryESProducer(const edm::ParameterSet &)
HLT enums.
ReturnType produce(const DDVectorRegistryRcd &)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
#define LogDebug(id)