CMS 3D CMS Logo

HcalSimParametersESModule.cc
Go to the documentation of this file.
12 
13 #include <memory>
14 
15 //#define EDM_ML_DEBUG
16 
18 public:
20 
21  using ReturnType = std::unique_ptr<HcalSimulationParameters>;
22 
24 
26 
27 private:
31 };
32 
34  fromDD4Hep_ = ps.getParameter<bool>("fromDD4Hep");
35  auto cc = setWhatProduced(this);
38 
39 #ifdef EDM_ML_DEBUG
40  edm::LogVerbatim("HCalGeom") << "HcalSimParametersESModule::HcalSimParametersESModule called with dd4hep: "
41  << fromDD4Hep_;
42 #endif
43 }
44 
47  desc.add<bool>("fromDD4Hep", false);
48  descriptions.add("hcalSimulationParameters", desc);
49 }
50 
52 #ifdef EDM_ML_DEBUG
53  edm::LogInfo("HCalGeom") << "HcalSimParametersESModule::produce(const HcalParametersRcd& iRecord)";
54 #endif
55 
56  auto ptp = std::make_unique<HcalSimulationParameters>();
58 
59  if (fromDD4Hep_) {
60 #ifdef EDM_ML_DEBUG
61  edm::LogVerbatim("HCalGeom") << "HcalSimParametersESModule::Try to access cms::DDCompactView";
62 #endif
64  builder.build(*cpv, *ptp);
65  } else {
67  builder.build(&(*cpv), *ptp);
68  }
69  return ptp;
70 }
71 
ConfigurationDescriptions.h
edm::ESInputTag
Definition: ESInputTag.h:87
ESTransientHandle.h
HcalSimParametersESModule::HcalSimParametersESModule
HcalSimParametersESModule(const edm::ParameterSet &)
Definition: HcalSimParametersESModule.cc:33
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ESProducer.h
HcalParametersRcd
Definition: HcalParametersRcd.h:8
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
HcalSimParametersESModule::cpvTokenDD4Hep_
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokenDD4Hep_
Definition: HcalSimParametersESModule.cc:29
DDCompactView.h
HcalSimParametersESModule::cpvTokenDDD_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvTokenDDD_
Definition: HcalSimParametersESModule.cc:28
HcalSimParametersESModule::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: HcalSimParametersESModule.cc:45
HcalParametersRcd.h
HcalSimParametersFromDD.h
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
HcalSimParametersESModule::fromDD4Hep_
bool fromDD4Hep_
Definition: HcalSimParametersESModule.cc:30
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
edm::eventsetup::DependentRecordImplementation::getTransientHandle
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:92
HcalSimParametersFromDD
Definition: HcalSimParametersFromDD.h:13
HcalSimulationParameters.h
DDCompactView.h
ParameterSetDescription.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
HcalSimParametersESModule
Definition: HcalSimParametersESModule.cc:17
edm::ParameterSet
Definition: ParameterSet.h:47
IdealGeometryRecord.h
cc
edm::ESGetToken< DDCompactView, IdealGeometryRecord >
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
HcalSimParametersFromDD::build
bool build(const DDCompactView *, HcalSimulationParameters &)
Definition: HcalSimParametersFromDD.cc:18
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
cms::DDCompactView
Definition: DDCompactView.h:31
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESProducer
Definition: ESProducer.h:104
HcalSimParametersESModule::produce
ReturnType produce(const HcalParametersRcd &)
Definition: HcalSimParametersESModule.cc:51
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25
HcalSimParametersESModule::ReturnType
std::unique_ptr< HcalSimulationParameters > ReturnType
Definition: HcalSimParametersESModule.cc:21