CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions
DDDCmsTrackerContruction Class Reference

#include <DDDCmsTrackerContruction.h>

Public Member Functions

 DDDCmsTrackerContruction ()=delete
 

Static Public Member Functions

static std::unique_ptr< GeometricDetconstruct (cms::DDCompactView const &cpv, std::vector< int > const &detidShifts)
 
static std::unique_ptr< GeometricDetconstruct (DDCompactView const &cpv, std::vector< int > const &detidShifts)
 takes ownership of detidShifts More...
 

Detailed Description

High level class to build a tracker. It will only build subdets, then call subdet builders

Definition at line 22 of file DDDCmsTrackerContruction.h.

Constructor & Destructor Documentation

◆ DDDCmsTrackerContruction()

DDDCmsTrackerContruction::DDDCmsTrackerContruction ( )
delete

Member Function Documentation

◆ construct() [1/2]

std::unique_ptr< GeometricDet > DDDCmsTrackerContruction::construct ( cms::DDCompactView const &  cpv,
std::vector< int > const &  detidShifts 
)
static

Definition at line 51 of file DDDCmsTrackerContruction.cc.

52  {
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 }

References CmsTrackerLevelBuilder< FilteredView >::build(), Exception, cms::DDFilteredView::firstChild(), ExtractStringFromDDD< FilteredView >::getString(), AlCaHLTBitMon_QueryRunRegistry::string, GeometricDet::Tracker, PbPb_ZMuSkimMuonDPG_cff::tracker, and CmsTrackerStringToEnum::type().

◆ construct() [2/2]

std::unique_ptr< GeometricDet > DDDCmsTrackerContruction::construct ( DDCompactView const &  cpv,
std::vector< int > const &  detidShifts 
)
static

takes ownership of detidShifts

Definition at line 14 of file DDDCmsTrackerContruction.cc.

15  {
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 }

References CmsTrackerLevelBuilder< FilteredView >::build(), CmsTrackerDetIdBuilder::buildId(), Exception, ALCARECOTkAlBeamHalo_cff::filter, DDFilteredView::firstChild(), ExtractStringFromDDD< FilteredView >::getString(), DDFilteredView::parent(), AlCaHLTBitMon_QueryRunRegistry::string, GeometricDet::Tracker, PbPb_ZMuSkimMuonDPG_cff::tracker, and CmsTrackerStringToEnum::type().

Referenced by TrackerGeometricDetESModule::produce().

ExtractStringFromDDD::getString
static std::string getString(const std::string &, FilteredView *)
CmsTrackerStringToEnum::type
GeometricDet::GeometricEnumType type(std::string const &) const
Definition: CmsTrackerStringToEnum.cc:122
CmsTrackerBuilder
Definition: CmsTrackerBuilder.h:14
CmsTrackerStringToEnum
Definition: CmsTrackerStringToEnum.h:10
cms::DDFilteredView
Definition: DDFilteredView.h:65
ExtractStringFromDDD
Definition: ExtractStringFromDDD.h:12
GeometricDet::Tracker
Definition: GeometricDet.h:54
cms::DDFilter
Definition: DDFilteredView.h:54
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
CmsTrackerDetIdBuilder
Definition: CmsTrackerDetIdBuilder.h:15
Exception
Definition: hltDiff.cc:246
DDFilteredView
Definition: DDFilteredView.h:20