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  fromDD4Hep_ = iC.getParameter<bool>("fromDD4Hep");
40 #ifdef EDM_ML_DEBUG
41  edm::LogVerbatim("HGCalGeom") << "HGCalParametersESModule for " << name_ << ":" << namew_ << ":" << namec_ << ":"
42  << namet_ << " and fromDD4Hep flag " << fromDD4Hep_;
43 #endif
44  auto cc = setWhatProduced(this, name_);
47 }
48 
51  desc.add<std::string>("name", "HGCalEESensitive");
52  desc.add<std::string>("name2", "HGCalEE");
53  desc.add<std::string>("nameW", "HGCalEEWafer");
54  desc.add<std::string>("nameC", "HGCalEECell");
55  desc.add<std::string>("nameT", "HGCal");
56  desc.add<bool>("fromDD4Hep", false);
57  descriptions.add("hgcalEEParametersInitialize", desc);
58 }
59 
61 #ifdef EDM_ML_DEBUG
62  edm::LogVerbatim("HGCalGeom") << "HGCalParametersESModule::produce(const IdealGeometryRecord& iRecord)";
63 #endif
64  auto ptp = std::make_unique<HGCalParameters>(name_);
65  HGCalParametersFromDD builder;
66  if (fromDD4Hep_) {
67 #ifdef EDM_ML_DEBUG
68  edm::LogVerbatim("HGCalGeom") << "HGCalParametersESModule::Try to access cms::DDCompactView";
69 #endif
71  builder.build(cpv.product(), *ptp, name_, namew_, namec_, namet_, name2_);
72  } else {
73 #ifdef EDM_ML_DEBUG
74  edm::LogVerbatim("HGCalGeom") << "HGCalParametersESModule::Try to access DDCompactView";
75 #endif
77  builder.build(cpv.product(), *ptp, name_, namew_, namec_, namet_);
78  }
79  return ptp;
80 }
81 
82 // define this as a plug-in
ConfigurationDescriptions.h
HGCalParametersESModule
Definition: HGCalParametersESModule.cc:16
edm::ESInputTag
Definition: ESInputTag.h:87
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
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:138
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ESProducer.h
HGCalParametersESModule::produce
ReturnType produce(const IdealGeometryRecord &)
Definition: HGCalParametersESModule.cc:60
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:80
HGCalParametersFromDD.h
edm::eventsetup::DependentRecordImplementation::getTransientHandle
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:99
HGCalParametersESModule::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: HGCalParametersESModule.cc:49
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:36
edm::LogVerbatim
Definition: MessageLogger.h:297
IdealGeometryRecord.h
cc
edm::ESGetToken< DDCompactView, IdealGeometryRecord >
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
HGCalParametersESModule::cpvTokenDDD_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvTokenDDD_
Definition: HGCalParametersESModule.cc:29
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
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
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
cms::DDCompactView
Definition: DDCompactView.h:29
edm::ESProducer
Definition: ESProducer.h:101
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:27
HGCalParametersESModule::namet_
std::string namet_
Definition: HGCalParametersESModule.cc:27