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);
40 
41 #ifdef EDM_ML_DEBUG
42  edm::LogVerbatim("HCalGeom") << "CaloSimParametersESModule::CaloSimParametersESModule called with dd4hep: "
43  << fromDD4Hep_;
44 #endif
45 }
46 
48 
51  desc.add<bool>("fromDD4Hep", false);
52  descriptions.add("caloSimulationParameters", desc);
53 }
54 
56 #ifdef EDM_ML_DEBUG
57  edm::LogVerbatim("HCalGeom") << "CaloSimParametersESModule::produce(const HcalParametersRcd& iRecord)";
58 #endif
59 
60  auto ptp = std::make_unique<CaloSimulationParameters>();
62  if (fromDD4Hep_) {
63 #ifdef EDM_ML_DEBUG
64  edm::LogVerbatim("HCalGeom") << "CaloSimParametersESModule::Try to access cms::DDCompactView";
65 #endif
67  builder.build(&(*cpv), *ptp);
68  } else {
69 #ifdef EDM_ML_DEBUG
70  edm::LogVerbatim("HCalGeom") << "CaloSimParametersESModule::Try to access DDCompactView";
71 #endif
73  builder.build(&(*cpv), *ptp);
74  }
75  return ptp;
76 }
77 
ConfigurationDescriptions.h
edm::ESInputTag
Definition: ESInputTag.h:87
CaloSimParametersESModule::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: CaloSimParametersESModule.cc:49
ESTransientHandle.h
CaloSimParametersFromDD::build
bool build(const DDCompactView *, CaloSimulationParameters &)
Definition: CaloSimParametersFromDD.cc:23
CaloSimParametersESModule::produce
ReturnType produce(const HcalParametersRcd &)
Definition: CaloSimParametersESModule.cc:55
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:92
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:47
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