CMS 3D CMS Logo

HGCalParametersESModule.cc
Go to the documentation of this file.
13 
14 //#define EDM_ML_DEBUG
15 
17 public:
19 
20  using ReturnType = std::unique_ptr<HGCalParameters>;
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") << "HGCalParametersESModule for " << name_ << ":" << name2_ << ":" << namew_ << ":"
43  << namec_ << ":" << namet_ << ":" << namex_ << " 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", "HGCalEELayer");
55  desc.add<std::string>("name2", "HGCalEESensitive");
56  desc.add<std::string>("nameW", "HGCalEEWafer");
57  desc.add<std::string>("nameC", "HGCalEESensitive");
58  desc.add<std::string>("nameT", "HGCal");
59  desc.add<std::string>("nameX", "HGCalEESensitive");
60  desc.add<bool>("fromDD4hep", false);
61  descriptions.add("hgcalEEParametersInitialize", desc);
62 }
63 
65 #ifdef EDM_ML_DEBUG
66  edm::LogVerbatim("HGCalGeom") << "HGCalParametersESModule::produce(const IdealGeometryRecord& iRecord)";
67 #endif
68  auto ptp = std::make_unique<HGCalParameters>(name_);
69  HGCalParametersFromDD builder;
70  if (fromDD4hep_) {
71 #ifdef EDM_ML_DEBUG
72  edm::LogVerbatim("HGCalGeom") << "HGCalParametersESModule::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") << "HGCalParametersESModule::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
ReturnType produce(const IdealGeometryRecord &)
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
std::unique_ptr< HGCalParameters > ReturnType
static void fillDescriptions(edm::ConfigurationDescriptions &)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61
void add(std::string const &label, ParameterSetDescription const &psetDescription)
T const * product() const
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokenDD4hep_
HGCalParametersESModule(const edm::ParameterSet &)
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvTokenDDD_