Commit in lcsim/src/org/lcsim/contrib/uiowa/structural/likelihood on MAIN
TrackToTrackDOCA.java+15-11.2 -> 1.3
Fixed a typo bug; added comments

lcsim/src/org/lcsim/contrib/uiowa/structural/likelihood
TrackToTrackDOCA.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- TrackToTrackDOCA.java	14 Oct 2005 17:43:56 -0000	1.2
+++ TrackToTrackDOCA.java	18 Oct 2005 17:46:20 -0000	1.3
@@ -7,10 +7,24 @@
 import hep.physics.vec.Hep3Vector;
 import hep.physics.vec.VecOp;
 
+/**
+  * This quantity calculates the distance of closest approach (DOCA)
+  * of two track-like clusters. The clusters are treated as straight
+  * lines, with position and direction derived from the energy tensor.
+  *
+  * Note that here the DOCA is the distance from one track to the
+  * other, not the distance from each track to the POCA.
+  */
+
 public class TrackToTrackDOCA implements StructuralLikelihoodQuantity
 {
     public TrackToTrackDOCA() {}
 
+    /**
+      * Find the DOCA. Each cluster must have at least 4 hits to calculate the
+      * position and direction properly; if not this will fail and throw a
+      * QuantityNotDefinedException.
+      */
     public double evaluate(Cluster track1, Cluster track2) throws QuantityNotDefinedException
     {
 	if (track1.getCalorimeterHits().size()<4 || track2.getCalorimeterHits().size()<4) {
@@ -28,7 +42,7 @@
 	double[] distancesAlongLinesToPOCAs = Line.getPOCAOfLines(line1, line2);
 	
 	Hep3Vector poca1 = line1.getPointAtDistance(distancesAlongLinesToPOCAs[0]);
-	Hep3Vector poca2 = line1.getPointAtDistance(distancesAlongLinesToPOCAs[1]);
+	Hep3Vector poca2 = line2.getPointAtDistance(distancesAlongLinesToPOCAs[1]);
 	double doca = VecOp.sub(poca1,poca2).magnitude();
 	return doca;
     }
CVSspam 0.2.8