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 using namespace std;
35 using namespace cms;
36 using namespace edm;
37 
39 public:
40 
42  ~DDVectorRegistryESProducer() override;
43 
44  using ReturnType = unique_ptr<DDVectorRegistry>;
45 
47 
48  ReturnType produce(const DDVectorRegistryRcd&);
49 
50 private:
51  const string m_label;
52 };
53 
55  : m_label(iConfig.getParameter<string>("appendToDataLabel"))
56 {
57  setWhatProduced(this);
58 }
59 
61 {
62 }
63 
64 void
66 {
68  descriptions.addDefault(desc);
69 }
70 
73 {
74  LogDebug("Geometry") << "DDVectorRegistryESProducer::produce\n";
76  iRecord.getRecord<GeometryFileRcd>().get(m_label, det);
77 
78  const DDVectorsMap& registry = det->vectors();
79 
80  auto product = std::make_unique<DDVectorRegistry>();
81  product->vectors.insert(registry.begin(), registry.end());
82  return product;
83 }
84 
#define LogDebug(id)
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
unique_ptr< DDVectorRegistry > ReturnType
static void fillDescriptions(edm::ConfigurationDescriptions &)
DDVectorsMap const & vectors() const
Definition: DDDetector.h:28
void addDefault(ParameterSetDescription const &psetDescription)
tbb::concurrent_unordered_map< std::string, tbb::concurrent_vector< double >> DDVectorsMap
Namespace of DDCMS conversion namespace.
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
DDVectorRegistryESProducer(const edm::ParameterSet &)
HLT enums.
ReturnType produce(const DDVectorRegistryRcd &)
static Interceptor::Registry registry("Interceptor")