00001
00002
00003 #ifndef __DETDESC_TRANSPORTSVC_TRASNPORTSVCDISTANCEINRADUNITS_H__
00004 #define __DETDESC_TRANSPORTSVC_TRASNPORTSVCDISTANCEINRADUNITS_H__ 1
00005
00006
00007 #include "DetDesc/VolumeIntersectionIntervals.h"
00008
00009
00010 #include "TransportSvc.h"
00011
00012
00021
00022
00023
00034
00035 inline double TransportSvc::distanceInRadUnits
00036 ( const Gaudi::XYZPoint& point1 ,
00037 const Gaudi::XYZPoint& point2 ,
00038 double threshold ,
00039 IGeometryInfo* alternativeGeometry ,
00040 IGeometryInfo* geometryGuess )
00041 {
00042
00043 if( point1 == point2 ) { return 0 ;}
00044
00045
00046 Gaudi::XYZVector Vector( point2 - point1 ) ;
00047
00048
00049
00050
00051
00052
00053
00054
00055 intersections( point1 ,
00056 Vector ,
00057 0.0 ,
00058 1.0 ,
00059 m_local_intersects ,
00060 threshold ,
00061 alternativeGeometry ,
00062 geometryGuess );
00063
00064
00065 double RadLength =
00066 std::accumulate
00067 ( m_local_intersects.begin() ,
00068 m_local_intersects.end () ,
00069 0.0 ,
00070 VolumeIntersectionIntervals::AccumulateIntersections() );
00071
00072
00073 const ISolid::Tick TickLength = std::sqrt( Vector.mag2() );
00074
00075 return RadLength * TickLength ;
00077 };
00078
00079
00080
00081
00082 #endif // __DETDESC_TRANSPORTSVC_TRASNPORTSVCDISTANCEINRADUNITS_H__
00083