CMS 3D CMS Logo

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

#include <DTGeometryBuilder.h>

Public Types

using DDSpecParRefs = std::vector< const DDSpecPar * >
 
using Detector = dd4hep::Detector
 

Public Member Functions

void build (DTGeometry &, const DDDetector *, const MuonNumbering &, const DDSpecParRefs &)
 
 DTGeometryBuilder ()
 
 ~DTGeometryBuilder ()
 

Private Types

using RCPPlane = ReferenceCountingPointer< Plane >
 

Private Member Functions

DTChamberbuildChamber (const DDFilteredView &, const MuonNumbering &) const
 create the chamber More...
 
void buildGeometry (DDFilteredView &, DTGeometry &, const MuonNumbering &) const
 
DTLayerbuildLayer (DDFilteredView &, DTSuperLayer *, const MuonNumbering &) const
 create the layer More...
 
DTSuperLayerbuildSuperLayer (const DDFilteredView &, DTChamber *, const MuonNumbering &) const
 create the SL More...
 
RCPPlane plane (const DDFilteredView &, Bounds *bounds) const
 

Private Attributes

std::unique_ptr< cms::DTNumberingSchemedtnum_ = 0
 

Detailed Description

Definition at line 25 of file DTGeometryBuilder.h.

Member Typedef Documentation

using cms::DTGeometryBuilder::DDSpecParRefs = std::vector<const DDSpecPar*>

Definition at line 31 of file DTGeometryBuilder.h.

using cms::DTGeometryBuilder::Detector = dd4hep::Detector

Definition at line 30 of file DTGeometryBuilder.h.

Definition at line 55 of file DTGeometryBuilder.h.

Constructor & Destructor Documentation

cms::DTGeometryBuilder::DTGeometryBuilder ( )
inline

Definition at line 27 of file DTGeometryBuilder.h.

27 {}
cms::DTGeometryBuilder::~DTGeometryBuilder ( )
inline

Definition at line 28 of file DTGeometryBuilder.h.

28 {}

Member Function Documentation

void DTGeometryBuilder::build ( DTGeometry geom,
const DDDetector det,
const MuonNumbering num,
const DDSpecParRefs refs 
)

Definition at line 181 of file DTGeometryBuilder.cc.

References cms::DDFilteredView::mergedSpecifics(), cms::MuonNumbering::values(), and cms::DDDetector::worldVolume().

Referenced by DTGeometryESProducer::setupGeometry().

184  {
185  Volume top = det->worldVolume();
186  DDFilteredView fview(det, top);
187  fview.mergedSpecifics(refs);
188  dtnum_ = make_unique<DTNumberingScheme>(num.values());
189  buildGeometry(fview, geom, num);
190 }
void buildGeometry(DDFilteredView &, DTGeometry &, const MuonNumbering &) const
Volume worldVolume() const
Definition: DDDetector.cc:34
std::unique_ptr< cms::DTNumberingScheme > dtnum_
dd4hep::Volume Volume
const MuonConstants & values() const
DTChamber * DTGeometryBuilder::buildChamber ( const DDFilteredView fview,
const MuonNumbering muonConstants 
) const
private

create the chamber

Definition at line 103 of file DTGeometryBuilder.cc.

References relativeConstraints::chamber, cms::DDFilteredView::extractParameters(), cms::MuonNumbering::geoHistoryToBaseNumber(), and cms::DDFilteredView::history().

104  {
105  int rawid = dtnum_->getDetId(muonConstants.geoHistoryToBaseNumber(fview.history()));
106  DTChamberId detId(rawid);
107  auto const& par = fview.extractParameters();
108  // par[0] r-phi dimension - different in different chambers
109  // par[1] z dimension - constant 125.55 cm
110  // par[2] radial thickness - almost constant about 18 cm
111 
112  RCPPlane surf(plane(fview, new RectangularPlaneBounds(par[0], par[1], par[2])));
113 
114  DTChamber* chamber = new DTChamber(detId, surf);
115 
116  return chamber;
117 }
RCPPlane plane(const DDFilteredView &, Bounds *bounds) const
const ExpandedNodes & history() const
The numbering history of the current node.
std::unique_ptr< cms::DTNumberingScheme > dtnum_
const MuonBaseNumber geoHistoryToBaseNumber(const cms::ExpandedNodes &) const
std::vector< double > extractParameters() const
extract shape parameters
ReferenceCountingPointer< Plane > RCPPlane
void DTGeometryBuilder::buildGeometry ( DDFilteredView fview,
DTGeometry geom,
const MuonNumbering num 
) const
private

Definition at line 52 of file DTGeometryBuilder.cc.

References DTGeometry::add(), relativeConstraints::chamber, cms::DDFilteredView::down(), cms::DDFilteredView::firstChild(), cms::DDFilteredView::firstSibling(), checklumidiff::l, cms::DDFilteredView::nextSibling(), cms::DDFilteredView::parent(), cms::DDFilteredView::sibling(), cms::DDFilteredView::unCheckNode(), and cms::DDFilteredView::up().

53  {
54 
55  bool doChamber = fview.firstChild();
56 
57  while(doChamber) {
58  DTChamber* chamber = buildChamber(fview, num);
59 
60  // Loop on SLs
61  bool doSL = fview.firstSibling();
62  while(doSL) {
63  DTSuperLayer* sl = buildSuperLayer(fview, chamber, num);
64 
65  // Loop on Layers
66  fview.down();
67  bool doLayers = fview.sibling();
68  while(doLayers) {
69  DTLayer* l = buildLayer(fview, sl, num);
70  fview.unCheckNode();
71  geom.add(l);
72 
73  doLayers = fview.sibling(); // go to next Layer
74  }
75  // Done with layers, go up
76  fview.up();
77 
78  geom.add(sl);
79  doSL = fview.nextSibling(); // go to next SL
80  }
81  geom.add(chamber);
82 
83  fview.parent(); // stop iterating current branch
84  doChamber = fview.firstChild(); // go to next chamber
85  }
86 }
void up()
set current node to the parent node in the filtered tree
bool firstSibling()
set the current node to the first sibling
bool sibling()
set the current node to the next sub sibling
void down()
set current node to the child node in the filtered tree
DTLayer * buildLayer(DDFilteredView &, DTSuperLayer *, const MuonNumbering &) const
create the layer
bool nextSibling()
set the current node to the next sibling
bool parent()
set the current node to the parent node ...
bool firstChild()
set the current node to the first child
DTChamber * buildChamber(const DDFilteredView &, const MuonNumbering &) const
create the chamber
DTSuperLayer * buildSuperLayer(const DDFilteredView &, DTChamber *, const MuonNumbering &) const
create the SL
void unCheckNode()
pop current node
void add(DTChamber *ch)
Add a DTChamber to Geometry.
Definition: DTGeometry.cc:44
DTLayer * DTGeometryBuilder::buildLayer ( DDFilteredView fview,
DTSuperLayer sl,
const MuonNumbering muonConstants 
) const
private

create the layer

Definition at line 143 of file DTGeometryBuilder.cc.

References DTSuperLayer::add(), cms::DDFilteredView::checkChild(), cms::DDFilteredView::down(), cms::DDFilteredView::extractParameters(), cms::MuonNumbering::geoHistoryToBaseNumber(), cms::DDFilteredView::history(), cms::DDFilteredView::siblingNoCheck(), ecaldqm::topology(), cms::DDFilteredView::up(), and cms::DDFilteredView::volume().

145  {
146  int rawid = dtnum_->getDetId(muonConstants.geoHistoryToBaseNumber(fview.history()));
147  DTLayerId layId(rawid);
148 
149  auto const& par = fview.extractParameters();
150  // Layer specific parameter (size)
151  // par[0] r-phi dimension - changes in different chambers
152  // par[1] z dimension - constant 126.8 cm
153  // par[2] radial thickness - almost constant about 20 cm
154  RCPPlane surf(plane(fview, new RectangularPlaneBounds(par[0], par[1], par[2])));
155 
156  // Loop on wires
157  fview.down();
158  bool doWire = fview.siblingNoCheck();
159  int firstWire = fview.volume()->GetNumber(); // copy no
160  auto const& wpar = fview.extractParameters();
161  float wireLength = wpar[1];
162 
163  int WCounter = 0;
164  while(doWire) {
165  doWire = fview.checkChild();
166  WCounter++;
167  }
168  fview.up();
169 
170  DTTopology topology(firstWire, WCounter, wireLength);
171 
172  DTLayerType layerType;
173 
174  DTLayer* layer = new DTLayer(layId, surf, topology, layerType, sl);
175 
176  sl->add(layer);
177  return layer;
178 }
void up()
set current node to the parent node in the filtered tree
CaloTopology const * topology(0)
RCPPlane plane(const DDFilteredView &, Bounds *bounds) const
void add(DTLayer *l)
Add layer to the SL which owns it.
Definition: DTSuperLayer.cc:59
const PlacedVolume volume() const
The physical volume of the current node.
const ExpandedNodes & history() const
The numbering history of the current node.
void down()
set current node to the child node in the filtered tree
std::unique_ptr< cms::DTNumberingScheme > dtnum_
const MuonBaseNumber geoHistoryToBaseNumber(const cms::ExpandedNodes &) const
std::vector< double > extractParameters() const
extract shape parameters
bool checkChild()
count the number of children matching selection
ReferenceCountingPointer< Plane > RCPPlane
DTSuperLayer * DTGeometryBuilder::buildSuperLayer ( const DDFilteredView fview,
DTChamber chamber,
const MuonNumbering muonConstants 
) const
private

create the SL

Definition at line 120 of file DTGeometryBuilder.cc.

References DTChamber::add(), cms::DDFilteredView::extractParameters(), cms::MuonNumbering::geoHistoryToBaseNumber(), and cms::DDFilteredView::history().

122  {
123  int rawid = dtnum_->getDetId(muonConstants.geoHistoryToBaseNumber(fview.history()));
124  DTSuperLayerId slId(rawid);
125 
126  auto const& par = fview.extractParameters();
127  // par[0] r-phi dimension - changes in different chambers
128  // par[1] z dimension - constant 126.8 cm
129  // par[2] radial thickness - almost constant about 20 cm
130 
131  // Ok this is the slayer position...
132  RCPPlane surf(plane(fview, new RectangularPlaneBounds(par[0], par[1], par[2])));
133 
134  DTSuperLayer* slayer = new DTSuperLayer(slId, surf, chamber);
135 
136  // add to the chamber
137  chamber->add(slayer);
138 
139  return slayer;
140 }
RCPPlane plane(const DDFilteredView &, Bounds *bounds) const
const ExpandedNodes & history() const
The numbering history of the current node.
std::unique_ptr< cms::DTNumberingScheme > dtnum_
const MuonBaseNumber geoHistoryToBaseNumber(const cms::ExpandedNodes &) const
std::vector< double > extractParameters() const
extract shape parameters
void add(DTSuperLayer *sl)
Add SL to the chamber which takes ownership.
Definition: DTChamber.cc:41
ReferenceCountingPointer< Plane > RCPPlane
DTGeometryBuilder::RCPPlane DTGeometryBuilder::plane ( const DDFilteredView fview,
Bounds bounds 
) const
private

Definition at line 89 of file DTGeometryBuilder.cc.

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

90  {
91 
92  const Double_t *tr = fview.trans();
93  const Double_t *rot = fview.rot();
94 
95  return RCPPlane(new Plane(Surface::PositionType(tr[0], tr[1], tr[2]),
96  Surface::RotationType(rot[0], rot[3], rot[6],
97  rot[1], rot[4], rot[7],
98  rot[2], rot[5], rot[8]),
99  bounds));
100 }
Definition: Plane.h:17
const Double_t * rot() const
The absolute rotation of the current node.
const Double_t * trans() const
The absolute translation of the current node.
ReferenceCountingPointer< Plane > RCPPlane

Member Data Documentation

std::unique_ptr<cms::DTNumberingScheme> cms::DTGeometryBuilder::dtnum_ = 0
private

Definition at line 60 of file DTGeometryBuilder.h.