Commit in GeomConverter/src/org/lcsim/geometry on MAIN
segmentation/GlobalGridXY.java+22-21.3 -> 1.4
subdetector/PolyhedraEndcapCalorimeter.java+31.13 -> 1.14
           /PolyhedraEndcapCalorimeter2.java+4-11.5 -> 1.6
+29-3
3 modified files
fix problem with global z computation in GlobalGridXY

GeomConverter/src/org/lcsim/geometry/segmentation
GlobalGridXY.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- GlobalGridXY.java	28 Jan 2010 19:46:36 -0000	1.3
+++ GlobalGridXY.java	10 Feb 2010 00:33:34 -0000	1.4
@@ -8,11 +8,13 @@
 
 import org.jdom.DataConversionException;
 import org.jdom.Element;
+import org.lcsim.detector.DetectorStore;
 import org.lcsim.detector.IDetectorElement;
 import org.lcsim.detector.identifier.ExpandedIdentifier;
 import org.lcsim.detector.identifier.IExpandedIdentifier;
 import org.lcsim.detector.identifier.IIdentifier;
 import org.lcsim.detector.identifier.Identifier;
+import org.lcsim.geometry.subdetector.BarrelEndcapFlag;
 import org.lcsim.geometry.util.IDDescriptor;
 
 /**
@@ -108,12 +110,28 @@
         globalPosition[1] = (((double) getValue(yIndex)) + 0.5) * gridSizeY;
     }      
     
+    /**
+     * Compute and cache the global Z of the hit.  This method uses the compact system instead of the new geometry
+     * package, because the PolyhedraEndcap2 does not have a detailed description yet. 
+     */
+    private void computeGlobalZ()    
+    {        
+        globalPosition[2] = getSubdetector().getLayering().getDistanceToLayerSensorMid(getLayer());
+        // Flip sign to negative for south endcap.
+        if (getBarrelEndcapFlag() == BarrelEndcapFlag.ENDCAP_SOUTH)
+        {
+            globalPosition[2] = -globalPosition[2];
+        }        
+    }
+    
+    /*
+    OLD METHOD
     private void computeGlobalZ()
     {
         // Make an id only containing geometric fields and no segmentation fields.
         IExpandedIdentifier geomIdExp = detector.getDetectorElement().getIdentifierHelper().unpack(new Identifier(this.getDecoder().getID()), geomFields);
         IIdentifier geomId = detector.getDetectorElement().getIdentifierHelper().pack(geomIdExp);
-        
+                              
         // Search for the the DetectorElement associated with the geometry id.
         List<IDetectorElement> deSearch = detector.getDetectorElement().findDetectorElement(geomId);
 
@@ -127,7 +145,9 @@
         IDetectorElement sensor = deSearch.get(0);
         
         globalPosition[2] = sensor.getGeometry().getPosition().z();
-    }    
+    } 
+    
+       */
     
 
     public long findCellContainingXYZ(double x, double y, double z) 

GeomConverter/src/org/lcsim/geometry/subdetector
PolyhedraEndcapCalorimeter.java 1.13 -> 1.14
diff -u -r1.13 -r1.14
--- PolyhedraEndcapCalorimeter.java	18 Nov 2009 22:20:15 -0000	1.13
+++ PolyhedraEndcapCalorimeter.java	10 Feb 2010 00:33:34 -0000	1.14
@@ -46,6 +46,9 @@
 
         irad = dimensions.getAttribute("rmin").getDoubleValue();
         orad = dimensions.getAttribute("rmax").getDoubleValue();
+        
+        // Set layering pre-offset.
+        getLayering().setOffset(zmin);
     }
 
     public double getZMin()

GeomConverter/src/org/lcsim/geometry/subdetector
PolyhedraEndcapCalorimeter2.java 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- PolyhedraEndcapCalorimeter2.java	18 Nov 2009 22:20:15 -0000	1.5
+++ PolyhedraEndcapCalorimeter2.java	10 Feb 2010 00:33:34 -0000	1.6
@@ -32,10 +32,13 @@
         Element dimensions = node.getChild("dimensions");
 
         zmin = dimensions.getAttribute("zmin").getDoubleValue();
-        zmax = zmin + thickness;
+        zmax = zmin + thickness;        
 
         irad = dimensions.getAttribute("rmin").getDoubleValue();
         orad = dimensions.getAttribute("rmax").getDoubleValue();
+        
+        // Set layering pre-offset.
+        getLayering().setOffset(zmin);
     }
 
     public double getZMin()
CVSspam 0.2.8