CMS 3D CMS Logo

MTDGeometricTimingDetESModule.cc
Go to the documentation of this file.
16 
17 #include <memory>
18 
20 public:
23 
24  std::unique_ptr<GeometricTimingDet> produce(const IdealGeometryRecord&);
25 
26  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
27 
28 private:
29  const bool fromDDD_;
30  const bool fromDD4hep_;
31 
35 };
36 
37 using namespace edm;
38 
40  : fromDDD_(p.getParameter<bool>("fromDDD")), fromDD4hep_(p.getParameter<bool>("fromDD4hep")) {
41  auto cc = setWhatProduced(this);
42  if (fromDDD_) {
44  } else if (fromDD4hep_) {
46  } else {
48  }
49 }
50 
52 
55  descDB.add<bool>("fromDDD", false);
56  descDB.add<bool>("fromDD4hep", false);
57  descriptions.add("mtdNumberingGeometryDB", descDB);
58 
60  desc.add<bool>("fromDDD", true);
61  desc.add<bool>("fromDD4hep", false);
62  descriptions.add("mtdNumberingGeometry", desc);
63 }
64 
65 std::unique_ptr<GeometricTimingDet> MTDGeometricTimingDetESModule::produce(const IdealGeometryRecord& iRecord) {
66  if (fromDDD_) {
68  return DDCmsMTDConstruction::construct((*cpv));
69  } else if (fromDD4hep_) {
71  return DDCmsMTDConstruction::construct((*cpv));
72  } else {
73  PGeometricTimingDet const& pgd = iRecord.get(pGTDetToken_);
75  }
76 }
77 
DDVectorGetter.h
ConfigurationDescriptions.h
MTDGeometricTimingDetESModule::fromDDD_
const bool fromDDD_
Definition: MTDGeometricTimingDetESModule.cc:29
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
DDCmsMTDConstruction::construct
static std::unique_ptr< GeometricTimingDet > construct(const DDCompactView &cpv)
Definition: DDCmsMTDConstruction.cc:42
ESHandle.h
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ESProducer.h
DDDetector.h
DDCompactView.h
CondDBCmsMTDConstruction::construct
static std::unique_ptr< GeometricTimingDet > construct(const PGeometricTimingDet &pgd)
Definition: CondDBCmsMTDConstruction.cc:10
cc
MTDGeometricTimingDetESModule::fromDD4hep_
const bool fromDD4hep_
Definition: MTDGeometricTimingDetESModule.cc:30
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
MTDGeometricTimingDetESModule::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: MTDGeometricTimingDetESModule.cc:53
MTDGeometricTimingDetESModule::dd4hepToken_
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > dd4hepToken_
Definition: MTDGeometricTimingDetESModule.cc:33
edm::eventsetup::DependentRecordImplementation::getTransientHandle
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:99
DDCmsMTDConstruction.h
DDCompactView.h
MTDGeometricTimingDetESModule::pGTDetToken_
edm::ESGetToken< PGeometricTimingDet, IdealGeometryRecord > pGTDetToken_
Definition: MTDGeometricTimingDetESModule.cc:34
ParameterSetDescription.h
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:112
MTDGeometricTimingDetESModule::MTDGeometricTimingDetESModule
MTDGeometricTimingDetESModule(const edm::ParameterSet &p)
Definition: MTDGeometricTimingDetESModule.cc:39
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
edm::ParameterSet
Definition: ParameterSet.h:36
CondDBCmsMTDConstruction.h
PGeometricTimingDet
Definition: PGeometricTimingDet.h:9
DDutils.h
MTDGeometricTimingDetESModule
Definition: MTDGeometricTimingDetESModule.cc:19
IdealGeometryRecord.h
edm::ESGetToken< DDCompactView, IdealGeometryRecord >
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
ModuleFactory.h
MTDGeometricTimingDetESModule::produce
std::unique_ptr< GeometricTimingDet > produce(const IdealGeometryRecord &)
Definition: MTDGeometricTimingDetESModule.cc:65
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
cms::DDCompactView
Definition: DDCompactView.h:29
MTDGeometricTimingDetESModule::~MTDGeometricTimingDetESModule
~MTDGeometricTimingDetESModule() override
Definition: MTDGeometricTimingDetESModule.cc:51
MTDGeometricTimingDetESModule::ddCompactToken_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > ddCompactToken_
Definition: MTDGeometricTimingDetESModule.cc:32
EventSetup.h
edm::ESProducer
Definition: ESProducer.h:101
IdealGeometryRecord
Definition: IdealGeometryRecord.h:27