CMS 3D CMS Logo

HcalTB06BeamParametersESModule.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<HcalTB06BeamParameters>;
21 
24 
25 private:
30 };
31 
33  name1_ = ps.getParameter<std::string>("name1");
34  name2_ = ps.getParameter<std::string>("name2");
35  fromDD4Hep_ = ps.getParameter<bool>("fromDD4Hep");
36  auto cc = setWhatProduced(this);
39 
40 #ifdef EDM_ML_DEBUG
41  edm::LogVerbatim("HCalGeom") << "HcalTB06ParametersESModule::HcalTB06ParametersESModule called with dd4hep: "
42  << fromDD4Hep_ << " and names " << name1_ << ":" << name2_;
43 #endif
44 }
45 
48  desc.add<std::string>("name1", "WireChamber");
49  desc.add<std::string>("name2", "HcalTB06BeamHits");
50  desc.add<bool>("fromDD4Hep", false);
51  descriptions.add("hcalTB06BeamParameters", desc);
52 }
53 
55 #ifdef EDM_ML_DEBUG
56  edm::LogInfo("HCalGeom") << "HcalTB06ParametersESModule::produce(const IdealGeometryRecord& iRecord)";
57 #endif
58 
59  auto ptp = std::make_unique<HcalTB06BeamParameters>();
61 
62  if (fromDD4Hep_) {
63 #ifdef EDM_ML_DEBUG
64  edm::LogVerbatim("HCalGeom") << "HcalTB06ParametersESModule::Try to access cms::DDCompactView";
65 #endif
67  builder.build(&(*cpv), *ptp, name1_, name2_);
68  } else {
70  builder.build(&(*cpv), *ptp, name1_, name2_);
71  }
72  return ptp;
73 }
74 
ConfigurationDescriptions.h
edm::ESInputTag
Definition: ESInputTag.h:87
ESTransientHandle.h
HcalTB06ParametersESModule::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: HcalTB06BeamParametersESModule.cc:46
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ESProducer.h
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
HcalTB06ParametersESModule::ReturnType
std::unique_ptr< HcalTB06BeamParameters > ReturnType
Definition: HcalTB06BeamParametersESModule.cc:20
DDCompactView.h
HcalTB06BeamParametersFromDD::build
bool build(const DDCompactView *cpv, HcalTB06BeamParameters &php, const std::string &name1, const std::string &name2)
Definition: HcalTB06BeamParametersFromDD.cc:12
HcalTB06BeamParametersFromDD
Definition: HcalTB06BeamParametersFromDD.h:12
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
HcalTB06BeamParameters.h
HcalTB06BeamParametersFromDD.h
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
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HcalTB06ParametersESModule
Definition: HcalTB06BeamParametersESModule.cc:16
edm::ParameterSet
Definition: ParameterSet.h:47
HcalTB06ParametersESModule::name1_
std::string name1_
Definition: HcalTB06BeamParametersESModule.cc:28
IdealGeometryRecord.h
HcalTB06ParametersESModule::name2_
std::string name2_
Definition: HcalTB06BeamParametersESModule.cc:28
cc
HcalTB06ParametersESModule::cpvTokenDDD_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvTokenDDD_
Definition: HcalTB06BeamParametersESModule.cc:26
edm::ESGetToken< DDCompactView, IdealGeometryRecord >
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
HcalTB06ParametersESModule::HcalTB06ParametersESModule
HcalTB06ParametersESModule(const edm::ParameterSet &)
Definition: HcalTB06BeamParametersESModule.cc:32
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
HcalTB06ParametersESModule::cpvTokenDD4Hep_
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokenDD4Hep_
Definition: HcalTB06BeamParametersESModule.cc:27
HcalTB06ParametersESModule::produce
ReturnType produce(const IdealGeometryRecord &)
Definition: HcalTB06BeamParametersESModule.cc:54
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
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HcalTB06ParametersESModule::fromDD4Hep_
bool fromDD4Hep_
Definition: HcalTB06BeamParametersESModule.cc:29
edm::ESProducer
Definition: ESProducer.h:104
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25