8#include "cdc/utilities/ClosestApproach.h"
52 if (hitXwire.
Mag() == 0) {
53 distance = wireLine.
Cross(wire2hit).
Mag() / wireLine.
Mag();
55 t2 = (posIn - fwp).Dot(wireLine) / wireLine.
Mag2();
57 double t1 = hitXwire.
Dot(wire2hit.
Cross(wireLine)) / hitXwire.
Mag2();
58 hitPosition = posOut + t1 * hitLine;
59 t2 = hitXwire.
Dot(wire2hit.
Cross(hitLine)) / hitXwire.
Mag2();
66 distance = fabs(wire2hit.
Dot(hitXwire) / hitXwire.
Mag());
80 wirePosition = fwp + t2 * wireLine;
B2Vector3< DataType > Cross(const B2Vector3< DataType > &p) const
Cross product.
DataType Mag() const
The magnitude (rho in spherical coordinate system).
DataType Mag2() const
The magnitude squared (rho^2 in spherical coordinate system).
DataType Dot(const B2Vector3< DataType > &p) const
Scalar product.
double ClosestApproach(const B2Vector3D &bwp, const B2Vector3D &fwp, const B2Vector3D &posIn, const B2Vector3D &posOut, B2Vector3D &hitPosition, B2Vector3D &wirePosition)
Returns a closest distance between a track and a wire.
Abstract base class for different kinds of events.