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);
36  if (fromDD4Hep_)
38  else
40 
41 #ifdef EDM_ML_DEBUG
42  edm::LogVerbatim("HCalGeom") << "HcalSimParametersESModule::HcalSimParametersESModule called with dd4hep: "
43  << fromDD4Hep_;
44 #endif
45 }
46 
49  desc.add<bool>("fromDD4Hep", false);
50  descriptions.add("hcalSimulationParameters", desc);
51 }
52 
54 #ifdef EDM_ML_DEBUG
55  edm::LogInfo("HCalGeom") << "HcalSimParametersESModule::produce(const HcalParametersRcd& iRecord)";
56 #endif
57 
58  auto ptp = std::make_unique<HcalSimulationParameters>();
60 
61  if (fromDD4Hep_) {
62 #ifdef EDM_ML_DEBUG
63  edm::LogVerbatim("HCalGeom") << "HcalSimParametersESModule::Try to access cms::DDCompactView";
64 #endif
66  builder.build(*cpv, *ptp);
67  } else {
69  builder.build(&(*cpv), *ptp);
70  }
71  return ptp;
72 }
73 
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:47
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:98
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:53
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25
HcalSimParametersESModule::ReturnType
std::unique_ptr< HcalSimulationParameters > ReturnType
Definition: HcalSimParametersESModule.cc:21