lcsim/src/org/lcsim/fit/helicaltrack
diff -u -r1.7 -r1.8
--- HitUtils.java 20 Feb 2009 22:45:10 -0000 1.7
+++ HitUtils.java 1 Apr 2009 20:50:15 -0000 1.8
@@ -1,3 +1,4 @@
+
/*
* HitUtils.java
*
@@ -179,9 +180,13 @@
// Calculate the uncertainty in the unmeasured coordinate due to not knowing the track direction
// by assuming phat . u has an uncertainty of 2/sqrt(12) so dv = 2 / sqrt(12) * seperation / sin(alpha)
double dv = Math.abs(2. * separation / (Math.sqrt(12) * salpha));
- // Add the covariance contributions from not knowing the track direction cov += (v1 * v1^T + v2 * v2^T) * (dv/2)^2
- MatrixAdd(Vec2Matrix(VecOp.mult(dv * factor, strip1.v())), cov);
- MatrixAdd(Vec2Matrix(VecOp.mult(dv * factor, strip2.v())), cov);
+ // Don't let dv by greater than the strip length / sqrt(12)
+ double dv1 = Math.min(dv, (strip1.vmax()-strip1.vmin()) / Math.sqrt(12.));
+ double dv2 = Math.min(dv, (strip1.vmax()-strip1.vmin()) / Math.sqrt(12.));
+ // Add the covariance contributions from not knowing the track direction
+ // cov += v1 * v1^T * (dv1/2)^2 + v2 * v2^T * (dv2/2)^2
+ MatrixAdd(Vec2Matrix(VecOp.mult(0.5 * dv1, strip1.v())), cov);
+ MatrixAdd(Vec2Matrix(VecOp.mult(0.5 * dv2, strip2.v())), cov);
return new SymmetricMatrix(cov);
}