Print

Print


Commit in GeomConverter/src/org/lcsim/geometry/compact/converter/lcdd/util on MAIN
Trap.java+8-71.1 -> 1.2
Trapezoid.java+12-101.3 -> 1.4
+20-17
2 modified files
JM: handle discrepancy between gdml and geant4 shape parameters for trd and trap

GeomConverter/src/org/lcsim/geometry/compact/converter/lcdd/util
Trap.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- Trap.java	25 Oct 2007 20:06:22 -0000	1.1
+++ Trap.java	29 Oct 2007 21:10:54 -0000	1.2
@@ -2,6 +2,7 @@
 
 public class Trap extends Solid
 {
+    // FIXME: Hard-coded multiplication by 2 to match GDML convention of dividing inputs by 2.
     public Trap(
             String name, 
             double z, 
@@ -21,16 +22,16 @@
         setAttribute("aunit","radian");
         setAttribute("lunit","mm");
         
-        setAttribute("z",String.valueOf(z));
+        setAttribute("z",String.valueOf(z*2));
         setAttribute("theta",String.valueOf(theta));
         setAttribute("phi",String.valueOf(phi));
-        setAttribute("y1",String.valueOf(y1));
-        setAttribute("x1",String.valueOf(x1));
-        setAttribute("x2",String.valueOf(x2));
+        setAttribute("y1",String.valueOf(y1*2));
+        setAttribute("x1",String.valueOf(x1*2));
+        setAttribute("x2",String.valueOf(x2*2));
         setAttribute("alpha1",String.valueOf(alpha1));
-        setAttribute("y2",String.valueOf(x3));
-        setAttribute("x3",String.valueOf(x3));
-        setAttribute("x4",String.valueOf(x4));
+        setAttribute("y2",String.valueOf(y2*2));
+        setAttribute("x3",String.valueOf(x3*2));
+        setAttribute("x4",String.valueOf(x4*2));
         setAttribute("alpha2",String.valueOf(alpha2));
     }  
 }
\ No newline at end of file

GeomConverter/src/org/lcsim/geometry/compact/converter/lcdd/util
Trapezoid.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- Trapezoid.java	25 Oct 2007 20:06:01 -0000	1.3
+++ Trapezoid.java	29 Oct 2007 21:10:54 -0000	1.4
@@ -22,51 +22,53 @@
 
     public double x1()
     {
-        return getDim("x1");
+        return getDim("x1")/2;
     }
 
     public double x2()
     {
-        return getDim("x2");
+        return getDim("x2")/2;
     }
 
     public double y1()
     {
-        return getDim("y1");
+        return getDim("y1")/2;
     }
 
     public double y2()
     {
-        return getDim("y2");
+        return getDim("y2")/2;
     }
 
     public double z()
     {
-        return getDim("z");
+        return getDim("z")/2;
     }
 
+    // FIXME: Input is multiplied by 2 to conform to GDML "convention" of using full side lengths rather than
+    //        half, which is the Geant4 standard.
     public void setX1(double x1)
     {
-        setAttribute("x1",String.valueOf(x1));
+        setAttribute("x1",String.valueOf(x1*2));
     }
 
     public void setX2(double x2)
     {
-        setAttribute("x2", String.valueOf(x2));
+        setAttribute("x2", String.valueOf(x2*2));
     }
 
     public void setY1(double y1)
     {
-        setAttribute("y1", String.valueOf(y1));
+        setAttribute("y1", String.valueOf(y1*2));
     }
 
     public void setY2(double y2)
     {
-        setAttribute("y2", String.valueOf(y2));
+        setAttribute("y2", String.valueOf(y2*2));
     }
 
     public void setZ(double z)
     {
-        setAttribute("z",String.valueOf(z));
+        setAttribute("z",String.valueOf(z*2));
     }
 }
\ No newline at end of file
CVSspam 0.2.8