CMS 3D CMS Logo

HcalTB06BeamParametersESModule.cc
Go to the documentation of this file.
11 
12 #include <memory>
13 
15 public:
17 
18  using ReturnType = std::unique_ptr<HcalTB06BeamParameters>;
19 
22 
23 private:
28 };
29 
31  name1_ = ps.getParameter<std::string>("name1");
32  name2_ = ps.getParameter<std::string>("name2");
33  fromDD4hep_ = ps.getParameter<bool>("fromDD4hep");
34  auto cc = setWhatProduced(this);
35  if (fromDD4hep_)
37  else
39 
40 #ifdef EDM_ML_DEBUG
41  edm::LogVerbatim("HCalGeom") << "HcalTB06ParametersESModule::HcalTB06ParametersESModule called with dd4hep: "
42  << fromDD4hep_ << " and names " << name1_ << ":" << name2_;
43 #endif
44 }
45 
48  desc.add<std::string>("name1", "WireChamber");
49  desc.add<std::string>("name2", "HcalTB06BeamHits");
50  desc.add<bool>("fromDD4hep", false);
51  descriptions.add("hcalTB06BeamParameters", desc);
52 }
53 
55 #ifdef EDM_ML_DEBUG
56  edm::LogInfo("HCalGeom") << "HcalTB06ParametersESModule::produce(const IdealGeometryRecord& iRecord)";
57 #endif
58 
59  auto ptp = std::make_unique<HcalTB06BeamParameters>();
61 
62  if (fromDD4hep_) {
63 #ifdef EDM_ML_DEBUG
64  edm::LogVerbatim("HCalGeom") << "HcalTB06ParametersESModule::Try to access cms::DDCompactView";
65 #endif
67  builder.build(&(*cpv), *ptp, name1_, name2_);
68  } else {
70  builder.build(&(*cpv), *ptp, name1_, name2_);
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:165
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unique_ptr< HcalTB06BeamParameters > ReturnType
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
static void fillDescriptions(edm::ConfigurationDescriptions &)
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokenDD4hep_
HcalTB06ParametersESModule(const edm::ParameterSet &)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61
Log< level::Info, false > LogInfo
ReturnType produce(const IdealGeometryRecord &)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvTokenDDD_