This is a helper class for TwoTrackMinimumDistance. No user should need direct access to this class. Exact solution.
Definition at line 17 of file TwoTrackMinimumDistanceLineLine.h.
Calculates the point of closest approach on the two tracks.
- Returns
- false in case of success
true in case of failure. Possible failures:
- Either of the Trajectories are charged
- Either of the Trajectories is of zero momentum
- Trajectories are parallel
Definition at line 8 of file TwoTrackMinimumDistanceLineLine.cc.
References GlobalTrajectoryParameters::charge(), Vector3DBase< T, FrameTag >::dot(), gPos, hPos, MagneticField::inTesla(), PV3DBase< T, PVType, FrameType >::mag(), GlobalTrajectoryParameters::magneticField(), GlobalTrajectoryParameters::momentum(), pathG, pathH, PV3DBase< T, PVType, FrameType >::phi(), phiG, phiH, GlobalTrajectoryParameters::position(), and PV3DBase< T, PVType, FrameType >::z().
16 if ( ! (isLineG && isLineH) )
19 <<
"charge of input track is not zero or field non zero" 20 <<
"\n positions: "<<gOrig<<
" , "<<hOrig
27 const double gMag= theG.
momentum().
mag();
double gMag2 = gMag*gMag;
29 const double hMag= theH.
momentum().
mag();
double hMag2 = hMag*hMag;
31 if ( gMag == 0. || hMag == 0. )
34 <<
"momentum of input trajectory is zero.";
41 double gVec_Dot_hVec = gVec.
dot(hVec);
42 double norm = gVec_Dot_hVec*gVec_Dot_hVec - gMag2*hMag2;
47 <<
"Tracks are parallel.";
53 double tG = (posDiff.
dot(gVec) * hMag2 - gVec_Dot_hVec * posDiff.
dot(hVec))/ norm;
54 double tH = (gVec_Dot_hVec * posDiff.
dot(gVec) - posDiff.
dot(hVec) * gMag2)/ norm;
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
GlobalVector momentum() const
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
GlobalPoint position() const
const MagneticField & magneticField() const
TrackCharge charge() const