CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/Geometry/TrackerGeometryBuilder/src/StripTopologyBuilder.cc

Go to the documentation of this file.
00001 
00002 #include "Geometry/TrackerGeometryBuilder/interface/StripTopologyBuilder.h"
00003 #include "Geometry/CommonTopologies/interface/RectangularStripTopology.h"
00004 #include "Geometry/CommonTopologies/interface/RadialStripTopology.h"
00005 #include "DataFormats/GeometrySurface/interface/Bounds.h"
00006 #include "DataFormats/GeometrySurface/interface/TrapezoidalPlaneBounds.h"
00007 
00008 
00009 
00010 StripTopologyBuilder::StripTopologyBuilder(){}
00011 
00012 StripTopology* StripTopologyBuilder::build(const Bounds* bs,double apvnumb,std::string part)
00013 {
00014   theAPVNumb = apvnumb;
00015 
00016   StripTopology* result;
00017   if (part == "barrel") {
00018     result = constructBarrel( bs->length(), bs->width());
00019   }
00020   else {
00021     int yAx = (dynamic_cast<const TrapezoidalPlaneBounds*>(bs))->yAxisOrientation();
00022     result = constructForward( bs->length(), bs->width(),bs->widthAtHalfLength(),yAx);
00023   }
00024   return result;
00025 }
00026 
00027 StripTopology* StripTopologyBuilder::constructBarrel( float length, float width)
00028 {
00029   int nstrip = int(128*theAPVNumb);
00030   float pitch = width/nstrip;
00031   
00032   return new RectangularStripTopology(nstrip,pitch,length);
00033 }
00034 
00035 StripTopology* StripTopologyBuilder::constructForward( float length, float width, float widthAtHalf, int yAxOr)
00036 {
00037   int nstrip = int(128*theAPVNumb);
00038   float rCross = widthAtHalf*length/(2*(width-widthAtHalf));
00039   float aw = atan2(widthAtHalf/2., static_cast<double>(rCross))/(nstrip/2);
00040   return new RadialStripTopology(nstrip, aw, length, rCross, yAxOr);
00041 }
00042