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 7 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().
13 if (!(isLineG && isLineH)) {
15 <<
"charge of input track is not zero or field non zero" 16 <<
"\n positions: " << gOrig <<
" , " << hOrig <<
"\n Bz fields: " << theG.
magneticField().
inTesla(gOrig).
z()
24 double gMag2 = gMag * gMag;
27 double hMag2 = hMag * hMag;
29 if (gMag == 0. || hMag == 0.) {
30 edm::LogWarning(
"TwoTrackMinimumDistanceLineLine") <<
"momentum of input trajectory is zero.";
37 double gVec_Dot_hVec = gVec.
dot(hVec);
38 double norm = gVec_Dot_hVec * gVec_Dot_hVec - gMag2 * hMag2;
41 edm::LogWarning(
"TwoTrackMinimumDistanceLineLine") <<
"Tracks are parallel.";
47 double tG = (posDiff.
dot(gVec) * hMag2 - gVec_Dot_hVec * posDiff.
dot(hVec)) / norm;
48 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