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);
37 
38 #ifdef EDM_ML_DEBUG
39  edm::LogVerbatim("Geometry") << "MuonGeometryConstantsESModule::MuonGeometryConstantsESModule called with dd4hep: "
40  << fromDD4Hep_;
41 #endif
42 }
43 
46  desc.add<bool>("fromDD4Hep", false);
47  descriptions.add("muonGeometryConstants", desc);
48 }
49 
51  edm::LogInfo("Geometry") << "MuonGeometryConstantsESModule::produce(const IdealGeometryRecord& iRecord)";
52 
53  auto ptp = std::make_unique<MuonGeometryConstants>();
55 
56  if (fromDD4Hep_) {
57 #ifdef EDM_ML_DEBUG
58  edm::LogVerbatim("Geometry") << "MuonGeometryConstantsESModule::Try to access cms::DDCompactView";
59 #endif
61  builder.build(&(*cpv), *ptp);
62  } else {
63 #ifdef EDM_ML_DEBUG
64  edm::LogVerbatim("Geometry") << "MuonGeometryConstantsESModule::Try to access DDCompactView";
65 #endif
67  builder.build(&(*cpv), *ptp);
68  }
69 
70  return ptp;
71 }
72 
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:44
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:50
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:92
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