Commit in GeomConverter on RefactorBranch
src/org/lcsim/geometry/subdetector/PolyconeSupport.java+90added 1.1.2.1
test/org/lcsim/geometry/compact/CompactReaderTest.java+1-11.3 -> 1.3.2.1
                               /sdjan03_compact.xml+111.12 -> 1.12.2.1
test/org/lcsim/geometry/subdetector/PolyconeSupportTest.java+55added 1.1.2.1
                                   /PolyconeSupportTest.xml+68added 1.1.2.1
+225-1
3 added + 2 modified, total 5 files
added support for accessing a PolyconeSupport object through compact description

GeomConverter/src/org/lcsim/geometry/subdetector
PolyconeSupport.java added at 1.1.2.1
diff -N PolyconeSupport.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ PolyconeSupport.java	31 Oct 2005 19:02:58 -0000	1.1.2.1
@@ -0,0 +1,90 @@
+/*
+ * PolyconeSupport.java
+ *
+ * Created on October 31, 2005, 10:18 AM
+ */
+
+package org.lcsim.geometry.subdetector;
+
+import org.jdom.Element;
+import org.jdom.DataConversionException;
+import org.jdom.JDOMException;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Iterator;
+import org.lcsim.material.Material;
+
+/**
+ *
+ * @author jeremym
+ */
+public class PolyconeSupport extends AbstractSubdetector
+{
+    List<ZPlane> zplanes = new ArrayList<ZPlane>();
+    Material material;
+        
+    public PolyconeSupport(Element node) throws JDOMException
+    {
+        super(node);
+        material = org.lcsim.material.MaterialManager.getMaterial(
+                node.getChild("material").getAttributeValue("name"));
+        for(Iterator i = node.getChildren("zplane").iterator(); i.hasNext(); )
+        {
+            try
+            {
+                Element zplane = (Element) i.next();
+                zplanes.add(
+                        new ZPlane(zplane.getAttribute("rmin").getDoubleValue(),
+                        zplane.getAttribute("rmax").getDoubleValue(),
+                        zplane.getAttribute("z").getDoubleValue()
+                        ));
+            }
+            catch (DataConversionException dce)
+            {
+                throw new RuntimeException("bad values to zplane", dce);
+            }
+        }
+    }
+        
+    List<ZPlane> getZPlanes()
+    {
+        return zplanes;
+    }
+        
+    public int getNumberOfZPlanes()
+    {
+        return zplanes.size();
+    }
+    
+    public ZPlane getZPlane(int idx)
+    {
+        return zplanes.get(idx);
+    }
+    
+    public class ZPlane
+    {
+        double rmin, rmax, z;
+        
+        public ZPlane(double rmin, double rmax, double z)
+        {
+            this.rmin = rmin;
+            this.rmax = rmax;
+            this.z = z;
+        }
+        
+        double getRMin()
+        {
+            return rmin;
+        }
+        
+        double getRMax()
+        {
+            return rmax;
+        }
+        
+        double getZ()
+        {
+            return z;
+        }
+    }
+}
\ No newline at end of file

GeomConverter/test/org/lcsim/geometry/compact
CompactReaderTest.java 1.3 -> 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- CompactReaderTest.java	18 Jul 2005 18:00:07 -0000	1.3
+++ CompactReaderTest.java	31 Oct 2005 19:02:58 -0000	1.3.2.1
@@ -30,6 +30,6 @@
       InputStream in = CompactReaderTest.class.getResourceAsStream("sdjan03_compact.xml");
       CompactReader reader = new CompactReader();
       Detector det = reader.read(in);
-      assertEquals(10,det.getSubdetectors().size());
+      assertEquals(11,det.getSubdetectors().size());
    }
 }
\ No newline at end of file

GeomConverter/test/org/lcsim/geometry/compact
sdjan03_compact.xml 1.12 -> 1.12.2.1
diff -u -r1.12 -r1.12.2.1
--- sdjan03_compact.xml	5 Jul 2005 22:45:12 -0000	1.12
+++ sdjan03_compact.xml	31 Oct 2005 19:02:58 -0000	1.12.2.1
@@ -55,6 +55,17 @@
   </materials>
   
   <detectors>
+  
+      <detector id="0" name="BeamPipe" type="PolyconeSupport" insideTrackingVolume="true">
+          <material name="Beryllium"/>
+          <zplane rmin = "((tracking_region_zmax-6.25)*(8.96-1.2)/(185.-6.25)+1.2)" rmax="((tracking_region_zmax-6.25)*(8.96-1.2)/(185.-6.25)+1.3)" z="-tracking_region_zmax" />
+          <zplane rmin="1.2*cm" rmax="1.3*cm"   z="-6.251*cm"/>
+          <zplane rmin="1.2*cm" rmax="1.240*cm" z="-6.25*cm"/>
+          <zplane rmin="1.2*cm" rmax="1.240*cm" z="6.25*cm" />
+          <zplane rmin="1.2*cm" rmax="1.3*cm" z="6.251*cm" />
+          <zplane rmin = "((tracking_region_zmax-6.25)*(8.96-1.2)/(185.-6.25)+1.2)" rmax="((tracking_region_zmax-6.25)*(8.96-1.2)/(185.-6.25)+1.3)" z="tracking_region_zmax" />
+      </detector>
+        
       <detector id="0" name="BarrelVertex" type="MultiLayerTracker" readout="VtxBarrHits">
           <layer id="1" inner_r = "vertex_inner_r" outer_z = "2.5*cm">
                 <slice material = "Silicon" thickness = "0.01*cm" sensitive = "yes" />

GeomConverter/test/org/lcsim/geometry/subdetector
PolyconeSupportTest.java added at 1.1.2.1
diff -N PolyconeSupportTest.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ PolyconeSupportTest.java	31 Oct 2005 19:02:59 -0000	1.1.2.1
@@ -0,0 +1,55 @@
+package org.lcsim.geometry.subdetector;
+
+import java.io.IOException;
+import junit.framework.*;
+import java.io.InputStream;
+import org.jdom.JDOMException;
+import org.lcsim.util.xml.ElementFactory.ElementCreationException;
+import org.lcsim.geometry.GeometryReader;
+import org.lcsim.geometry.Detector;
+import org.lcsim.geometry.layer.Layering;
+
+/**
+ *
+ * @author jeremym
+ */
+public class PolyconeSupportTest extends TestCase
+{
+   Detector det;
+   public PolyconeSupportTest(String testName)
+   {
+      super(testName);
+   }   
+   
+   public static Test suite()
+   {
+      return new TestSuite(PolyconeSupportTest.class);
+   }   
+
+   protected void setUp() throws Exception
+   {
+      InputStream in = LayeredSubdetectorTest.class.getResourceAsStream("/org/lcsim/geometry/subdetector/PolyconeSupportTest.xml");
+      GeometryReader reader = new GeometryReader();
+      det = reader.read(in);
+   }
+   
+   public void testRead() throws IOException, JDOMException, ElementCreationException
+   {
+       assert(det.getSubdetectors().size() == 1);
+   }
+   
+   public void testPolyconeSupport()
+   {
+       PolyconeSupport bp = (PolyconeSupport) det.getSubdetectors().get("BeamPipe");       
+       assert(bp != null);
+       
+       assert(bp.getNumberOfZPlanes() == 6);          
+       
+       for(PolyconeSupport.ZPlane zp : bp.getZPlanes())
+       {
+           assert(zp.getRMin() != 0);
+           assert(zp.getRMax() != 0);
+           assert(zp.getZ() != 0);
+       }
+   }
+}
\ No newline at end of file

GeomConverter/test/org/lcsim/geometry/subdetector
PolyconeSupportTest.xml added at 1.1.2.1
diff -N PolyconeSupportTest.xml
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ PolyconeSupportTest.xml	31 Oct 2005 19:02:59 -0000	1.1.2.1
@@ -0,0 +1,68 @@
+<!-- top-level compact description element -->
+<lccdd xmlns:lccdd="namespaceUrl"
+       xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
+       xs:noNamespaceSchemaLocation="noNamespaceUrl">
+
+  <!-- info tag containing author, version, time, unique id (url) -->
+  <info name="PolyconeSupportTest"
+	title=""
+	author=""
+	url=""
+        status="development">
+    <comment></comment>
+  </info>
+
+  <!-- Constants -->
+  <define>
+
+    <constant name="cm" value="10"/>
+
+    <!-- world -->
+    <constant name="world_side" value="30000" />
+    <constant name="world_x" value="world_side" />
+    <constant name="world_y" value="world_side" />
+    <constant name="world_z" value="world_side" />
+
+    <!-- tracking region -->
+    <constant name="tracking_region_radius" value="126.5*cm"/>
+    <constant name="tracking_region_zmax" value="167.9*cm"/>
+
+  </define>
+
+  <materials>
+  </materials>
+
+  <detectors>
+
+    <!-- Beampipe -->
+
+    <detector id="0" name="BeamPipe" type="PolyconeSupport" insideTrackingVolume="true">
+      <material name="Beryllium"/>
+      <zplane rmin = "((tracking_region_zmax-6.25)*(8.96-1.2)/(185.-6.25)+1.2)" rmax="((tracking_region_zmax-6.25)*(8.96-1.2)/(185.-6.25)+1.3)" z="-tracking_region_zmax" />
+      <zplane rmin="1.2*cm" rmax="1.3*cm"   z="-6.251*cm"/>
+      <zplane rmin="1.2*cm" rmax="1.240*cm" z="-6.25*cm"/>
+      <zplane rmin="1.2*cm" rmax="1.240*cm" z="6.25*cm" />
+      <zplane rmin="1.2*cm" rmax="1.3*cm" z="6.251*cm" />
+      <zplane rmin = "((tracking_region_zmax-6.25)*(8.96-1.2)/(185.-6.25)+1.2)" rmax="((tracking_region_zmax-6.25)*(8.96-1.2)/(185.-6.25)+1.3)" z="tracking_region_zmax" />
+    </detector>
+
+    <!-- BeamPipe Liner -->
+
+    <detector id="0" name="BeamPipeLiner" type="PolyconeSupport" insideTrackingVolume="true">
+      <material name="Titanium"/>
+      <zplane rmin = "((tracking_region_zmax-6.25)*(8.96-1.2)/(185.-6.25)+1.1925)" rmax="((tracking_region_zmax-6.25)*(8.96-1.2)/(185.-6.25)+1.2)" z="-tracking_region_zmax" />
+      <zplane rmin="1.1925*cm"    rmax="1.2*cm"  z="-6.251*cm"/>
+      <zplane rmin="1.1975*cm" rmax="1.20*cm" z="-6.25*cm"  />
+      <zplane rmin="1.1975*cm" rmax="1.20*cm" z="6.25*cm" />
+      <zplane rmin="1.1925*cm" rmax="1.2*cm" z="6.251*cm" />
+      <zplane rmin = "((tracking_region_zmax-6.25)*(8.96-1.2)/(185.-6.25)+1.1925)" rmax="((tracking_region_zmax-6.25)*(8.96-1.2)/(185.-6.25)+1.2)" z="tracking_region_zmax" />
+    </detector>
+    
+  </detectors>
+
+  <!-- Sensitive Detector readout segmentation -->
+  <readouts>
+  </readouts>
+  <fields>
+   </fields>
+</lccdd>
CVSspam 0.2.8