CMS 3D CMS Logo

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 calculate(const TrackCharge & chargeA, 
00058                                         const GlobalVector & momentumA, 
00059                                         const GlobalPoint & positionA, 
00060                                         const TrackCharge & chargeB, 
00061                                         const GlobalVector & momentumB, 
00062                                         const GlobalPoint & positionB,
00063                                         const MagneticField& magField);
00064 
00065   // given the old Parameters, and a new GlobalPoint,
00066   // we return the full new GlobalTrajectoryParameters at the
00067   // Point.
00068   GlobalTrajectoryParameters trajectoryParameters ( const GlobalPoint & newpt,
00069         const GlobalTrajectoryParameters & oldpar ) const;
00070 
00071   // Computes center coordinates and unsigned radius of circle;
00072   void circleParameters(const TrackCharge& charge, 
00073                         const GlobalVector& momemtum, 
00074                         const GlobalPoint& position, 
00075                         double& xc, double& yc, double& r,
00076                         const MagneticField& magField) const;
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   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) const;
00090 
00091   // Computes z-coordinate on helix at given transverse coordinates
00092   double zCoord(const GlobalVector& mom, const GlobalPoint& pos, 
00093                 double r, double xc, double yc, double xg, double yg) const;
00094 
00095 
00096 private:
00097   bool status_;
00098   GlobalPoint posA, posB;
00099   GlobalTrajectoryParameters paramA, paramB;
00100 
00101 };
00102 
00103 #endif

Generated on Tue Jun 9 17:48:23 2009 for CMSSW by  doxygen 1.5.4