CMS 3D CMS Logo

DDCompactViewMFESProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: DetectorDescription/Core
4 // Class: DDCompactViewMFESProducer
5 //
13 //
14 // Original Author: Ianna Osborne
15 //
16 //
17 
18 #include <memory>
19 
23 
30 #include "DD4hep/Detector.h"
31 
32 using namespace std;
33 using namespace cms;
34 
36 public:
38  ~DDCompactViewMFESProducer() override;
39 
40  using ReturnType = unique_ptr<DDCompactView>;
41 
43 
44  ReturnType produce(const IdealMagneticFieldRecord &);
45 
46 protected:
47  void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &,
48  const edm::IOVSyncValue &,
49  edm::ValidityInterval &) override;
50 
51 private:
52  const string m_label;
53 };
54 
56  : m_label(iConfig.getParameter<std::string>("appendToDataLabel")) {
57  setWhatProduced(this);
58  findingRecord<IdealMagneticFieldRecord>();
59 }
60 
62 
65  descriptions.addDefault(desc);
66 }
67 
70  iRecord.get(m_label, det);
71 
72  auto product = std::make_unique<DDCompactView>(*det);
73  return product;
74 }
75 
77  const edm::IOVSyncValue &iosv,
78  edm::ValidityInterval &oValidity) {
80  oValidity = infinity;
81 }
82 
unique_ptr< DDCompactView > ReturnType
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
void addDefault(ParameterSetDescription const &psetDescription)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
const double infinity
Namespace of DDCMS conversion namespace.
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ReturnType produce(const IdealMagneticFieldRecord &)
static void fillDescriptions(edm::ConfigurationDescriptions &)
DDCompactViewMFESProducer(const edm::ParameterSet &)