Commit in lcsim on MAIN
project.xml+7-41.33 -> 1.34
src/org/lcsim/contrib/JanStrube/tracking/Helix.java+16-51.1 -> 1.2
                                        /HelixSwimmer.java+3-31.3 -> 1.4
                                        /NewFastMCTrackFactory.java+5-31.3 -> 1.4
                                        /HelixSwimmerTrackConsistencyTest.java-911.1 removed
                                        /NewTrackTest.java-1151.2 removed
src/org/lcsim/contrib/JanStrube/vtxFitter/FitterTest.java-11.4 -> 1.5
                                         /VertexFactory.java+14-141.4 -> 1.5
                                         /vertexing.lyx+51-11.1 -> 1.2
                                         /VertexTrackTest.java-811.4 removed
src/org/lcsim/recon/vertexing/zvtop4/VectorArithmetic.java+2-131.11 -> 1.12
+98-331
3 removed + 8 modified, total 11 files
Add the new tracking package in my contrib area to the list of packages to build. Added unit tests

lcsim
project.xml 1.33 -> 1.34
diff -u -r1.33 -r1.34
--- project.xml	5 Jun 2006 23:06:22 -0000	1.33
+++ project.xml	18 Jul 2006 03:26:48 -0000	1.34
@@ -146,20 +146,23 @@
    <sourceModification>
     <className>fakeClass</className>
     <excludes>
-     <exclude>org/lcsim/contrib/**</exclude>
-<!--
+
+<!--     <exclude>org/lcsim/contrib/**</exclude>
+-->
      <exclude>org/lcsim/plugin/web/**</exclude>
      <exclude>org/lcsim/contrib/CalAnal/**</exclude>
      <exclude>org/lcsim/contrib/CarstenHensel/**</exclude>
-     <exclude>org/lcsim/contrib/JanStrube/**</exclude>
      <exclude>org/lcsim/contrib/LeiXia/**</exclude>
+     <exclude>org/lcsim/contrib/JanStrube/*</exclude>
+     <exclude>org/lcsim/contrib/JanStrube/vtxFitter/**</exclude>
      <exclude>org/lcsim/contrib/SteveKuhlmann/**</exclude>
      <exclude>org/lcsim/contrib/compile/**</exclude>
      <exclude>org/lcsim/contrib/proulx/**</exclude>
      <exclude>org/lcsim/contrib/tracking/**</exclude>
      <exclude>org/lcsim/contrib/uiowa/**</exclude>
      <exclude>org/lcsim/contrib/garfield/**</exclude>
--->
+     <exclude>org/lcsim/contrib/timb/**</exclude>
+     <exclude>org/lcsim/contrib/SODTracker/**</exclude>
     </excludes>
    </sourceModification>
   </sourceModifications>

lcsim/src/org/lcsim/contrib/JanStrube/tracking
Helix.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- Helix.java	17 Jul 2006 10:12:40 -0000	1.1
+++ Helix.java	18 Jul 2006 03:26:50 -0000	1.2
@@ -4,6 +4,7 @@
 import static java.lang.Math.asin;
 import static java.lang.Math.atan2;
 import static java.lang.Math.cos;
+import static java.lang.Math.acos;
 import static java.lang.Math.signum;
 import static java.lang.Math.sin;
 import static java.lang.Math.sqrt;
@@ -21,7 +22,7 @@
  * For more info on swimming see <a href="doc-files/transport.pdf">this paper</a> by Paul Avery.
  * 
  * @author tonyj
- * @version $Id: Helix.java,v 1.1 2006/07/17 10:12:40 jstrube Exp $
+ * @version $Id: Helix.java,v 1.2 2006/07/18 03:26:50 jstrube Exp $
  */
 public class Helix implements Trajectory {
     private Hep3Vector origin;
@@ -116,7 +117,7 @@
      * 2*PI*radius/cos(lambda) is one rotation in the x-y plane
      */
     public SpacePoint getPointAtDistance(double alpha) {
-        double angle = phi - alpha * cosLambda / radius;
+        double angle = phi + alpha * rho;
         double x = xCenter + radius * sin(angle);
         double y = yCenter - radius * cos(angle);
         double z = origin.z() + alpha * sinLambda;
@@ -188,14 +189,12 @@
         Hep3Vector xDiff = VecOp.sub(origin, point);
         double zPos = xDiff.z();
         int addedQuarterPeriods = 0;
-        // these are two mutually exclusive cases and two while loops
-        // may not be the best way to express this
-
         while (abs(zPos) > abs(radius * tanLambda * Math.PI / 2)) {
             zPos -= signum(zPos) * abs(radius * tanLambda * Math.PI / 2);
             ++addedQuarterPeriods;
         }
         // Make sure the helix is in the right quadrant for the atan
+        // This is "empirical arithmetic". I'm sure there's a better way to do this.
         if (zPos > 0 && addedQuarterPeriods > 0)
             addedQuarterPeriods *= -1;
         if (addedQuarterPeriods % 2 != 0)
@@ -220,4 +219,16 @@
         pz = abs_r * sinLambda / cosLambda;
         rho = -cosLambda / radius;
     }
+    
+    public String toString() {
+    	String helix = String.format("Helix:\n");
+    	helix += String.format("radius: %f\n", radius);
+    	helix += String.format("phi: %f\n", phi);
+    	helix += String.format("lambda: %f\n", acos(cosLambda));
+    	helix += String.format("px: %f\n", px);
+    	helix += String.format("py: %f\n", py);
+    	helix += String.format("pz: %f\n", pz);
+    	helix += String.format("rho: %f\n", rho);
+    	return helix;
+    }
 }

lcsim/src/org/lcsim/contrib/JanStrube/tracking
HelixSwimmer.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- HelixSwimmer.java	17 Jul 2006 10:12:39 -0000	1.3
+++ HelixSwimmer.java	18 Jul 2006 03:26:50 -0000	1.4
@@ -23,7 +23,7 @@
  * For more info on swimming see <a href="doc-files/transport.pdf">this paper</a> by Paul Avery.
  * 
  * @author jstrube
- * @version $Id: HelixSwimmer.java,v 1.3 2006/07/17 10:12:39 jstrube Exp $
+ * @version $Id: HelixSwimmer.java,v 1.4 2006/07/18 03:26:50 jstrube Exp $
  */
 public class HelixSwimmer {
     public class SpatialParameters {
@@ -95,7 +95,7 @@
         spatialParms.pz = pt*t.getParameter(tanLambda);
         spatialParms.charge = t.getCharge();
 //        System.out.println(spatialParms);
-//        System.out.println(origin);
+//        System.out.println("Origin is " + origin);
     }
 
     public SpacePoint getPointAtDistance(double alpha) {
@@ -131,7 +131,7 @@
      * @param point The point to swim as close as possible to
      * @return the length parameter by how much the trajectory has to be swum
      */
-    public double getDistanceToPoint(SpacePoint point) {
+    public double getTrackLengthToPoint(SpacePoint point) {
         return _trajectory.getTrackLengthToPoint(point);
     }
 

lcsim/src/org/lcsim/contrib/JanStrube/tracking
NewFastMCTrackFactory.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- NewFastMCTrackFactory.java	17 Jul 2006 10:12:39 -0000	1.3
+++ NewFastMCTrackFactory.java	18 Jul 2006 03:26:50 -0000	1.4
@@ -1,5 +1,5 @@
 /**
- * @version $Id: NewFastMCTrackFactory.java,v 1.3 2006/07/17 10:12:39 jstrube Exp $
+ * @version $Id: NewFastMCTrackFactory.java,v 1.4 2006/07/18 03:26:50 jstrube Exp $
  */
 package org.lcsim.contrib.JanStrube.tracking;
 
@@ -127,9 +127,11 @@
      */
     Track getTrack(SpacePoint momentum, SpacePoint location, SpacePoint referencePoint, int charge, Random random, boolean shouldISmear) {
         _swimmer.setTrack(momentum, location, charge);
-        double alpha = _swimmer.getDistanceToPoint(referencePoint);
+        double alpha = _swimmer.getTrackLengthToPoint(referencePoint);
         SpacePoint poca = _swimmer.getPointAtDistance(alpha);
+//        System.out.println("poca is: " + poca);
         SpacePoint momentumAtPoca = _swimmer.getMomentumAtDistance(alpha);
+//        System.out.println("momentum at POCA is: " + momentumAtPoca);
         EMap parameters = new EMap();
         parameters.pt = momentumAtPoca.rxy();
         parameters.set(phi0, atan2(momentumAtPoca.y(), momentumAtPoca.x()));
@@ -189,7 +191,7 @@
      */
     public void setNewReferencePoint(Track track, SpacePoint referencePoint) {
         _swimmer.setTrack(track);
-        double alpha = _swimmer.getDistanceToPoint(referencePoint);
+        double alpha = _swimmer.getTrackLengthToPoint(referencePoint);
         
         // TODO this involves transportation of the full covariance matrix.
         // See Paul Avery's notes for details.

lcsim/src/org/lcsim/contrib/JanStrube/tracking
HelixSwimmerTrackConsistencyTest.java removed after 1.1
diff -N HelixSwimmerTrackConsistencyTest.java
--- HelixSwimmerTrackConsistencyTest.java	17 Jul 2006 10:12:39 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,91 +0,0 @@
-/**
- * @version $Id: HelixSwimmerTrackConsistencyTest.java,v 1.1 2006/07/17 10:12:39 jstrube Exp $
- */
-package org.lcsim.contrib.JanStrube.tracking;
-
-import java.util.Random;
-
-import org.lcsim.spacegeom.CartesianPoint;
-import org.lcsim.spacegeom.SpacePoint;
-
-import junit.framework.TestCase;
-
-/**
- * @author jstrube
- *
- */
-public class HelixSwimmerTrackConsistencyTest extends TestCase {
-
-    private HelixSwimmer swimmerRaw;
-    private HelixSwimmer swimmerTrack;
-    private NewFastMCTrackFactory factory;
-    /* (non-Javadoc)
-     * @see junit.framework.TestCase#setUp()
-     */
-    protected void setUp() throws Exception {
-        super.setUp();
-        swimmerRaw = new HelixSwimmer(5.);
-        factory = new NewFastMCTrackFactory("sidaug05", 5., true);
-        swimmerTrack = new HelixSwimmer(5.);
-    }
-
-    public void testHelix_TrackFactoryConsistency1() {
-        SpacePoint momentum = new CartesianPoint(-2, 2, 4);
-        SpacePoint location = new CartesianPoint(1, 2, 3);
-        int charge = -1;
-        swimmerRaw.setTrack(momentum, location, charge);
-        // get a Track in a way that no swimming is necessary for the reference point
-        // turn off smearing
-        Track t = factory.getTrack(momentum, location, location, charge, new Random(), false);
-        swimmerTrack.setTrack(t);
-        // swim to pocas of several points and compare position and momentum at these points
-        double alpha = swimmerRaw.getDistanceToPoint(location);
-        double beta = swimmerTrack.getDistanceToPoint(location);
-        assertEquals(swimmerRaw.getPointAtDistance(alpha), swimmerTrack.getPointAtDistance(beta), 4e-4);
-        assertEquals(swimmerRaw.getMomentumAtDistance(alpha), swimmerTrack.getMomentumAtDistance(beta), 1e-5);
-        
-        // use the momentum components as another random point to swim to
-        alpha = swimmerRaw.getDistanceToPoint(momentum);
-        beta = swimmerTrack.getDistanceToPoint(momentum);
-        // TODO there are obviously some floating point precision issues, probably related to the trigonometric functions.
-        // Investigation can be put off to a later date
-        assertEquals(swimmerRaw.getPointAtDistance(alpha), swimmerTrack.getPointAtDistance(beta), 4e-4);
-        assertEquals(swimmerRaw.getMomentumAtDistance(alpha), swimmerTrack.getMomentumAtDistance(beta), 4e-4);
-    }
-    
-    public void testHelix_TrackFactoryConsistency2() {
-        SpacePoint momentum = new CartesianPoint(-2, 2, 4);
-        SpacePoint location = new CartesianPoint(1, 2, 3);
-        int charge = -1;
-        swimmerRaw.setTrack(momentum, location, charge);
-        SpacePoint referencePoint = new SpacePoint();
-        // reference Point is (0, 0, 0)
-        Track t = factory.getTrack(momentum, location, referencePoint, charge, new Random(), false);
-        swimmerTrack.setTrack(t);
-
-        double alpha = swimmerRaw.getDistanceToPoint(referencePoint);
-        System.out.println("Raw: Distance to 000 is: " + alpha);
-        double beta = swimmerTrack.getDistanceToPoint(referencePoint);
-        System.out.println("Track: Distance to 000 is: " + beta);
-        assertEquals(beta, 0, 1e-10);
-        System.out.println(swimmerRaw.getPointAtDistance(alpha));
-    }
-    
-    /* (non-Javadoc)
-     * @see junit.framework.TestCase#tearDown()
-     */
-    protected void tearDown() throws Exception {
-        super.tearDown();
-    }
-
-    void assertEquals(SpacePoint a, SpacePoint b, double precision) {
-        assertEquals(a.x(), b.x(), precision);
-        assertEquals(a.y(), b.y(), precision);
-        assertEquals(a.z(), b.z(), precision);        
-    }
-    
-    void assertEquals(SpacePoint a, SpacePoint b) {
-        assertEquals(a, b, 1e-10);
-    }
-
-}

lcsim/src/org/lcsim/contrib/JanStrube/tracking
NewTrackTest.java removed after 1.2
diff -N NewTrackTest.java
--- NewTrackTest.java	17 Jul 2006 10:12:39 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,115 +0,0 @@
-/**
- * @version $Id: NewTrackTest.java,v 1.2 2006/07/17 10:12:39 jstrube Exp $
- */
-package org.lcsim.contrib.JanStrube.tracking;
-
-import org.lcsim.spacegeom.CartesianPoint;
-import org.lcsim.spacegeom.SpacePoint;
-
-import junit.framework.TestCase;
-
-/**
- * @author jstrube
- *
- */
-public class NewTrackTest extends TestCase {
-
-    private NewFastMCTrackFactory factory;
-    private Track t;
-    /* (non-Javadoc)
-     * @see junit.framework.TestCase#setUp()
-     */
-    protected void setUp() throws Exception {
-        super.setUp();
-        factory = new NewFastMCTrackFactory("sidaug05", 5., true);
-        SpacePoint momentum = new CartesianPoint(1, 1, 1);
-        SpacePoint location = new CartesianPoint(1, 2, 3);
-        t = factory.getTrack(momentum, location, 1);
-    }
-
-    /* (non-Javadoc)
-     * @see junit.framework.TestCase#tearDown()
-     */
-    protected void tearDown() throws Exception {
-        super.tearDown();
-    }
-
-    /**
-     * Test method for {@link org.lcsim.contrib.JanStrube.tracking.NewTrack#NewTrack(org.lcsim.spacegeom.SpacePoint, org.lcsim.contrib.JanStrube.tracking.EMap, Jama.Matrix, int)}.
-     */
-    public void testNewTrack() {
-        
-    }
-
-    /**
-     * Test method for {@link org.lcsim.contrib.JanStrube.tracking.NewTrack#getPt()}.
-     * Testing equality of pt for different initializations of the track.
-     * Notable is that different values of the charge are tested.
-     */
-    public void testGetPt() {
-        SpacePoint location = new CartesianPoint(0, 0, 0);
-        SpacePoint momentum = new CartesianPoint(1, 1, 1);
-        t = factory.getTrack(momentum, location, 1);
-        assertEquals(t.getPt(), momentum.rxy(), 1e-10);
-
-        location = new CartesianPoint(1, 2, 3);
-        momentum = new CartesianPoint(-1, -1, -1);
-        t = factory.getTrack(momentum, location, 2);
-        assertEquals(t.getPt(), momentum.rxy(), 1e-10);
-
-        location = new CartesianPoint(-1, -2, -3);
-        momentum = new CartesianPoint(-1, -1, -1);
-        t = factory.getTrack(momentum, location, -1);
-        assertEquals(t.getPt(), momentum.rxy(), 1e-10);
-        
-        location = new CartesianPoint(1, 2, 3);
-        momentum = new CartesianPoint(-2, -1, 1);
-        t = factory.getTrack(momentum, location, -2);
-        assertEquals(t.getPt(), momentum.rxy(), 1e-10);
-    }
-
-    /**
-     * Test method for {@link org.lcsim.contrib.JanStrube.tracking.NewTrack#getCharge()}.
-     */
-    public void testGetCharge() {
-        SpacePoint location = new CartesianPoint(0, 0, 0);
-        SpacePoint momentum = new CartesianPoint(1, 1, 1);
-        t = factory.getTrack(momentum, location, -2);
-        assertEquals(t.getCharge(), -2);
-        t = factory.getTrack(momentum, location, -1);
-        assertEquals(t.getCharge(), -1);
-        t = factory.getTrack(momentum, location, 1);
-        assertEquals(t.getCharge(), 1);
-        t = factory.getTrack(momentum, location, 2);
-        assertEquals(t.getCharge(), 2);
-    }
-
-    /**
-     * Test method for {@link org.lcsim.contrib.JanStrube.tracking.NewTrack#getReferencePoint()}.
-     */
-    public void testGetReferencePoint() {
-        SpacePoint location = new CartesianPoint(1, 2, 3);
-        SpacePoint momentum = new CartesianPoint(1, 1, 1);
-        SpacePoint referencePoint = new CartesianPoint(0, 0, 0);
-        t = factory.getTrack(momentum, location, referencePoint, -2);
-        assertEquals(t.getReferencePoint(), referencePoint);
-
-        referencePoint = new CartesianPoint(1, 2, 3);
-        t = factory.getTrack(momentum, location, referencePoint, -2);
-        assertEquals(t.getReferencePoint(), referencePoint);
-        
-        referencePoint = new CartesianPoint(-2, -3, -4);
-        t = factory.getTrack(momentum, location,referencePoint,  -2);
-        assertEquals(t.getReferencePoint(), referencePoint);
-
-        referencePoint = new CartesianPoint(1, 0, 7);
-        t = factory.getTrack(momentum, location, referencePoint, -2);
-        assertEquals(t.getReferencePoint(), referencePoint);
-    }
-    
-    void assertEquals(SpacePoint a, SpacePoint b) {
-        assertEquals(a.x(), b.x(), 1e-10);
-        assertEquals(a.y(), b.y(), 1e-10);
-        assertEquals(a.z(), b.z(), 1e-10);
-    }
-}

lcsim/src/org/lcsim/contrib/JanStrube/vtxFitter
FitterTest.java 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- FitterTest.java	4 Jul 2006 01:41:48 -0000	1.4
+++ FitterTest.java	18 Jul 2006 03:26:52 -0000	1.5
@@ -8,7 +8,6 @@
 import org.lcsim.event.ReconstructedParticle;
 import org.lcsim.event.Track;
 import org.lcsim.event.base.BaseReconstructedParticle;
-import org.lcsim.mc.fast.tracking.MCFastTrackFactory;
 import org.lcsim.spacegeom.CartesianPoint;
 import org.lcsim.spacegeom.SpacePoint;
 

lcsim/src/org/lcsim/contrib/JanStrube/vtxFitter
VertexFactory.java 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- VertexFactory.java	4 Jul 2006 01:41:48 -0000	1.4
+++ VertexFactory.java	18 Jul 2006 03:26:52 -0000	1.5
@@ -2,10 +2,10 @@
 
 import hep.physics.vec.Hep3Vector;
 
+import org.lcsim.contrib.JanStrube.tracking.NewFastMCTrackFactory;
 import org.lcsim.event.ReconstructedParticle;
 import org.lcsim.event.Track;
 import org.lcsim.event.base.BaseReconstructedParticle;
-import org.lcsim.mc.fast.tracking.MCFastTrackFactory;
 import org.lcsim.recon.tracking.trfutil.RandomGenerator;
 import static org.lcsim.recon.vertexing.zvtop4.VectorArithmetic.subtract;
 import org.lcsim.spacegeom.CartesianPoint;
@@ -40,19 +40,19 @@
 		momentum = (SpacePoint) mom.clone();
 		Vertex particle = new Vertex(0.);
 		particle.setOrigin(pos);
-		MCFastTrackFactory fac = new MCFastTrackFactory();
-		for (int i=0; i<nTracks-1; i++) {
-			int c = (int) Math.pow(-1, Math.round((i+1)/2));
-			double px = flat(-momentum.x(), momentum.x());
-			double py = flat(-momentum.y(), momentum.y());
-			double pz = flat(-momentum.z(), momentum.z());
-			SpacePoint p = new CartesianPoint(px, py, pz);
-			momentum = subtract(momentum, p);
-			Track t = fac.getMCTrack(p, pos, c);
-			particle.addTrack(t);
-		}
-        int c = (int)Math.pow(-1, Math.round((nTracks+1)/2));
-		particle.addTrack(fac.getMCTrack(momentum, pos, c));
+//		NewFastMCTrackFactory fac = new NewFastMCTrackFactory("sidaug05", 5., true);
+//		for (int i=0; i<nTracks-1; i++) {
+//			int c = (int) Math.pow(-1, Math.round((i+1)/2));
+//			double px = flat(-momentum.x(), momentum.x());
+//			double py = flat(-momentum.y(), momentum.y());
+//			double pz = flat(-momentum.z(), momentum.z());
+//			SpacePoint p = new CartesianPoint(px, py, pz);
+//			momentum = subtract(momentum, p);
+//			Track t = fac.getMCTrack(p, pos, c);
+//			particle.addTrack(t);
+//		}
+//        int c = (int)Math.pow(-1, Math.round((nTracks+1)/2));
+//		particle.addTrack(fac.getMCTrack(momentum, pos, c));
 		return particle;
 	}
 }

lcsim/src/org/lcsim/contrib/JanStrube/vtxFitter
vertexing.lyx 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- vertexing.lyx	15 Jul 2006 09:12:47 -0000	1.1
+++ vertexing.lyx	18 Jul 2006 03:26:53 -0000	1.2
@@ -79,7 +79,7 @@
 \end_inset
 
 is then calculated.
- The track parameters are computed by the following equations:
+ The track parameters are computed with the following equations:
 \end_layout
 
 \begin_layout Standard
@@ -264,5 +264,55 @@
  the components of space and momentum can be written as follows:
 \end_layout
 
+\begin_layout Section
+Design and Rationale
+\end_layout
+
+\begin_layout Standard
+The Track class represents the measurement of the track of a charged particle
+ in a magnetic field.
+ Being a measurement, it contains the measured valued with an error.
+ Nothing more, nothing less.
+\end_layout
+
+\begin_layout Standard
+Because of the choice of measurement parameters in org.lcsim, track objects
+ are ignorant of the field that surrounds them.
+ Furthermore, they are ignorant of all detector-related information in general.
+ Because of these qualities, transport of the track parameters to different
+ points has to be performed by classes that can take into account this informati
+on, so-called 
+\begin_inset Quotes eld
+\end_inset
+
+Swimmers
+\begin_inset Quotes erd
+\end_inset
+
+.
+ Different swimmers can employ various levels of sophistication upon calculating
+ track parameters at different points in the detector, taking account, e.g.,
+ variations in the magnetic field and multiple scattering of the particle
+ during its traversal of the detector.
+\end_layout
+
+\begin_layout Standard
+Tracks that are generated using a Fast Monte Carlo technique are created
+ by a factory class which itself is instantiated with the current EventHeader
+ object, from which it reads the necessary data about the detector.
+ The factory class can then return arbitrary Tracks with a given point on
+ the track and the momentum vector at that point.
+ The track parameters are then calculated wrt.
+ a reference point by first creating a helix with the given parameters and
+ then swimming the helix to the point of closest approach to the reference
+ point.
+ Following this procedure the track parameters are calculated with the formulae
+ given above.
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
 \end_body
 \end_document

lcsim/src/org/lcsim/contrib/JanStrube/vtxFitter
VertexTrackTest.java removed after 1.4
diff -N VertexTrackTest.java
--- VertexTrackTest.java	13 Jul 2006 10:53:59 -0000	1.4
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,81 +0,0 @@
-package org.lcsim.contrib.JanStrube.vtxFitter;
-
-import hep.physics.vec.Hep3Vector;
-
-import org.lcsim.event.Track;
-import org.lcsim.mc.fast.tracking.MCFastTrackFactory;
-import org.lcsim.recon.vertexing.zvtop4.VectorArithmetic;
-import org.lcsim.spacegeom.CartesianPoint;
-import org.lcsim.spacegeom.SpacePoint;
-import org.lcsim.util.swim.Helix;
-import org.lcsim.util.swim.HelixSwimmer;
-import org.lcsim.util.swim.HelixSwimmer.SpatialParameters;
-
-import junit.framework.TestCase;
-
-public class VertexTrackTest extends TestCase {
-
-	HelixSwimmer helix;
-	MCFastTrackFactory tf;
-	VertexTrack vtxTrack;
-    SpacePoint momentum;
-    SpacePoint location;
-    int charge;
-	protected void setUp() throws Exception {
-		super.setUp();
-		helix = new HelixSwimmer(5);
-		tf = new MCFastTrackFactory();
-		momentum = new CartesianPoint(0.7, 0.01, 0.2);
-		location = new CartesianPoint(1, 2, 3);
-		charge = 1;
-		Track t = tf.getMCTrack(momentum, location, charge);
-		helix.setTrack(t);
-		vtxTrack = new VertexTrack(t);
-
-	}
-
-	protected void tearDown() throws Exception {
-		super.tearDown();
-	}
-
-	public void testGetPointAtLength() {
-		Hep3Vector p1 = helix.getPointAtDistance(0);
-		double[] p2 = vtxTrack.getPointAtLength(0);
-        System.out.println("Position comparison");
-        System.out.println(p1);
-        System.out.printf("%f\t%f\t%f\n", p2[0], p2[1], p2[2]);
-		assertEquals(p1.x(), p2[0], 1e-10);
-		assertEquals(p1.y(), p2[1], 1e-10);
-		assertEquals(p1.z(), p2[2], 1e-10);
-	}
-
-	public void testGetMomentumAtLength() {
-        SpatialParameters mom1 = helix.getSpatialParameters();
-        double[] mom2 = vtxTrack.getMomentumAtLength(0);
-        System.out.println(mom1);
-        System.out.printf("x: %f\ty: %f\tz: %f\n", mom2[0], mom2[1], mom2[2]);
-        assertEquals(mom1.px, mom2[0], 1e-10);
-		assertEquals(mom1.py, mom2[1], 1e-10);
-		assertEquals(mom1.pz, mom2[2], 1e-10);
-        Helix hlx = (Helix) helix.getTrajectory();
-        Hep3Vector mom3 = hlx.getTangentAtDistance(0);
-        System.out.println(mom3);
-	}
-    
-    public void testGetMeasurementVector() {
-        double[] vec = VertexTrack.getMeasurementVector(location.getCartesianArray(), momentum.getCartesianArray(), charge);
-        double[] ref = vtxTrack.getReferencePoint();
-        System.out.printf("%f\t%f\t%f\n", ref[0], ref[1], ref[2]);
-        SpacePoint loc2 = VectorArithmetic.subtract(location, new CartesianPoint(vtxTrack.getReferencePoint()));
-        double[] trackParams = vtxTrack.getTrackParameters();
-        double[] vec2 = VertexTrack.getMeasurementVector(loc2.getCartesianArray(), momentum.getCartesianArray(), charge);
-        System.out.printf("Vec:    %f\t%f\t%f\t%f\t%f\n", vec[0], vec[1], vec[2], vec[3], vec[4]);
-        System.out.printf("Vec2:    %f\t%f\t%f\t%f\t%f\n", vec2[0], vec2[1], vec2[2], vec2[3], vec2[4]);
-        System.out.printf("Params: %f\t%f\t%f\t%f\t%f\n", trackParams[0], trackParams[1], trackParams[2], trackParams[3], trackParams[4]);
-        assertEquals(vec[0], trackParams[0]);
-        assertEquals(vec[1], trackParams[1]);
-        assertEquals(vec[2], trackParams[2]);
-        assertEquals(vec[3], trackParams[3]);
-        assertEquals(vec[4], trackParams[4]);
-    }
-}

lcsim/src/org/lcsim/recon/vertexing/zvtop4
VectorArithmetic.java 1.11 -> 1.12
diff -u -r1.11 -r1.12
--- VectorArithmetic.java	28 Jun 2006 07:06:53 -0000	1.11
+++ VectorArithmetic.java	18 Jul 2006 03:26:54 -0000	1.12
@@ -12,7 +12,7 @@
 /**
  * Class to perform basic vector arithmetic on Hep3Vectors
  * @author jstrube
- * @version $Id: VectorArithmetic.java,v 1.11 2006/06/28 07:06:53 jstrube Exp $
+ * @version $Id: VectorArithmetic.java,v 1.12 2006/07/18 03:26:54 jstrube Exp $
  */
 final public class VectorArithmetic {
 
@@ -50,18 +50,7 @@
      * @param a scalar factor
      * @return a new Hep3Vector object
      */
-    public static Hep3Vector multiply(Hep3Vector vec, double a) {
-        return new BasicHep3Vector(vec.x() * a, vec.y() * a, vec.z() * a);
-    }
-
-    /**
-     * Multiplies the vector with a scalar
-     * @param vec vector object
-     * @param a scalar factor
-     * @return a new Hep3Vector object
-     */
-    @Deprecated public static SpacePoint multiply(SpacePoint vec, double a) {
-        // why would I want to normalize a position ?
+    public static SpacePoint multiply(Hep3Vector vec, double a) {
         return new CartesianPoint(vec.x() * a, vec.y() * a, vec.z() * a);
     }
 
CVSspam 0.2.8