CMS 3D CMS Logo

HcalTB02ParametersESModule.cc
Go to the documentation of this file.
11 
12 #include <memory>
13 
15 public:
17 
18  using ReturnType = std::unique_ptr<HcalTB02Parameters>;
19 
22 
23 private:
28 };
29 
31  name_ = ps.getParameter<std::string>("name");
32  fromDD4hep_ = ps.getParameter<bool>("fromDD4hep");
33  auto cc = setWhatProduced(this, name_);
34  if (fromDD4hep_)
36  else
38 
39 #ifdef EDM_ML_DEBUG
40  edm::LogVerbatim("HCalGeom") << "HcalTB02ParametersESModule::HcalTB02ParametersESModule called with dd4hep: "
41  << fromDD4hep_ << " and name " << name_;
42 #endif
43 }
44 
47  desc.add<std::string>("name", "EcalHitsEB");
48  desc.add<bool>("fromDD4hep", false);
49  descriptions.add("hcalTB02XtalParameters", desc);
50 }
51 
53 #ifdef EDM_ML_DEBUG
54  edm::LogInfo("HCalGeom") << "HcalTB02ParametersESModule::produce(const IdealGeometryRecord& iRecord)";
55 #endif
56 
57  auto ptp = std::make_unique<HcalTB02Parameters>(name_);
59 
60  if (fromDD4hep_) {
61 #ifdef EDM_ML_DEBUG
62  edm::LogVerbatim("HCalGeom") << "HcalTB02ParametersESModule::Try to access cms::DDCompactView";
63 #endif
65  builder.build(&(*cpv), *ptp, name_);
66  } else {
68  builder.build(&(*cpv), *ptp, name_);
69  }
70  return ptp;
71 }
72 
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:307
std::unique_ptr< HcalTB02Parameters > ReturnType
HcalTB02ParametersESModule(const edm::ParameterSet &)
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
ReturnType produce(const IdealGeometryRecord &)
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvTokenDDD_
static void fillDescriptions(edm::ConfigurationDescriptions &)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61
Log< level::Info, false > LogInfo
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokenDD4hep_