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