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, and ddtubs.

Referenced by GeometricDet::bounds().

32  {
33  switch(_shape){
34  case ddbox: return buildBox(_par);
35  break;
36  case ddtrap: return buildTrap(_par);
37  break;
38  case ddtubs: return buildOpen(_par);
39  break;
40  case ddpolycone_rrz: return buildOpen(_par);
41  break;
42  case ddsubtraction: return buildOpen(_par);
43  break;
44  default:
45  std::cout<<"Wrong DDshape to build...."<<_shape<<std::endl;
46  Bounds* bounds = nullptr;
47  return bounds;
48  }
49 }
Bounds * buildTrap(const std::vector< double > &) const
Bounds * buildOpen(const std::vector< double > &) const
Bounds * buildBox(const std::vector< double > &) const
Definition: Bounds.h:22
Bounds * TrackerShapeToBounds::buildBox ( const std::vector< double > &  paras) const
private

Definition at line 51 of file TrackerShapeToBounds.cc.

Referenced by buildBounds().

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

Definition at line 114 of file TrackerShapeToBounds.cc.

Referenced by buildBounds().

114  {
115  OpenBounds* bounds = new OpenBounds();
116  return bounds;
117 }
Unlimited (trivial) bounds.
Definition: OpenBounds.h:10
Bounds * TrackerShapeToBounds::buildTrap ( const std::vector< double > &  paras) const
private

Definition at line 69 of file TrackerShapeToBounds.cc.

Referenced by buildBounds().

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