Print

Print


Commit in lcsim/sandbox/RobKutschke/TRFTests/v1 on MAIN
VTUtil.java+24-31.1 -> 1.2
Add Support for tracks defined at ZPlanes.  Hack for direction.

lcsim/sandbox/RobKutschke/TRFTests/v1
VTUtil.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- VTUtil.java	18 Sep 2007 17:54:53 -0000	1.1
+++ VTUtil.java	21 Sep 2007 16:38:03 -0000	1.2
@@ -12,9 +12,9 @@
  * Still under construction.
  *
  *@author $Author: kutschke $
- *@version $Id: VTUtil.java,v 1.1 2007/09/18 17:54:53 kutschke Exp $
+ *@version $Id: VTUtil.java,v 1.2 2007/09/21 16:38:03 kutschke Exp $
  *
- * Date $Date: 2007/09/18 17:54:53 $
+ * Date $Date: 2007/09/21 16:38:03 $
  *
  */
 
@@ -27,7 +27,10 @@
 
 	if ( s.pureType().equals( SurfCylinder.staticType()) ){
 	    DoCylinder();
-	} else{
+	} else if ( s.pureType().equals( SurfZPlane.staticType()) ){
+	    DoZPlane();
+	}
+	else{
 	    DoNull();
 	}
     }
@@ -77,5 +80,23 @@
 	phi   = 0.;
     }
 
+    private void DoZPlane(){
+	double xpr = v.vector(SurfZPlane.IDXDZ);
+	double ypr = v.vector(SurfZPlane.IDYDZ);
+
+	costh = 1./Math.sqrt( 1. + xpr*xpr + ypr*ypr);
+	SurfZPlane sz = (SurfZPlane) v.surface();
+
+	// This is a hack and needs to be done more generally.
+	if ( sz.z() <  0) costh = -costh;
+
+	sinth = Math.sqrt( 1. - costh*costh);
+	cotth = costh/sinth;
+	p     = Math.abs(1./v.vector(SurfZPlane.IQP));
+	pt    = p*sinth;
+	phi   = Math.atan2( ypr, xpr );
+
+    }
+
 
 }
CVSspam 0.2.8