Commit in lcsim/src/org/lcsim/fit/helicaltrack on MAIN
HitUtils.java+10-91.3 -> 1.4
Fix problems with forward disk hit uncertainty when the estimated helix slope is tiny

lcsim/src/org/lcsim/fit/helicaltrack
HitUtils.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- HitUtils.java	30 Jul 2008 00:11:50 -0000	1.3
+++ HitUtils.java	18 Aug 2008 21:05:00 -0000	1.4
@@ -112,15 +112,16 @@
             //  Combine resolution and multiple scattering uncertainties in quadrature
             return Math.sqrt(dz_res2 + dz_ms*dz_ms);
         } else {
-            //  For endcap disks, take dz = dr * slope
-            //  First find the slope
-            double slope;
-            //  If we have a helix, use the slope from the helix
-            if (helix != null) slope = helix.slope();
-            //  Otherwise, assume straight-line track from the origin
-            else slope = Math.abs(hit.z() / hit.r());
-            //  Take the resolution uncertainty to be dr * slope
-            double dzres = hit.dr() * slope;
+            //  For endcap disks, take dz = dr * |slope|
+            //  First find the slope - default to the slope for a straight-line track from the origin
+            double slope = hit.z() / hit.r();
+            //  If we have a helix, see if we can use the slope from the helix
+            if (helix != null) {
+                //  Don't use the helix slope if the magnitude of the slope is smaller than it's uncertainty
+                if (Math.abs(slope) > helix.getSlopeError()) slope = helix.slope();
+            }
+            //  Take the resolution uncertainty to be dr * |slope|
+            double dzres = hit.dr() * Math.abs(slope);
             //  Combine resolution and multiple scattering uncertainties in quadrature
             return Math.sqrt(dzres*dzres + dz_ms*dz_ms);
         }
CVSspam 0.2.8