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 
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokenDD4Hep_
std::unique_ptr< HcalSimulationParameters > ReturnType
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvTokenDDD_
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
static void fillDescriptions(edm::ConfigurationDescriptions &)
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
HcalSimParametersESModule(const edm::ParameterSet &)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
ReturnType produce(const HcalParametersRcd &)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
void add(std::string const &label, ParameterSetDescription const &psetDescription)