Print

Print


Commit in lcsim/src/org/lcsim/contrib/JanStrube on MAIN
tracking/NewTrackTest.java+70added 1.1
        /Constants.java+12added 1.1
        /NewTrack.java+5-31.1 -> 1.2
        /EMap.java+18-31.1 -> 1.2
        /Track.java+2-21.1 -> 1.2
        /HelixSwimmer.java+21-161.1 -> 1.2
        /NewFastMCTrackFactory.java+76-391.1 -> 1.2
vtxFitter/helixDef.png[binary]added 1.1
         /vertexing.lyx+268added 1.1
         /helixDef.svg+313added 1.1
+785-63
5 added + 5 modified, total 10 files
Track parameter based on the LCSIM document are now established and documented. Transformations between track parameters and space and momentum components were derived and written down.

lcsim/src/org/lcsim/contrib/JanStrube/tracking
NewTrackTest.java added at 1.1
diff -N NewTrackTest.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ NewTrackTest.java	15 Jul 2006 09:12:45 -0000	1.1
@@ -0,0 +1,70 @@
+/**
+ * @version $Id: NewTrackTest.java,v 1.1 2006/07/15 09:12:45 jstrube Exp $
+ */
+package org.lcsim.contrib.JanStrube.tracking;
+
+import junit.framework.TestCase;
+
+/**
+ * @author jstrube
+ *
+ */
+public class NewTrackTest extends TestCase {
+
+    /* (non-Javadoc)
+     * @see junit.framework.TestCase#setUp()
+     */
+    protected void setUp() throws Exception {
+        super.setUp();
+    }
+
+    /* (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() {
+        fail("Not yet implemented");
+    }
+
+    /**
+     * Test method for {@link org.lcsim.contrib.JanStrube.tracking.NewTrack#getParameter(org.lcsim.contrib.JanStrube.tracking.Track.ParameterName)}.
+     */
+    public void testGetParameter() {
+        fail("Not yet implemented");
+    }
+
+    /**
+     * Test method for {@link org.lcsim.contrib.JanStrube.tracking.NewTrack#getPt()}.
+     */
+    public void testGetPt() {
+        fail("Not yet implemented");
+    }
+
+    /**
+     * Test method for {@link org.lcsim.contrib.JanStrube.tracking.NewTrack#getCharge()}.
+     */
+    public void testGetCharge() {
+        fail("Not yet implemented");
+    }
+
+    /**
+     * Test method for {@link org.lcsim.contrib.JanStrube.tracking.NewTrack#getReferencePoint()}.
+     */
+    public void testGetReferencePoint() {
+        fail("Not yet implemented");
+    }
+
+    /**
+     * Test method for {@link org.lcsim.contrib.JanStrube.tracking.NewTrack#getErrorMatrix()}.
+     */
+    public void testGetErrorMatrix() {
+        fail("Not yet implemented");
+    }
+
+}

lcsim/src/org/lcsim/contrib/JanStrube/tracking
Constants.java added at 1.1
diff -N Constants.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Constants.java	15 Jul 2006 09:12:45 -0000	1.1
@@ -0,0 +1,12 @@
+/**
+ * @version $Id: Constants.java,v 1.1 2006/07/15 09:12:45 jstrube Exp $
+ */
+package org.lcsim.contrib.JanStrube.tracking;
+
+/**
+ * @author jstrube
+ *
+ */
+public final class Constants {
+    public static final double fieldConversion = 3335.641;
+}

lcsim/src/org/lcsim/contrib/JanStrube/tracking
NewTrack.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- NewTrack.java	13 Jul 2006 10:53:58 -0000	1.1
+++ NewTrack.java	15 Jul 2006 09:12:45 -0000	1.2
@@ -1,5 +1,5 @@
 /**
- * @version $Id: NewTrack.java,v 1.1 2006/07/13 10:53:58 jstrube Exp $
+ * @version $Id: NewTrack.java,v 1.2 2006/07/15 09:12:45 jstrube Exp $
  */
 package org.lcsim.contrib.JanStrube.tracking;
 
@@ -9,7 +9,9 @@
 
 /**
  * @author jstrube
- *
+ * The class to store the measurement information of the track of a charged particle in a magnetic field.
+ * This class represents the FastMC simulation.
+ * An invariant of this class is that the "origin" is the point of closest approach to the reference point.
  */
 public class NewTrack implements Track {
     private EMap _parameters;
@@ -38,7 +40,7 @@
      * @see org.lcsim.contrib.JanStrube.tracking.Track#getPt()
      */
     public double getPt() {
-        return _parameters.get(ParameterName.pt);
+        return _parameters.pt;
     }
     /* (non-Javadoc)
      * @see org.lcsim.contrib.JanStrube.tracking.Track#getCharge()

lcsim/src/org/lcsim/contrib/JanStrube/tracking
EMap.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- EMap.java	13 Jul 2006 10:53:58 -0000	1.1
+++ EMap.java	15 Jul 2006 09:12:45 -0000	1.2
@@ -1,14 +1,20 @@
 /**
- * @version $Id: EMap.java,v 1.1 2006/07/13 10:53:58 jstrube Exp $
+ * @version $Id: EMap.java,v 1.2 2006/07/15 09:12:45 jstrube Exp $
  */
 package org.lcsim.contrib.JanStrube.tracking;
 
 import org.lcsim.contrib.JanStrube.tracking.Track.ParameterName;
 
 public class EMap {
-    public double[] values;
+    double[] values;
+    double pt;
     EMap() {
-        values = new double[6];
+        values = new double[5];
+        pt = 0;
+    }
+    EMap(double[] vals, double p_t) {
+        values = vals;
+        pt = p_t;
     }
     double get(ParameterName name) {
         return values[name.ordinal()];
@@ -16,4 +22,13 @@
     void set(ParameterName name, double val) {
         values[name.ordinal()] = val;
     }
+    void setPt(double p_t) {
+        pt = p_t;
+    }
+    double[] getValues() {
+        return values;
+    }
+    double getPt() {
+        return pt;
+    }
 }
\ No newline at end of file

lcsim/src/org/lcsim/contrib/JanStrube/tracking
Track.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- Track.java	13 Jul 2006 10:53:58 -0000	1.1
+++ Track.java	15 Jul 2006 09:12:45 -0000	1.2
@@ -1,5 +1,5 @@
 /**
- * @version $Id: Track.java,v 1.1 2006/07/13 10:53:58 jstrube Exp $
+ * @version $Id: Track.java,v 1.2 2006/07/15 09:12:45 jstrube Exp $
  */
 package org.lcsim.contrib.JanStrube.tracking;
 
@@ -14,7 +14,7 @@
 public interface Track {
 
     enum ParameterName {
-        d0, phi0, omega, z0, tanLambda, pt 
+        d0, phi0, omega, z0, tanLambda
     }
 
     /**

lcsim/src/org/lcsim/contrib/JanStrube/tracking
HelixSwimmer.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- HelixSwimmer.java	13 Jul 2006 10:53:58 -0000	1.1
+++ HelixSwimmer.java	15 Jul 2006 09:12:45 -0000	1.2
@@ -1,6 +1,5 @@
 package org.lcsim.contrib.JanStrube.tracking;
 
-import org.lcsim.event.Track;
 import org.lcsim.spacegeom.CartesianPoint;
 import org.lcsim.spacegeom.SpacePoint;
 import org.lcsim.util.swim.Helix;
@@ -12,13 +11,12 @@
 import static java.lang.Math.cos;
 import static java.lang.Math.sqrt;
 import static java.lang.Math.signum;
-import static org.lcsim.constants.Constants.fieldConversion;
+import static org.lcsim.contrib.JanStrube.tracking.Constants.fieldConversion;
 import static org.lcsim.contrib.JanStrube.tracking.Track.ParameterName.d0;
 import static org.lcsim.contrib.JanStrube.tracking.Track.ParameterName.phi0;
 import static org.lcsim.contrib.JanStrube.tracking.Track.ParameterName.omega;
 import static org.lcsim.contrib.JanStrube.tracking.Track.ParameterName.z0;
 import static org.lcsim.contrib.JanStrube.tracking.Track.ParameterName.tanLambda;
-import static org.lcsim.contrib.JanStrube.tracking.Track.ParameterName.pt;
 
 /**
  * A simple helix smimmer for use in org.lcsim. Uses standard lcsim units
@@ -26,8 +24,8 @@
  * <p> 
  * For more info on swimming see <a href="doc-files/transport.pdf">this paper</a>
  * by Paul Avery.
- * @author tonyj
- * @version $Id: HelixSwimmer.java,v 1.1 2006/07/13 10:53:58 jstrube Exp $
+ * @author jstrube
+ * @version $Id: HelixSwimmer.java,v 1.2 2006/07/15 09:12:45 jstrube Exp $
  */
 public class HelixSwimmer
 {
@@ -66,16 +64,13 @@
     */
    public void setTrack(SpacePoint p, SpacePoint r0, int iq)
    {
-      double temp = p.x()*p.x()+p.y()*p.y();
-      double pmom = Math.sqrt(temp + p.z()*p.z());
-      double sin_lambda = p.z()/pmom;
+      double tan_lambda = p.z()/p.rxy();
       double phi = Math.atan2(p.y(),p.x());
-      double lambda = Math.asin(sin_lambda);
+      double lambda = Math.atan(tan_lambda);
       
       if (iq != 0 && field != 0)
       {
-         double p_t = Math.sqrt(temp);
-         double radius = p_t/(iq*field);
+         double radius = p.rxy()/(iq*field);
          trajectory = new Helix(r0,radius,phi,lambda);
       }
       else
@@ -85,27 +80,35 @@
       spatialParms.isInvalid = true;
    }
    
-   public void setTrack(org.lcsim.contrib.JanStrube.tracking.Track t)
+   public void setTrack(Track t)
    {
       double o = t.getParameter(omega);
       double p = t.getParameter(phi0);
       double lambda = Math.atan(t.getParameter(tanLambda));
-      
-      // origin of the circle that is the x-y projection of the helix
-      trajectory = new Helix(origin,1/o,p,lambda);
+
+      SpacePoint ref = t.getReferencePoint();
+      double x = ref.x() - t.getParameter(d0)*sin(t.getParameter(phi0));
+      double y = ref.y() + t.getParameter(d0)*cos(t.getParameter(phi0));
+      double z = ref.z() + t.getParameter(z0);
+      SpacePoint origin = new CartesianPoint(x, y, z);
+      trajectory = new Helix(origin, 1/o, p, lambda);
       spatialParms.isInvalid = true;
       track=t;
    }
+   
    public SpacePoint getPointAtDistance(double alpha)
    {
-      if (trajectory == null) throw new RuntimeException("Trajectory not set");
+      if (trajectory == null)
+          throw new RuntimeException("Trajectory not set");
       return trajectory.getPointAtDistance(alpha);
    }
+   
    public double getDistanceToRadius(double r)
    {
       if (trajectory == null) throw new RuntimeException("Trajectory not set");
       return trajectory.getDistanceToInfiniteCylinder(r);
    }
+   
    public double getDistanceToZ(double z)
    {
       if (trajectory == null) throw new RuntimeException("Trajectory not set");
@@ -113,6 +116,7 @@
       if (result<0) result = trajectory.getDistanceToZPlane(-z);
       return result;
    }
+   
    public double getDistanceToCylinder(double r,double z)
    {
       double x1 = getDistanceToRadius(r);
@@ -145,6 +149,7 @@
        double pz = p_t*t;
        return new CartesianPoint(px, py, pz);
    }
+   
    public Trajectory getTrajectory() {
        return trajectory;
    }

lcsim/src/org/lcsim/contrib/JanStrube/tracking
NewFastMCTrackFactory.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- NewFastMCTrackFactory.java	13 Jul 2006 10:53:58 -0000	1.1
+++ NewFastMCTrackFactory.java	15 Jul 2006 09:12:45 -0000	1.2
@@ -1,43 +1,58 @@
 /**
- * @version $Id: NewFastMCTrackFactory.java,v 1.1 2006/07/13 10:53:58 jstrube Exp $
+ * @version $Id: NewFastMCTrackFactory.java,v 1.2 2006/07/15 09:12:45 jstrube Exp $
  */
 package org.lcsim.contrib.JanStrube.tracking;
 
+import static java.lang.Math.PI;
+import static java.lang.Math.abs;
+import static java.lang.Math.atan2;
+import static java.lang.Math.cos;
+import static java.lang.Math.sin;
+import static java.lang.Math.sqrt;
+import static org.lcsim.contrib.JanStrube.tracking.Track.ParameterName.d0;
+import static org.lcsim.contrib.JanStrube.tracking.Track.ParameterName.omega;
+import static org.lcsim.contrib.JanStrube.tracking.Track.ParameterName.phi0;
+import static org.lcsim.contrib.JanStrube.tracking.Track.ParameterName.tanLambda;
+import static org.lcsim.contrib.JanStrube.tracking.Track.ParameterName.z0;
+import static org.lcsim.contrib.JanStrube.tracking.Constants.fieldConversion;
+
 import java.io.IOException;
 import java.util.Random;
 
 import org.lcsim.conditions.ConditionsManager;
 import org.lcsim.conditions.ConditionsSet;
+import org.lcsim.event.EventHeader;
 import org.lcsim.geometry.Detector;
 import org.lcsim.mc.fast.tracking.ResolutionTable;
 import org.lcsim.mc.fast.tracking.SimpleTables;
 import org.lcsim.mc.fast.tracking.TrackResolutionTables;
 import org.lcsim.spacegeom.SpacePoint;
 
+import Jama.EigenvalueDecomposition;
 import Jama.Matrix;
-import static java.lang.Math.abs;
-import static org.lcsim.contrib.JanStrube.tracking.Track.ParameterName.d0;
-import static org.lcsim.contrib.JanStrube.tracking.Track.ParameterName.phi0;
-import static org.lcsim.contrib.JanStrube.tracking.Track.ParameterName.omega;
-import static org.lcsim.contrib.JanStrube.tracking.Track.ParameterName.z0;
-import static org.lcsim.contrib.JanStrube.tracking.Track.ParameterName.tanLambda;
-import static org.lcsim.contrib.JanStrube.tracking.Track.ParameterName.pt;
 
 /**
  * @author jstrube
+ * This class creates a new FastMC Track. It is used as the interface between the track measurement and the detector.
+ * Since Track doesn't know anything about the magnetic field, and the material, it cannot transport its own parameters.
+ * Changing the reference point of a track requires swimming; it is therefore done in this class.
  * 
  */
 public class NewFastMCTrackFactory {
     private TrackResolutionTables _tables;
     private SimpleTables _simpleTables;
     private ConditionsManager _manager;
-    private final static double Bz = 5.;
+    private double _Bz;
     private HelixSwimmer _swimmer;
 
-    public NewFastMCTrackFactory(String detector, boolean beamConstraint) {
+    public NewFastMCTrackFactory(EventHeader event, boolean beamConstraint) {
+        String detectorName = event.getDetectorName();
+        Detector detector = event.getDetector();
+        // We want always the z component of the field at 0, 0, 0
+        _Bz = detector.getFieldMap().getField(new double[3])[2];
         _manager = ConditionsManager.defaultInstance();
         try {
-            _manager.setDetector(detector, 0);
+            _manager.setDetector(detectorName, 0);
         } catch (ConditionsManager.ConditionsNotFoundException e) {
         }
         ConditionsSet trackParameters = _manager.getConditions("TrackParameters");
@@ -47,31 +62,31 @@
             _simpleTables = new SimpleTables(simpleTrack);
         } catch (IOException e) {
         }
-        _swimmer = new HelixSwimmer(Bz);
+        _swimmer = new HelixSwimmer(_Bz);
     }
 
-    public Track getTrack(
-            SpacePoint momentum
-            , SpacePoint location
-            , SpacePoint referencePoint
-            , int charge
-            , Random random) {
+    public Track getTrack(SpacePoint momentum, SpacePoint location, SpacePoint referencePoint, int charge, Random random) {
         _swimmer.setTrack(momentum, location, charge);
         double alpha = _swimmer.getDistanceToPoint(referencePoint);
         SpacePoint poca = _swimmer.getPointAtDistance(alpha);
         SpacePoint momentumAtPoca = _swimmer.getMomentumAtDistance(alpha);
         EMap parameters = new EMap();
-        parameters.set(d0, 0);
-        parameters.set(phi0, 0);
-        parameters.set(omega, 0);
-        parameters.set(tanLambda, 0);
-        parameters.set(z0, 0);
-        parameters.set(pt, 0);
+        parameters.pt = momentumAtPoca.rxy();
+        parameters.set(phi0, atan2(momentumAtPoca.y(), momentumAtPoca.x()));
+        parameters.set(d0, - (poca.x() - referencePoint.x())
+                * sin(parameters.get(phi0))
+                + (poca.y() - referencePoint.y())
+                * cos(parameters.get(phi0)));
+        parameters.set(omega, charge * _Bz * fieldConversion / parameters.pt);
+        parameters.set(tanLambda, momentumAtPoca.z()/parameters.pt);
+        parameters.set(z0, poca.z()-referencePoint.z());
         Matrix errorMatrix = new Matrix(5, 5);
         // this sets the measurement error
         double cosTheta = abs(momentumAtPoca.cosTheta());
         double p_mag = momentumAtPoca.magnitude();
-        ResolutionTable table = cosTheta < _tables.getPolarInner() ? _tables.getBarrelTable() : _tables.getEndcapTable();
+        ResolutionTable table = cosTheta < _tables.getPolarInner()
+            ? _tables.getBarrelTable() 
+            : _tables.getEndcapTable();
         errorMatrix = new Matrix(5, 5);
         for (int i = 0; i < 5; i++ ) {
             for (int j = 0; j <= i; j++ ) {
@@ -82,29 +97,51 @@
                 }
             }
         }
+        smearParameters(parameters, errorMatrix, random);
         return new NewTrack(referencePoint, parameters, errorMatrix, charge);
     }
 
-    Track getTrack(
-            SpacePoint momentum
-            , SpacePoint location
-            , SpacePoint referencePoint
-            , int charge) {
+    private EMap smearParameters(EMap oldParams, Matrix errorMatrix, Random random) {
+        EigenvalueDecomposition eigen = errorMatrix.eig();
+        double[] realEigen = eigen.getRealEigenvalues();
+        double[] imaginaryEigen = eigen.getImagEigenvalues();
+        Matrix eigenValues = eigen.getV();
+        if (eigenValues.det() == 0) {
+            throw new RuntimeException("ErrorMatrix does not have orthogonal basis");
+        }
+        for (int i = 0; i < imaginaryEigen.length; i++ ) {
+            if (imaginaryEigen[i] != 0)
+                throw new RuntimeException("ErrorMatrix has imaginary eigenvalues");
+        }
+        Matrix x = new Matrix(5, 1);
+        for (int i = 0; i < 5; i++ ) {
+            if (realEigen[i] <= 0)
+                throw new RuntimeException("non-positive eigenvalue encountered");
+            x.set(i, 0, sqrt(realEigen[i]) * random.nextGaussian());
+        }
+        Matrix shift = eigenValues.times(x);
+        Matrix params = new Matrix(oldParams.values, 5);
+        // calculate the new parameters
+        double[] parameters = params.plus(shift).getColumnPackedCopy();
+        double pt = oldParams.pt * oldParams.get(omega) / parameters[omega.ordinal()];
+        // adjust the new parameters if necessary
+        if (parameters[phi0.ordinal()] > PI) {
+            parameters[phi0.ordinal()] -= 2 * PI;
+        } else if (parameters[phi0.ordinal()] < -PI) {
+            parameters[phi0.ordinal()] += 2 * PI;
+        }
+        return new EMap(parameters, pt);
+    }
+
+    Track getTrack(SpacePoint momentum, SpacePoint location, SpacePoint referencePoint, int charge) {
         return getTrack(momentum, location, referencePoint, charge, new Random());
     }
 
-    Track getTrack(
-            SpacePoint momentum
-            , SpacePoint location
-            , int charge
-            , Random random) {
+    Track getTrack(SpacePoint momentum, SpacePoint location, int charge, Random random) {
         return getTrack(momentum, location, new SpacePoint(), charge, random);
     }
 
-    Track getTrack(
-            SpacePoint momentum
-            , SpacePoint location
-            , int charge) {
+    Track getTrack(SpacePoint momentum, SpacePoint location, int charge) {
         return getTrack(momentum, location, new SpacePoint(), charge, new Random());
     }
 

lcsim/src/org/lcsim/contrib/JanStrube/vtxFitter
vertexing.lyx added at 1.1
diff -N vertexing.lyx
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ vertexing.lyx	15 Jul 2006 09:12:47 -0000	1.1
@@ -0,0 +1,268 @@
+#LyX 1.4.1 created this file. For more info see http://www.lyx.org/
+\lyxformat 245
+\begin_document
+\begin_header
+\textclass article
+\language english
+\inputencoding auto
+\fontscheme default
+\graphics default
+\paperfontsize default
+\spacing single
+\papersize default
+\use_geometry false
+\use_amsmath 2
+\cite_engine basic
+\use_bibtopic false
+\paperorientation portrait
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\defskip medskip
+\quotes_language english
+\papercolumns 1
+\papersides 2
+\paperpagestyle default
+\tracking_changes false
+\output_changes true
+\end_header
+
+\begin_body
+
+\begin_layout Title
+Vertexing in org.lcsim
+\end_layout
+
+\begin_layout Section
+Track Parametrization at the point of closest approach to a reference point
+\end_layout
+
+\begin_layout Standard
+The track of a charged particle in a magnetic field is uniquely identified
+ by a five-component measurement vector.
+ However, since the track is supposed to represent a charged physical unity,
+ the physical properties of which cannot be restored from only these five
+ parameters, the class that represents the track in the org.lcsim was awarded
+ a parameter 
+\begin_inset Formula $p_{t}$
+\end_inset
+
+ for computational convenience.
+ It should be noted that this parameter is not part of the measurement vector
+ and the covariance matrix is a 
+\begin_inset Formula $5\times5$
+\end_inset
+
+ element symmetric table.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Graphics
+	filename helixDef.png
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+From physical quantities to track parameters
+\end_layout
+
+\begin_layout Standard
+Given an abitrary reference point with respect to which the parameters are
+ defined, and a point in space and a momentum, the track of the particle
+ that has the given momentum at this point can be parameterized by a helix,
+ which is then swum to the point of closest approach to the reference point,
+ and the momentum at this point 
+\begin_inset Formula $P^{0}$
+\end_inset
+
+is then calculated.
+ The track parameters are computed by the following equations:
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{align*}
+pt & =\sqrt{p_{x}^{2}+p_{y}^{2}}\\
+\omega & =aq\frac{B_{z}}{p_{t}}\\
+\phi_{0} & =\text{atan2}(py,px)\\
+\tan(\lambda) & =\frac{p_{z}}{p_{t}}\\
+z_{0} & =P_{z}^{0}-P_{z}^{\text{r}}\\
+d_{0} & =-(P_{x}^{0}-P_{x}^{\text{r}})\sin(\phi_{0})+(P_{y}^{0}-P_{y}^{\text{r}})\cos(\phi_{0})\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+with the unit conversion constant 
+\begin_inset Formula $a=p_{t}/(qB_{z}r)$
+\end_inset
+
+ and therefore 
+\begin_inset Formula $[a]=1$
+\end_inset
+
+, specifically 
+\begin_inset Formula $a=\text{GeV}/(ce\text{ T mm})=3335.641$
+\end_inset
+
+, where 
+\begin_inset Formula $c$
+\end_inset
+
+ is the speed of light, and 
+\begin_inset Formula $e$
+\end_inset
+
+ is the charge of the proton.
+\end_layout
+
+\begin_layout Subsection
+From track parameters to physical quantities
+\end_layout
+
+\begin_layout Standard
+Conversely, the physical quantities position and momentum at the point of
+ closest approach can also be computed given the track parameters:
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{align*}
+p_{t} & =\left|\frac{qaB_{z}}{\omega}\right|\\
+p_{x} & =p_{t}\cos(\phi_{0})\\
+p_{y} & =p_{t}\sin(\phi_{0})\\
+p_{z} & =p_{t}\tan(\lambda)\\
+x & =P_{x}^{\text{r}}-d_{0}\sin(\phi_{0})\\
+y & =P_{y}^{\text{r}}+d_{0}\cos(\phi_{0})\\
+z & =P_{z}^{\text{r}}+z_{0}\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+General parameterization
+\end_layout
+
+\begin_layout Subsection
+From track parameters to space and momentum
+\end_layout
+
+\begin_layout Standard
+Once the reference point and the track parameters have been determined,
+ any point along the track can simply be parametrized by the length along
+ the trajectory 
+\begin_inset Formula $L$
+\end_inset
+
+.
+ We find:
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{align*}
+x & =P_{x}^{\text{r}}+(r-d_{0})\sin(\phi_{0})-r\sin(\phi)\\
+y & =P_{y}^{\text{r}}-(r-d_{0})\cos(\phi_{0})+r\cos(\phi)\\
+z & =P_{z}^{\text{r}}+z_{0}+l\tan(\lambda)\\
+p_{x} & =p_{t}\cos(\phi)\\
+p_{y} & =p_{t}\sin(\phi)\\
+p_{z} & =p_{t}\tan(\lambda)\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+with the tracklength in the x-y plane 
+\begin_inset Formula $l=L\cos(\lambda)=L/\sqrt{1+\tan^{2}(\lambda)}$
+\end_inset
+
+, 
+\begin_inset Formula $\phi=\phi_{0}-\omega l$
+\end_inset
+
+, 
+\begin_inset Formula $r=1/\omega$
+\end_inset
+
+.
+ It is noteworthy that the right-hand side of each equation is expressed
+ exclusively in terms of the track measurements and the tracklength parameter.
+\end_layout
+
+\begin_layout Subsection
+From space and momentum to track parameters
+\end_layout
+
+\begin_layout Standard
+This set of equations can be inverted to give the measurement in terms of
+ physical quantities:
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{align*}
+\tan(\lambda) & =\frac{p_{z}}{p_{t}}\\
+z_{0} & =z-P_{z}^{\text{r}}-l\frac{p_{z}}{p_{t}}\\
+\omega & =\frac{aqB_{z}}{p_{t}}\\
+\phi_{0} & =\text{atan2}(\tilde{p}_{y},\tilde{p}_{x})\\
+d_{0} & =\frac{p_{t}-\tilde{p}_{t}}{aqB_{z}}\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+with the abbreviations 
+\begin_inset Formula $p_{t}=\sqrt{p_{x}^{2}+p_{y}^{2}}$
+\end_inset
+
+, 
+\begin_inset Formula $\tilde{x}=x-P_{x}^{\text{r}}$
+\end_inset
+
+, 
+\begin_inset Formula $\tilde{y}=y-P_{y}^{\text{r}}$
+\end_inset
+
+, 
+\begin_inset Formula $\tilde{p}_{x}=p_{x}-aqB_{z}\tilde{y}$
+\end_inset
+
+, 
+\begin_inset Formula $\tilde{p}_{y}=p_{y}+aqB_{z}\tilde{x}$
+\end_inset
+
+, 
+\begin_inset Formula $\tilde{p}_{t}=\sqrt{\tilde{p}_{x}^{2}+\tilde{p}_{y}^{2}}$
+\end_inset
+
+, 
+\begin_inset Formula $\phi=\text{atan2}(p_{y},p_{x})$
+\end_inset
+
+, 
+\begin_inset Formula $l=(\phi_{0}-\phi)p_{t}/qaB_{z}$
+\end_inset
+
+.
+ 
+\end_layout
+
+\begin_layout Subsection
+Derivatives of the track parameters wrt.
+ space and momentum components
+\end_layout
+
+\begin_layout Standard
+With these conventions established, the derivatives wrt.
+ the components of space and momentum can be written as follows:
+\end_layout
+
+\end_body
+\end_document

lcsim/src/org/lcsim/contrib/JanStrube/vtxFitter
helixDef.svg added at 1.1
diff -N helixDef.svg
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ helixDef.svg	15 Jul 2006 09:12:47 -0000	1.1
@@ -0,0 +1,313 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="612pt"
+   height="792pt"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.43"
+   sodipodi:docbase="/home/jstrube/Workspace/lcsim/src/org/lcsim/contrib/JanStrube/vtxFitter"
+   sodipodi:docname="helixDef.svg"
+   version="1.0"
+   inkscape:export-filename="/home/jstrube/Workspace/lcsim/src/org/lcsim/contrib/JanStrube/vtxFitter/helixDef.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs4" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1.4142136"
+     inkscape:cx="375"
+     inkscape:cy="720.37227"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     showguides="true"
+     inkscape:window-width="1390"
+     inkscape:window-height="971"
+     inkscape:window-x="0"
+     inkscape:window-y="25"
+     inkscape:grid-points="true"
+     inkscape:guide-bbox="true"
+     inkscape:guide-points="true" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <cc:license
+           rdf:resource="http://artlibre.org/licence.php/lalgb.html" />
+      </cc:Work>
+      <cc:License
+         rdf:about="http://artlibre.org/licence.php/lalgb.html">
+        <cc:permits
+           rdf:resource="http://web.resource.org/cc/Reproduction" />
+        <cc:permits
+           rdf:resource="http://web.resource.org/cc/Distribution" />
+        <cc:permits
+           rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
+        <cc:requires
+           rdf:resource="http://web.resource.org/cc/ShareAlike" />
+        <cc:requires
+           rdf:resource="http://web.resource.org/cc/Notice" />
+        <cc:requires
+           rdf:resource="http://web.resource.org/cc/Attribution" />
+      </cc:License>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <path
+       style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:2,2;stroke-dashoffset:0"
+       d="M 139,336 C 178,353 177.4838,353 177.4838,353 L 177.4838,353"
+       id="path7480" />
+    <path
+       sodipodi:type="arc"
+       style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.82930291;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path1307"
+       sodipodi:cx="290"
+       sodipodi:cy="379.50504"
+       sodipodi:rx="110"
+       sodipodi:ry="107.14286"
+       d="M 400 379.50504 A 110 107.14286 0 1 1  180,379.50504 A 110 107.14286 0 1 1  400 379.50504 z"
+       transform="matrix(1.081707,0,0,1.118968,-33.6928,-11.93845)" />
+    <path
+       style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 177,352.36218 C 229,352.36218 229,352.36218 229,352.36218"
+       id="path3065" />
+    <path
+       style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:8, 8;stroke-dashoffset:0;stroke-opacity:1"
+       d="M 177.30475,352.10099 C 214.69525,289.62338 214.69525,289.62338 214.69525,289.62338"
+       id="path3067" />
+    <path
+       sodipodi:type="arc"
+       style="fill:#0000e6;fill-opacity:1;stroke:none;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="path4837"
+       sodipodi:cx="119.50105"
+       sodipodi:cy="346.66962"
+       sodipodi:rx="2.1213202"
+       sodipodi:ry="2.1213202"
+       d="M 121.62237 346.66962 A 2.1213202 2.1213202 0 1 1  117.37973,346.66962 A 2.1213202 2.1213202 0 1 1  121.62237 346.66962 z"
+       transform="matrix(1.885618,0,0,1.885618,-47.74749,-301.3243)" />
+    <path
+       sodipodi:type="arc"
+       style="fill:#0000e6;fill-opacity:1;stroke:none;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="path6589"
+       sodipodi:cx="148.84598"
+       sodipodi:cy="306.01099"
+       sodipodi:rx="3.8890872"
+       sodipodi:ry="3.8890872"
+       d="M 152.73506 306.01099 A 3.8890872 3.8890872 0 1 1  144.95689,306.01099 A 3.8890872 3.8890872 0 1 1  152.73506 306.01099 z"
+       transform="translate(-7.735065,30.46211)" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="132.17383"
+       y="327.11023"
+       id="text7464"><tspan
+         sodipodi:role="line"
+         id="tspan7466"
+         x="132.17383"
+         y="327.11023">P</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="177.17383"
+       y="371.11023"
+       id="text7468"><tspan
+         sodipodi:role="line"
+         id="tspan7470"
+         x="177.17383"
+         y="371.11023">P</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="272.17383"
+       y="431.36218"
+       id="text7472"><tspan
+         sodipodi:role="line"
+         id="tspan7474"
+         x="272.17383"
+         y="431.36218">P</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="367.17383"
+       y="305"
+       id="text7476"><tspan
+         sodipodi:role="line"
+         id="tspan7478"
+         x="367.17383"
+         y="305">P</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="279.09766"
+       y="423.48047"
+       id="text8355"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan8357"
+         x="279.09766"
+         y="423.48047">c</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="184.47266"
+       y="363"
+       id="text8359"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan8361"
+         x="184.47266"
+         y="363">0</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="139.27344"
+       y="316.48047"
+       id="text8363"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan8365"
+         x="139.27344"
+         y="316.48047">r</tspan></text>
+    <path
+       style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.40838194;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:5.63352749, 5.63352749;stroke-dashoffset:0;stroke-opacity:1"
+       d="M 358.07472,322.45517 C 396,353 396,353 396,353"
+       id="path9242" />
+    <path
+       style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 359,324 C 411,324 411,324 411,324"
+       id="path9244" />
+    <path
+       sodipodi:type="arc"
+       style="fill:#f7090b;fill-opacity:1;stroke:none;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="path8367"
+       sodipodi:cx="148.84598"
+       sodipodi:cy="306.01099"
+       sodipodi:rx="3.8890872"
+       sodipodi:ry="3.8890872"
+       d="M 152.73506 306.01099 A 3.8890872 3.8890872 0 1 1  144.95689,306.01099 A 3.8890872 3.8890872 0 1 1  152.73506 306.01099 z"
+       transform="translate(209.154,16.8781)" />
+    <path
+       sodipodi:type="arc"
+       style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:2, 2;stroke-dashoffset:0;stroke-opacity:1"
+       id="path9248"
+       sodipodi:cx="210"
+       sodipodi:cy="338.5"
+       sodipodi:rx="39.935421"
+       sodipodi:ry="39.935421"
+       d="M 245.13585,357.48184 A 39.935421,39.935421 0 0 1 208.6922,378.414 L 210,338.5 z"
+       sodipodi:start="0.49532013"
+       sodipodi:end="1.60355"
+       transform="matrix(0,-0.928762,1.023997,0,-167.623,546.6729)" />
+    <path
+       sodipodi:type="arc"
+       style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:2, 2;stroke-dashoffset:0;stroke-opacity:1"
+       id="path9250"
+       sodipodi:cx="324.5"
+       sodipodi:cy="274.5"
+       sodipodi:rx="37.629944"
+       sodipodi:ry="37.629944"
+       d="M 362.12794,274.88836 A 37.629944,37.629944 0 0 1 353.52973,298.44342 L 324.5,274.5 z"
+       sodipodi:start="0.010320726"
+       sodipodi:end="0.6896748"
+       transform="matrix(1,0,0,0.938489,34.5,66.38467)" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="146.33789"
+       y="355"
+       id="text1330"><tspan
+         sodipodi:role="line"
+         id="tspan1332"
+         x="146.33789"
+         y="355">d</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="155"
+       y="358"
+       id="text1334"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan1336"
+         x="155"
+         y="358">0</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:SF Math Ext"
+       x="192.34375"
+       y="342.11719"
+       id="text1338"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan1342"
+         x="192.34375"
+         y="342.11719">ϕ</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:SF Math Ext"
+       x="380.34375"
+       y="335.11719"
+       id="text1344"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan1346"
+         x="380.34375"
+         y="335.11719">ϕ</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="198.44141"
+       y="346.88672"
+       id="text1348"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan1350"
+         x="198.44141"
+         y="346.88672">0</tspan></text>
+    <path
+       style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 281,293.49984 C 281,409.46535 281,409.46535 281,409.46535"
+       id="path1352" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="285.67114"
+       y="350.06839"
+       id="text1354"><tspan
+         sodipodi:role="line"
+         id="tspan1356"
+         x="285.67114"
+         y="350.06839">R</tspan></text>
+    <path
+       sodipodi:type="arc"
+       style="fill:#13b01a;fill-opacity:1;stroke:none;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="path6587"
+       sodipodi:cx="148.84598"
+       sodipodi:cy="306.01099"
+       sodipodi:rx="3.8890872"
+       sodipodi:ry="3.8890872"
+       d="M 152.73506 306.01099 A 3.8890872 3.8890872 0 1 1  144.95689,306.01099 A 3.8890872 3.8890872 0 1 1  152.73506 306.01099 z"
+       transform="translate(132.2649,104.0999)" />
+  </g>
+</svg>
CVSspam 0.2.8