CMS 3D CMS Logo

DDDetectorESProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: DetectorDescription/DDDetectorESProducer
4 // Class: DDDetectorESProducer
5 //
13 //
14 // Original Author: Ianna Osborne
15 // Created: Fri, 07 Dec 2018 11:20:52 GMT
16 //
17 //
18 
19 #include <memory>
20 
26 
29 #include "DD4hep/Detector.h"
30 
31 using namespace std;
32 using namespace cms;
33 using namespace edm;
34 
37 public:
39  ~DDDetectorESProducer() override;
40 
41  using ReturnType = unique_ptr<DDDetector>;
43 
44  ReturnType produce(const GeometryFileRcd&);
46 
47 protected:
48  void setIntervalFor(const eventsetup::EventSetupRecordKey&,
49  const IOVSyncValue&, ValidityInterval&) override;
50 
51 private:
52  const string m_confGeomXMLFiles;
53  const string m_label;
54 };
55 
57  : m_confGeomXMLFiles(iConfig.getParameter<FileInPath>("confGeomXMLFiles").fullPath()),
58  m_label(iConfig.getParameter<string>("appendToDataLabel"))
59 {
60  setWhatProduced(this);
61  findingRecord<GeometryFileRcd>();
62 }
63 
65 {
66 }
67 
68 void
70 {
72 
73  desc.add<FileInPath>("confGeomXMLFiles");
74  descriptions.addDefault(desc);
75 }
76 
77 void
79  const IOVSyncValue& iTime, ValidityInterval& oInterval) {
80  oInterval = ValidityInterval(IOVSyncValue::beginOfTime(), IOVSyncValue::endOfTime()); //infinite
81 }
82 
85 {
86  LogDebug("Geometry") << "DDDetectorESProducer::Produce " << m_label;
87  return make_unique<DDDetector>(m_label, m_confGeomXMLFiles);
88 }
89 
#define LogDebug(id)
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:19
unique_ptr< DDDetector > ReturnType
void addDefault(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void setIntervalFor(const eventsetup::EventSetupRecordKey &, const IOVSyncValue &, ValidityInterval &) override
Namespace of DDCMS conversion namespace.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static void fillDescriptions(ConfigurationDescriptions &)
DDDetectorESProducer(const ParameterSet &)
ReturnType produce(const GeometryFileRcd &)
HLT enums.
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
Definition: SourceFactory.h:91