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 36 of file DTGeometryBuilderFromCondDB.cc.

36 {}

◆ ~DTGeometryBuilderFromCondDB()

DTGeometryBuilderFromCondDB::~DTGeometryBuilderFromCondDB ( )
virtual

Definition at line 39 of file DTGeometryBuilderFromCondDB.cc.

39 {}

Member Function Documentation

◆ build()

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

Definition at line 42 of file DTGeometryBuilderFromCondDB.cc.

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

Referenced by DTGeometryESModule::setupDBGeometry().

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

◆ 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 98 of file DTGeometryBuilderFromCondDB.cc.

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

98  {
99  DTChamberId detId(id);
100 
102  // width is along local X
103  // length is along local Y
104  // length z dimension - constant 125.55 cm
105  // thickness is along local Z
106  // radial thickness - almost constant about 18 cm
107  RCPPlane surf(
108  plane(rig.tranStart(idt), rig.rotStart(idt), dtGeometryBuilder::getRecPlaneBounds(++rig.shapeStart(idt))));
109 
110  DTChamber* chamber = new DTChamber(detId, surf);
111 
112  return chamber;
113 }
RCPPlane plane(const std::vector< double >::const_iterator tranStart, const std::vector< double >::const_iterator rotStart, Bounds *bounds) const
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 shapeStart(size_t ind) const
std::vector< double >::const_iterator tranStart(size_t ind) const

◆ buildLayer()

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

Definition at line 139 of file DTGeometryBuilderFromCondDB.cc.

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

142  {
143  DTLayerId layId(id);
144 
145  // Layer specific parameter (size)
146  // r-phi dimension - different in different chambers
147  // z dimension - constant 126.8 cm
148  // radial thickness - almost constant about 20 cm
149 
150  auto shapeStartPtr = rig.shapeStart(idt);
151  RCPPlane surf(
152  plane(rig.tranStart(idt), rig.rotStart(idt), dtGeometryBuilder::getRecPlaneBounds((shapeStartPtr + 1))));
153 
154  // Loop on wires
155  int firstWire = static_cast<int>(*(shapeStartPtr + 4)); //par[4]);
156  int WCounter = static_cast<int>(*(shapeStartPtr + 5)); //par[5]);
157  double sensibleLength = convertMmToCm(*(shapeStartPtr + 6)); //par[6] in cm;
158  DTTopology topology(firstWire, WCounter, sensibleLength);
159 
160  DTLayerType layerType;
161 
162  DTLayer* layer = new DTLayer(layId, surf, topology, layerType, sl);
163 #ifdef EDM_ML_DEBUG
164  edm::LogVerbatim("DTGeometry") << "adding layer " << layer->id() << " to sl " << sl->id();
165 #endif
166  assert(sl);
167  sl->add(layer);
168  return layer;
169 }
Log< level::Info, true > LogVerbatim
RCPPlane plane(const std::vector< double >::const_iterator tranStart, const std::vector< double >::const_iterator rotStart, Bounds *bounds) const
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)
ReferenceCountingPointer< Plane > RCPPlane
std::vector< double >::const_iterator shapeStart(size_t ind) const
constexpr NumType convertMmToCm(NumType millimeters)
Definition: angle_units.h:44
std::vector< double >::const_iterator tranStart(size_t ind) const
DTSuperLayerId id() const
Return the DetId of this SL.
Definition: DTSuperLayer.cc:34

◆ buildSuperLayer()

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

Definition at line 115 of file DTGeometryBuilderFromCondDB.cc.

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

118  {
119  DTSuperLayerId slId(id);
120 
121  // r-phi dimension - different in different chambers
122  // z dimension - constant 126.8 cm
123  // radial thickness - almost constant about 5 cm
124 
125  // Ok this is the slayer position...
126  RCPPlane surf(
127  plane(rig.tranStart(idt), rig.rotStart(idt), dtGeometryBuilder::getRecPlaneBounds(++rig.shapeStart(idt))));
128 
129  DTSuperLayer* slayer = new DTSuperLayer(slId, surf, chamber);
130 
131 #ifdef EDM_ML_DEBUG
132  edm::LogVerbatim("DTGeometry") << "adding slayer " << slayer->id() << " to chamber " << chamber->id();
133 #endif
134  assert(chamber);
135  chamber->add(slayer);
136  return slayer;
137 }
Log< level::Info, true > LogVerbatim
RCPPlane plane(const std::vector< double >::const_iterator tranStart, const std::vector< double >::const_iterator rotStart, Bounds *bounds) const
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 shapeStart(size_t ind) const
std::vector< double >::const_iterator tranStart(size_t ind) const

◆ 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 171 of file DTGeometryBuilderFromCondDB.cc.

173  {
174  // extract the position
175  const Surface::PositionType posResult(*(tranStart), *(tranStart + 1), *(tranStart + 2));
176  // now the rotation
177  Surface::RotationType rotResult(*(rotStart + 0),
178  *(rotStart + 1),
179  *(rotStart + 2),
180  *(rotStart + 3),
181  *(rotStart + 4),
182  *(rotStart + 5),
183  *(rotStart + 6),
184  *(rotStart + 7),
185  *(rotStart + 8));
186 
187  return RCPPlane(new Plane(posResult, rotResult, bounds));
188 }
Definition: Plane.h:16
ReferenceCountingPointer< Plane > RCPPlane