CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions
DTGeometryBuilderFromDD4Hep Class Reference

#include <DTGeometryBuilderFromDD4Hep.h>

Public Member Functions

void build (DTGeometry &, const cms::DDDetector *, const MuonGeometryConstants &, const dd4hep::SpecParRefs &)
 
 DTGeometryBuilderFromDD4Hep ()
 

Private Types

using RCPPlane = ReferenceCountingPointer< Plane >
 

Private Member Functions

DTChamberbuildChamber (cms::DDFilteredView &, const MuonGeometryConstants &) const
 
void buildGeometry (cms::DDFilteredView &, DTGeometry &, const MuonGeometryConstants &) const
 
DTLayerbuildLayer (cms::DDFilteredView &, DTSuperLayer *, const MuonGeometryConstants &) const
 
DTSuperLayerbuildSuperLayer (cms::DDFilteredView &, DTChamber *, const MuonGeometryConstants &) const
 
RCPPlane plane (const cms::DDFilteredView &, Bounds *bounds) const
 

Detailed Description

Description: DT Geometry builder from DD4hep

Implementation: DT Geometry Builder iterates over a Detector Tree and retrvieves DT chambers, super layers, layers and wires.

Definition at line 42 of file DTGeometryBuilderFromDD4Hep.h.

Member Typedef Documentation

◆ RCPPlane

Definition at line 57 of file DTGeometryBuilderFromDD4Hep.h.

Constructor & Destructor Documentation

◆ DTGeometryBuilderFromDD4Hep()

DTGeometryBuilderFromDD4Hep::DTGeometryBuilderFromDD4Hep ( )
inline

Definition at line 44 of file DTGeometryBuilderFromDD4Hep.h.

44 {}

Member Function Documentation

◆ build()

void DTGeometryBuilderFromDD4Hep::build ( DTGeometry geom,
const cms::DDDetector det,
const MuonGeometryConstants num,
const dd4hep::SpecParRefs &  refs 
)

Definition at line 163 of file DTGeometryBuilderFromDD4Hep.cc.

166  {
167  cms::Volume top = det->worldVolume();
168  cms::DDFilteredView fview(det, top);
169  fview.mergedSpecifics(refs);
170  buildGeometry(fview, geom, num);
171 }

References relativeConstraints::geom, cms::DDFilteredView::mergedSpecifics(), EgammaValidation_cff::num, and cms::DDDetector::worldVolume().

Referenced by DTGeometryESModule::setupDD4hepGeometry().

◆ buildChamber()

DTChamber * DTGeometryBuilderFromDD4Hep::buildChamber ( cms::DDFilteredView fview,
const MuonGeometryConstants muonConstants 
) const
private

Definition at line 91 of file DTGeometryBuilderFromDD4Hep.cc.

92  {
93  MuonGeometryNumbering mdddnum(muonConstants);
94  DTNumberingScheme dtnum(muonConstants);
95  int rawid = dtnum.baseNumberToUnitNumber(mdddnum.geoHistoryToBaseNumber(fview.history()));
96 
97  DTChamberId detId(rawid);
98  auto const& par = fview.parameters();
99 
100  RCPPlane surf(plane(fview, new RectangularPlaneBounds(par[0], par[1], par[2])));
101 
102  DTChamber* chamber = new DTChamber(detId, surf);
103 
104  return chamber;
105 }

References DTNumberingScheme::baseNumberToUnitNumber(), relativeConstraints::chamber, MuonGeometryNumbering::geoHistoryToBaseNumber(), cms::DDFilteredView::history(), and cms::DDFilteredView::parameters().

◆ buildGeometry()

void DTGeometryBuilderFromDD4Hep::buildGeometry ( cms::DDFilteredView fview,
DTGeometry geom,
const MuonGeometryConstants num 
) const
private

Definition at line 49 of file DTGeometryBuilderFromDD4Hep.cc.

51  {
52  bool doChamber = fview.firstChild();
53 
54  while (doChamber) {
55  DTChamber* chamber = buildChamber(fview, num);
56 
57  bool doSL = fview.nextSibling();
58  while (doSL) {
59  DTSuperLayer* sl = buildSuperLayer(fview, chamber, num);
60 
61  fview.down();
62  bool doLayers = fview.sibling();
63  while (doLayers) {
64  DTLayer* l = buildLayer(fview, sl, num);
65  geom.add(l);
66 
67  doLayers = fview.sibling();
68  }
69 
70  geom.add(sl);
71  doSL = fview.nextSibling();
72  }
73  geom.add(chamber);
74 
75  fview.parent();
76  doChamber = fview.firstChild();
77  }
78 }

References relativeConstraints::chamber, cms::DDFilteredView::down(), cms::DDFilteredView::firstChild(), relativeConstraints::geom, cmsLHEtoEOSManager::l, cms::DDFilteredView::nextSibling(), EgammaValidation_cff::num, cms::DDFilteredView::parent(), and cms::DDFilteredView::sibling().

◆ buildLayer()

DTLayer * DTGeometryBuilderFromDD4Hep::buildLayer ( cms::DDFilteredView fview,
DTSuperLayer sl,
const MuonGeometryConstants muonConstants 
) const
private

Definition at line 127 of file DTGeometryBuilderFromDD4Hep.cc.

129  {
130  MuonGeometryNumbering mdddnum(muonConstants);
131  DTNumberingScheme dtnum(muonConstants);
132  int rawid = dtnum.baseNumberToUnitNumber(mdddnum.geoHistoryToBaseNumber(fview.history()));
133 
134  DTLayerId layId(rawid);
135 
136  auto const& par = fview.parameters();
137 
138  RCPPlane surf(plane(fview, new RectangularPlaneBounds(par[0], par[1], par[2])));
139 
140  fview.down();
141  bool doWire = fview.sibling();
142  int firstWire = fview.volume()->GetNumber();
143  auto const& wpar = fview.parameters();
144  float wireLength = wpar[1];
145 
146  int WCounter = 0;
147  while (doWire) {
148  doWire = fview.checkChild();
149  WCounter++;
150  }
151  fview.up();
152 
153  DTTopology topology(firstWire, WCounter, wireLength);
154 
155  DTLayerType layerType;
156 
157  DTLayer* layer = new DTLayer(layId, surf, topology, layerType, sl);
158 
159  sl->add(layer);
160  return layer;
161 }

References DTSuperLayer::add(), DTNumberingScheme::baseNumberToUnitNumber(), cms::DDFilteredView::checkChild(), cms::DDFilteredView::down(), MuonGeometryNumbering::geoHistoryToBaseNumber(), cms::DDFilteredView::history(), cms::DDFilteredView::parameters(), cms::DDFilteredView::sibling(), ecaldqm::topology(), cms::DDFilteredView::up(), and cms::DDFilteredView::volume().

◆ buildSuperLayer()

DTSuperLayer * DTGeometryBuilderFromDD4Hep::buildSuperLayer ( cms::DDFilteredView fview,
DTChamber chamber,
const MuonGeometryConstants muonConstants 
) const
private

Definition at line 107 of file DTGeometryBuilderFromDD4Hep.cc.

109  {
110  MuonGeometryNumbering mdddnum(muonConstants);
111  DTNumberingScheme dtnum(muonConstants);
112  int rawid = dtnum.baseNumberToUnitNumber(mdddnum.geoHistoryToBaseNumber(fview.history()));
113 
114  DTSuperLayerId slId(rawid);
115 
116  auto const& par = fview.parameters();
117 
118  RCPPlane surf(plane(fview, new RectangularPlaneBounds(par[0], par[1], par[2])));
119 
120  DTSuperLayer* slayer = new DTSuperLayer(slId, surf, chamber);
121 
122  chamber->add(slayer);
123 
124  return slayer;
125 }

References DTNumberingScheme::baseNumberToUnitNumber(), relativeConstraints::chamber, MuonGeometryNumbering::geoHistoryToBaseNumber(), cms::DDFilteredView::history(), and cms::DDFilteredView::parameters().

◆ plane()

DTGeometryBuilderFromDD4Hep::RCPPlane DTGeometryBuilderFromDD4Hep::plane ( const cms::DDFilteredView fview,
Bounds bounds 
) const
private

Definition at line 80 of file DTGeometryBuilderFromDD4Hep.cc.

81  {
82  const Double_t* tr = fview.trans();
83  const Double_t* rot = fview.rot();
84 
85  return RCPPlane(
86  new Plane(Surface::PositionType(tr[0], tr[1], tr[2]),
87  Surface::RotationType(rot[0], rot[3], rot[6], rot[1], rot[4], rot[7], rot[2], rot[5], rot[8]),
88  bounds));
89 }

References cms::DDFilteredView::rot(), makeMuonMisalignmentScenario::rot, and cms::DDFilteredView::trans().

cms::DDFilteredView::rot
const Double_t * rot() const
The absolute rotation of the current node.
Definition: DDFilteredView.cc:120
cms::DDFilteredView::volume
const PlacedVolume volume() const
The physical volume of the current node.
Definition: DDFilteredView.cc:68
DTGeometryBuilderFromDD4Hep::RCPPlane
ReferenceCountingPointer< Plane > RCPPlane
Definition: DTGeometryBuilderFromDD4Hep.h:57
TkRotation< float >
DTSuperLayerId
Definition: DTSuperLayerId.h:12
cms::DDFilteredView::parameters
const std::vector< double > parameters() const
extract shape parameters
Definition: DDFilteredView.cc:536
cms::DDFilteredView::sibling
bool sibling()
set the current node to the next sub sibling
Definition: DDFilteredView.cc:450
DTGeometryBuilderFromDD4Hep::buildLayer
DTLayer * buildLayer(cms::DDFilteredView &, DTSuperLayer *, const MuonGeometryConstants &) const
Definition: DTGeometryBuilderFromDD4Hep.cc:127
DTChamber
Definition: DTChamber.h:24
cms::DDFilteredView::parent
bool parent()
set the current node to the parent node ...
Definition: DDFilteredView.cc:481
DTSuperLayer
Definition: DTSuperLayer.h:24
cms::DDFilteredView
Definition: DDFilteredView.h:70
DTGeometryBuilderFromDD4Hep::buildSuperLayer
DTSuperLayer * buildSuperLayer(cms::DDFilteredView &, DTChamber *, const MuonGeometryConstants &) const
Definition: DTGeometryBuilderFromDD4Hep.cc:107
DTGeometryBuilderFromDD4Hep::buildGeometry
void buildGeometry(cms::DDFilteredView &, DTGeometry &, const MuonGeometryConstants &) const
Definition: DTGeometryBuilderFromDD4Hep.cc:49
cms::DDFilteredView::nextSibling
bool nextSibling()
set the current node to the next sibling
Definition: DDFilteredView.cc:427
DTTopology
Definition: DTTopology.h:28
cms::DDFilteredView::trans
const Double_t * trans() const
The absolute translation of the current node.
Definition: DDFilteredView.cc:101
ecaldqm::topology
const CaloTopology * topology(nullptr)
cms::DDFilteredView::firstChild
bool firstChild()
set the current node to the first child
Definition: DDFilteredView.cc:268
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
cms::DDFilteredView::down
void down()
set current node to the child node in the filtered tree
Definition: DDFilteredView.cc:505
Point3DBase< float, GlobalTag >
DTLayerId
Definition: DTLayerId.h:12
DTSuperLayer::add
void add(DTLayer *l)
Add layer to the SL which owns it.
Definition: DTSuperLayer.cc:47
cms::Volume
dd4hep::Volume Volume
Definition: DDFilteredView.h:47
cms::DDDetector::worldVolume
dd4hep::Volume worldVolume() const
Handle to the world volume containing everything.
Definition: DDDetector.cc:40
cms::DDFilteredView::history
const ExpandedNodes & history()
The numbering history of the current node.
Definition: DDFilteredView.cc:683
cms::DDFilteredView::up
void up()
set current node to the parent node in the filtered tree
Definition: DDFilteredView.cc:516
DTLayer
Definition: DTLayer.h:25
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
DTGeometryBuilderFromDD4Hep::plane
RCPPlane plane(const cms::DDFilteredView &, Bounds *bounds) const
Definition: DTGeometryBuilderFromDD4Hep.cc:80
RectangularPlaneBounds
Definition: RectangularPlaneBounds.h:12
cms::DDFilteredView::checkChild
bool checkChild()
count the number of children matching selection
Definition: DDFilteredView.cc:466
DTLayerType
Definition: DTLayerType.h:15
Plane
Definition: Plane.h:16
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
MuonGeometryNumbering
Definition: MuonGeometryNumbering.h:24
DTGeometryBuilderFromDD4Hep::buildChamber
DTChamber * buildChamber(cms::DDFilteredView &, const MuonGeometryConstants &) const
Definition: DTGeometryBuilderFromDD4Hep.cc:91
DTChamberId
Definition: DTChamberId.h:14
DTNumberingScheme
Definition: DTNumberingScheme.h:20