Print

Print


Commit in GeomConverter/src/org/lcsim/geometry/segmentation on MAIN
ProjectiveCylinder.java+4-81.20 -> 1.21
GL: Some fixes to findCellContainingXYZ

GeomConverter/src/org/lcsim/geometry/segmentation
ProjectiveCylinder.java 1.20 -> 1.21
diff -u -r1.20 -r1.21
--- ProjectiveCylinder.java	7 Dec 2005 10:39:37 -0000	1.20
+++ ProjectiveCylinder.java	12 Dec 2005 04:44:24 -0000	1.21
@@ -135,18 +135,14 @@
 
 	double phi = Math.atan2( y, x );
 	if(phi<0) phi += 2*Math.PI;
-	int iphi = (int)( phi / phiBins );
+	int iphi = (int)( phi * phiBins / (2*Math.PI) );
 
 	double theta = Math.atan2( rho, z );
-	if(theta<0) {
-	    // If never prints out, the whole if can be dropped
-	    System.out.println("ProjCylinder: Is this really needed?!?");
-	    theta += 2.*Math.PI;
-	}
-	int itheta = (int)(theta/thetaBins);
+	int itheta = (int)(theta*thetaBins/Math.PI);
 
 	IDEncoder enc = new IDEncoder(descriptor);
-	enc.setValue("layer",ilay);
+	enc.setValues(values);
+	enc.setValue(layerIndex,ilay);
 	enc.setValue(thetaIndex,itheta);
 	enc.setValue(phiIndex,iphi);
 	long resultID = enc.getID();
CVSspam 0.2.8