CMS 3D CMS Logo

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 
ConfigurationDescriptions.h
edm::ESInputTag
Definition: ESInputTag.h:87
ESTransientHandle.h
MuonGeometryConstantsESModule
Definition: MuonGeometryConstantsESModule.cc:16
MuonGeometryConstants.h
MuonGeometryConstantsESModule::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: MuonGeometryConstantsESModule.cc:46
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ESProducer.h
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
DDCompactView.h
MuonGeometryConstantsBuild.h
MuonGeometryConstantsESModule::produce
ReturnType produce(const IdealGeometryRecord &)
Definition: MuonGeometryConstantsESModule.cc:52
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
MuonGeometryConstantsESModule::MuonGeometryConstantsESModule
MuonGeometryConstantsESModule(const edm::ParameterSet &)
Definition: MuonGeometryConstantsESModule.cc:32
edm::eventsetup::DependentRecordImplementation::getTransientHandle
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:98
DDCompactView.h
ParameterSetDescription.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
edm::ParameterSet
Definition: ParameterSet.h:47
MuonGeometryConstantsESModule::ReturnType
std::unique_ptr< MuonGeometryConstants > ReturnType
Definition: MuonGeometryConstantsESModule.cc:20
MuonGeometryConstantsESModule::cpvTokenDD4Hep_
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokenDD4Hep_
Definition: MuonGeometryConstantsESModule.cc:28
IdealGeometryRecord.h
cc
edm::ESGetToken< DDCompactView, IdealGeometryRecord >
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
MuonGeometryConstantsESModule::fromDD4Hep_
bool fromDD4Hep_
Definition: MuonGeometryConstantsESModule.cc:29
MuonGeometryConstantsBuild::build
bool build(const DDCompactView *cpv, MuonGeometryConstants &php)
Definition: MuonGeometryConstantsBuild.cc:13
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
MuonGeometryConstantsBuild
Definition: MuonGeometryConstantsBuild.h:11
cms::DDCompactView
Definition: DDCompactView.h:31
MuonGeometryConstantsESModule::cpvTokenDDD_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvTokenDDD_
Definition: MuonGeometryConstantsESModule.cc:27
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESProducer
Definition: ESProducer.h:104
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25