Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:31:33

0001 #ifndef IterativeHelixExtrapolatorToLine_h_
0002 #define IterativeHelixExtrapolatorToLine_h_
0003 
0004 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
0005 #include "TrackingTools/GeomPropagators/interface/HelixLineExtrapolation.h"
0006 #include "TrackingTools/GeomPropagators/interface/HelixExtrapolatorToLine2Order.h"
0007 #include "FWCore/Utilities/interface/Visibility.h"
0008 
0009 /** Calculates closest approach of a helix to a line or a point by 
0010  *  iterative use of a 2nd order expansion of the helix.
0011  */
0012 
0013 class IterativeHelixExtrapolatorToLine final : public HelixLineExtrapolation {
0014 public:
0015   /** Constructor using point, direction and (transverse!) curvature.
0016    */
0017   IterativeHelixExtrapolatorToLine(const PositionType& point,
0018                                    const DirectionType& direction,
0019                                    const float curvature,
0020                                    const PropagationDirection propDir = anyDirection);
0021   // destructor
0022   ~IterativeHelixExtrapolatorToLine() override {}
0023 
0024   /** Propagation status (true if valid) and (signed) path length 
0025    *  along the helix from the starting point to the closest approach. 
0026    *  to the point. The starting point is given in the constructor.
0027    */
0028   std::pair<bool, double> pathLength(const GlobalPoint& point) const override;
0029 
0030   /** Propagation status (true if valid) and (signed) path length 
0031    *  along the helix from the starting point to the closest approach
0032    *  to the line. The starting point is given in the constructor.
0033    */
0034   std::pair<bool, double> pathLength(const Line& line) const override;
0035 
0036   /** Position at pathlength s from the starting point.
0037    */
0038   PositionType position(double s) const override;
0039 
0040   /** Direction at pathlength s from the starting point.
0041    */
0042   DirectionType direction(double s) const override;
0043 
0044   /** Position at pathlength s from the starting point.
0045    */
0046   PositionTypeDouble positionInDouble(double s) const;
0047 
0048   /** Direction at pathlength s from the starting point.
0049    */
0050   DirectionTypeDouble directionInDouble(double s) const;
0051 
0052 private:
0053   /// common functionality for extrapolation to line or point
0054   template <class T>
0055   std::pair<bool, double> genericPathLength(const T& object) const dso_internal;
0056 
0057 private:
0058   const double theX0, theY0, theZ0;
0059   double theCosPhi0, theSinPhi0;
0060   double theCosTheta, theSinTheta;
0061   const double theRho;
0062 
0063   HelixExtrapolatorToLine2Order theQuadraticSolutionFromStart;
0064 
0065   const PropagationDirection thePropDir;
0066 
0067   mutable double theCachedS;
0068   mutable double theCachedDPhi;
0069   mutable double theCachedSDPhi;
0070   mutable double theCachedCDPhi;
0071 };
0072 
0073 #endif