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 (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 (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 47 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 167 of file DTGeometryBuilder.cc.

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

Referenced by DTGeometryESProducer::setupGeometry().

170  {
171  Volume top = det->worldVolume();
172  DDFilteredView fview(det, top);
173  fview.mergedSpecifics(refs);
174  dtnum_ = make_unique<DTNumberingScheme>(num.values());
175  buildGeometry(fview, geom, num);
176 }
void buildGeometry(DDFilteredView &, DTGeometry &, const MuonNumbering &) const
Volume worldVolume() const
Handle to the world volume containing everything.
Definition: DDDetector.cc:41
std::unique_ptr< cms::DTNumberingScheme > dtnum_
dd4hep::Volume Volume
const MuonConstants & values() const
DTChamber * DTGeometryBuilder::buildChamber ( DDFilteredView fview,
const MuonNumbering muonConstants 
) const
private

create the chamber

Definition at line 93 of file DTGeometryBuilder.cc.

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

93  {
94  int rawid = dtnum_->getDetId(muonConstants.geoHistoryToBaseNumber(fview.history()));
95  DTChamberId detId(rawid);
96  auto const& par = fview.parameters();
97  // par[0] r-phi dimension - different in different chambers
98  // par[1] z dimension - constant 125.55 cm
99  // par[2] radial thickness - almost constant about 18 cm
100 
101  RCPPlane surf(plane(fview, new RectangularPlaneBounds(par[0], par[1], par[2])));
102 
103  DTChamber* chamber = new DTChamber(detId, surf);
104 
105  return chamber;
106 }
RCPPlane plane(const DDFilteredView &, Bounds *bounds) const
const ExpandedNodes & history()
The numbering history of the current node.
std::unique_ptr< cms::DTNumberingScheme > dtnum_
const MuonBaseNumber geoHistoryToBaseNumber(const cms::ExpandedNodes &) const
const std::vector< double > parameters() const
extract shape parameters
ReferenceCountingPointer< Plane > RCPPlane
void DTGeometryBuilder::buildGeometry ( DDFilteredView fview,
DTGeometry geom,
const MuonNumbering num 
) const
private

Definition at line 51 of file DTGeometryBuilder.cc.

References DTGeometry::add(), relativeConstraints::chamber, cms::DDFilteredView::down(), cms::DDFilteredView::firstChild(), cmsLHEtoEOSManager::l, cms::DDFilteredView::nextSibling(), cms::DDFilteredView::parent(), and cms::DDFilteredView::sibling().

51  {
52  bool doChamber = fview.firstChild();
53 
54  while (doChamber) {
55  DTChamber* chamber = buildChamber(fview, num);
56 
57  // Loop on SLs
58  bool doSL = fview.nextSibling();
59  while (doSL) {
60  DTSuperLayer* sl = buildSuperLayer(fview, chamber, num);
61 
62  // Loop on Layers
63  fview.down();
64  bool doLayers = fview.sibling();
65  while (doLayers) {
66  DTLayer* l = buildLayer(fview, sl, num);
67  geom.add(l);
68 
69  doLayers = fview.sibling(); // go to next Layer
70  }
71  // Done with layers
72 
73  geom.add(sl);
74  doSL = fview.nextSibling(); // go to next SL
75  }
76  geom.add(chamber);
77 
78  fview.parent(); // stop iterating current branch
79  doChamber = fview.firstChild(); // go to next chamber
80  }
81 }
DTSuperLayer * buildSuperLayer(DDFilteredView &, DTChamber *, const MuonNumbering &) const
create the SL
bool sibling()
set the current node to the next sub sibling
DTChamber * buildChamber(DDFilteredView &, const MuonNumbering &) const
create the chamber
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
void add(DTChamber *ch)
Add a DTChamber to Geometry.
Definition: DTGeometry.cc:42
DTLayer * DTGeometryBuilder::buildLayer ( DDFilteredView fview,
DTSuperLayer sl,
const MuonNumbering muonConstants 
) const
private

create the layer

Definition at line 130 of file DTGeometryBuilder.cc.

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

132  {
133  int rawid = dtnum_->getDetId(muonConstants.geoHistoryToBaseNumber(fview.history()));
134  DTLayerId layId(rawid);
135 
136  auto const& par = fview.parameters();
137  // Layer specific parameter (size)
138  // par[0] r-phi dimension - changes in different chambers
139  // par[1] z dimension - constant 126.8 cm
140  // par[2] radial thickness - almost constant about 20 cm
141  RCPPlane surf(plane(fview, new RectangularPlaneBounds(par[0], par[1], par[2])));
142 
143  // Loop on wires
144  fview.down();
145  bool doWire = fview.sibling();
146  int firstWire = fview.volume()->GetNumber(); // copy no
147  auto const& wpar = fview.parameters();
148  float wireLength = wpar[1];
149 
150  int WCounter = 0;
151  while (doWire) {
152  doWire = fview.checkChild();
153  WCounter++;
154  }
155  fview.up();
156 
157  DTTopology topology(firstWire, WCounter, wireLength);
158 
159  DTLayerType layerType;
160 
161  DTLayer* layer = new DTLayer(layId, surf, topology, layerType, sl);
162 
163  sl->add(layer);
164  return layer;
165 }
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:47
const PlacedVolume volume() const
The physical volume of the current node.
bool sibling()
set the current node to the next sub sibling
void down()
set current node to the child node in the filtered tree
const ExpandedNodes & history()
The numbering history of the current node.
std::unique_ptr< cms::DTNumberingScheme > dtnum_
const MuonBaseNumber geoHistoryToBaseNumber(const cms::ExpandedNodes &) const
const std::vector< double > parameters() const
extract shape parameters
bool checkChild()
count the number of children matching selection
ReferenceCountingPointer< Plane > RCPPlane
DTSuperLayer * DTGeometryBuilder::buildSuperLayer ( DDFilteredView fview,
DTChamber chamber,
const MuonNumbering muonConstants 
) const
private

create the SL

Definition at line 108 of file DTGeometryBuilder.cc.

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

110  {
111  int rawid = dtnum_->getDetId(muonConstants.geoHistoryToBaseNumber(fview.history()));
112  DTSuperLayerId slId(rawid);
113 
114  auto const& par = fview.parameters();
115  // par[0] r-phi dimension - changes in different chambers
116  // par[1] z dimension - constant 126.8 cm
117  // par[2] radial thickness - almost constant about 20 cm
118 
119  // Ok this is the slayer position...
120  RCPPlane surf(plane(fview, new RectangularPlaneBounds(par[0], par[1], par[2])));
121 
122  DTSuperLayer* slayer = new DTSuperLayer(slId, surf, chamber);
123 
124  // add to the chamber
125  chamber->add(slayer);
126 
127  return slayer;
128 }
RCPPlane plane(const DDFilteredView &, Bounds *bounds) const
const ExpandedNodes & history()
The numbering history of the current node.
std::unique_ptr< cms::DTNumberingScheme > dtnum_
const MuonBaseNumber geoHistoryToBaseNumber(const cms::ExpandedNodes &) const
void add(DTSuperLayer *sl)
Add SL to the chamber which takes ownership.
Definition: DTChamber.cc:36
const std::vector< double > parameters() const
extract shape parameters
ReferenceCountingPointer< Plane > RCPPlane
DTGeometryBuilder::RCPPlane DTGeometryBuilder::plane ( const DDFilteredView fview,
Bounds bounds 
) const
private

Definition at line 83 of file DTGeometryBuilder.cc.

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

83  {
84  const Double_t* tr = fview.trans();
85  const Double_t* rot = fview.rot();
86 
87  return RCPPlane(
88  new Plane(Surface::PositionType(tr[0], tr[1], tr[2]),
89  Surface::RotationType(rot[0], rot[3], rot[6], rot[1], rot[4], rot[7], rot[2], rot[5], rot[8]),
90  bounds));
91 }
Definition: Plane.h:16
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 51 of file DTGeometryBuilder.h.