lcsim-contrib/src/main/java/org/lcsim/contrib/onoprien/util/swim
diff -u -r1.5 -r1.6
--- Helix.java 24 Feb 2009 02:59:34 -0000 1.5
+++ Helix.java 26 Feb 2009 19:01:28 -0000 1.6
@@ -9,7 +9,7 @@
* Helical {@link Trajectory} with its axis parallel to Z.
*
* @author D. Onoprienko
- * @version $Id: Helix.java,v 1.5 2009/02/24 02:59:34 onoprien Exp $
+ * @version $Id: Helix.java,v 1.6 2009/02/26 19:01:28 onoprien Exp $
*/
public class Helix extends AbstractTrajectory {
@@ -395,7 +395,15 @@
}
private void repCtoV() {
- throw new UnsupportedOperationException(); // FIXME
+ double d2 = 1./(1.+_tan*_tan);
+ double d = Math.sqrt(d2);
+ double cos = Math.cos(_phi0);
+ double sin = Math.sin(_phi0);
+ _dir = new ConstHep3Vector(d*cos, d*sin, Math.signum(_tan) * Math.sqrt(1.-d2));
+ double x0 = _ref.x() - _d0 * sin;
+ double y0 = _ref.y() + _d0 * cos;
+ _orig = new ConstHep3Vector(x0, y0, _z0);
+ _ro = d * _c;
}
// -- Private parts : ---------------------------------------------------------
@@ -410,7 +418,7 @@
SymmetricMatrix _covW; // covariance matrix in VRep representation
SymmetricMatrix _covC; // covariance matrix in CRep representation
- double _ro; // - sqrt(dx**2+dy**2) * _c
+ double _ro; // sqrt(dx**2+dy**2) * _c
static private final double TWOPI = 2. * Math.PI;
static private final String ERR1 = "Reference point not set";