CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions
cms::DTGeometryBuilder Class Reference

#include <DTGeometryBuilder.h>

Public Member Functions

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

Private Types

using RCPPlane = ReferenceCountingPointer< Plane >
 

Private Member Functions

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

Detailed Description

Definition at line 46 of file DTGeometryBuilder.h.

Member Typedef Documentation

◆ RCPPlane

Definition at line 61 of file DTGeometryBuilder.h.

Constructor & Destructor Documentation

◆ DTGeometryBuilder()

cms::DTGeometryBuilder::DTGeometryBuilder ( )
inline

Definition at line 48 of file DTGeometryBuilder.h.

48 {}

Member Function Documentation

◆ build()

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

Definition at line 162 of file DTGeometryBuilder.cc.

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

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

Referenced by DTGeometryESProducer::setupGeometry().

◆ buildChamber()

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

Definition at line 91 of file DTGeometryBuilder.cc.

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

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

◆ buildGeometry()

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

Definition at line 52 of file DTGeometryBuilder.cc.

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

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 * DTGeometryBuilder::buildLayer ( DDFilteredView fview,
DTSuperLayer sl,
const MuonGeometryConstants muonConstants 
) const
private

Definition at line 126 of file DTGeometryBuilder.cc.

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

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 * DTGeometryBuilder::buildSuperLayer ( DDFilteredView fview,
DTChamber chamber,
const MuonGeometryConstants muonConstants 
) const
private

Definition at line 106 of file DTGeometryBuilder.cc.

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

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

◆ plane()

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

Definition at line 81 of file DTGeometryBuilder.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
TkRotation< float >
DTSuperLayerId
Definition: DTSuperLayerId.h:12
cms::DTGeometryBuilder::buildGeometry
void buildGeometry(DDFilteredView &, DTGeometry &, const MuonGeometryConstants &) const
Definition: DTGeometryBuilder.cc:52
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
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
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
cms::DTGeometryBuilder::buildSuperLayer
DTSuperLayer * buildSuperLayer(DDFilteredView &, DTChamber *, const MuonGeometryConstants &) const
Definition: DTGeometryBuilder.cc:106
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::DTGeometryBuilder::RCPPlane
ReferenceCountingPointer< Plane > RCPPlane
Definition: DTGeometryBuilder.h:61
cms::DTGeometryBuilder::buildLayer
DTLayer * buildLayer(DDFilteredView &, DTSuperLayer *, const MuonGeometryConstants &) const
Definition: DTGeometryBuilder.cc:126
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
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
cms::DTGeometryBuilder::plane
RCPPlane plane(const DDFilteredView &, Bounds *bounds) const
Definition: DTGeometryBuilder.cc:81
MuonGeometryNumbering
Definition: MuonGeometryNumbering.h:24
DTChamberId
Definition: DTChamberId.h:14
cms::DTGeometryBuilder::buildChamber
DTChamber * buildChamber(DDFilteredView &, const MuonGeometryConstants &) const
Definition: DTGeometryBuilder.cc:91
DTNumberingScheme
Definition: DTNumberingScheme.h:20