CMS 3D CMS Logo

CaloSimParametersESModule.cc
Go to the documentation of this file.
1 
13 
14 #include <memory>
15 
16 //#define EDM_ML_DEBUG
17 
19 public:
21  ~CaloSimParametersESModule(void) override;
22 
23  using ReturnType = std::unique_ptr<CaloSimulationParameters>;
24 
26 
28 
29 private:
33 };
34 
36  fromDD4Hep_ = ps.getParameter<bool>("fromDD4Hep");
37  auto cc = setWhatProduced(this);
38  if (fromDD4Hep_)
40  else
42 
43 #ifdef EDM_ML_DEBUG
44  edm::LogVerbatim("HCalGeom") << "CaloSimParametersESModule::CaloSimParametersESModule called with dd4hep: "
45  << fromDD4Hep_;
46 #endif
47 }
48 
50 
53  desc.add<bool>("fromDD4Hep", false);
54  descriptions.add("caloSimulationParameters", desc);
55 }
56 
58 #ifdef EDM_ML_DEBUG
59  edm::LogVerbatim("HCalGeom") << "CaloSimParametersESModule::produce(const HcalParametersRcd& iRecord)";
60 #endif
61 
62  auto ptp = std::make_unique<CaloSimulationParameters>();
64  if (fromDD4Hep_) {
65 #ifdef EDM_ML_DEBUG
66  edm::LogVerbatim("HCalGeom") << "CaloSimParametersESModule::Try to access cms::DDCompactView";
67 #endif
69  builder.build(&(*cpv), *ptp);
70  } else {
71 #ifdef EDM_ML_DEBUG
72  edm::LogVerbatim("HCalGeom") << "CaloSimParametersESModule::Try to access DDCompactView";
73 #endif
75  builder.build(&(*cpv), *ptp);
76  }
77  return ptp;
78 }
79 
ConfigurationDescriptions.h
edm::ESInputTag
Definition: ESInputTag.h:87
CaloSimParametersESModule::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: CaloSimParametersESModule.cc:51
ESTransientHandle.h
CaloSimParametersFromDD::build
bool build(const DDCompactView *, CaloSimulationParameters &)
Definition: CaloSimParametersFromDD.cc:21
CaloSimParametersESModule::produce
ReturnType produce(const HcalParametersRcd &)
Definition: CaloSimParametersESModule.cc:57
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ESProducer.h
CaloSimParametersESModule::cpvTokenDD4Hep_
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokenDD4Hep_
Definition: CaloSimParametersESModule.cc:31
HcalParametersRcd
Definition: HcalParametersRcd.h:8
DDCompactView.h
HcalParametersRcd.h
CaloSimulationParameters.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
edm::eventsetup::DependentRecordImplementation::getTransientHandle
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:98
DDCompactView.h
ParameterSetDescription.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
CaloSimParametersESModule::fromDD4Hep_
bool fromDD4Hep_
Definition: CaloSimParametersESModule.cc:32
edm::ParameterSet
Definition: ParameterSet.h:47
IdealGeometryRecord.h
cc
CaloSimParametersESModule::CaloSimParametersESModule
CaloSimParametersESModule(const edm::ParameterSet &)
Definition: CaloSimParametersESModule.cc:35
edm::ESGetToken< DDCompactView, IdealGeometryRecord >
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
CaloSimParametersESModule::cpvTokenDDD_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvTokenDDD_
Definition: CaloSimParametersESModule.cc:30
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
CaloSimParametersESModule::ReturnType
std::unique_ptr< CaloSimulationParameters > ReturnType
Definition: CaloSimParametersESModule.cc:23
CaloSimParametersFromDD.h
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
CaloSimParametersESModule::~CaloSimParametersESModule
~CaloSimParametersESModule(void) override
Definition: CaloSimParametersESModule.cc:49
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
CaloSimParametersESModule
Definition: CaloSimParametersESModule.cc:18
CaloSimParametersFromDD
Definition: CaloSimParametersFromDD.h:14
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25