CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/TrackingTools/PatternTools/interface/ClosestApproachInRPhi.h

Go to the documentation of this file.
00001 #ifndef _ClosestApproachInRPhi_H_
00002 #define _ClosestApproachInRPhi_H_
00003 
00004 #include "TrackingTools/PatternTools/interface/ClosestApproachOnHelices.h"
00005 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h" 
00006 
00018 class ClosestApproachInRPhi : public ClosestApproachOnHelices {
00019 
00020 public:
00021 
00022   ClosestApproachInRPhi() {status_ = false;}
00023 
00024   virtual bool calculate(const TrajectoryStateOnSurface & sta, 
00025                          const TrajectoryStateOnSurface & stb);
00026 
00027   virtual bool calculate(const FreeTrajectoryState & sta,
00028                          const FreeTrajectoryState & stb);
00029 
00030   virtual bool status() const {return status_;}
00031 
00035   virtual std::pair<GlobalPoint, GlobalPoint> points() const;
00036 
00039   std::pair <GlobalTrajectoryParameters, GlobalTrajectoryParameters >
00040   trajectoryParameters () const;
00041 
00043   virtual GlobalPoint crossingPoint() const;
00044 
00046   virtual float distance() const;
00047 
00051   virtual ClosestApproachInRPhi * clone() const {
00052     return new ClosestApproachInRPhi(* this);
00053   }
00054 
00055 private:
00056 
00057   bool compute(const TrackCharge & chargeA, 
00058                const GlobalVector & momentumA, 
00059                const GlobalPoint & positionA, 
00060                const TrackCharge & chargeB, 
00061                const GlobalVector & momentumB, 
00062                const GlobalPoint & positionB);
00063 
00064   // given the old Parameters, and a new GlobalPoint,
00065   // we return the full new GlobalTrajectoryParameters at the
00066   // Point.
00067   static GlobalTrajectoryParameters
00068   newTrajectory( const GlobalPoint & newpt,
00069                  const GlobalTrajectoryParameters & oldpar, double bz);
00070 
00071   // Computes center coordinates and unsigned radius of circle;
00072   static void circleParameters(const TrackCharge& charge, 
00073                                const GlobalVector& momemtum, 
00074                                const GlobalPoint& position, 
00075                                double& xc, double& yc, double& r,
00076                                double bz);
00077 
00078   // Computes crossing points of 2 circles with centres (cx_i, cy_i) 
00079   // and unsigned radii r_i. 
00080   // Two cases: - circles have one or two intersection points; 
00081   //              return value = 1; 
00082   //            - circles do not cross; computes point of closest approach 
00083   //              on each circle; return value = 2;
00084   // if the calculation fails (e.g. concentric circles), return value = 0;
00085 
00086   static int transverseCoord(double cxa, double cya, double ra, 
00087                              double cxb, double cyb, double rb, 
00088                              double & xg1, double & yg1, 
00089                              double & xg2, double & yg2);
00090 
00091   // Computes z-coordinate on helix at given transverse coordinates
00092   static double zCoord(const GlobalVector& mom, const GlobalPoint& pos, 
00093                        double r, double xc, double yc, double xg, double yg);
00094 
00095 
00096 private:
00097   GlobalPoint posA, posB;
00098   GlobalTrajectoryParameters paramA, paramB;
00099   double bz;
00100   bool status_;
00101   
00102 };
00103 
00104 #endif