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 
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Log< level::Info, true > LogVerbatim
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unique_ptr< HcalSimulationParameters > ReturnType
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvTokenDDD_
static void fillDescriptions(edm::ConfigurationDescriptions &)
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
HcalSimParametersESModule(const edm::ParameterSet &)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokenDD4hep_
ReturnType produce(const HcalParametersRcd &)
Log< level::Info, false > LogInfo
void add(std::string const &label, ParameterSetDescription const &psetDescription)