CMS 3D CMS Logo

MTDGeometricTimingDetESModule.cc
Go to the documentation of this file.
15 
16 #include <memory>
17 
19 public:
22 
23  std::unique_ptr<GeometricTimingDet> produce(const IdealGeometryRecord&);
24 
25  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
26 
27 private:
28  const bool fromDDD_;
29  const bool fromDD4hep_;
30 
34 };
35 
36 using namespace edm;
37 
39  : fromDDD_(p.getParameter<bool>("fromDDD")), fromDD4hep_(p.getParameter<bool>("fromDD4hep")) {
40  auto cc = setWhatProduced(this);
41  if (fromDDD_) {
43  } else if (fromDD4hep_) {
45  } else {
47  }
48 }
49 
51 
54  descDB.add<bool>("fromDDD", false);
55  descDB.add<bool>("fromDD4hep", false);
56  descriptions.add("mtdNumberingGeometryDB", descDB);
57 
59  desc.add<bool>("fromDDD", true);
60  desc.add<bool>("fromDD4hep", false);
61  descriptions.add("mtdNumberingGeometry", desc);
62 }
63 
64 std::unique_ptr<GeometricTimingDet> MTDGeometricTimingDetESModule::produce(const IdealGeometryRecord& iRecord) {
65  if (fromDDD_) {
67  return DDCmsMTDConstruction::construct((*cpv));
68  } else if (fromDD4hep_) {
70  return DDCmsMTDConstruction::construct((*cpv));
71  } else {
72  PGeometricTimingDet const& pgd = iRecord.get(pGTDetToken_);
74  }
75 }
76 
ConfigurationDescriptions.h
MTDGeometricTimingDetESModule::fromDDD_
const bool fromDDD_
Definition: MTDGeometricTimingDetESModule.cc:28
electrons_cff.bool
bool
Definition: electrons_cff.py:366
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
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
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: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:81
MTDGeometricTimingDetESModule::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: MTDGeometricTimingDetESModule.cc:52
MTDGeometricTimingDetESModule::dd4hepToken_
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > dd4hepToken_
Definition: MTDGeometricTimingDetESModule.cc:32
edm::eventsetup::DependentRecordImplementation::getTransientHandle
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:98
DDCmsMTDConstruction.h
DDCompactView.h
MTDGeometricTimingDetESModule::pGTDetToken_
edm::ESGetToken< PGeometricTimingDet, IdealGeometryRecord > pGTDetToken_
Definition: MTDGeometricTimingDetESModule.cc:33
ParameterSetDescription.h
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:109
MTDGeometricTimingDetESModule::MTDGeometricTimingDetESModule
MTDGeometricTimingDetESModule(const edm::ParameterSet &p)
Definition: MTDGeometricTimingDetESModule.cc:38
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
DDutils.h
edm::ParameterSet
Definition: ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CondDBCmsMTDConstruction.h
PGeometricTimingDet
Definition: PGeometricTimingDet.h:9
MTDGeometricTimingDetESModule
Definition: MTDGeometricTimingDetESModule.cc:18
IdealGeometryRecord.h
edm::ESGetToken< DDCompactView, IdealGeometryRecord >
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
MTDGeometricTimingDetESModule::produce
std::unique_ptr< GeometricTimingDet > produce(const IdealGeometryRecord &)
Definition: MTDGeometricTimingDetESModule.cc:64
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
cms::DDCompactView
Definition: DDCompactView.h:31
MTDGeometricTimingDetESModule::~MTDGeometricTimingDetESModule
~MTDGeometricTimingDetESModule() override
Definition: MTDGeometricTimingDetESModule.cc:50
MTDGeometricTimingDetESModule::ddCompactToken_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > ddCompactToken_
Definition: MTDGeometricTimingDetESModule.cc:31
EventSetup.h
edm::ESProducer
Definition: ESProducer.h:104
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25