CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
< Plane
RCPPlane
 

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

Definition at line 58 of file DTGeometryBuilderFromCondDB.h.

Constructor & Destructor Documentation

DTGeometryBuilderFromCondDB::DTGeometryBuilderFromCondDB ( )

Definition at line 35 of file DTGeometryBuilderFromCondDB.cc.

35 {}
DTGeometryBuilderFromCondDB::~DTGeometryBuilderFromCondDB ( )
virtual

Definition at line 38 of file DTGeometryBuilderFromCondDB.cc.

38 {}

Member Function Documentation

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

Definition at line 41 of file DTGeometryBuilderFromCondDB.cc.

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

Referenced by DTGeometryESModule::setupDBGeometry().

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 }
DTChamber * buildChamber(const DetId &id, const RecoIdealGeometry &rig, size_t idt) const
const std::vector< DetId > & detIds() const
DTLayer * buildLayer(DTSuperLayer *sl, const DetId &id, const RecoIdealGeometry &rig, size_t idt) const
std::vector< double >::const_iterator shapeStart(size_t ind) const
tuple cout
Definition: gather_cfg.py:144
DTSuperLayer * buildSuperLayer(DTChamber *chamber, const DetId &id, const RecoIdealGeometry &rig, size_t idt) const
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.

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

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 }
RectangularPlaneBounds * getRecPlaneBounds(const std::vector< double >::const_iterator &shapeStart)
std::vector< double >::const_iterator rotStart(size_t ind) const
ReferenceCountingPointer< Plane > RCPPlane
std::vector< double >::const_iterator tranStart(size_t ind) const
std::vector< double >::const_iterator shapeStart(size_t ind) const
RCPPlane plane(const std::vector< double >::const_iterator tranStart, const std::vector< double >::const_iterator rotStart, Bounds *bounds) const
DTLayer * DTGeometryBuilderFromCondDB::buildLayer ( DTSuperLayer sl,
const DetId id,
const RecoIdealGeometry rig,
size_t  idt 
) const
private

Definition at line 126 of file DTGeometryBuilderFromCondDB.cc.

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

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 }
RectangularPlaneBounds * getRecPlaneBounds(const std::vector< double >::const_iterator &shapeStart)
std::vector< double >::const_iterator rotStart(size_t ind) const
void add(DTLayer *l)
Add layer to the SL which owns it.
Definition: DTSuperLayer.cc:47
assert(be >=bs)
constexpr std::array< uint8_t, layerIndexSize > layer
ReferenceCountingPointer< Plane > RCPPlane
std::vector< double >::const_iterator tranStart(size_t ind) const
std::vector< double >::const_iterator shapeStart(size_t ind) const
constexpr NumType convertMmToCm(NumType millimeters)
Definition: GeantUnits.h:63
RCPPlane plane(const std::vector< double >::const_iterator tranStart, const std::vector< double >::const_iterator rotStart, Bounds *bounds) const
DTSuperLayer * DTGeometryBuilderFromCondDB::buildSuperLayer ( DTChamber chamber,
const DetId id,
const RecoIdealGeometry rig,
size_t  idt 
) const
private

Definition at line 104 of file DTGeometryBuilderFromCondDB.cc.

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

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 }
RectangularPlaneBounds * getRecPlaneBounds(const std::vector< double >::const_iterator &shapeStart)
std::vector< double >::const_iterator rotStart(size_t ind) const
assert(be >=bs)
ReferenceCountingPointer< Plane > RCPPlane
std::vector< double >::const_iterator tranStart(size_t ind) const
std::vector< double >::const_iterator shapeStart(size_t ind) const
void add(DTSuperLayer *sl)
Add SL to the chamber which takes ownership.
Definition: DTChamber.cc:36
RCPPlane plane(const std::vector< double >::const_iterator tranStart, const std::vector< double >::const_iterator rotStart, Bounds *bounds) const
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 }
Definition: Plane.h:16
ReferenceCountingPointer< Plane > RCPPlane