Print

Print


Commit in lcsim/src/org/lcsim/recon/vertexing/zvtop4 on MAIN
ZvUtil.java+5-51.8 -> 1.9
ZvTrack.java+96-11.15 -> 1.16
+101-6
2 modified files
Reduced area to search. Finding works OK to first approximation

lcsim/src/org/lcsim/recon/vertexing/zvtop4
ZvUtil.java 1.8 -> 1.9
diff -u -r1.8 -r1.9
--- ZvUtil.java	1 Aug 2005 18:09:50 -0000	1.8
+++ ZvUtil.java	1 Aug 2005 20:59:51 -0000	1.9
@@ -9,6 +9,7 @@
 import java.util.Collection;
 
 import org.lcsim.event.Track;
+import org.lcsim.geometry.Detector;
 import org.lcsim.spacegeom.CartesianPoint;
 import org.lcsim.spacegeom.SpacePath;
 import org.lcsim.spacegeom.SpacePoint;
@@ -52,17 +53,16 @@
         SpacePoint maxLocation = new SpacePoint();
         // limit the region where to look to the vertex detector.
         // FIXME look at the real dimensions
-        final double maxX = 100;
-        final double maxY = 100;
-        final double maxZ = 500;
+        final double maxRad = 5;
+        final double maxZ = 15;
         final int maxStep = 1000;
         double maxOverlap = 0;
         // cut the Track into maxStep steps and calculate the distance
         // to the other parabola
         for (int s=0; s <= maxStep; ++s) {
-            double lengthParameter = - sqrt(maxX*maxX + maxY*maxY) + s*maxY/maxStep;
+            double lengthParameter = - maxRad + 2*s*maxRad/maxStep;
             SpacePoint thisITrackPoint = iTrack.getTubeCenter(lengthParameter);
-            double closestJTrackLength = jTrack.closestParabolaPoint(thisITrackPoint);
+            double closestJTrackLength = jTrack.closestParabolaPointOptimized(thisITrackPoint);
             SpacePoint closestJTrackPoint = jTrack.getTubeCenter(closestJTrackLength);
             SpacePath t = new SpacePath();
             t.setOrigin(thisITrackPoint);

lcsim/src/org/lcsim/recon/vertexing/zvtop4
ZvTrack.java 1.15 -> 1.16
diff -u -r1.15 -r1.16
--- ZvTrack.java	1 Aug 2005 18:09:50 -0000	1.15
+++ ZvTrack.java	1 Aug 2005 20:59:51 -0000	1.16
@@ -503,6 +503,100 @@
         return _errorMatrix;
     }
 
+    double closestParabolaPointOptimized(SpacePoint point) {
+        double x1 = point.x();
+        double y1 = point.y();
+        double z1 = point.z();
+        double kappa = _parameters.kappa;
+        double tanLambda = _parameters.s;
+        double theta = trackRotationAngle;
+        double x0 = rotateLocation(_referencePoint).x();
+        double z0 = _referencePoint.z();
+        double t68;
+        double t45;
+        double t25;
+        double t5;
+        double t134;
+        double t172;
+        double t175;
+        double t178;
+        double t39;
+        double t26;
+        double t52;
+        double t157;
+        double t13;
+        double t21;
+        double t3;
+        double t4;
+        double t1;
+        double t2;
+        double t85;
+        double t56;
+        double t8;
+        double t106;
+        double t43;
+        double t96;
+        double t19;
+        double t20;
+        double t31;
+        double t117;
+        double t114;
+        double t27;
+        double t141;
+        double t142;
+        double t9;
+        double t10;
+        double t14;
+        double t65;
+        double t154;
+        double t66;
+        double t67;
+        double t150;
+        double t152;
+        t1 = kappa;
+        t2 = 0.1e1 / t1;
+        t3 = tanLambda;
+        t4 = t3 * t1;
+        t5 = z0;
+        t8 = x1 * t1;
+        t9 = theta;
+        t10 = Math.sin(t9);
+        t13 = y1 * t1;
+        t14 = Math.cos(t9);
+        t19 = t1 * t1;
+        t20 = t3 * t3;
+        t21 = t20 * t19;
+        t25 = t1 * t19;
+        t26 = t25 * y1;
+        t27 = x0 * x0;
+        t31 = t19 * x1;
+        t39 = t20 * t20;
+        t43 = x1 * x1;
+        t45 = t14 * t14;
+        t52 = t19 * y1;
+        t56 = t3 * t19;
+        t65 = 0.6e1 - 162 * z1 * t5 * t21 - 0.144e3 * t27 * t10 * t26 - 0.144e3 * x0 * t14 * t31 - 0.144e3 * t27 * t14 * t25 * x1 - 0.36e2 * t39 * t14 * t8 + 0.144e3 * x0 * t45 * t25 * t43 - 0.36e2 * t39 * t10 * t13 - 0.144e3 * x0 * t10 * t52 + 0.162e3 * t10 * x1 * t5 * t56 - 0.162e3 * t14 * y1 * t5 * t56;
+        t66 = y1 * y1;
+        t67 = t25 * t66;
+        t68 = t10 * t10;
+        t85 = t14 * x1;
+        t96 = t20 * t10;
+        t106 = -0.144e3 * t14 * x1 * t68 * t67 - 0.18e2 * t14 * x1 * t10 * t52 + 0.6e1 * t20 * t39 - 0.144e3 * t45 * t43 * t10 * t26 + 0.18e2 * t20 + 0.144e3 * t20 * t85 * t10 * t52 + 0.48e2 * t25 * x0 * t27 + 0.288e3 * x0 * t85 * t10 * t26 - 0.144e3 * x0 * t96 * t52 - 0.162e3 * z1 * t3 * t10 * t31 + 0.72e2 * t19 * t27;
+        t114 = t66 * t19;
+        t117 = t19 * t43;
+        t134 = z1 * z1;
+        t141 = 0.36e2 * t1 * x0 * t39 + 0.72e2 * t1 * x0 * t20 + 0.81e2 * t45 * t114 + 0.72e2 * t45 * t117 - 0.48e2 * t10 * t68 * t25 * y1 * t66 - 0.48e2 * t14 * t45 * t25 * x1 * t43 + 0.81e2 * t68 * t117 + 0.72e2 * t68 * t114 + 81 * t134 * t21 + 0.72e2 * t19 * t27 * t20 + 0.18e2 * t39;
+        t142 = t20 * t14;
+        t150 = t1 * x0;
+        t152 = t14 * t8;
+        t154 = t5 * t5;
+        t157 = t10 * t13;
+        t172 = -0.144e3 * x0 * t142 * t31 + 0.162e3 * z1 * t3 * t14 * t52 + 0.36e2 * t150 - 0.36e2 * t152 + 81 * t154 * t21 - 0.36e2 * t157 - 0.72e2 * t142 * t8 + 0.72e2 * t20 * t68 * t114 + 0.144e3 * x0 * t68 * t67 - 0.72e2 * t96 * t13 + 0.72e2 * t20 * t45 * t117;
+        t175 = Math.sqrt(t65 + t106 + t141 + t172);
+        t178 = Math.pow(-54 * t5 * t4 - 0.54e2 * t10 * t8 + 0.54e2 * t14 * t13 + 54 * z1 * t4 + 0.6e1 * t175, 0.1e1 / 0.3e1);
+        return(t178 * t2 / 0.6e1 + 0.1e1 / t178 * t2 * (0.2e1 * t157 + 0.2e1 * t152 - t20 - 0.2e1 * t150 - 0.1e1));
+    }
+    
     /**
      * Calculates the lengthParameter s at which the ZvTrack is closest to the
      * given SpacePoint
@@ -521,7 +615,7 @@
         double theta = trackRotationAngle;
         double x0 = rotateLocation(_referencePoint).x();
         double z0 = _referencePoint.z();
-        return ((Math.pow(0.54e2
+        double result = ((Math.pow(0.54e2
                 * kappa
                 * y1
                 * Math.cos(theta)
@@ -660,5 +754,6 @@
                                 * kappa * Math.pow(Math.cos(theta), 0.2e1) * tanLambda * tanLambda
                                 - 0.72e2 * x1 * kappa * Math.cos(theta) * tanLambda * tanLambda),
                         -0.1e1 / 0.3e1) / kappa / 0.6e1);
+        return result;
     }
 }
CVSspam 0.2.8