CMS 3D CMS Logo

EcalSimParametersESModule.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<EcalSimulationParameters>;
21 
23 
25 
26 private:
29  const bool fromDD4Hep_;
31 };
32 
34  : fromDD4Hep_(ps.getParameter<bool>("fromDD4Hep")), name_(ps.getParameter<std::string>("name")) {
35  auto cc = setWhatProduced(this, name_);
36  if (fromDD4Hep_) {
38  } else {
40  }
41 
42 #ifdef EDM_ML_DEBUG
43  edm::LogVerbatim("EcalGeom") << "EcalSimParametersESModule::EcalSimParametersESModule called with dd4hep: "
44  << fromDD4Hep_ << " for " << name_;
45 #endif
46 }
47 
50  desc.add<bool>("fromDD4Hep", false);
51  desc.add<std::string>("name", "EcalHitsEB");
52  descriptions.add("ecalSimulationParametersEB", desc);
53 }
54 
56 #ifdef EDM_ML_DEBUG
57  edm::LogVerbatim("EcalGeom") << "EcalSimParametersESModule::produce(const IdealGeometryRecord& iRecord)";
58 #endif
59 
60  auto ptp = std::make_unique<EcalSimulationParameters>();
62  if (fromDD4Hep_) {
63 #ifdef EDM_ML_DEBUG
64  edm::LogVerbatim("EcalGeom") << "EcalSimParametersESModule::Try to access cms::DDCompactView";
65 #endif
67  builder.build(&(*cpv), name_, *ptp);
68  } else {
69 #ifdef EDM_ML_DEBUG
70  edm::LogVerbatim("EcalGeom") << "EcalSimParametersESModule::Try to access DDCompactView";
71 #endif
73  builder.build(&(*cpv), name_, *ptp);
74  }
75  return ptp;
76 }
77 
ConfigurationDescriptions.h
electrons_cff.bool
bool
Definition: electrons_cff.py:372
edm::ESInputTag
Definition: ESInputTag.h:87
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
ESTransientHandle.h
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ESProducer.h
EcalSimParametersESModule::name_
const std::string name_
Definition: EcalSimParametersESModule.cc:30
DDCompactView.h
EcalSimParametersFromDD
Definition: EcalSimParametersFromDD.h:14
EcalSimParametersESModule::cpvTokenDD4Hep_
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokenDD4Hep_
Definition: EcalSimParametersESModule.cc:28
EcalSimParametersESModule
Definition: EcalSimParametersESModule.cc:16
EcalSimParametersESModule::fromDD4Hep_
const bool fromDD4Hep_
Definition: EcalSimParametersESModule.cc:29
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
EcalSimParametersESModule::cpvTokenDDD_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvTokenDDD_
Definition: EcalSimParametersESModule.cc:27
DDCompactView.h
ParameterSetDescription.h
EcalSimParametersFromDD::build
bool build(const DDCompactView *, const std::string &name, EcalSimulationParameters &)
Definition: EcalSimParametersFromDD.cc:26
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalSimParametersESModule::EcalSimParametersESModule
EcalSimParametersESModule(const edm::ParameterSet &)
Definition: EcalSimParametersESModule.cc:33
EcalSimParametersFromDD.h
edm::ParameterSet
Definition: ParameterSet.h:36
EcalSimulationParameters.h
edm::LogVerbatim
Definition: MessageLogger.h:297
IdealGeometryRecord.h
EcalSimParametersESModule::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: EcalSimParametersESModule.cc:48
cc
EcalSimParametersESModule::ReturnType
std::unique_ptr< EcalSimulationParameters > ReturnType
Definition: EcalSimParametersESModule.cc:20
edm::ESGetToken< DDCompactView, IdealGeometryRecord >
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
ModuleFactory.h
std
Definition: JetResolutionObject.h:76
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
cms::DDCompactView
Definition: DDCompactView.h:29
edm::ESProducer
Definition: ESProducer.h:101
EcalSimParametersESModule::produce
ReturnType produce(const IdealGeometryRecord &)
Definition: EcalSimParametersESModule.cc:55
IdealGeometryRecord
Definition: IdealGeometryRecord.h:27