CMS 3D CMS Logo

HGCalTBParametersESModule.cc
Go to the documentation of this file.
13 
14 //#define EDM_ML_DEBUG
15 
17 public:
19 
20  using ReturnType = std::unique_ptr<HGCalTBParameters>;
21 
23 
25 
26 private:
31 };
32 
34  name_ = iC.getParameter<std::string>("name");
35  name2_ = iC.getParameter<std::string>("name2");
36  namew_ = iC.getParameter<std::string>("nameW");
37  namec_ = iC.getParameter<std::string>("nameC");
38  namet_ = iC.getParameter<std::string>("nameT");
39  namex_ = iC.getParameter<std::string>("nameX");
40  fromDD4hep_ = iC.getParameter<bool>("fromDD4hep");
41 #ifdef EDM_ML_DEBUG
42  edm::LogVerbatim("HGCalGeom") << "HGCalTBParametersESModule for " << name_ << ":" << namew_ << ":" << namec_ << ":"
43  << namet_ << " and fromDD4hep flag " << fromDD4hep_;
44 #endif
45  auto cc = setWhatProduced(this, namex_);
46  if (fromDD4hep_)
48  else
50 }
51 
54  desc.add<std::string>("name", "HGCalEESensitive");
55  desc.add<std::string>("name2", "HGCalEE");
56  desc.add<std::string>("nameW", "HGCalEEWafer");
57  desc.add<std::string>("nameC", "HGCalEECell");
58  desc.add<std::string>("nameT", "HGCal");
59  desc.add<std::string>("nameX", "HGCalEESensitive");
60  desc.add<bool>("fromDD4hep", false);
61  descriptions.add("hgcalTBEEParametersInitialize", desc);
62 }
63 
65 #ifdef EDM_ML_DEBUG
66  edm::LogVerbatim("HGCalGeom") << "HGCalTBParametersESModule::produce(const IdealGeometryRecord& iRecord)";
67 #endif
68  auto ptp = std::make_unique<HGCalTBParameters>(name_);
70  if (fromDD4hep_) {
71 #ifdef EDM_ML_DEBUG
72  edm::LogVerbatim("HGCalGeom") << "HGCalTBParametersESModule::Try to access cms::DDCompactView";
73 #endif
75  builder.build(cpv.product(), *ptp, name_, namew_, namec_, namet_, name2_);
76  } else {
77 #ifdef EDM_ML_DEBUG
78  edm::LogVerbatim("HGCalGeom") << "HGCalTBParametersESModule::Try to access DDCompactView";
79 #endif
81  builder.build(cpv.product(), *ptp, name_, namew_, namec_, namet_);
82  }
83  return ptp;
84 }
85 
86 // define this as a plug-in
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
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
HGCalTBParametersESModule(const edm::ParameterSet &)
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokenDD4hep_
std::unique_ptr< HGCalTBParameters > ReturnType
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvTokenDDD_
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61
void add(std::string const &label, ParameterSetDescription const &psetDescription)
T const * product() const
static void fillDescriptions(edm::ConfigurationDescriptions &)
ReturnType produce(const IdealGeometryRecord &)