00001
00002 #ifndef GEAR_VXDParametersImpl_H
00003 #define GEAR_VXDParametersImpl_H 1
00004
00005 #include "gear/VXDParameters.h"
00006 #include "gearimpl/GearParametersImpl.h"
00007 #include "gearimpl/VXDLayerLayoutImpl.h"
00008
00009
00010 namespace gear {
00011
00012 class VXDLayerLayout;
00013
00026 class VXDParametersImpl : public GearParametersImpl, public VXDParameters {
00027
00028 public:
00037 VXDParametersImpl( int vxdType, double shellInnerRadius, double shellOuterRadius, double shellHalfLength, double shellGap, double shellRadLength ) ;
00038
00039
00040 virtual ~VXDParametersImpl() { ; }
00041
00042
00043
00044 static const int CCD = 1 ;
00045 static const int CMOS = 2 ;
00046 static const int HYBRID = 3 ;
00047
00070 virtual void addLayer(int nLadders, double phi0,
00071 double ladderDistance, double ladderOffset, double ladderThickness,
00072 double ladderLength, double ladderWidth, double ladderRadLength,
00073 double sensitiveDistance, double sensitiveOffset, double sensitiveThickness,
00074 double sensitiveLength, double sensitiveWidth, double sensitiveRadLength )
00075 {
00076 _layer.addLayer( nLadders, phi0,
00077 ladderDistance, ladderOffset, ladderThickness, ladderLength, ladderWidth, ladderRadLength,
00078 sensitiveDistance, sensitiveOffset, sensitiveThickness, sensitiveLength, sensitiveWidth, sensitiveRadLength ) ;
00079 return ;
00080 }
00081
00082
00084 virtual const VXDLayerLayout & getVXDLayerLayout() const { return _layer ; }
00085
00089 virtual int getVXDType() const { return _vxdType ; }
00090
00093 virtual double getShellHalfLength() const { return _shellHalfLength ; }
00094
00097 virtual double getShellGap() const { return _shellGap ; }
00098
00101 virtual double getShellInnerRadius() const { return _shellInnerRadius ; }
00102
00105 virtual double getShellOuterRadius() const { return _shellOuterRadius ; }
00106
00109 virtual double getShellRadLength() const { return _shellRadLength ; }
00110
00113 virtual bool isPointInLadder(Point3D p) const {
00114 return isPointInVXD( p, false );
00115 }
00116
00119 virtual bool isPointInSensitive(Point3D p) const {
00120 return isPointInVXD( p, true ) ;
00121 }
00122
00125 virtual Vector3D distanceToNearestLadder(Point3D p) const {
00126 return distanceToNearestVXD( p, false ) ;
00127 }
00128
00131 virtual Vector3D distanceToNearestSensitive(Point3D p) const {
00132 return distanceToNearestVXD( p, true ) ;
00133 }
00134
00138 virtual Point3D intersectionLadder( Point3D p, Vector3D v ) const {
00139 return intersectionVXD( p, v, false ) ;
00140 }
00141
00145 virtual Point3D intersectionSensitive( Point3D p, Vector3D v ) const {
00146 return intersectionVXD( p, v, true ) ;
00147 }
00148
00149 protected:
00150
00151 VXDLayerLayoutImpl _layer ;
00152
00153 int _vxdType ;
00154
00155 double _shellInnerRadius ;
00156
00157 double _shellOuterRadius ;
00158
00159 double _shellHalfLength ;
00160
00161 double _shellGap ;
00162
00163 double _shellRadLength ;
00164
00165 private:
00166
00169 bool isPointInVXD(Point3D p , bool sensitive = false) const ;
00170
00173 Vector3D distanceToNearestVXD(Point3D p, bool sensitive = false) const ;
00174
00182 Vector3D distanceToPlane(Point3D p, Vector3D r, Vector3D n, Vector3D u, Vector3D v, float minU, float maxU, float minV, float maxV) const ;
00183
00186 Point3D intersectionVXD( Point3D p, Vector3D v, bool sensitive = false) const ;
00187
00190 Point3D planeLineIntersection( Vector3D r, Vector3D n, Point3D linePoint, Vector3D lineDir) const ;
00191
00195 double confiningRatio( Point3D p , Vector3D r, Vector3D n, Vector3D u, Vector3D v, float minU, float maxU, float minV, float maxV ) const ;
00196
00201 Vector3D correctToBorderPoint( Vector3D vPlane , Vector3D u, Vector3D v, float minU, float maxU, float minV, float maxV ) const ;
00202
00203 bool isEqual( double valueOne , double valueTwo ) const ;
00204
00205 bool isEqual( Point3D p1 , Point3D p2 ) const ;
00206
00207 bool differsLess( double valueOne , double valueTwo ) const ;
00208
00209
00212 double correctPhiRange( double Phi ) const ;
00213
00216 double getPhiPoint( Point3D p ) const ;
00217
00218 };
00219
00220 }
00221
00222 #endif