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 179 of file DTGeometryBuilder.cc.

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

Referenced by DTGeometryESProducer::setupGeometry().

182  {
183  Volume top = det->worldVolume();
184  DDFilteredView fview(det, top);
185  fview.mergedSpecifics(refs);
186  buildGeometry(fview, geom, num);
187 }
void buildGeometry(DDFilteredView &, DTGeometry &, const MuonGeometryConstants &) const
dd4hep::Volume Volume
dd4hep::Volume worldVolume() const
Handle to the world volume containing everything.
Definition: DDDetector.cc:67

◆ buildChamber()

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

Definition at line 93 of file DTGeometryBuilder.cc.

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

93  {
94  MuonGeometryNumbering mdddnum(muonConstants);
95  DTNumberingScheme dtnum(muonConstants);
96  int rawid = dtnum.baseNumberToUnitNumber(mdddnum.geoHistoryToBaseNumber(fview.history()));
97 
98  DTChamberId detId(rawid);
99  auto const& par = fview.parameters();
100 
101  edm::LogVerbatim("DTGeometryBuilder") << "(1) detId: " << rawid << " par[0]: " << par[0] / dd4hep::cm
102  << " par[1]: " << par[1] / dd4hep::cm << " par[2]: " << par[2] / dd4hep::cm;
103 
104  RCPPlane surf(
105  plane(fview, new RectangularPlaneBounds(par[0] / dd4hep::cm, par[1] / dd4hep::cm, par[2] / dd4hep::cm)));
106 
107  DTChamber* chamber = new DTChamber(detId, surf);
108 
109  return chamber;
110 }
Log< level::Info, true > LogVerbatim
const ExpandedNodes & history()
The numbering history of the current node.
RCPPlane plane(const DDFilteredView &, Bounds *bounds) const
const std::vector< double > parameters() const
extract shape parameters
ReferenceCountingPointer< Plane > RCPPlane

◆ buildGeometry()

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

Definition at line 52 of file DTGeometryBuilder.cc.

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

52  {
53  edm::LogVerbatim("DTGeometryBuilder") << "(0) DTGeometryBuilder - DD4hep ";
54 
55  bool doChamber = fview.firstChild();
56 
57  while (doChamber) {
58  DTChamber* chamber = buildChamber(fview, num);
59 
60  bool doSL = fview.nextSibling();
61  while (doSL) {
62  DTSuperLayer* sl = buildSuperLayer(fview, chamber, num);
63 
64  fview.down();
65  bool doLayers = fview.sibling();
66  while (doLayers) {
67  DTLayer* l = buildLayer(fview, sl, num);
68  geom.add(l);
69 
70  doLayers = fview.sibling();
71  }
72 
73  geom.add(sl);
74  doSL = fview.nextSibling();
75  }
76  geom.add(chamber);
77 
78  fview.parent();
79  doChamber = fview.firstChild();
80  }
81 }
Log< level::Info, true > LogVerbatim
DTChamber * buildChamber(DDFilteredView &, const MuonGeometryConstants &) const
bool sibling()
set the current node to the next sub sibling
void down()
set current node to the child node in the filtered tree
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
DTSuperLayer * buildSuperLayer(DDFilteredView &, DTChamber *, const MuonGeometryConstants &) const
DTLayer * buildLayer(DDFilteredView &, DTSuperLayer *, const MuonGeometryConstants &) const

◆ buildLayer()

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

Definition at line 136 of file DTGeometryBuilder.cc.

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

138  {
139  MuonGeometryNumbering mdddnum(muonConstants);
140  DTNumberingScheme dtnum(muonConstants);
141  int rawid = dtnum.baseNumberToUnitNumber(mdddnum.geoHistoryToBaseNumber(fview.history()));
142 
143  DTLayerId layId(rawid);
144 
145  auto const& par = fview.parameters();
146 
147  edm::LogVerbatim("DTGeometryBuilder") << "(3) detId: " << rawid << " par[0]: " << par[0] / dd4hep::cm
148  << " par[1]: " << par[1] / dd4hep::cm << " par[2]: " << par[2] / dd4hep::cm;
149 
150  RCPPlane surf(
151  plane(fview, new RectangularPlaneBounds(par[0] / dd4hep::cm, par[1] / dd4hep::cm, par[2] / dd4hep::cm)));
152 
153  fview.down();
154  bool doWire = fview.sibling();
155  int firstWire = fview.volume()->GetNumber();
156  auto const& wpar = fview.parameters();
157  float wireLength = wpar[1] / dd4hep::cm;
158 
159  edm::LogVerbatim("DTGeometryBuilder") << "(4) detId: " << rawid << " wpar[1]: " << wpar[1] / dd4hep::cm
160  << " firstWire: " << firstWire;
161 
162  int WCounter = 0;
163  while (doWire) {
164  doWire = fview.checkChild();
165  WCounter++;
166  }
167  fview.up();
168 
169  DTTopology topology(firstWire, WCounter, wireLength);
170 
171  DTLayerType layerType;
172 
173  DTLayer* layer = new DTLayer(layId, surf, topology, layerType, sl);
174 
175  sl->add(layer);
176  return layer;
177 }
Log< level::Info, true > LogVerbatim
void up()
set current node to the parent node in the filtered tree
void add(DTLayer *l)
Add layer to the SL which owns it.
Definition: DTSuperLayer.cc:47
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.
const PlacedVolume volume() const
The physical volume of the current node.
RCPPlane plane(const DDFilteredView &, Bounds *bounds) const
bool checkChild()
count the number of children matching selection
const std::vector< double > parameters() const
extract shape parameters
ReferenceCountingPointer< Plane > RCPPlane

◆ buildSuperLayer()

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

Definition at line 112 of file DTGeometryBuilder.cc.

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

114  {
115  MuonGeometryNumbering mdddnum(muonConstants);
116  DTNumberingScheme dtnum(muonConstants);
117  int rawid = dtnum.baseNumberToUnitNumber(mdddnum.geoHistoryToBaseNumber(fview.history()));
118 
119  DTSuperLayerId slId(rawid);
120 
121  auto const& par = fview.parameters();
122 
123  edm::LogVerbatim("DTGeometryBuilder") << "(2) detId: " << rawid << " par[0]: " << par[0] / dd4hep::cm
124  << " par[1]: " << par[1] / dd4hep::cm << " par[2]: " << par[2] / dd4hep::cm;
125 
126  RCPPlane surf(
127  plane(fview, new RectangularPlaneBounds(par[0] / dd4hep::cm, par[1] / dd4hep::cm, par[2] / dd4hep::cm)));
128 
129  DTSuperLayer* slayer = new DTSuperLayer(slId, surf, chamber);
130 
131  chamber->add(slayer);
132 
133  return slayer;
134 }
Log< level::Info, true > LogVerbatim
const ExpandedNodes & history()
The numbering history of the current node.
RCPPlane plane(const DDFilteredView &, Bounds *bounds) const
const std::vector< double > parameters() const
extract shape parameters
ReferenceCountingPointer< Plane > RCPPlane

◆ plane()

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] / dd4hep::cm, tr[1] / dd4hep::cm, tr[2] / dd4hep::cm),
89  Surface::RotationType(rot[0], rot[3], rot[6], rot[1], rot[4], rot[7], rot[2], rot[5], rot[8]),
90  bounds));
91 }
const Double_t * rot() const
The absolute rotation of the current node.
Definition: Plane.h:16
const Double_t * trans() const
The absolute translation of the current node.
ReferenceCountingPointer< Plane > RCPPlane