CMS 3D CMS Logo

HcalParametersESModule.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<HcalParameters>;
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") << "HcalParametersESModule::HcalParametersESModule called with dd4hep: " << fromDD4hep_;
43 #endif
44 }
45 
48  desc.add<bool>("fromDD4hep", false);
49  descriptions.add("hcalParameters", desc);
50 }
51 
53  edm::LogInfo("HCalGeom") << "HcalParametersESModule::produce(const HcalParametersRcd& iRecord)";
54 
55  auto ptp = std::make_unique<HcalParameters>();
56  HcalParametersFromDD builder;
57 
58  if (fromDD4hep_) {
59 #ifdef EDM_ML_DEBUG
60  edm::LogVerbatim("HCalGeom") << "HcalParametersESModule::Try to access cms::DDCompactView";
61 #endif
63  builder.build(*cpv, *ptp);
64  } else {
65 #ifdef EDM_ML_DEBUG
66  edm::LogVerbatim("HCalGeom") << "HcalParametersESModule::Try to access DDCompactView";
67 #endif
69  builder.build(&(*cpv), *ptp);
70  }
71 
72  return ptp;
73 }
74 
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
ReturnType produce(const HcalParametersRcd &)
std::unique_ptr< HcalParameters > ReturnType
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
Log< level::Info, false > LogInfo
static void fillDescriptions(edm::ConfigurationDescriptions &)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvTokenDDD_
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokenDD4hep_
HcalParametersESModule(const edm::ParameterSet &)