# Project CMSSW displayed by LXR

File indexing completed on 2024-04-06 12:31:34

```0001 #ifndef _Tracker_TwoTrackMinimumDistanceHelixLine_H_
0002 #define _Tracker_TwoTrackMinimumDistanceHelixLine_H_
0003
0004 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0005 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
0006 #include <utility>
0007 /** \class TwoTrackMinimumDistanceHelixLine
0008  *  This is a helper class for TwoTrackMinimumDistance, for the
0009  *  case where one of the tracks is charged and the other not.
0011  *  It implements a Newton method
0012  *  for finding the minimum distance between two tracks.
0013  */
0014
0015 class GlobalTrajectoryParameters;
0016
0017 class TwoTrackMinimumDistanceHelixLine {
0018 public:
0019   TwoTrackMinimumDistanceHelixLine() : theH(nullptr), theL(nullptr), themaxiter(12), pointsUpdated(false) {}
0020   ~TwoTrackMinimumDistanceHelixLine() {}
0021
0022   /**
0023    * Calculates the PCA between a charged particle (helix) and a neutral
0024    * particle (line). The order of the trajectories (helix-line or line-helix)
0025    * is irrelevent, and will be conserved.
0026    */
0027
0028   bool calculate(const GlobalTrajectoryParameters &,
0029                  const GlobalTrajectoryParameters &,
0030                  const float qual = .0001);  // retval=true? error occured.
0031
0032   /**
0033    * Returns the PCA's on the two trajectories. The first point lies on the
0034    * first trajectory, the second point on the second trajectory.
0035    */
0036
0037   std::pair<GlobalPoint, GlobalPoint> points() const;
0038   std::pair<double, double> pathLength() const;
0039
0040   double firstAngle() const;
0041   double secondAngle() const;
0042
0043 private:
0044   const GlobalTrajectoryParameters *theH, *theL, *firstGTP, *secondGTP;
0045   GlobalVector posDiff;
0046   GlobalVector theLp;
0047   double X, Y, Z, px, py, pz, px2, py2, pz2, baseFct, baseDer;
0048   double theh, thePhiH0, thesinPhiH0, thecosPhiH0, thetanlambdaH;
0049   double thePhiH;
0050   double Hn, Ln;
0051   double aa, bb, cc, dd, ee, ff;
0052
0053   int themaxiter;
0054   bool updateCoeffs();
0055   void finalPoints();
0056   bool oneIteration(double &thePhiH, double &fct, double &derivative) const;
0057   GlobalPoint helixPoint, linePoint;
0058   double tL, linePath, helixPath;
0059   bool pointsUpdated;
0060 };
0061 #endif```