lcsim/src/org/lcsim/util/swim
diff -u -r1.24 -r1.25
--- Helix.java 27 Oct 2006 17:53:14 -0000 1.24
+++ Helix.java 2 Dec 2006 02:39:02 -0000 1.25
@@ -22,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.24 2006/10/27 17:53:14 jstrube Exp $
+ * @version $Id: Helix.java,v 1.25 2006/12/02 02:39:02 sinev Exp $
*/
public class Helix implements Trajectory
{
@@ -184,6 +184,26 @@
double p0z = pz*cos(rho*alpha) + pz*(1-cos(rho*alpha));
return new BasicHep3Vector(p0x, p0y, p0z);
}
+
+ // added by Nick Sinev
+ public double getSecondDistanceToInfiniteCylinder(double r)
+ {
+ double result = getDistanceToInfiniteCylinder(r);
+ SpacePoint first = getPointAtDistance(result);
+ double angto0 = Math.atan2(-yCenter,-xCenter);
+ double angtofirst = Math.atan2(first.y()-yCenter,first.x()-xCenter);
+ double dang = angtofirst-angto0;
+ if(dang < -Math.PI) dang+= 2.*Math.PI;
+ if(dang > Math.PI) dang-= 2.*Math.PI;
+ double angofarc = 2.*(Math.PI - Math.abs(dang));
+ double arc = Math.abs(radius) * angofarc / cosLambda;
+ return result+arc;
+ }
+
+ public double getZPeriod()
+ {
+ return Math.PI * radius * 2. *sinLambda/cosLambda;
+ }
/**
* Sets the parametereization in terms of "momentum" and charge