CMS 3D CMS Logo

Public Member Functions | Private Member Functions

TrackerShapeToBounds Class Reference

#include <TrackerShapeToBounds.h>

List of all members.

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

                                                                                                          {
  switch(_shape){
  case ddbox: return buildBox(_par);
    break;
  case ddtrap: return buildTrap(_par);
    break;
  case ddtubs: return buildOpen(_par);
    break;
  case ddpolycone_rrz: return buildOpen(_par);
    break;
  case ddsubtraction: return buildOpen(_par);
    break;
  default:
    std::cout<<"Wrong DDshape to build...."<<_shape<<std::endl; 
    Bounds* bounds = 0;
    return bounds;
  }
}      
Bounds * TrackerShapeToBounds::buildBox ( const std::vector< double > &  paras) const [private]

Definition at line 51 of file TrackerShapeToBounds.cc.

Referenced by buildBounds().

                                                                            {
  int indexX = 0;
  int indexY = 1; 
  int indexZ = 2;
  Bounds* bounds = 0;
  
  if(paras[1]<paras[0]&&paras[0]<paras[2]){
    indexX=0;
    indexY=2;
    indexZ=1;
  }
  
  bounds = new RectangularPlaneBounds(paras[indexX]/cm, // width - shorter side 
                                      paras[indexY]/cm, // length - longer side
                                      paras[indexZ]/cm);// thickness
  return bounds;
} 
Bounds * TrackerShapeToBounds::buildOpen ( const std::vector< double > &  paras) const [private]

Definition at line 114 of file TrackerShapeToBounds.cc.

Referenced by buildBounds().

                                                                             {  
  OpenBounds*  bounds = new OpenBounds();
  return bounds;
} 
Bounds * TrackerShapeToBounds::buildTrap ( const std::vector< double > &  paras) const [private]

Definition at line 69 of file TrackerShapeToBounds.cc.

Referenced by buildBounds().

                                                                             {


  Bounds* bounds = 0;
  /*
    TrapezoidalPlaneBounds (float be, float te, float a, float t)
    constructed from:
    half bottom edge (smaller side width)
    half top edge (larger side width)
    half apothem (distance from top to bottom sides, measured perpendicularly to them)
    half thickness.
    
    if  we have indexX=0, indexY=1 and indeZ=2
    4 = be (ORCA x)
    9 = te (ORCA x)
    0 = a (ORCA y)
    3 = t (ORCA z)

    if  we have indexX=0, indexY=2 and indeZ=1
    4 = be (ORCA x)
    9 = te (ORCA x)
    3 = a (ORCA y)
    0 = t (ORCA z)

    so, so we have the indexes:
    if indexX==0, indexY==1, indexZ==2, then everything is ok and
    the following orcaCorrection-rotation will be a unit-matrix.
  */
  

  if(paras[0]<5){
    bounds = new TrapezoidalPlaneBounds(paras[4]/cm,
                                        paras[9]/cm,
                                        paras[3]/cm,
                                        paras[0]/cm);
  }else if(paras[0]>paras[3]){
    bounds = new TrapezoidalPlaneBounds(paras[4]/cm,
                                        paras[9]/cm,
                                        paras[0]/cm,
                                        paras[3]/cm);
  }  
  return bounds;
}