CMS 3D CMS Logo

CaloSimParametersESModule.cc
Go to the documentation of this file.
1 
13 
14 #include <memory>
15 
16 //#define EDM_ML_DEBUG
17 
19 public:
21  ~CaloSimParametersESModule(void) override;
22 
23  using ReturnType = std::unique_ptr<CaloSimulationParameters>;
24 
26 
28 
29 private:
33 };
34 
36  fromDD4hep_ = ps.getParameter<bool>("fromDD4hep");
37  auto cc = setWhatProduced(this);
38  if (fromDD4hep_)
40  else
42 
43 #ifdef EDM_ML_DEBUG
44  edm::LogVerbatim("HCalGeom") << "CaloSimParametersESModule::CaloSimParametersESModule called with dd4hep: "
45  << fromDD4hep_;
46 #endif
47 }
48 
50 
53  desc.add<bool>("fromDD4hep", false);
54  descriptions.add("caloSimulationParameters", desc);
55 }
56 
58 #ifdef EDM_ML_DEBUG
59  edm::LogVerbatim("HCalGeom") << "CaloSimParametersESModule::produce(const HcalParametersRcd& iRecord)";
60 #endif
61 
62  auto ptp = std::make_unique<CaloSimulationParameters>();
64  if (fromDD4hep_) {
65 #ifdef EDM_ML_DEBUG
66  edm::LogVerbatim("HCalGeom") << "CaloSimParametersESModule::Try to access cms::DDCompactView";
67 #endif
69  builder.build(&(*cpv), *ptp);
70  } else {
71 #ifdef EDM_ML_DEBUG
72  edm::LogVerbatim("HCalGeom") << "CaloSimParametersESModule::Try to access DDCompactView";
73 #endif
75  builder.build(&(*cpv), *ptp);
76  }
77  return ptp;
78 }
79 
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:163
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvTokenDDD_
std::unique_ptr< CaloSimulationParameters > ReturnType
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
ReturnType produce(const HcalParametersRcd &)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61
void add(std::string const &label, ParameterSetDescription const &psetDescription)
CaloSimParametersESModule(const edm::ParameterSet &)
static void fillDescriptions(edm::ConfigurationDescriptions &)
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokenDD4hep_