CMS 3D CMS Logo

TrackerGeometricDetESModule.cc
Go to the documentation of this file.
16 
17 #include <memory>
18 
20 public:
22  ~TrackerGeometricDetESModule(void) override;
23  std::unique_ptr<GeometricDet> produce(const IdealGeometryRecord&);
24 
25  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
26 
27 private:
31  bool fromDDD_;
33 };
34 
35 using namespace edm;
36 
38  : fromDDD_(p.getParameter<bool>("fromDDD")), fromDD4hep_(p.getParameter<bool>("fromDD4hep")) {
39  auto cc = setWhatProduced(this);
40  if (fromDDD_) {
42  } else if (fromDD4hep_) {
44  } else {
46  }
47 }
48 
50 
53  descDB.add<bool>("fromDDD", false);
54  descDB.add<bool>("fromDD4hep", false);
55  descriptions.add("trackerNumberingGeometryDB", descDB);
56 
58  desc.add<bool>("fromDDD", true);
59  desc.add<bool>("fromDD4hep", false);
60  descriptions.add("trackerNumberingGeometry", desc);
61 
63  descDD4hep.add<bool>("fromDDD", false);
64  descDD4hep.add<bool>("fromDD4hep", true);
65  descriptions.add("DD4hep_trackerNumberingGeometry", descDD4hep);
66 }
67 
68 std::unique_ptr<GeometricDet> TrackerGeometricDetESModule::produce(const IdealGeometryRecord& iRecord) {
69  if (fromDDD_) {
71 
73  } else if (fromDD4hep_) {
75 
76  return DDDCmsTrackerContruction::construct(*cpv, cpv->getVector<int>("detIdShifts"));
77  } else {
78  auto const& pgd = iRecord.get(pgToken_);
79 
81  }
82 }
83 
DDVectorGetter.h
ConfigurationDescriptions.h
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
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:51
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
TrackerGeometricDetESModule::produce
std::unique_ptr< GeometricDet > produce(const IdealGeometryRecord &)
Definition: TrackerGeometricDetESModule.cc:68
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ESProducer.h
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
DDCompactView.h
DDVectorGetter::get
std::vector< double > get(const std::string &)
Definition: DDVectorGetter.h:28
TrackerGeometricDetESModule::pgToken_
edm::ESGetToken< PGeometricDet, IdealGeometryRecord > pgToken_
Definition: TrackerGeometricDetESModule.cc:30
cc
TrackerGeometricDetESModule
Definition: TrackerGeometricDetESModule.cc:19
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
edm::eventsetup::DependentRecordImplementation::getTransientHandle
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:99
DDCompactView.h
ParameterSetDescription.h
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:112
TrackerGeometricDetESModule::fromDD4hep_
bool fromDD4hep_
Definition: TrackerGeometricDetESModule.cc:32
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
edm::ParameterSet
Definition: ParameterSet.h:36
DDutils.h
IdealGeometryRecord.h
DDDCmsTrackerContruction::construct
static std::unique_ptr< GeometricDet > construct(DDCompactView const &cpv, std::vector< int > const &detidShifts)
takes ownership of detidShifts
Definition: DDDCmsTrackerContruction.cc:14
edm::ESGetToken< DDCompactView, IdealGeometryRecord >
cms::DDCompactView::getVector
std::vector< T > getVector(const std::string &) const
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
ModuleFactory.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
CondDBCmsTrackerConstruction.h
cms::DDCompactView
Definition: DDCompactView.h:29
EventSetup.h
PGeometricDet.h
TrackerGeometricDetESModule::~TrackerGeometricDetESModule
~TrackerGeometricDetESModule(void) override
Definition: TrackerGeometricDetESModule.cc:49
edm::ESProducer
Definition: ESProducer.h:101
TrackerGeometricDetESModule::TrackerGeometricDetESModule
TrackerGeometricDetESModule(const edm::ParameterSet &p)
Definition: TrackerGeometricDetESModule.cc:37
PGeometricDet
Definition: PGeometricDet.h:9
TrackerGeometricDetESModule::fromDDD_
bool fromDDD_
Definition: TrackerGeometricDetESModule.cc:31
TrackerGeometricDetESModule::ddToken_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > ddToken_
Definition: TrackerGeometricDetESModule.cc:28
IdealGeometryRecord
Definition: IdealGeometryRecord.h:27
DDDCmsTrackerContruction.h
TrackerGeometricDetESModule::dd4hepToken_
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > dd4hepToken_
Definition: TrackerGeometricDetESModule.cc:29