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 cms::DDSolidShape &, const std::vector< double > &) const
 

Private Member Functions

BoundsbuildBox (const std::vector< double > &) const
 
BoundsbuildOpen () 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

◆ buildBounds()

Bounds * TrackerShapeToBounds::buildBounds ( const cms::DDSolidShape shape,
const std::vector< double > &  par 
) const

buildBounds() return the Bounds.

Definition at line 34 of file TrackerShapeToBounds.cc.

References buildBox(), buildOpen(), buildTrap(), gather_cfg::cout, cms::ddbox, cms::ddpolycone, cms::DDSolidShapeMap, cms::ddsubtraction, cms::ddtrap, cms::ddtubs, cms::dd::name(), and l1trig_cff::shape.

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

34  {
35  switch (shape) {
37  return buildBox(par);
38  break;
40  return buildTrap(par);
41  break;
45  return buildOpen();
46  break;
47  default:
48  std::cout << "Wrong DDshape to build...." << cms::dd::name(cms::DDSolidShapeMap, shape) << std::endl;
49  Bounds* bounds = nullptr;
50  return bounds;
51  }
52 }
std::string name(Mapping a, V value)
Definition: DDSolidShapes.h:31
const std::array< const cms::dd::NameValuePair< DDSolidShape >, 21 > DDSolidShapeMap
Definition: DDSolidShapes.h:99
Bounds * buildTrap(const std::vector< double > &) const
Definition: Bounds.h:18
Bounds * buildBox(const std::vector< double > &) const

◆ buildBox()

Bounds * TrackerShapeToBounds::buildBox ( const std::vector< double > &  paras) const
private

Definition at line 54 of file TrackerShapeToBounds.cc.

Referenced by buildBounds().

54  {
55  int indexX = 0;
56  int indexY = 1;
57  int indexZ = 2;
58  Bounds* bounds = nullptr;
59 
60  if (paras[1] < paras[0] && paras[0] < paras[2]) {
61  indexX = 0;
62  indexY = 2;
63  indexZ = 1;
64  }
65 
66  bounds = new RectangularPlaneBounds(paras[indexX] / cm, // width - shorter side
67  paras[indexY] / cm, // length - longer side
68  paras[indexZ] / cm); // thickness
69  return bounds;
70 }
Definition: Bounds.h:18

◆ buildOpen()

Bounds * TrackerShapeToBounds::buildOpen ( ) const
private

Definition at line 107 of file TrackerShapeToBounds.cc.

Referenced by buildBounds().

107  {
108  OpenBounds* bounds = new OpenBounds();
109  return bounds;
110 }
Unlimited (trivial) bounds.
Definition: OpenBounds.h:9

◆ buildTrap()

Bounds * TrackerShapeToBounds::buildTrap ( const std::vector< double > &  paras) const
private

Definition at line 72 of file TrackerShapeToBounds.cc.

Referenced by buildBounds().

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