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 }
CmsTrackerDetIdBuilder.h
ExtractStringFromDDD::getString
static std::string getString(const std::string &, FilteredView *)
CmsTrackerStringToEnum::type
GeometricDet::GeometricEnumType type(std::string const &) const
Definition: CmsTrackerStringToEnum.cc:122
MessageLogger.h
CmsTrackerBuilder
Definition: CmsTrackerBuilder.h:14
CmsTrackerStringToEnum
Definition: CmsTrackerStringToEnum.h:10
cms::DDFilteredView
Definition: DDFilteredView.h:65
DDFilteredView::parent
bool parent()
set the current node to the parent node ...
Definition: DDFilteredView.cc:161
DDCompactView.h
ExtractStringFromDDD
Definition: ExtractStringFromDDD.h:12
GeometricDet::Tracker
Definition: GeometricDet.h:54
DDFilteredView::firstChild
bool firstChild()
set the current node to the first child ...
Definition: DDFilteredView.cc:86
DDFilteredView.h
cms::DDFilter
Definition: DDFilteredView.h:54
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
cms::DDFilteredView::firstChild
bool firstChild()
set the current node to the first child
Definition: DDFilteredView.cc:218
DDFilteredView.h
DDCompactView.h
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
CmsTrackerLevelBuilder::build
void build(FilteredView &, GeometricDet *, const std::string &) override
Definition: CmsTrackerLevelBuilder.cc:141
DDSpecificsHasNamedValueFilter
Definition: DDFilter.h:60
DDDCmsTrackerContruction::construct
static std::unique_ptr< GeometricDet > construct(DDCompactView const &cpv, std::vector< int > const &detidShifts)
takes ownership of detidShifts
Definition: DDDCmsTrackerContruction.cc:14
GeometricDet.h
CmsTrackerDetIdBuilder
Definition: CmsTrackerDetIdBuilder.h:15
ExtractStringFromDDD.h
Exception
Definition: hltDiff.cc:246
cms::DDCompactView
Definition: DDCompactView.h:29
CmsTrackerBuilder.h
CmsTrackerDetIdBuilder::buildId
void buildId(GeometricDet &det)
Definition: CmsTrackerDetIdBuilder.cc:24
DDFilteredView
Definition: DDFilteredView.h:20
DDDCmsTrackerContruction.h