CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Member Functions
DTGeometryBuilderFromCondDB Class Reference

#include <DTGeometryBuilderFromCondDB.h>

Public Member Functions

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

Private Types

typedef
ReferenceCountingPointer
< BoundPlane
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, const 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 $date : 19/11/2008 19:14:24 CET $

Modification:

Definition at line 36 of file DTGeometryBuilderFromCondDB.h.

Member Typedef Documentation

Definition at line 66 of file DTGeometryBuilderFromCondDB.h.

Constructor & Destructor Documentation

DTGeometryBuilderFromCondDB::DTGeometryBuilderFromCondDB ( )

Definition at line 33 of file DTGeometryBuilderFromCondDB.cc.

33  {
34 }
DTGeometryBuilderFromCondDB::~DTGeometryBuilderFromCondDB ( )
virtual

Definition at line 37 of file DTGeometryBuilderFromCondDB.cc.

37  {
38 }

Member Function Documentation

void DTGeometryBuilderFromCondDB::build ( boost::shared_ptr< DTGeometry theGeometry,
const RecoIdealGeometry rig 
)

Definition at line 42 of file DTGeometryBuilderFromCondDB.cc.

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

Referenced by DTGeometryESModule::geometryCallback_().

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

References RecoIdealGeometry::rotStart(), RecoIdealGeometry::shapeStart(), RecoIdealGeometry::tranStart(), and tablePrinter::width.

83  {
84  DTChamberId detId(id);
85 
86 
87  float width = (*(rig.shapeStart(idt) + 1))/cm; // r-phi dimension - different in different chambers
88  float length = (*(rig.shapeStart(idt) + 2))/cm; // z dimension - constant 125.55 cm
89  float thickness = (*(rig.shapeStart(idt) + 3))/cm; // radial thickness - almost constant about 18 cm
90 
92  // width is along local X
93  // length is along local Y
94  // thickness is long local Z
95  RectangularPlaneBounds bound(width, length, thickness);
96  // std::vector<double> tran(rig.tranStart(idt), rig.tranEnd(idt));
97  // std::vector<double> rot(rig.rotStart(idt), rig.rotEnd(idt));
98  RCPPlane surf(plane(rig.tranStart(idt), rig.rotStart(idt), bound));
99 
100  DTChamber* chamber = new DTChamber(detId, surf);
101 
102  return chamber;
103 }
std::vector< double >::const_iterator rotStart(size_t ind) const
RCPPlane plane(const std::vector< double >::const_iterator tranStart, const std::vector< double >::const_iterator rotStart, const Bounds &bounds) const
std::vector< double >::const_iterator tranStart(size_t ind) const
ReferenceCountingPointer< BoundPlane > RCPPlane
std::vector< double >::const_iterator shapeStart(size_t ind) const
DTLayer * DTGeometryBuilderFromCondDB::buildLayer ( DTSuperLayer sl,
const DetId id,
const RecoIdealGeometry rig,
size_t  idt 
) const
private

Definition at line 130 of file DTGeometryBuilderFromCondDB.cc.

References DTSuperLayer::add(), RecoIdealGeometry::rotStart(), RecoIdealGeometry::shapeStart(), RecoIdealGeometry::tranStart(), and tablePrinter::width.

133  {
134 
135  DTLayerId layId(id);
136 
137  // Layer specific parameter (size)
138  float width = (*(rig.shapeStart(idt) + 1))/cm; // r-phi dimension - changes in different chambers
139  float length = (*(rig.shapeStart(idt) + 2))/cm; // z dimension - constant 126.8 cm
140  float thickness = (*(rig.shapeStart(idt) + 3))/cm; // radial thickness - almost constant about 20 cm
141 
142  // define Bounds
143  RectangularPlaneBounds bound(width, length, thickness);
144 
145  RCPPlane surf(plane(rig.tranStart(idt), rig.rotStart(idt), bound));//tran, rot, bound));
146 
147  // Loop on wires
148  int firstWire=int(*(rig.shapeStart(idt) + 4 ));//par[4]);
149  int WCounter=int(*(rig.shapeStart(idt) + 5 ));//par[5]);
150  double sensibleLenght=(*(rig.shapeStart(idt) + 6 ))/cm;//par[6]/cm;
151  DTTopology topology(firstWire, WCounter, sensibleLenght);
152 
153  DTLayerType layerType;
154 
155  DTLayer* layer = new DTLayer(layId, surf, topology, layerType, sl);
156  // cout << "adding layer " << layer->id() << " to sl "<< sl->id() << endl;
157 
158  sl->add(layer);
159  return layer;
160 }
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:61
RCPPlane plane(const std::vector< double >::const_iterator tranStart, const std::vector< double >::const_iterator rotStart, const Bounds &bounds) const
std::vector< double >::const_iterator tranStart(size_t ind) const
ReferenceCountingPointer< BoundPlane > RCPPlane
std::vector< double >::const_iterator shapeStart(size_t ind) const
DTSuperLayer * DTGeometryBuilderFromCondDB::buildSuperLayer ( DTChamber chamber,
const DetId id,
const RecoIdealGeometry rig,
size_t  idt 
) const
private

Definition at line 106 of file DTGeometryBuilderFromCondDB.cc.

References DTChamber::add(), RecoIdealGeometry::rotStart(), RecoIdealGeometry::shapeStart(), RecoIdealGeometry::tranStart(), and tablePrinter::width.

109  {
110 
111  DTSuperLayerId slId(id);
112 
113  float width = (*(rig.shapeStart(idt) + 1))/cm; // r-phi dimension - different in different chambers
114  float length = (*(rig.shapeStart(idt) + 2))/cm; // z dimension - constant 126.8 cm
115  float thickness = (*(rig.shapeStart(idt) + 3))/cm; // radial thickness - almost constant about 5 cm
116 
117  RectangularPlaneBounds bound(width, length, thickness);
118 
119  // Ok this is the slayer position...
120  RCPPlane surf(plane(rig.tranStart(idt), rig.rotStart(idt), bound));
121 
122  DTSuperLayer* slayer = new DTSuperLayer(slId, surf, chamber);
123 
124  // cout << "adding slayer " << slayer->id() << " to chamber "<< chamber->id() << endl;
125  chamber->add(slayer);
126  return slayer;
127 }
std::vector< double >::const_iterator rotStart(size_t ind) const
RCPPlane plane(const std::vector< double >::const_iterator tranStart, const std::vector< double >::const_iterator rotStart, const Bounds &bounds) const
std::vector< double >::const_iterator tranStart(size_t ind) const
ReferenceCountingPointer< BoundPlane > RCPPlane
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:43
DTGeometryBuilderFromCondDB::RCPPlane DTGeometryBuilderFromCondDB::plane ( const std::vector< double >::const_iterator  tranStart,
const std::vector< double >::const_iterator  rotStart,
const Bounds bounds 
) const
private

Definition at line 163 of file DTGeometryBuilderFromCondDB.cc.

165  {
166  // extract the position
167  const Surface::PositionType posResult(*(tranStart), *(tranStart+1), *(tranStart+2));
168  // now the rotation
169  Surface::RotationType rotResult( *(rotStart+0), *(rotStart+1), *(rotStart+2),
170  *(rotStart+3), *(rotStart+4), *(rotStart+5),
171  *(rotStart+6), *(rotStart+7), *(rotStart+8) );
172 
173  return RCPPlane( new BoundPlane( posResult, rotResult, bounds));
174 }
ReferenceCountingPointer< BoundPlane > RCPPlane