6 modified files
GeomConverter/src/org/lcsim/geometry/compact
diff -u -r1.17 -r1.18
--- CompactReader.java 28 Oct 2005 00:34:18 -0000 1.17
+++ CompactReader.java 31 Oct 2005 19:06:20 -0000 1.18
@@ -18,7 +18,7 @@
/**
* A tool for reading xml files containing compact detector descriptions.
* @author tonyj
- * @version $Id: CompactReader.java,v 1.17 2005/10/28 00:34:18 jeremy Exp $
+ * @version $Id: CompactReader.java,v 1.18 2005/10/31 19:06:20 jeremy Exp $
*
* This class does not create subclass objects. For example, CylindricalBarrelCalorimeter
* is inserted into Detector as a generic Subdetector. To get subclasses, use the
GeomConverter/src/org/lcsim/geometry/subdetector
diff -N PolyconeSupport.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ PolyconeSupport.java 31 Oct 2005 19:06:20 -0000 1.2
@@ -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/src/org/lcsim/geometry/subdetector
diff -u -r1.2 -r1.3
--- AbstractSubdetector.java 28 Oct 2005 00:34:24 -0000 1.2
+++ AbstractSubdetector.java 31 Oct 2005 19:06:20 -0000 1.3
@@ -14,13 +14,14 @@
import org.jdom.JDOMException;
import org.lcsim.geometry.HepRepProvider;
import org.lcsim.geometry.SubdetectorIDDecoder;
+import org.lcsim.geometry.layer.Layering;
/**
*
* @author jeremym
*
- * This class is supposed to simplify inheritance hierarchy for org.lcsim.geometry.subdetector
- * implementation classes, which extend it.
+ * This class is meant to simplify inheritance hierarchy for org.lcsim.geometry.subdetector
+ * implementation classes that extend it.
*
*/
abstract class AbstractSubdetector
@@ -42,4 +43,9 @@
/** FIXME: Should live in org.lcsim.geometry.heprep or equivalent. */
public void appendHepRep(HepRepFactory factory, HepRep heprep)
{}
-}
\ No newline at end of file
+
+ public Layering getLayering()
+ {
+ return null;
+ }
+}
GeomConverter/test/org/lcsim/geometry/compact
diff -u -r1.3 -r1.4
--- CompactReaderTest.java 18 Jul 2005 18:00:07 -0000 1.3
+++ CompactReaderTest.java 31 Oct 2005 19:06:21 -0000 1.4
@@ -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/subdetector
diff -N PolyconeSupportTest.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ PolyconeSupportTest.java 31 Oct 2005 19:06:21 -0000 1.2
@@ -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
diff -N PolyconeSupportTest.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ PolyconeSupportTest.xml 31 Oct 2005 19:06:21 -0000 1.2
@@ -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