CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules 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 
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Log< level::Info, true > LogVerbatim
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
static void fillDescriptions(edm::ConfigurationDescriptions &)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokenDD4hep_
MuonGeometryConstantsESModule(const edm::ParameterSet &)
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61
ReturnType produce(const IdealGeometryRecord &)
Log< level::Info, false > LogInfo
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvTokenDDD_
std::unique_ptr< MuonGeometryConstants > ReturnType