CMS 3D CMS Logo

TrackerGeometricDetESModule.cc
Go to the documentation of this file.
15 
16 #include <memory>
17 
19 public:
21  ~TrackerGeometricDetESModule(void) override;
22  std::unique_ptr<GeometricDet> produce(const IdealGeometryRecord&);
23 
24  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
25 
26 private:
30  bool fromDDD_;
32 };
33 
34 using namespace edm;
35 
37  : fromDDD_(p.getParameter<bool>("fromDDD")), fromDD4hep_(p.getParameter<bool>("fromDD4hep")) {
38  auto cc = setWhatProduced(this);
39  if (fromDDD_) {
41  } else if (fromDD4hep_) {
43  } else {
45  }
46 }
47 
49 
52  descDB.add<bool>("fromDDD", false);
53  descDB.add<bool>("fromDD4hep", false);
54  descriptions.add("trackerNumberingGeometryDB", descDB);
55 
57  desc.add<bool>("fromDDD", true);
58  desc.add<bool>("fromDD4hep", false);
59  descriptions.add("trackerNumberingGeometry", desc);
60 
62  descDD4hep.add<bool>("fromDDD", false);
63  descDD4hep.add<bool>("fromDD4hep", true);
64  descriptions.add("DD4hep_trackerNumberingGeometry", descDD4hep);
65 }
66 
67 std::unique_ptr<GeometricDet> TrackerGeometricDetESModule::produce(const IdealGeometryRecord& iRecord) {
68  if (fromDDD_) {
70 
71  return DDDCmsTrackerContruction::construct(*cpv, dbl_to_int(cpv->vector("detIdShifts")));
72  } else if (fromDD4hep_) {
74 
75  return DDDCmsTrackerContruction::construct(*cpv, cpv->getVector<int>("detIdShifts"));
76  } else {
77  auto const& pgd = iRecord.get(pgToken_);
78 
80  }
81 }
82 
ConfigurationDescriptions.h
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
CondDBCmsTrackerConstruction::construct
static std::unique_ptr< GeometricDet > construct(const PGeometricDet &pgd)
Definition: CondDBCmsTrackerConstruction.cc:12
ESHandle.h
edm
HLT enums.
Definition: AlignableModifier.h:19
TrackerGeometricDetESModule::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: TrackerGeometricDetESModule.cc:50
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
TrackerGeometricDetESModule::produce
std::unique_ptr< GeometricDet > produce(const IdealGeometryRecord &)
Definition: TrackerGeometricDetESModule.cc:67
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ESProducer.h
DDCompactView::vector
std::vector< double > const & vector(std::string_view iKey) const
returns an empty container if not found
Definition: DDCompactView.cc:67
DDCompactView.h
TrackerGeometricDetESModule::pgToken_
edm::ESGetToken< PGeometricDet, IdealGeometryRecord > pgToken_
Definition: TrackerGeometricDetESModule.cc:29
cc
TrackerGeometricDetESModule
Definition: TrackerGeometricDetESModule.cc:18
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
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:109
TrackerGeometricDetESModule::fromDD4hep_
bool fromDD4hep_
Definition: TrackerGeometricDetESModule.cc:31
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
DDutils.h
edm::ParameterSet
Definition: ParameterSet.h:47
IdealGeometryRecord.h
edm::ESGetToken< DDCompactView, IdealGeometryRecord >
cms::DDCompactView::getVector
std::vector< T > getVector(const std::string &) const
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
CondDBCmsTrackerConstruction.h
cms::DDCompactView
Definition: DDCompactView.h:31
EventSetup.h
PGeometricDet.h
TrackerGeometricDetESModule::~TrackerGeometricDetESModule
~TrackerGeometricDetESModule(void) override
Definition: TrackerGeometricDetESModule.cc:48
edm::ESProducer
Definition: ESProducer.h:104
dbl_to_int
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
Definition: DDutils.h:7
TrackerGeometricDetESModule::TrackerGeometricDetESModule
TrackerGeometricDetESModule(const edm::ParameterSet &p)
Definition: TrackerGeometricDetESModule.cc:36
DDDCmsTrackerContruction::construct
std::unique_ptr< GeometricDet > construct(DDCompactView const &cpv, std::vector< int > const &detidShifts)
Definition: DDDCmsTrackerContruction.cc:18
PGeometricDet
Definition: PGeometricDet.h:9
TrackerGeometricDetESModule::fromDDD_
bool fromDDD_
Definition: TrackerGeometricDetESModule.cc:30
TrackerGeometricDetESModule::ddToken_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > ddToken_
Definition: TrackerGeometricDetESModule.cc:27
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25
DDDCmsTrackerContruction.h
TrackerGeometricDetESModule::dd4hepToken_
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > dd4hepToken_
Definition: TrackerGeometricDetESModule.cc:28