GeomConverter/src/org/lcsim/geometry/compact/converter/lcdd
diff -u -r1.6 -r1.7
--- AbstractTestBeam.java 12 Sep 2006 01:20:53 -0000 1.6
+++ AbstractTestBeam.java 16 Oct 2008 23:32:45 -0000 1.7
@@ -84,12 +84,12 @@
envelopePosition.setZ(zpos);
define.addPosition(envelopePosition);
- double layerZPos = zdim / 2;
+ double layerZPos = -zdim / 2;
+
+ System.out.println("layerZPos="+layerZPos);
int layerCount = 0;
int layerTypeCount = 0;
- //double maxLayerX = 0;
- //double maxLayerY = 0;
for ( Object lo : node.getChildren("layer") )
{
Element layer = (Element) lo;
@@ -110,6 +110,8 @@
double layerZ = LayerFromCompactCnv.computeSingleLayerThickness(layer);
+ System.out.println("layerZ="+layerZ);
+
int repeat = 1;
Attribute repeatAttrib = layer.getAttribute("repeat");
if ( repeatAttrib != null )
@@ -129,7 +131,8 @@
layerVolume.setSolid(layerBox);
int sliceCount = 0;
- double slicePosZ = layerZ / 2;
+ double slicePosZ = -layerZ / 2;
+ System.out.println("slicePosZ="+slicePosZ);
for ( Object so : layer.getChildren("slice"))
{
Element slice = (Element) so;
@@ -175,9 +178,10 @@
PhysVol slicePhysVol = new PhysVol(sliceVolume);
slicePhysVol.addPhysVolID("slice", sliceCount);
Position slicePosition = new Position(sliceName + "_position");
- slicePosZ -= sliceZ / 2;
+ slicePosZ += sliceZ / 2;
+ System.out.println("slicePosZ="+slicePosZ);
slicePosition.setZ(slicePosZ);
- slicePosZ -= sliceZ / 2;
+ slicePosZ += sliceZ / 2;
define.addPosition(slicePosition);
slicePhysVol.setPosition(slicePosition);
layerVolume.addPhysVol(slicePhysVol);
@@ -195,12 +199,13 @@
PhysVol layerPhysVol = new PhysVol(layerVolume);
layerPhysVol.addPhysVolID("layer", layerCount);
- layerZPos -= layerZ / 2;
+ layerZPos += layerZ / 2;
+ System.out.println("layerZPos="+layerZPos);
Position layerPosition = new Position(layerPhysVolName + "_position");
define.addPosition(layerPosition);
layerPosition.setZ(layerZPos);
layerPhysVol.setPosition(layerPosition);
- layerZPos -= layerZ / 2;
+ layerZPos += layerZ / 2;
envelopeVolume.addPhysVol(layerPhysVol);