CMS 3D CMS Logo

DDDCmsTrackerContruction.cc
Go to the documentation of this file.
2 
3 #include <utility>
13 
14 std::unique_ptr<GeometricDet> DDDCmsTrackerContruction::construct(const DDCompactView& cpv,
15  std::vector<int> const& detidShifts) {
16  std::string attribute = "TkDDDStructure";
18 
19  DDFilteredView fv(cpv, filter);
20 
21  CmsTrackerStringToEnum theCmsTrackerStringToEnum;
22  if (theCmsTrackerStringToEnum.type(ExtractStringFromDDD<DDFilteredView>::getString(attribute, &fv)) !=
24  fv.firstChild();
25  if (theCmsTrackerStringToEnum.type(ExtractStringFromDDD<DDFilteredView>::getString(attribute, &fv)) !=
27  throw cms::Exception("Configuration") << " The first child of the DDFilteredView is not what is expected \n"
28  << ExtractStringFromDDD<DDFilteredView>::getString(attribute, &fv) << "\n";
29  }
30  }
31 
32  auto tracker = std::make_unique<GeometricDet>(&fv, GeometricDet::Tracker);
33  CmsTrackerBuilder<DDFilteredView> theCmsTrackerBuilder;
34  theCmsTrackerBuilder.build(fv, tracker.get(), attribute);
35 
36  CmsTrackerDetIdBuilder theCmsTrackerDetIdBuilder(detidShifts);
37 
38  theCmsTrackerDetIdBuilder.buildId(*tracker);
39  fv.parent();
40  //
41  // set the Tracker
42  //
43  //TrackerMapDDDtoID::instance().setTracker(tracker);
44  //NOTE: If it is decided that the TrackerMapDDDtoID should be
45  // constructed here, then we should return from this
46  // function so that the EventSetup can manage it
47 
48  return tracker;
49 }
50 
51 std::unique_ptr<GeometricDet> DDDCmsTrackerContruction::construct(const cms::DDCompactView& cpv,
52  std::vector<int> const& detidShifts) {
53  std::string attribute("TkDDDStructure");
54  cms::DDFilteredView fv(cpv, cms::DDFilter(attribute));
55 
56  CmsTrackerStringToEnum theCmsTrackerStringToEnum;
57  if (theCmsTrackerStringToEnum.type(ExtractStringFromDDD<cms::DDFilteredView>::getString("TkDDDStructure", &fv)) !=
59  fv.firstChild();
60  if (theCmsTrackerStringToEnum.type(ExtractStringFromDDD<cms::DDFilteredView>::getString(attribute, &fv)) !=
62  throw cms::Exception("Configuration")
63  << " The first child of the DDFilteredView is not what is expected \n"
65  }
66  }
67 
68  auto tracker = std::make_unique<GeometricDet>(&fv, GeometricDet::Tracker);
69  CmsTrackerBuilder<cms::DDFilteredView> theCmsTrackerBuilder;
70  theCmsTrackerBuilder.build(fv, tracker.get(), attribute);
71 
72  return tracker;
73 }
std::string_view DDFilter
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
void build(FilteredView &, GeometricDet *, const std::string &) override
static std::unique_ptr< GeometricDet > construct(DDCompactView const &cpv, std::vector< int > const &detidShifts)
takes ownership of detidShifts
static std::string getString(std::string const &, DDFilteredView *)
GeometricDet::GeometricEnumType type(std::string const &) const