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_);
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("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
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:64
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:52
DDCompactView.h
HGCalParametersESModule::fromDD4Hep_
bool fromDD4Hep_
Definition: HGCalParametersESModule.cc:28
ParameterSetDescription.h
HGCalParametersFromDD
Definition: HGCalParametersFromDD.h:12
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
edm::ParameterSet
Definition: ParameterSet.h:47
IdealGeometryRecord.h
cc
edm::ESGetToken< DDCompactView, IdealGeometryRecord >
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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