Print

Print


Commit in GeomConverter/src/org/lcsim/geometry/segmentation on MAIN
GridXYZ.java+91.3 -> 1.4
ProjectiveCylinder.java+6-31.10 -> 1.11
ProjectiveZPlane.java+51.4 -> 1.5
SegmentationImpl.java+22-551.3 -> 1.4
+42-58
4 modified files
Interface functions made abstract in SegmentationImpl.  Changed getCoordinateSystemType() to not require member var.

GeomConverter/src/org/lcsim/geometry/segmentation
GridXYZ.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- GridXYZ.java	15 Jun 2005 00:23:41 -0000	1.3
+++ GridXYZ.java	23 Jun 2005 19:15:34 -0000	1.4
@@ -59,6 +59,15 @@
         coordinateSystemType = CoordinateSystemType.LOCAL;
     }
     
+    /**
+     * In the simulator, this is actually local because local -> global
+     * is applied depending on cylinder's position.  --JM
+     */
+    public CoordinateSystemType getCoordinateSystemType()
+    {
+        return CoordinateSystemType.LOCAL;
+    }
+    
     public void setGridSizeX(double gsx)
     {
         gridSizeX = gsx;

GeomConverter/src/org/lcsim/geometry/segmentation
ProjectiveCylinder.java 1.10 -> 1.11
diff -u -r1.10 -r1.11
--- ProjectiveCylinder.java	10 Jun 2005 01:11:21 -0000	1.10
+++ ProjectiveCylinder.java	23 Jun 2005 19:15:34 -0000	1.11
@@ -23,11 +23,14 @@
    {
       super(node);
       thetaBins = node.getAttribute("thetaBins").getIntValue();
-      phiBins = node.getAttribute("phiBins").getIntValue();
-      
-      coordinateSystemType = CoordinateSystemType.GLOBAL;
+      phiBins = node.getAttribute("phiBins").getIntValue();            
    }    
    
+   public CoordinateSystemType getCoordinateSystemType()
+   {
+       return CoordinateSystemType.GLOBAL;
+   }
+   
    public double getPhi()
    {
       return Math.PI*2*(getValue(phiIndex)+0.5)/phiBins;

GeomConverter/src/org/lcsim/geometry/segmentation
ProjectiveZPlane.java 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- ProjectiveZPlane.java	2 Jun 2005 02:54:41 -0000	1.4
+++ ProjectiveZPlane.java	23 Jun 2005 19:15:34 -0000	1.5
@@ -29,6 +29,11 @@
       
       coordinateSystemType = CoordinateSystemType.GLOBAL;
    }
+   
+   public CoordinateSystemType getCoordinateSystemType()
+   {
+       return CoordinateSystemType.GLOBAL;
+   }
       
    public double getPhi()
    {

GeomConverter/src/org/lcsim/geometry/segmentation
SegmentationImpl.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- SegmentationImpl.java	11 Jun 2005 01:17:53 -0000	1.3
+++ SegmentationImpl.java	23 Jun 2005 19:15:34 -0000	1.4
@@ -12,7 +12,6 @@
 import org.lcsim.geometry.util.IDDescriptor;
 import org.lcsim.geometry.util.IDEncoder;
 import org.lcsim.geometry.CalorimeterIDDecoder;
-//import org.lcsim.geometry.CylindricalSubdetector;
 import org.lcsim.geometry.compact.LayeredSubdetector;
 import org.jdom.Element;
 
@@ -20,7 +19,7 @@
  * @author jeremym
  * Base implementation
  */
-public class SegmentationImpl 
+public abstract class SegmentationImpl 
        extends org.lcsim.geometry.compact.Segmentation 
        implements CalorimeterIDDecoder
 {   
@@ -33,85 +32,54 @@
     protected CoordinateSystemType coordinateSystemType;
     
     /** 
-     * TODO: Do NOT cache the Subdetector here.
-     *
-     * A subdetector should contain or point to a segmentation,
-     * not vice versa.  Also, forcing a specific subtype
-     * is an ugly hack.
-     */
-    //protected CylindricalSubdetector detector;
+     * FIXME: Caching the Subdetector here seems like an ugly hack.  --JM
+     */    
     protected LayeredSubdetector detector;
     
     SegmentationImpl(Element e)        
     {        
-        super(e);
-        coordinateSystemType = CoordinateSystemType.UNDEFINED;
-    }
-    
-    /** Override. */
-    public double getX()
-    {
-        return 0.;
+        super(e);        
     }
     
-    /** Override. */    
-    public double getY()
+    public CoordinateSystemType getCoordinateSystemType()
     {
-        return 0.;
+        return CoordinateSystemType.UNDEFINED;
     }
     
-    /** Override. */    
-    public double getZ()
-    {
-        return 0.;
-    }
+    abstract public double getX();
+      
+    abstract public double getY();
         
-    /** Override. */
-    public double getTheta()
-    {
-        return 0.;
-    }   
-    
-    /** Override. */
-    public double getPhi()
-    {
-        return 0.;
-    }
-    
-    /** Override. */
-    public long[] getNeighbourIDs(int deltaLayer, int deltaTheta, int deltaPhi)
-    {
-        return new long[] { 0, 1, 0 };
-    }
+    abstract public double getZ();    
+            
+    abstract public double getTheta();
+        
+    abstract public double getPhi();
+        
+    abstract public long[] getNeighbourIDs(int deltaLayer, int deltaTheta, int deltaPhi);            
     
-    /** Override but make sure to call super method. */
+    /** Override but make sure to call this super method. */
     public void setIDDescription(IDDescriptor id)
     {        
         decoder = new IDDecoder(id);
         encoder = new IDEncoder(id);        
         values = new int[id.fieldCount()];
         
-        /** TODO: Doesn't seem to belong here. */
+        /** FIXME: Doesn't seem to belong here. */
         layerIndex = id.indexOf("layer");            
     }
     
     /** 
      * Next set of methods should probably not need to be 
      * overridden but will leave as non-final (for now).
-     */
-    
-    public CoordinateSystemType getCoordinateSystemType()
-    {
-        return coordinateSystemType;
-    }
-                    
+     */                            
     public void setSubdetector(Subdetector det)
     {
       detector = (LayeredSubdetector) det;
     }
     
     /** 
-     * TODO: Should be renamed as it is actually returning the distance to the midpoint of the sensitive layer. 
+     * FIXME: Should be renamed as it is actually returning the distance to the midpoint of the sensitive layer. 
      */
     public double getRadius(int layer)
     {
@@ -147,8 +115,7 @@
     {
        decoder.setID(id);
        decoder.getValues(values);
-    }
-  
+    }  
     
     public double[] getPosition()
     {
@@ -162,7 +129,7 @@
    
     public boolean supportsNeighbours()
     {
-        return true;
+        return false;
     }
         
     public long[] getNeighbourIDs()
CVSspam 0.2.8