CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MuonGeometryConstantsESModule.cc
Go to the documentation of this file.
11 
12 #include <memory>
13 
14 //#define EDM_ML_DEBUG
15 
17 public:
19 
20  using ReturnType = std::unique_ptr<MuonGeometryConstants>;
21 
23 
25 
26 private:
30 };
31 
33  fromDD4hep_ = ps.getParameter<bool>("fromDD4hep");
34  auto cc = setWhatProduced(this);
35  if (fromDD4hep_)
37  else
39 
40 #ifdef EDM_ML_DEBUG
41  edm::LogVerbatim("MuonGeom") << "MuonGeometryConstantsESModule::MuonGeometryConstantsESModule called with dd4hep: "
42  << fromDD4hep_;
43 #endif
44 }
45 
48  desc.add<bool>("fromDD4hep", false);
49  descriptions.add("muonGeometryConstants", desc);
50 }
51 
53  edm::LogInfo("MuonGeom") << "MuonGeometryConstantsESModule::produce(const IdealGeometryRecord& iRecord)";
54 
55  auto ptp = std::make_unique<MuonGeometryConstants>();
57 
58  if (fromDD4hep_) {
59 #ifdef EDM_ML_DEBUG
60  edm::LogVerbatim("MuonGeom") << "MuonGeometryConstantsESModule::Try to access cms::DDCompactView";
61 #endif
63  builder.build(&(*cpv), *ptp);
64  } else {
65 #ifdef EDM_ML_DEBUG
66  edm::LogVerbatim("MuonGeom") << "MuonGeometryConstantsESModule::Try to access DDCompactView";
67 #endif
69  builder.build(&(*cpv), *ptp);
70  }
71 
72  return ptp;
73 }
74 
Log< level::Info, true > LogVerbatim
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
static void fillDescriptions(edm::ConfigurationDescriptions &)
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokenDD4hep_
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
MuonGeometryConstantsESModule(const edm::ParameterSet &)
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
ParameterDescriptionBase * add(U const &iLabel, T const &value)
ReturnType produce(const IdealGeometryRecord &)
Log< level::Info, false > LogInfo
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvTokenDDD_
std::unique_ptr< MuonGeometryConstants > ReturnType