00001 #ifndef _TwoTrackMinimumDistance_H_ 00002 #define _TwoTrackMinimumDistance_H_ 00003 00004 #include "TrackingTools/PatternTools/interface/ClosestApproachOnHelices.h" 00005 #include "TrackingTools/PatternTools/interface/ClosestApproachInRPhi.h" 00006 #include "TrackingTools/PatternTools/interface/TwoTrackMinimumDistanceHelixHelix.h" 00007 #include "TrackingTools/PatternTools/interface/TwoTrackMinimumDistanceLineLine.h" 00008 #include "TrackingTools/PatternTools/interface/TwoTrackMinimumDistanceHelixLine.h" 00009 00019 class TwoTrackMinimumDistance : public ClosestApproachOnHelices { 00020 00021 public: 00022 00023 enum Mode { FastMode=0, SlowMode=1 }; 00024 00025 TwoTrackMinimumDistance( const Mode m=FastMode ) { theModus=m; status_ = false;}; 00026 00027 virtual bool calculate(const TrajectoryStateOnSurface & sta, 00028 const TrajectoryStateOnSurface & stb); 00029 00030 virtual bool calculate(const FreeTrajectoryState & sta, 00031 const FreeTrajectoryState & stb); 00032 00033 virtual bool calculate(const GlobalTrajectoryParameters & sta, 00034 const GlobalTrajectoryParameters & stb); 00035 00036 virtual bool status() const {return status_;} 00037 00042 virtual std::pair<GlobalPoint, GlobalPoint> points() const; 00043 00045 virtual GlobalPoint crossingPoint() const; 00046 00048 virtual float distance() const; 00049 00050 00054 virtual TwoTrackMinimumDistance * clone() const { 00055 return new TwoTrackMinimumDistance(* this); 00056 } 00057 00058 double firstAngle() const; 00059 double secondAngle() const; 00060 std::pair <double, double> pathLength() const; 00061 00062 private: 00063 enum Charge { hh, hl, ll }; 00064 Mode theModus; 00065 mutable Charge theCharge; 00066 ClosestApproachInRPhi theIniAlgo; 00067 mutable TwoTrackMinimumDistanceHelixHelix theTTMDhh; 00068 mutable TwoTrackMinimumDistanceLineLine theTTMDll; 00069 mutable TwoTrackMinimumDistanceHelixLine theTTMDhl; 00070 bool status_; 00071 std::pair<GlobalPoint, GlobalPoint> points_; 00072 00073 bool pointsLineLine(const GlobalTrajectoryParameters & sta, 00074 const GlobalTrajectoryParameters & stb); 00075 bool pointsHelixLine(const GlobalTrajectoryParameters & sta, 00076 const GlobalTrajectoryParameters & stb); 00077 bool pointsHelixHelix(const GlobalTrajectoryParameters & sta, 00078 const GlobalTrajectoryParameters & stb); 00079 }; 00080 00081 #endif