CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
TrackerShapeToBounds Class Reference

#include <TrackerShapeToBounds.h>

Public Member Functions

BoundsbuildBounds (const DDSolidShape &, const std::vector< double > &) const
 

Private Member Functions

BoundsbuildBox (const std::vector< double > &) const
 
BoundsbuildOpen (const std::vector< double > &) const
 
BoundsbuildTrap (const std::vector< double > &) const
 

Detailed Description

Converts DDSolid volumes to Bounds

Definition at line 11 of file TrackerShapeToBounds.h.

Member Function Documentation

Bounds * TrackerShapeToBounds::buildBounds ( const DDSolidShape _shape,
const std::vector< double > &  _par 
) const

buildBounds() return the Bounds.

Definition at line 32 of file TrackerShapeToBounds.cc.

References buildBox(), buildOpen(), buildTrap(), gather_cfg::cout, ddbox, ddpolycone_rrz, ddsubtraction, ddtrap, ddtubs, and DDSolidShapesName::name().

Referenced by GeometricTimingDet::bounds(), and GeometricDet::bounds().

32  {
33  switch (_shape) {
35  return buildBox(_par);
36  break;
38  return buildTrap(_par);
39  break;
41  return buildOpen(_par);
42  break;
44  return buildOpen(_par);
45  break;
47  return buildOpen(_par);
48  break;
49  default:
50  std::cout << "Wrong DDshape to build...." << DDSolidShapesName::name(_shape) << std::endl;
51  Bounds* bounds = nullptr;
52  return bounds;
53  }
54 }
Bounds * buildTrap(const std::vector< double > &) const
static const char *const name(DDSolidShape s)
Definition: DDSolidShapes.h:32
Bounds * buildOpen(const std::vector< double > &) const
Bounds * buildBox(const std::vector< double > &) const
Definition: Bounds.h:20
Bounds * TrackerShapeToBounds::buildBox ( const std::vector< double > &  paras) const
private

Definition at line 56 of file TrackerShapeToBounds.cc.

Referenced by buildBounds().

56  {
57  int indexX = 0;
58  int indexY = 1;
59  int indexZ = 2;
60  Bounds* bounds = nullptr;
61 
62  if (paras[1] < paras[0] && paras[0] < paras[2]) {
63  indexX = 0;
64  indexY = 2;
65  indexZ = 1;
66  }
67 
68  bounds = new RectangularPlaneBounds(paras[indexX] / cm, // width - shorter side
69  paras[indexY] / cm, // length - longer side
70  paras[indexZ] / cm); // thickness
71  return bounds;
72 }
Definition: Bounds.h:20
Bounds * TrackerShapeToBounds::buildOpen ( const std::vector< double > &  paras) const
private

Definition at line 109 of file TrackerShapeToBounds.cc.

Referenced by buildBounds().

109  {
110  OpenBounds* bounds = new OpenBounds();
111  return bounds;
112 }
Unlimited (trivial) bounds.
Definition: OpenBounds.h:9
Bounds * TrackerShapeToBounds::buildTrap ( const std::vector< double > &  paras) const
private

Definition at line 74 of file TrackerShapeToBounds.cc.

Referenced by buildBounds().

74  {
75  Bounds* bounds = nullptr;
76  /*
77  TrapezoidalPlaneBounds (float be, float te, float a, float t)
78  constructed from:
79  half bottom edge (smaller side width)
80  half top edge (larger side width)
81  half apothem (distance from top to bottom sides, measured perpendicularly to them)
82  half thickness.
83 
84  if we have indexX=0, indexY=1 and indeZ=2
85  4 = be (ORCA x)
86  9 = te (ORCA x)
87  0 = a (ORCA y)
88  3 = t (ORCA z)
89 
90  if we have indexX=0, indexY=2 and indeZ=1
91  4 = be (ORCA x)
92  9 = te (ORCA x)
93  3 = a (ORCA y)
94  0 = t (ORCA z)
95 
96  so, so we have the indexes:
97  if indexX==0, indexY==1, indexZ==2, then everything is ok and
98  the following orcaCorrection-rotation will be a unit-matrix.
99  */
100 
101  if (paras[0] < 5) {
102  bounds = new TrapezoidalPlaneBounds(paras[4] / cm, paras[9] / cm, paras[3] / cm, paras[0] / cm);
103  } else if (paras[0] > paras[3]) {
104  bounds = new TrapezoidalPlaneBounds(paras[4] / cm, paras[9] / cm, paras[0] / cm, paras[3] / cm);
105  }
106  return bounds;
107 }
Definition: Bounds.h:20