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_ = nullptr
 

Detailed Description

Definition at line 25 of file DTGeometryBuilder.h.

Member Typedef Documentation

◆ DDSpecParRefs

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

Definition at line 31 of file DTGeometryBuilder.h.

◆ Detector

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

Definition at line 30 of file DTGeometryBuilder.h.

◆ RCPPlane

Definition at line 47 of file DTGeometryBuilder.h.

Constructor & Destructor Documentation

◆ DTGeometryBuilder()

cms::DTGeometryBuilder::DTGeometryBuilder ( )
inline

Definition at line 27 of file DTGeometryBuilder.h.

27 {}

◆ ~DTGeometryBuilder()

cms::DTGeometryBuilder::~DTGeometryBuilder ( )
inline

Definition at line 28 of file DTGeometryBuilder.h.

28 {}

Member Function Documentation

◆ build()

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

Definition at line 167 of file DTGeometryBuilder.cc.

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 }

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

Referenced by DTGeometryESProducer::setupGeometry().

◆ buildChamber()

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

create the chamber

Definition at line 93 of file DTGeometryBuilder.cc.

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 }

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

◆ buildGeometry()

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

Definition at line 51 of file DTGeometryBuilder.cc.

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 }

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 MuonNumbering muonConstants 
) const
private

create the layer

Definition at line 130 of file DTGeometryBuilder.cc.

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 }

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().

◆ buildSuperLayer()

DTSuperLayer * DTGeometryBuilder::buildSuperLayer ( DDFilteredView fview,
DTChamber chamber,
const MuonNumbering muonConstants 
) const
private

create the SL

Definition at line 108 of file DTGeometryBuilder.cc.

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 }

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

◆ plane()

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

Definition at line 83 of file DTGeometryBuilder.cc.

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 }

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

Member Data Documentation

◆ dtnum_

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

Definition at line 51 of file DTGeometryBuilder.h.

cms::DTGeometryBuilder::buildChamber
DTChamber * buildChamber(DDFilteredView &, const MuonNumbering &) const
create the chamber
Definition: DTGeometryBuilder.cc:93
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::MuonNumbering::geoHistoryToBaseNumber
const MuonBaseNumber geoHistoryToBaseNumber(const cms::ExpandedNodes &) const
Definition: DD4hep_MuonNumbering.cc:8
cms::DDFilteredView::parameters
const std::vector< double > parameters() const
extract shape parameters
Definition: DDFilteredView.cc:448
cms::DDFilteredView::sibling
bool sibling()
set the current node to the next sub sibling
Definition: DDFilteredView.cc:371
cms::DTGeometryBuilder::buildSuperLayer
DTSuperLayer * buildSuperLayer(DDFilteredView &, DTChamber *, const MuonNumbering &) const
create the SL
Definition: DTGeometryBuilder.cc:108
DTChamber
Definition: DTChamber.h:24
cms::DDFilteredView::parent
bool parent()
set the current node to the parent node ...
Definition: DDFilteredView.cc:398
DTSuperLayer
Definition: DTSuperLayer.h:24
cms::DDFilteredView
Definition: DDFilteredView.h:65
cms::DDFilteredView::nextSibling
bool nextSibling()
set the current node to the next sibling
Definition: DDFilteredView.cc:350
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:218
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:419
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:45
cms::DTGeometryBuilder::RCPPlane
ReferenceCountingPointer< Plane > RCPPlane
Definition: DTGeometryBuilder.h:47
cms::DTGeometryBuilder::buildGeometry
void buildGeometry(DDFilteredView &, DTGeometry &, const MuonNumbering &) const
Definition: DTGeometryBuilder.cc:51
cms::DDFilteredView::history
const ExpandedNodes & history()
The numbering history of the current node.
Definition: DDFilteredView.cc:573
cms::DDFilteredView::up
void up()
set current node to the parent node in the filtered tree
Definition: DDFilteredView.cc:428
cms::DTGeometryBuilder::buildLayer
DTLayer * buildLayer(DDFilteredView &, DTSuperLayer *, const MuonNumbering &) const
create the layer
Definition: DTGeometryBuilder.cc:130
DTLayer
Definition: DTLayer.h:25
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
RectangularPlaneBounds
Definition: RectangularPlaneBounds.h:12
cms::DDFilteredView::checkChild
bool checkChild()
count the number of children matching selection
Definition: DDFilteredView.cc:385
cms::DTGeometryBuilder::dtnum_
std::unique_ptr< cms::DTNumberingScheme > dtnum_
Definition: DTGeometryBuilder.h:51
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:83
DTChamberId
Definition: DTChamberId.h:14
cms::DDDetector::worldVolume
Volume worldVolume() const
Handle to the world volume containing everything.
Definition: DDDetector.cc:41