CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions
DTGeometryBuilderFromCondDB Class Reference

#include <DTGeometryBuilderFromCondDB.h>

Public Member Functions

void build (const std::shared_ptr< DTGeometry > &theGeometry, const RecoIdealGeometry &rig)
 
 DTGeometryBuilderFromCondDB ()
 
virtual ~DTGeometryBuilderFromCondDB ()
 

Private Types

typedef ReferenceCountingPointer< PlaneRCPPlane
 

Private Member Functions

DTChamberbuildChamber (const DetId &id, const RecoIdealGeometry &rig, size_t idt) const
 
DTLayerbuildLayer (DTSuperLayer *sl, const DetId &id, const RecoIdealGeometry &rig, size_t idt) const
 
DTSuperLayerbuildSuperLayer (DTChamber *chamber, const DetId &id, const RecoIdealGeometry &rig, size_t idt) const
 
RCPPlane plane (const std::vector< double >::const_iterator tranStart, const std::vector< double >::const_iterator rotStart, Bounds *bounds) const
 

Detailed Description

Description:

detailed description

Author
: Stefano Lacaprara - INFN LNL stefa.nosp@m.no.l.nosp@m.acapr.nosp@m.ara@.nosp@m.pd.in.nosp@m.fn.i.nosp@m.t

Modification:

Definition at line 40 of file DTGeometryBuilderFromCondDB.h.

Member Typedef Documentation

◆ RCPPlane

Definition at line 58 of file DTGeometryBuilderFromCondDB.h.

Constructor & Destructor Documentation

◆ DTGeometryBuilderFromCondDB()

DTGeometryBuilderFromCondDB::DTGeometryBuilderFromCondDB ( )

Definition at line 35 of file DTGeometryBuilderFromCondDB.cc.

35 {}

◆ ~DTGeometryBuilderFromCondDB()

DTGeometryBuilderFromCondDB::~DTGeometryBuilderFromCondDB ( )
virtual

Definition at line 38 of file DTGeometryBuilderFromCondDB.cc.

38 {}

Member Function Documentation

◆ build()

void DTGeometryBuilderFromCondDB::build ( const std::shared_ptr< DTGeometry > &  theGeometry,
const RecoIdealGeometry rig 
)

Definition at line 41 of file DTGeometryBuilderFromCondDB.cc.

41  {
42  // cout << "DTGeometryBuilderFromCondDB " << endl;
43  const std::vector<DetId>& detids(rig.detIds());
44  // cout << "size " << detids.size() << endl;
45 
46  size_t idt = 0;
47  DTChamber* chamber(nullptr);
48  DTSuperLayer* sl(nullptr);
49  while (idt < detids.size()) {
50  //copy(par.begin(), par.end(), ostream_iterator<double>(std::cout," "));
51  if (int(*(rig.shapeStart(idt))) == 0) { // a Chamber
52  // add the provious chamber which by now has been updated with SL and
53  // layers
54  if (chamber)
55  theGeometry->add(chamber);
56  // go for the actual one
57  DTChamberId chid(detids[idt]);
58  //cout << "CH: " << chid << endl;
59  chamber = buildChamber(chid, rig, idt);
60  } else if (int(*(rig.shapeStart(idt))) == 1) { // a SL
61  DTSuperLayerId slid(detids[idt]);
62  //cout << " SL: " << slid << endl;
63  sl = buildSuperLayer(chamber, slid, rig, idt);
64  theGeometry->add(sl);
65  } else if (int(*(rig.shapeStart(idt))) == 2) { // a Layer
66  DTLayerId lid(detids[idt]);
67  //cout << " LAY: " << lid << endl;
68  DTLayer* lay = buildLayer(sl, lid, rig, idt);
69  theGeometry->add(lay);
70  } else {
71  cout << "What is this?" << endl;
72  }
73  ++idt;
74  }
75  if (chamber)
76  theGeometry->add(chamber); // add the last chamber
77 }

References relativeConstraints::chamber, gather_cfg::cout, RecoIdealGeometry::detIds(), and RecoIdealGeometry::shapeStart().

Referenced by DTGeometryESModule::setupDBGeometry().

◆ buildChamber()

DTChamber * DTGeometryBuilderFromCondDB::buildChamber ( const DetId id,
const RecoIdealGeometry rig,
size_t  idt 
) const
private

SL the definition of length, width, thickness depends on the local reference frame of the Det

Definition at line 87 of file DTGeometryBuilderFromCondDB.cc.

87  {
88  DTChamberId detId(id);
89 
91  // width is along local X
92  // length is along local Y
93  // length z dimension - constant 125.55 cm
94  // thickness is along local Z
95  // radial thickness - almost constant about 18 cm
96  RCPPlane surf(
98 
99  DTChamber* chamber = new DTChamber(detId, surf);
100 
101  return chamber;
102 }

References relativeConstraints::chamber, dtGeometryBuilder::getRecPlaneBounds(), RecoIdealGeometry::rotStart(), RecoIdealGeometry::shapeStart(), and RecoIdealGeometry::tranStart().

◆ buildLayer()

DTLayer * DTGeometryBuilderFromCondDB::buildLayer ( DTSuperLayer sl,
const DetId id,
const RecoIdealGeometry rig,
size_t  idt 
) const
private

Definition at line 126 of file DTGeometryBuilderFromCondDB.cc.

129  {
130  DTLayerId layId(id);
131 
132  // Layer specific parameter (size)
133  // r-phi dimension - different in different chambers
134  // z dimension - constant 126.8 cm
135  // radial thickness - almost constant about 20 cm
136 
137  auto shapeStartPtr = rig.shapeStart(idt);
138  RCPPlane surf(
139  plane(rig.tranStart(idt), rig.rotStart(idt), dtGeometryBuilder::getRecPlaneBounds((shapeStartPtr + 1))));
140 
141  // Loop on wires
142  int firstWire = static_cast<int>(*(shapeStartPtr + 4)); //par[4]);
143  int WCounter = static_cast<int>(*(shapeStartPtr + 5)); //par[5]);
144  double sensibleLength = convertMmToCm(*(shapeStartPtr + 6)); //par[6] in cm;
145  DTTopology topology(firstWire, WCounter, sensibleLength);
146 
147  DTLayerType layerType;
148 
149  DTLayer* layer = new DTLayer(layId, surf, topology, layerType, sl);
150  // cout << "adding layer " << layer->id() << " to sl "<< sl->id() << endl;
151 
152  assert(sl);
153  sl->add(layer);
154  return layer;
155 }

References DTSuperLayer::add(), cms::cuda::assert(), geant_units::operators::convertMmToCm(), dtGeometryBuilder::getRecPlaneBounds(), phase1PixelTopology::layer, RecoIdealGeometry::rotStart(), RecoIdealGeometry::shapeStart(), and RecoIdealGeometry::tranStart().

◆ buildSuperLayer()

DTSuperLayer * DTGeometryBuilderFromCondDB::buildSuperLayer ( DTChamber chamber,
const DetId id,
const RecoIdealGeometry rig,
size_t  idt 
) const
private

Definition at line 104 of file DTGeometryBuilderFromCondDB.cc.

107  {
108  DTSuperLayerId slId(id);
109 
110  // r-phi dimension - different in different chambers
111  // z dimension - constant 126.8 cm
112  // radial thickness - almost constant about 5 cm
113 
114  // Ok this is the slayer position...
115  RCPPlane surf(
116  plane(rig.tranStart(idt), rig.rotStart(idt), dtGeometryBuilder::getRecPlaneBounds(++rig.shapeStart(idt))));
117 
118  DTSuperLayer* slayer = new DTSuperLayer(slId, surf, chamber);
119 
120  // cout << "adding slayer " << slayer->id() << " to chamber "<< chamber->id() << endl;
121  assert(chamber);
122  chamber->add(slayer);
123  return slayer;
124 }

References cms::cuda::assert(), relativeConstraints::chamber, dtGeometryBuilder::getRecPlaneBounds(), RecoIdealGeometry::rotStart(), RecoIdealGeometry::shapeStart(), and RecoIdealGeometry::tranStart().

◆ plane()

DTGeometryBuilderFromCondDB::RCPPlane DTGeometryBuilderFromCondDB::plane ( const std::vector< double >::const_iterator  tranStart,
const std::vector< double >::const_iterator  rotStart,
Bounds bounds 
) const
private

Definition at line 157 of file DTGeometryBuilderFromCondDB.cc.

159  {
160  // extract the position
161  const Surface::PositionType posResult(*(tranStart), *(tranStart + 1), *(tranStart + 2));
162  // now the rotation
163  Surface::RotationType rotResult(*(rotStart + 0),
164  *(rotStart + 1),
165  *(rotStart + 2),
166  *(rotStart + 3),
167  *(rotStart + 4),
168  *(rotStart + 5),
169  *(rotStart + 6),
170  *(rotStart + 7),
171  *(rotStart + 8));
172 
173  return RCPPlane(new Plane(posResult, rotResult, bounds));
174 }
TkRotation< float >
DTSuperLayerId
Definition: DTSuperLayerId.h:12
DTGeometryBuilderFromCondDB::buildSuperLayer
DTSuperLayer * buildSuperLayer(DTChamber *chamber, const DetId &id, const RecoIdealGeometry &rig, size_t idt) const
Definition: DTGeometryBuilderFromCondDB.cc:104
DTGeometryBuilderFromCondDB::buildChamber
DTChamber * buildChamber(const DetId &id, const RecoIdealGeometry &rig, size_t idt) const
Definition: DTGeometryBuilderFromCondDB.cc:87
dtGeometryBuilder::getRecPlaneBounds
RectangularPlaneBounds * getRecPlaneBounds(const std::vector< double >::const_iterator &shapeStart)
Definition: DTGeometryBuilderFromCondDB.cc:80
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DTChamber
Definition: DTChamber.h:24
cms::cuda::assert
assert(be >=bs)
DTSuperLayer
Definition: DTSuperLayer.h:24
DTTopology
Definition: DTTopology.h:28
RecoIdealGeometry::rotStart
std::vector< double >::const_iterator rotStart(size_t ind) const
Definition: RecoIdealGeometry.h:91
DTGeometryBuilderFromCondDB::plane
RCPPlane plane(const std::vector< double >::const_iterator tranStart, const std::vector< double >::const_iterator rotStart, Bounds *bounds) const
Definition: DTGeometryBuilderFromCondDB.cc:157
DTGeometryBuilderFromCondDB::RCPPlane
ReferenceCountingPointer< Plane > RCPPlane
Definition: DTGeometryBuilderFromCondDB.h:58
Point3DBase< float, GlobalTag >
DTLayerId
Definition: DTLayerId.h:12
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
DTSuperLayer::add
void add(DTLayer *l)
Add layer to the SL which owns it.
Definition: DTSuperLayer.cc:47
DTGeometryBuilderFromCondDB::buildLayer
DTLayer * buildLayer(DTSuperLayer *sl, const DetId &id, const RecoIdealGeometry &rig, size_t idt) const
Definition: DTGeometryBuilderFromCondDB.cc:126
RecoIdealGeometry::detIds
const std::vector< DetId > & detIds() const
Definition: RecoIdealGeometry.h:85
RecoIdealGeometry::tranStart
std::vector< double >::const_iterator tranStart(size_t ind) const
Definition: RecoIdealGeometry.h:87
DTLayer
Definition: DTLayer.h:25
DTLayerType
Definition: DTLayerType.h:15
RecoIdealGeometry::shapeStart
std::vector< double >::const_iterator shapeStart(size_t ind) const
Definition: RecoIdealGeometry.h:95
Plane
Definition: Plane.h:16
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
geant_units::operators::convertMmToCm
constexpr NumType convertMmToCm(NumType millimeters)
Definition: GeantUnits.h:62
DTChamberId
Definition: DTChamberId.h:14