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_ << ":" << namew_ << ":" << namec_ << ":"
43  << namet_ << " and fromDD4Hep flag " << fromDD4Hep_;
44 #endif
45  auto cc = setWhatProduced(this, namex_);
48 }
49 
52  desc.add<std::string>("name", "HGCalEESensitive");
53  desc.add<std::string>("name2", "HGCalEE");
54  desc.add<std::string>("nameW", "HGCalEEWafer");
55  desc.add<std::string>("nameC", "HGCalEECell");
56  desc.add<std::string>("nameT", "HGCal");
57  desc.add<std::string>("nameX", "HGCalEESensitive");
58  desc.add<bool>("fromDD4Hep", false);
59  descriptions.add("hgcalEEParametersInitialize", desc);
60 }
61 
63 #ifdef EDM_ML_DEBUG
64  edm::LogVerbatim("HGCalGeom") << "HGCalParametersESModule::produce(const IdealGeometryRecord& iRecord)";
65 #endif
66  auto ptp = std::make_unique<HGCalParameters>(name_);
67  HGCalParametersFromDD builder;
68  if (fromDD4Hep_) {
69 #ifdef EDM_ML_DEBUG
70  edm::LogVerbatim("HGCalGeom") << "HGCalParametersESModule::Try to access cms::DDCompactView";
71 #endif
73  builder.build(cpv.product(), *ptp, name_, namew_, namec_, namet_, name2_);
74  } else {
75 #ifdef EDM_ML_DEBUG
76  edm::LogVerbatim("HGCalGeom") << "HGCalParametersESModule::Try to access DDCompactView";
77 #endif
79  builder.build(cpv.product(), *ptp, name_, namew_, namec_, namet_);
80  }
81  return ptp;
82 }
83 
84 // define this as a plug-in
ConfigurationDescriptions.h
HGCalParametersESModule
Definition: HGCalParametersESModule.cc:16
edm::ESInputTag
Definition: ESInputTag.h:87
ESTransientHandle.h
MessageLogger.h
edm::ESTransientHandle::product
T const * product() const
Definition: ESTransientHandle.h:51
HGCalParametersESModule::namec_
std::string namec_
Definition: HGCalParametersESModule.cc:27
HGCalParametersESModule::name_
std::string name_
Definition: HGCalParametersESModule.cc:27
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ESProducer.h
HGCalParametersESModule::produce
ReturnType produce(const IdealGeometryRecord &)
Definition: HGCalParametersESModule.cc:62
HGCalParametersESModule::ReturnType
std::unique_ptr< HGCalParameters > ReturnType
Definition: HGCalParametersESModule.cc:20
DDCompactView.h
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
HGCalParametersFromDD.h
edm::eventsetup::DependentRecordImplementation::getTransientHandle
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:98
HGCalParametersESModule::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: HGCalParametersESModule.cc:50
DDCompactView.h
HGCalParametersESModule::fromDD4Hep_
bool fromDD4Hep_
Definition: HGCalParametersESModule.cc:28
ParameterSetDescription.h
HGCalParametersFromDD
Definition: HGCalParametersFromDD.h:12
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
IdealGeometryRecord.h
cc
edm::ESGetToken< DDCompactView, IdealGeometryRecord >
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
HGCalParametersESModule::cpvTokenDDD_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvTokenDDD_
Definition: HGCalParametersESModule.cc:29
HGCalParametersESModule::namex_
std::string namex_
Definition: HGCalParametersESModule.cc:27
HGCalParametersESModule::name2_
std::string name2_
Definition: HGCalParametersESModule.cc:27
HGCalParametersFromDD::build
bool build(const DDCompactView *cpv, HGCalParameters &php, const std::string &name, const std::string &namew, const std::string &namec, const std::string &namet)
Definition: HGCalParametersFromDD.cc:57
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
HGCalParametersESModule::cpvTokenDD4Hep_
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokenDD4Hep_
Definition: HGCalParametersESModule.cc:30
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
cms::DDCompactView
Definition: DDCompactView.h:31
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESProducer
Definition: ESProducer.h:104
ParameterSet.h
HGCalParametersESModule::namew_
std::string namew_
Definition: HGCalParametersESModule.cc:27
HGCalParameters.h
HGCalParametersESModule::HGCalParametersESModule
HGCalParametersESModule(const edm::ParameterSet &)
Definition: HGCalParametersESModule.cc:33
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25
HGCalParametersESModule::namet_
std::string namet_
Definition: HGCalParametersESModule.cc:27