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
HcalParametersESModule::fromDD4Hep_
bool fromDD4Hep_
Definition: HcalParametersESModule.cc:30
ESTransientHandle.h
HcalParametersESModule::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: HcalParametersESModule.cc:44
HcalParametersFromDD.h
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ESProducer.h
HcalParameters.h
HcalParametersRcd
Definition: HcalParametersRcd.h:8
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
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:56
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:81
edm::eventsetup::DependentRecordImplementation::getTransientHandle
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:92
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:47
IdealGeometryRecord.h
cc
edm::ESGetToken< DDCompactView, IdealGeometryRecord >
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
HcalParametersESModule::produce
ReturnType produce(const HcalParametersRcd &)
Definition: HcalParametersESModule.cc:50
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
HcalParametersESModule::ReturnType
std::unique_ptr< HcalParameters > ReturnType
Definition: HcalParametersESModule.cc:21
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESProducer
Definition: ESProducer.h:104
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25