Go to the documentation of this file.00001 #include "Geometry/TrackerNumberingBuilder/interface/TrackerShapeToBounds.h"
00002 #include "DataFormats/GeometrySurface/interface/OpenBounds.h"
00003 #include "DataFormats/GeometrySurface/interface/RectangularPlaneBounds.h"
00004 #include "DataFormats/GeometrySurface/interface/TrapezoidalPlaneBounds.h"
00005 #include "CLHEP/Units/GlobalSystemOfUnits.h"
00006 #include <algorithm>
00007 #include <iostream>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 Bounds * TrackerShapeToBounds::buildBounds(const DDSolidShape & _shape, const std::vector<double>& _par) const{
00033 switch(_shape){
00034 case ddbox: return buildBox(_par);
00035 break;
00036 case ddtrap: return buildTrap(_par);
00037 break;
00038 case ddtubs: return buildOpen(_par);
00039 break;
00040 case ddpolycone_rrz: return buildOpen(_par);
00041 break;
00042 case ddsubtraction: return buildOpen(_par);
00043 break;
00044 default:
00045 std::cout<<"Wrong DDshape to build...."<<_shape<<std::endl;
00046 Bounds* bounds = 0;
00047 return bounds;
00048 }
00049 }
00050
00051 Bounds * TrackerShapeToBounds::buildBox(const std::vector<double>& paras ) const{
00052 int indexX = 0;
00053 int indexY = 1;
00054 int indexZ = 2;
00055 Bounds* bounds = 0;
00056
00057 if(paras[1]<paras[0]&¶s[0]<paras[2]){
00058 indexX=0;
00059 indexY=2;
00060 indexZ=1;
00061 }
00062
00063 bounds = new RectangularPlaneBounds(paras[indexX]/cm,
00064 paras[indexY]/cm,
00065 paras[indexZ]/cm);
00066 return bounds;
00067 }
00068
00069 Bounds * TrackerShapeToBounds::buildTrap(const std::vector<double>& paras ) const{
00070
00071
00072 Bounds* bounds = 0;
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099 if(paras[0]<5){
00100 bounds = new TrapezoidalPlaneBounds(paras[4]/cm,
00101 paras[9]/cm,
00102 paras[3]/cm,
00103 paras[0]/cm);
00104 }else if(paras[0]>paras[3]){
00105 bounds = new TrapezoidalPlaneBounds(paras[4]/cm,
00106 paras[9]/cm,
00107 paras[0]/cm,
00108 paras[3]/cm);
00109 }
00110 return bounds;
00111 }
00112
00113
00114 Bounds * TrackerShapeToBounds::buildOpen(const std::vector<double>& paras ) const{
00115 OpenBounds* bounds = new OpenBounds();
00116 return bounds;
00117 }