00001 //-------------------------------------------------------------------------- 00002 // File and Version Information: 00003 // $Id: TrkPoca.h,v 1.1.1.1 2005/04/21 06:01:42 zhangy Exp $ 00004 // 00005 // Description: 00006 // Calculate the point of closest approach between two trajectories, 00007 // or between a trajectory and a point. 00008 // Calculates (in ctor) the distance and the flight lengths alongs 00009 // the trajectory or trajectories; calculated values are obtained 00010 // through accessors. "Precision" is maximum allowed error on distance 00011 // (in cm). The input flightlengths are used as a starting point; the 00012 // code will find the point-of-closest-approach that is closest to that 00013 // point. (A good starting point also reduces CPU time.) 00014 // Note that distance is a signed quantity for two trajectories. 00015 // Environment: 00016 // Software developed for the BaBar Detector at the SLAC B-Factory. 00017 // 00018 // Author(s): Steve Schaffner; core algorithm stolen from Art Snyder. 00019 // 00020 //------------------------------------------------------------------------ 00021 #ifndef TRKPOCA_H 00022 #define TRKPOCA_H 00023 class TrkDifTraj; 00024 #include "TrkBase/TrkPocaBase.h" 00025 00026 // Class interface // 00027 class TrkPoca : public TrkPocaBase { 00028 public: 00029 TrkPoca(const Trajectory& traj1, double flt1, 00030 const Trajectory& traj2, double flt2, 00031 double precision=1.e-5); 00032 TrkPoca(const Trajectory& traj, double flt, 00033 const HepPoint3D& pt, double precision=1.e-5); 00034 ~TrkPoca() {}; 00035 00036 inline double doca() const; // distance of closest approach 00037 /* 00038 // The following inherited functions are also available: 00039 const TrkErrCode& status() const; // did the calculation succeed? 00040 double flt1() const; // path length on traj 1 @ poca 00041 double flt2() const; 00042 double precision(); // In case anyone wants to know: 00043 */ 00044 00045 private: 00046 double _doca; 00047 00048 // private functions 00049 void calcDist(const Trajectory& traj1, const Trajectory& traj2); 00050 // Preempt 00051 // TrkPoca& operator= (const TrkPoca&); 00052 // TrkPoca(const TrkPoca &); 00053 }; 00054 00055 // Inlined functions 00056 double TrkPoca::doca() const {return _doca;} 00057 00058 #endif