CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/RecoEgamma/EgammaPhotonAlgos/interface/TangentApproachInRPhi.h

Go to the documentation of this file.
00001 #ifndef _TangentApproachInRPhi_H_
00002 #define _TangentApproachInRPhi_H_
00003 
00004 #include "TrackingTools/PatternTools/interface/ClosestApproachOnHelices.h"
00005 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h" 
00006 
00015 class TangentApproachInRPhi : public ClosestApproachOnHelices {
00016 
00017 public:
00018 
00019   TangentApproachInRPhi() {status_ = false; intersection_ = false;}
00020 
00021   virtual bool calculate(const TrajectoryStateOnSurface & sta, 
00022          const TrajectoryStateOnSurface & stb);
00023 
00024   virtual bool calculate(const FreeTrajectoryState & sta,
00025         const FreeTrajectoryState & stb);
00026 
00027   virtual bool status() const {return status_;}
00028 
00032   virtual std::pair<GlobalPoint, GlobalPoint> points() const;
00033 
00036   std::pair <GlobalTrajectoryParameters, GlobalTrajectoryParameters >
00037         trajectoryParameters () const;
00038 
00040   virtual GlobalPoint crossingPoint() const;
00041 
00043   virtual float distance() const;
00044   
00046   float perpdist() const;
00047 
00051   virtual TangentApproachInRPhi * clone() const {
00052     return new TangentApproachInRPhi(* 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   bool intersection_;
00101 
00102 };
00103 
00104 #endif