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 32 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().

32  {
33  switch (shape) {
35  return buildBox(par);
36  break;
38  return buildTrap(par);
39  break;
43  return buildOpen();
44  break;
45  default:
46  std::cout << "Wrong DDshape to build...." << cms::dd::name(cms::DDSolidShapeMap, shape) << std::endl;
47  Bounds* bounds = nullptr;
48  return bounds;
49  }
50 }
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 52 of file TrackerShapeToBounds.cc.

Referenced by buildBounds().

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

◆ buildOpen()

Bounds * TrackerShapeToBounds::buildOpen ( ) const
private

Definition at line 105 of file TrackerShapeToBounds.cc.

Referenced by buildBounds().

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

◆ buildTrap()

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

Definition at line 70 of file TrackerShapeToBounds.cc.

Referenced by buildBounds().

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