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 42 of file DTGeometryBuilderFromCondDB.h.

Member Typedef Documentation

Definition at line 73 of file DTGeometryBuilderFromCondDB.h.

Constructor & Destructor Documentation

DTGeometryBuilderFromCondDB::DTGeometryBuilderFromCondDB ( )

Definition at line 35 of file DTGeometryBuilderFromCondDB.cc.

35  {
36 }
DTGeometryBuilderFromCondDB::~DTGeometryBuilderFromCondDB ( )
virtual

Definition at line 39 of file DTGeometryBuilderFromCondDB.cc.

39  {
40 }

Member Function Documentation

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

Definition at line 44 of file DTGeometryBuilderFromCondDB.cc.

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

Referenced by DTGeometryESModule::setupDBGeometry().

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

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

94  {
95  DTChamberId detId(id);
96 
98  // width is along local X
99  // length is along local Y
100  // length z dimension - constant 125.55 cm
101  // thickness is along local Z
102  // radial thickness - almost constant about 18 cm
103  RCPPlane surf(plane(rig.tranStart(idt), rig.rotStart(idt), dtGeometryBuilder::getRecPlaneBounds(++rig.shapeStart(idt))));
104 
105  DTChamber* chamber = new DTChamber(detId, surf);
106 
107  return chamber;
108 }
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 134 of file DTGeometryBuilderFromCondDB.cc.

References DTSuperLayer::add(), geant_units::operators::convertMmToCm(), dtGeometryBuilder::getRecPlaneBounds(), RecoIdealGeometry::rotStart(), RecoIdealGeometry::shapeStart(), ecaldqm::topology(), and RecoIdealGeometry::tranStart().

137  {
138 
139  DTLayerId layId(id);
140 
141  // Layer specific parameter (size)
142  // r-phi dimension - different in different chambers
143  // z dimension - constant 126.8 cm
144  // radial thickness - almost constant about 20 cm
145 
146 
147  auto shapeStartPtr = rig.shapeStart(idt);
148  RCPPlane surf(plane(rig.tranStart(idt), rig.rotStart(idt), dtGeometryBuilder::getRecPlaneBounds((shapeStartPtr + 1))));
149 
150  // Loop on wires
151  int firstWire = static_cast<int>(*(shapeStartPtr + 4 )); //par[4]);
152  int WCounter = static_cast<int>(*(shapeStartPtr + 5 )); //par[5]);
153  double sensibleLength = convertMmToCm( *(shapeStartPtr + 6 ) ); //par[6] in cm;
154  DTTopology topology(firstWire, WCounter, sensibleLength);
155 
156  DTLayerType layerType;
157 
158  DTLayer* layer = new DTLayer(layId, surf, topology, layerType, sl);
159  // cout << "adding layer " << layer->id() << " to sl "<< sl->id() << endl;
160 
161  assert(sl);
162  sl->add(layer);
163  return layer;
164 }
RectangularPlaneBounds * getRecPlaneBounds(const std::vector< double >::const_iterator &shapeStart)
CaloTopology const * topology(0)
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:59
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:110
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 111 of file DTGeometryBuilderFromCondDB.cc.

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

114  {
115 
116  DTSuperLayerId slId(id);
117 
118  // r-phi dimension - different in different chambers
119  // z dimension - constant 126.8 cm
120  // radial thickness - almost constant about 5 cm
121 
122  // Ok this is the slayer position...
123  RCPPlane surf(plane(rig.tranStart(idt), rig.rotStart(idt), dtGeometryBuilder::getRecPlaneBounds(++rig.shapeStart(idt))));
124 
125  DTSuperLayer* slayer = new DTSuperLayer(slId, surf, chamber);
126 
127  // cout << "adding slayer " << slayer->id() << " to chamber "<< chamber->id() << endl;
128  assert(chamber);
129  chamber->add(slayer);
130  return slayer;
131 }
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
void add(DTSuperLayer *sl)
Add SL to the chamber which takes ownership.
Definition: DTChamber.cc:41
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 167 of file DTGeometryBuilderFromCondDB.cc.

169  {
170  // extract the position
171  const Surface::PositionType posResult(*(tranStart), *(tranStart+1), *(tranStart+2));
172  // now the rotation
173  Surface::RotationType rotResult( *(rotStart+0), *(rotStart+1), *(rotStart+2),
174  *(rotStart+3), *(rotStart+4), *(rotStart+5),
175  *(rotStart+6), *(rotStart+7), *(rotStart+8) );
176 
177  return RCPPlane( new Plane( posResult, rotResult, bounds));
178 }
Definition: Plane.h:17
ReferenceCountingPointer< Plane > RCPPlane