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

Member Typedef Documentation

Definition at line 65 of file DTGeometryBuilderFromCondDB.h.

Constructor & Destructor Documentation

DTGeometryBuilderFromCondDB::DTGeometryBuilderFromCondDB ( )

Definition at line 32 of file DTGeometryBuilderFromCondDB.cc.

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

Definition at line 36 of file DTGeometryBuilderFromCondDB.cc.

36  {
37 }

Member Function Documentation

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

Definition at line 41 of file DTGeometryBuilderFromCondDB.cc.

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

Referenced by DTGeometryESModule::dbGeometryCallback_().

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

References relativeConstraints::chamber, RecoIdealGeometry::rotStart(), RecoIdealGeometry::shapeStart(), RecoIdealGeometry::tranStart(), and ApeEstimator_cff::width.

82  {
83  DTChamberId detId(id);
84 
85 
86  float width = (*(rig.shapeStart(idt) + 1))/cm; // r-phi dimension - different in different chambers
87  float length = (*(rig.shapeStart(idt) + 2))/cm; // z dimension - constant 125.55 cm
88  float thickness = (*(rig.shapeStart(idt) + 3))/cm; // radial thickness - almost constant about 18 cm
89 
91  // width is along local X
92  // length is along local Y
93  // thickness is long local Z
94  RCPPlane surf(plane(rig.tranStart(idt), rig.rotStart(idt), new RectangularPlaneBounds(width, length, thickness) ));
95 
96  DTChamber* chamber = new DTChamber(detId, surf);
97 
98  return chamber;
99 }
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 125 of file DTGeometryBuilderFromCondDB.cc.

References DTSuperLayer::add(), createfilelist::int, RecoIdealGeometry::rotStart(), RecoIdealGeometry::shapeStart(), ecaldqm::topology(), RecoIdealGeometry::tranStart(), and ApeEstimator_cff::width.

128  {
129 
130  DTLayerId layId(id);
131 
132  // Layer specific parameter (size)
133  float width = (*(rig.shapeStart(idt) + 1))/cm; // r-phi dimension - changes in different chambers
134  float length = (*(rig.shapeStart(idt) + 2))/cm; // z dimension - constant 126.8 cm
135  float thickness = (*(rig.shapeStart(idt) + 3))/cm; // radial thickness - almost constant about 20 cm
136 
137 
138  RCPPlane surf(plane(rig.tranStart(idt), rig.rotStart(idt), new RectangularPlaneBounds(width, length, thickness) ));
139 
140  // Loop on wires
141  int firstWire=int(*(rig.shapeStart(idt) + 4 ));//par[4]);
142  int WCounter=int(*(rig.shapeStart(idt) + 5 ));//par[5]);
143  double sensibleLenght=(*(rig.shapeStart(idt) + 6 ))/cm;//par[6]/cm;
144  DTTopology topology(firstWire, WCounter, sensibleLenght);
145 
146  DTLayerType layerType;
147 
148  DTLayer* layer = new DTLayer(layId, surf, topology, layerType, sl);
149  // cout << "adding layer " << layer->id() << " to sl "<< sl->id() << endl;
150 
151  assert(sl);
152  sl->add(layer);
153  return layer;
154 }
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
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 102 of file DTGeometryBuilderFromCondDB.cc.

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

105  {
106 
107  DTSuperLayerId slId(id);
108 
109  float width = (*(rig.shapeStart(idt) + 1))/cm; // r-phi dimension - different in different chambers
110  float length = (*(rig.shapeStart(idt) + 2))/cm; // z dimension - constant 126.8 cm
111  float thickness = (*(rig.shapeStart(idt) + 3))/cm; // radial thickness - almost constant about 5 cm
112 
113  // Ok this is the slayer position...
114  RCPPlane surf(plane(rig.tranStart(idt), rig.rotStart(idt), new RectangularPlaneBounds(width, length, thickness) ));
115 
116  DTSuperLayer* slayer = new DTSuperLayer(slId, surf, chamber);
117 
118  // cout << "adding slayer " << slayer->id() << " to chamber "<< chamber->id() << endl;
119  assert(chamber);
120  chamber->add(slayer);
121  return slayer;
122 }
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 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), *(rotStart+1), *(rotStart+2),
164  *(rotStart+3), *(rotStart+4), *(rotStart+5),
165  *(rotStart+6), *(rotStart+7), *(rotStart+8) );
166 
167  return RCPPlane( new Plane( posResult, rotResult, bounds));
168 }
Definition: Plane.h:17
ReferenceCountingPointer< Plane > RCPPlane