CMS 3D CMS Logo

HcalTB02ParametersESModule.cc
Go to the documentation of this file.
11 
12 #include <memory>
13 
14 #define EDM_ML_DEBUG
15 
17 public:
19 
20  using ReturnType = std::unique_ptr<HcalTB02Parameters>;
21 
24 
25 private:
30 };
31 
33  name_ = ps.getParameter<std::string>("name");
34  fromDD4Hep_ = ps.getParameter<bool>("fromDD4Hep");
35  auto cc = setWhatProduced(this, name_);
38 
39 #ifdef EDM_ML_DEBUG
40  edm::LogVerbatim("HCalGeom") << "HcalTB02ParametersESModule::HcalTB02ParametersESModule called with dd4hep: "
41  << fromDD4Hep_ << " and name " << name_;
42 #endif
43 }
44 
47  desc.add<std::string>("name", "EcalHitsEB");
48  desc.add<bool>("fromDD4Hep", false);
49  descriptions.add("hcalTB02XtalParameters", desc);
50 }
51 
53 #ifdef EDM_ML_DEBUG
54  edm::LogInfo("HCalGeom") << "HcalTB02ParametersESModule::produce(const IdealGeometryRecord& iRecord)";
55 #endif
56 
57  auto ptp = std::make_unique<HcalTB02Parameters>(name_);
59 
60  if (fromDD4Hep_) {
61 #ifdef EDM_ML_DEBUG
62  edm::LogVerbatim("HCalGeom") << "HcalTB02ParametersESModule::Try to access cms::DDCompactView";
63 #endif
65  builder.build(&(*cpv), *ptp, name_);
66  } else {
68  builder.build(&(*cpv), *ptp, name_);
69  }
70  return ptp;
71 }
72 
ConfigurationDescriptions.h
HcalTB02ParametersESModule::cpvTokenDDD_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvTokenDDD_
Definition: HcalTB02ParametersESModule.cc:26
HcalTB02ParametersESModule::name_
std::string name_
Definition: HcalTB02ParametersESModule.cc:28
edm::ESInputTag
Definition: ESInputTag.h:87
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
ESTransientHandle.h
HcalTB02ParametersESModule
Definition: HcalTB02ParametersESModule.cc:16
edm::LogInfo
Definition: MessageLogger.h:254
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ESProducer.h
HcalTB02ParametersESModule::fromDD4Hep_
bool fromDD4Hep_
Definition: HcalTB02ParametersESModule.cc:29
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
edm::eventsetup::DependentRecordImplementation::getTransientHandle
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:99
DDCompactView.h
ParameterSetDescription.h
HcalTB02ParametersFromDD.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HcalTB02ParametersFromDD::build
bool build(const DDCompactView *cpv, HcalTB02Parameters &php, const std::string &name)
Definition: HcalTB02ParametersFromDD.cc:12
edm::ParameterSet
Definition: ParameterSet.h:36
HcalTB02ParametersESModule::ReturnType
std::unique_ptr< HcalTB02Parameters > ReturnType
Definition: HcalTB02ParametersESModule.cc:20
HcalTB02ParametersESModule::produce
ReturnType produce(const IdealGeometryRecord &)
Definition: HcalTB02ParametersESModule.cc:52
edm::LogVerbatim
Definition: MessageLogger.h:297
HcalTB02ParametersESModule::HcalTB02ParametersESModule
HcalTB02ParametersESModule(const edm::ParameterSet &)
Definition: HcalTB02ParametersESModule.cc:32
IdealGeometryRecord.h
HcalTB02ParametersESModule::cpvTokenDD4Hep_
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokenDD4Hep_
Definition: HcalTB02ParametersESModule.cc:27
cc
edm::ESGetToken< DDCompactView, IdealGeometryRecord >
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
ModuleFactory.h
HcalTB02Parameters.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
cms::DDCompactView
Definition: DDCompactView.h:29
HcalTB02ParametersESModule::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: HcalTB02ParametersESModule.cc:45
HcalTB02ParametersFromDD
Definition: HcalTB02ParametersFromDD.h:12
edm::ESProducer
Definition: ESProducer.h:101
IdealGeometryRecord
Definition: IdealGeometryRecord.h:27