Commit in hps-java/src/main/java/org/lcsim/hps/recon/tracking on MAIN | |||
TrackUtils.java | +31 | -1 | 1.2 -> 1.3 |
Added methods to calc. phi at any position and for cosTheta and sinTheta
diff -u -r1.2 -r1.3 --- TrackUtils.java 29 May 2012 17:37:27 -0000 1.2 +++ TrackUtils.java 31 May 2012 06:59:47 -0000 1.3 @@ -10,7 +10,8 @@
/** * * @author Omar Moreno <[log in to unmask]>
- * @version $Id: TrackUtils.java,v 1.2 2012/05/29 17:37:27 omoreno Exp $
+ * @version $Id: TrackUtils.java,v 1.3 2012/05/31 06:59:47 omoreno Exp $ + * TODO: Switch to JLab coordinates
*/ public class TrackUtils {
@@ -192,4 +193,33 @@
return new BasicHep3Vector(x, y, z); }
+ + /** + * + */ + public double getPhi(Hep3Vector position){ + + // Check if a track has been set + if(track == null) throw new RuntimeException("Track has not been set!"); + + double x = Math.sin(this.getPhi0() - (1/this.getR())*(position.x() - this.getX0())); + double y = Math.cos(this.getPhi0() + (1/this.getR())*(position.y() - this.getY0())); + + return Math.atan2(x, y); + } + + /** + * + */ + public double getSinTheta(){ + return 1/Math.sqrt(1 + Math.pow(this.getTanLambda(), 2)); + } + + /** + * + */ + public double getCosTheta(){ + return this.getTanLambda()/Math.sqrt(1 + Math.pow(this.getTanLambda(), 2)); + } +
}
Use REPLY-ALL to reply to list
To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1