Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:27:37

0001 #ifndef _TangentCircle_H_
0002 #define _TangentCircle_H_
0003 
0004 #include "RecoTracker/TkSeedGenerator/interface/FastCircle.h"
0005 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
0006 
0007 class TangentCircle {
0008   //   TODO : for speed-up :
0009   //   typedef Point2DBase< float, GlobalTag>     Global2DPoint;
0010   //   typedef Vector2DBase< float, GlobalTag>    Global2DVector;
0011 
0012 public:
0013   TangentCircle()
0014       : theInnerPoint(),
0015         theOuterPoint(),
0016         theVertexPoint(),
0017         theDirectionAtVertex(),
0018         theX0(0),
0019         theY0(0),
0020         theRho(0),
0021         theVertexError(0),
0022         valid(false),
0023         theCharge(0) {}
0024 
0025   /// Calculate the circle from 2 points on the circle (the vertex=innerPoint and the outerPoint)
0026   /// and the tangent direction at the inner point
0027   TangentCircle(const GlobalVector& direction, const GlobalPoint& innerPoint, const GlobalPoint& outerPoint);
0028 
0029   /// Copy of FastCircle
0030   TangentCircle(const GlobalPoint& outerPoint, const GlobalPoint& innerPoint, const GlobalPoint& vertexPoint);
0031 
0032   /// Calculate the parameters of a circle which pass by 2 points (innerPoint and outerPoint) and which is tangent to primCircle
0033   TangentCircle(const TangentCircle& primCircle, const GlobalPoint& outerPoint, const GlobalPoint& innerPoint);
0034 
0035   /// Return the direction at the vertex
0036   GlobalVector directionAtVertex();
0037 
0038   double x0() const { return theX0; }
0039 
0040   double y0() const { return theY0; }
0041 
0042   double rho() const { return theRho; }
0043 
0044   GlobalPoint outerPoint() const { return theOuterPoint; }
0045 
0046   GlobalPoint innerPoint() const { return theInnerPoint; }
0047 
0048   GlobalPoint vertexPoint() const { return theVertexPoint; }
0049 
0050   double vertexError() const { return theVertexError; }
0051 
0052   double curvatureError();
0053 
0054   int charge(float magz);
0055 
0056 private:
0057   GlobalPoint theInnerPoint;
0058   GlobalPoint theOuterPoint;
0059   GlobalPoint theVertexPoint;
0060 
0061   GlobalVector theDirectionAtVertex;
0062 
0063   double theX0;  /**< x center of the circle             */
0064   double theY0;  /**< y center of the circle             */
0065   double theRho; /**< Signed radius of the circle (=q*R) */
0066 
0067   double theVertexError; /**< the error on the vertex position along the direction of the circle at this point */
0068 
0069   bool valid;
0070   int theCharge;
0071 
0072   double isTangent(const TangentCircle& primCircle, const TangentCircle& secCircle) const;
0073   GlobalPoint getPosition(const TangentCircle& circle,
0074                           const GlobalPoint& initalPosition,
0075                           double theta,
0076                           int direction) const;
0077   int chargeLocally(float magz, GlobalVector v) const;
0078   GlobalVector direction(const GlobalPoint& point) const;
0079 };
0080 
0081 #endif