00001 #ifndef ThirdHitPredictionFromInvParabola_H 00002 #define ThirdHitPredictionFromInvParabola_H 00003 00012 #include "DataFormats/GeometryVector/interface/Basic2DVector.h" 00013 #include "DataFormats/GeometryVector/interface/Basic3DVector.h" 00014 #include "DataFormats/GeometrySurface/interface/TkRotation.h" 00015 00016 #include "DataFormats/GeometryVector/interface/GlobalPoint.h" 00017 #include "RecoTracker/TkMSParametrization/interface/PixelRecoRange.h" 00018 00019 00020 class TrackingRegion; 00021 class OrderedHitPair; 00022 00023 00024 class ThirdHitPredictionFromInvParabola { 00025 00026 public: 00027 00028 typedef TkRotation<double> Rotation; 00029 typedef PixelRecoRange<float> Range; 00030 00031 ThirdHitPredictionFromInvParabola(const GlobalPoint & P1, const GlobalPoint & P2, 00032 double ip, double curv, double tolerance); 00033 00034 Range operator()(double radius, int charge) const; 00035 00036 void init( const GlobalPoint & P1, const GlobalPoint & P2, double ip, double curv); 00037 00038 private: 00039 00040 double coeffA(const double & impactParameter, int charge) const; 00041 double coeffB(const double & impactParameter, int charge) const; 00042 double predV(const double & u, const double & ip, int charge) const; 00043 double ipFromCurvature(const double & curvature, int charge) const; 00044 00045 private: 00046 00047 template <class T> class MappedPoint { 00048 public: 00049 MappedPoint() : theU(0), theV(0), pRot(0) { } 00050 MappedPoint(const T & aU, const T & aV, const TkRotation<T> * aRot) 00051 : theU(aU), theV(aV), pRot(aRot) { } 00052 MappedPoint(const Basic2DVector<T> & point, const TkRotation<T> * aRot) 00053 : pRot(aRot) { 00054 T radius2 = point.mag2(); 00055 Basic3DVector<T> rotated = (*pRot) * point; 00056 theU = rotated.x() / radius2; 00057 theV = rotated.y() / radius2; 00058 } 00059 T u() const {return theU; } 00060 T v() const {return theV; } 00061 Basic2DVector<T> unmap () const { 00062 T invRadius2 = theU*theU+theV*theV; 00063 Basic3DVector<T> tmp 00064 = (*pRot).multiplyInverse(Basic2DVector<T>(theU,theV)); 00065 return Basic2DVector<T>( tmp.x()/invRadius2, tmp.y()/invRadius2); 00066 } 00067 private: 00068 T theU, theV; 00069 const TkRotation<T> * pRot; 00070 }; 00071 00072 private: 00073 00074 Rotation theRotation; 00075 typedef MappedPoint<double> PointUV; 00076 PointUV p1, p2; 00077 00078 Range theIpRangePlus, theIpRangeMinus; 00079 float theTolerance; 00080 00081 }; 00082 00083 #endif