CMS 3D CMS Logo

HcalParametersESModule.cc
Go to the documentation of this file.
12 
13 #include <memory>
14 
15 //#define EDM_ML_DEBUG
16 
18 public:
20 
21  using ReturnType = std::unique_ptr<HcalParameters>;
22 
24 
26 
27 private:
31 };
32 
34  fromDD4Hep_ = ps.getParameter<bool>("fromDD4Hep");
35  auto cc = setWhatProduced(this);
38 
39 #ifdef EDM_ML_DEBUG
40  edm::LogVerbatim("HCalGeom") << "HcalParametersESModule::HcalParametersESModule called with dd4hep: " << fromDD4Hep_;
41 #endif
42 }
43 
46  desc.add<bool>("fromDD4Hep", false);
47  descriptions.add("hcalParameters", desc);
48 }
49 
51  edm::LogInfo("HCalGeom") << "HcalParametersESModule::produce(const HcalParametersRcd& iRecord)";
52 
53  auto ptp = std::make_unique<HcalParameters>();
54  HcalParametersFromDD builder;
55 
56  if (fromDD4Hep_) {
57 #ifdef EDM_ML_DEBUG
58  edm::LogVerbatim("HCalGeom") << "HcalParametersESModule::Try to access cms::DDCompactView";
59 #endif
61  builder.build(*cpv, *ptp);
62  } else {
63 #ifdef EDM_ML_DEBUG
64  edm::LogVerbatim("HCalGeom") << "HcalParametersESModule::Try to access DDCompactView";
65 #endif
67  builder.build(&(*cpv), *ptp);
68  }
69 
70  return ptp;
71 }
72 
ConfigurationDescriptions.h
HcalParametersESModule
Definition: HcalParametersESModule.cc:17
edm::ESInputTag
Definition: ESInputTag.h:87
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
HcalParametersESModule::fromDD4Hep_
bool fromDD4Hep_
Definition: HcalParametersESModule.cc:30
ESTransientHandle.h
HcalParametersESModule::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: HcalParametersESModule.cc:44
edm::LogInfo
Definition: MessageLogger.h:254
HcalParametersFromDD.h
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ESProducer.h
HcalParameters.h
HcalParametersRcd
Definition: HcalParametersRcd.h:8
DDCompactView.h
HcalParametersFromDD
Definition: HcalParametersFromDD.h:9
HcalParametersRcd.h
HcalParametersESModule::cpvTokenDDD_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvTokenDDD_
Definition: HcalParametersESModule.cc:28
HcalParametersFromDD::build
bool build(const DDCompactView *, HcalParameters &)
Definition: HcalParametersFromDD.cc:57
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
HcalParametersESModule::HcalParametersESModule
HcalParametersESModule(const edm::ParameterSet &)
Definition: HcalParametersESModule.cc:33
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
HcalParametersESModule::cpvTokenDD4Hep_
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokenDD4Hep_
Definition: HcalParametersESModule.cc:29
DDCompactView.h
ParameterSetDescription.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
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
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
ModuleFactory.h
HcalParametersESModule::produce
ReturnType produce(const HcalParametersRcd &)
Definition: HcalParametersESModule.cc:50
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
cms::DDCompactView
Definition: DDCompactView.h:29
HcalParametersESModule::ReturnType
std::unique_ptr< HcalParameters > ReturnType
Definition: HcalParametersESModule.cc:21
edm::ESProducer
Definition: ESProducer.h:101
IdealGeometryRecord
Definition: IdealGeometryRecord.h:27