CMS 3D CMS Logo

MTDParametersESModule.cc
Go to the documentation of this file.
14 
15 #include <memory>
16 
18 public:
20 
21  using ReturnType = std::unique_ptr<PMTDParameters>;
22 
24 
26 
27 private:
29 
30  const bool fromDD4hep_;
33 };
34 
36  : fromDD4hep_(pset.getParameter<bool>("fromDD4hep")) {
37  auto cc = setWhatProduced(this);
38  if (!fromDD4hep_) {
40  } else {
42  }
43 }
44 
47  desc.add<bool>("fromDD4hep", false);
48  descriptions.add("mtdParameters", desc);
49 }
50 
52  auto ptp = std::make_unique<PMTDParameters>();
53  if (!fromDD4hep_) {
54  auto cpv = iRecord.getTransientHandle(ddCompactToken_);
55  builder.build(cpv.product(), *ptp);
56  } else {
57  auto cpv = iRecord.getTransientHandle(dd4hepToken_);
58  builder.build(cpv.product(), *ptp);
59  }
60 
61  return ptp;
62 }
63 
ConfigurationDescriptions.h
MTDParametersESModule::dd4hepToken_
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > dd4hepToken_
Definition: MTDParametersESModule.cc:32
electrons_cff.bool
bool
Definition: electrons_cff.py:366
edm::ESInputTag
Definition: ESInputTag.h:87
ESTransientHandle.h
ESHandle.h
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ESProducer.h
MTDParametersESModule
Definition: MTDParametersESModule.cc:17
DDCompactView.h
MTDParametersESModule::produce
ReturnType produce(const PMTDParametersRcd &)
Definition: MTDParametersESModule.cc:51
MTDParametersESModule::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: MTDParametersESModule.cc:45
MTDParametersESModule::builder
MTDParametersFromDD builder
Definition: MTDParametersESModule.cc:28
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
MTDParametersESModule::fromDD4hep_
const bool fromDD4hep_
Definition: MTDParametersESModule.cc:30
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
PMTDParametersRcd.h
edm::ParameterSet
Definition: ParameterSet.h:47
PMTDParametersRcd
Definition: PMTDParametersRcd.h:9
IdealGeometryRecord.h
cc
MTDParametersFromDD.h
edm::ESGetToken< DDCompactView, IdealGeometryRecord >
MTDParametersESModule::ddCompactToken_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > ddCompactToken_
Definition: MTDParametersESModule.cc:31
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
MTDParametersESModule::MTDParametersESModule
MTDParametersESModule(const edm::ParameterSet &)
Definition: MTDParametersESModule.cc:35
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
MTDParametersFromDD
Definition: MTDParametersFromDD.h:14
MTDParametersESModule::ReturnType
std::unique_ptr< PMTDParameters > ReturnType
Definition: MTDParametersESModule.cc:21
cms::DDCompactView
Definition: DDCompactView.h:31
PMTDParameters.h
MTDParametersFromDD::build
bool build(const DDCompactView *, PMTDParameters &)
Definition: MTDParametersFromDD.cc:33
edm::ESProducer
Definition: ESProducer.h:104
ParameterSet.h
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27