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 
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > dd4hepToken_
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
edm::ESGetToken< PGeometricTimingDet, IdealGeometryRecord > pGTDetToken_
static std::unique_ptr< GeometricTimingDet > construct(const DDCompactView &cpv)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61
std::unique_ptr< GeometricTimingDet > produce(const IdealGeometryRecord &)
MTDGeometricTimingDetESModule(const edm::ParameterSet &p)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::ESGetToken< DDCompactView, IdealGeometryRecord > ddCompactToken_
HLT enums.
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
static std::unique_ptr< GeometricTimingDet > construct(const PGeometricTimingDet &pgd)