CMS 3D CMS Logo

DDSpecParRegistryESProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: DetectorDescription/DDCMS
4 // Class: DDSpecParRegistryESProducer
5 //
13 //
14 // Original Author: Ianna Osborne
15 // Created: Wed, 09 Jan 2019 16:04:31 GMT
16 //
17 //
18 
19 #include <memory>
20 
24 
31 #include "DD4hep/Detector.h"
32 
33 using namespace std;
34 using namespace cms;
35 
37 public:
38 
40  ~DDSpecParRegistryESProducer() override;
41 
42  using ReturnType = unique_ptr<DDSpecParRegistry>;
43 
45 
46  ReturnType produce(const DDSpecParRegistryRcd&);
47 
48 private:
49  const string m_label;
50 };
51 
53  : m_label(iConfig.getParameter<std::string>("appendToDataLabel"))
54 {
55  setWhatProduced(this);
56 }
57 
59 {
60 }
61 
62 void
64 {
66  descriptions.addDefault(desc);
67 }
68 
71 {
73  iRecord.getRecord<GeometryFileRcd>().get(m_label, det);
74 
75  const DDSpecParRegistry* registry = det->description()->extension<DDSpecParRegistry>();
76  auto product = std::make_unique<DDSpecParRegistry>();
77  product->specpars.insert(registry->specpars.begin(), registry->specpars.end());
78  return product;
79 }
80 
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
static void fillDescriptions(edm::ConfigurationDescriptions &)
unique_ptr< DDSpecParRegistry > ReturnType
void addDefault(ParameterSetDescription const &psetDescription)
DDSpecParRegistryESProducer(const edm::ParameterSet &)
Namespace of DDCMS conversion namespace.
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ReturnType produce(const DDSpecParRegistryRcd &)
static Interceptor::Registry registry("Interceptor")
Detector const * description() const
Definition: DDDetector.h:24