1 removed + 13 modified, total 14 files
GeomConverter/src/org/lcsim/geometry
diff -u -r1.7 -r1.8
--- CalorimeterIDDecoder.java 20 Jul 2005 19:11:56 -0000 1.7
+++ CalorimeterIDDecoder.java 24 Jul 2005 06:47:41 -0000 1.8
@@ -14,14 +14,12 @@
*/
abstract public class CalorimeterIDDecoder extends SubdetectorIDDecoder
{
+ /* @return Calorimeter that this SubdetectorIDDecoder uses. */
abstract public Calorimeter getCalorimeter();
/* FIXME: doesn't need to be at top-level */
abstract public double getDistanceToSensitive(int layer);
-
- /* FIXME: whoever's calling should just use detector... */
- abstract public double[] transformLocalToGlobal(double[] localPos);
-
+
/* FIXME: Move to neighbors interface. */
abstract public boolean supportsNeighbours();
abstract public long[] getNeighbourIDs();
GeomConverter/src/org/lcsim/geometry
diff -u -r1.22 -r1.23
--- Detector.java 23 Jul 2005 00:44:35 -0000 1.22
+++ Detector.java 24 Jul 2005 06:47:41 -0000 1.23
@@ -19,7 +19,7 @@
/* FIXME: Move impl to base class or org.lcsim.geometry.compact.Detector and change to interface. */
public class Detector
extends org.lcsim.geometry.compact.Detector
- implements HepRepProvider, DetectorElement
+ implements HepRepProvider
{
private FieldMap fieldMap;
@@ -41,7 +41,7 @@
}
protected void addSubdetector(org.lcsim.geometry.compact.Subdetector sub)
- {
+ {
super.addSubdetector(sub);
setupSubdetectorIDDecoder(sub);
}
@@ -65,6 +65,17 @@
super.addReadout(r);
}
+ public FieldMap getFieldMap()
+ {
+ return fieldMap;
+ }
+
+ protected void addField(Field field)
+ {
+ super.addField(field);
+ fieldMap = (FieldMap) field; // assumes single field for now
+ }
+
public void appendHepRep(HepRepFactory factory, HepRep heprep)
{
HepRepTreeID treeID = factory.createHepRepTreeID("DetectorType", "1.0");
@@ -90,19 +101,4 @@
}
}
}
- public FieldMap getFieldMap()
- {
- return fieldMap;
- }
-
- protected void addField(Field field)
- {
- super.addField(field);
- fieldMap = (FieldMap) field; // assumes single field for now
- }
-
- public double[] transformLocalToGlobal(double[] localPos)
- {
- return localPos;
- }
}
\ No newline at end of file
GeomConverter/src/org/lcsim/geometry
diff -u -r1.5 -r1.6
--- IDDecoder.java 20 Jul 2005 19:11:56 -0000 1.5
+++ IDDecoder.java 24 Jul 2005 06:47:41 -0000 1.6
@@ -11,31 +11,20 @@
/* FIXME: should be called setRawID() . */
public void setID(long id);
- /* FIXME: encapsulate with field class */
- public int getValue(String field);
- public int getValue(int index);
- public String getFieldName(int index);
- public int getFieldIndex(String name);
- public int getFieldCount();
- /* FIXME: add method (from description?)
- int getFieldBitLength(String name);
- */
+ /* FIXME: should be called getIntValue() */
+ public int getValue(String field);
- /* FIXME: duplicate from Subdet/DE */
- public double[] transformLocalToGlobal(double[] localPos);
-
- /* FIXME: use hep3vector */
+ /* @return the currently loaded IDDescriptor */
+ public IDDescriptor getIDDescription();
+
+ /* FIXME: use Position interface */
public double[] getPosition();
- /* FIXME: should really be called computeX(), etc. */
+ /* FIXME: should really be called computeX(), etc. */
public double getX();
public double getY();
public double getZ();
public double getPhi();
public double getTheta();
public int getLayer();
-
- /* set/get IDDescription */
- public void setIDDescription(IDDescriptor d);
- public IDDescriptor getIDDescription();
}
\ No newline at end of file
GeomConverter/src/org/lcsim/geometry
diff -u -r1.1 -r1.2
--- Readout.java 18 Jul 2005 18:00:01 -0000 1.1
+++ Readout.java 24 Jul 2005 06:47:41 -0000 1.2
@@ -3,9 +3,6 @@
*
* Created on July 18, 2005, 3:54 AM
*
- * To change this template, choose Tools | Options and locate the template under
- * the Source Creation and Management node. Right-click the template and choose
- * Open. You can then make changes to the template in the Source Editor.
*/
package org.lcsim.geometry;
GeomConverter/src/org/lcsim/geometry
diff -u -r1.6 -r1.7
--- Subdetector.java 20 Jul 2005 19:11:56 -0000 1.6
+++ Subdetector.java 24 Jul 2005 06:47:41 -0000 1.7
@@ -6,8 +6,10 @@
/**
* @author jeremym
*/
-public interface Subdetector extends DetectorElement
-{
+//extends DetectorElement
+public interface Subdetector
+{
+ String getName();
IDDecoder getIDDecoder();
/** @return Layering object or null if not implemented */
@@ -18,4 +20,6 @@
boolean isLayered();
boolean isBarrel();
boolean isEndcap();
+
+ double[] transformLocalToGlobal(double[] localPos);
}
\ No newline at end of file
GeomConverter/src/org/lcsim/geometry
diff -N DetectorElement.java
--- DetectorElement.java 20 Jul 2005 19:11:56 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,32 +0,0 @@
-/*
- * DetectorElement.java
- *
- * Created on July 17, 2005, 9:41 PM
- *
- * To change this template, choose Tools | Options and locate the template under
- * the Source Creation and Management node. Right-click the template and choose
- * Open. You can then make changes to the template in the Source Editor.
- */
-
-package org.lcsim.geometry;
-
-/**
- *
- * @author jeremym
- *
- * Common interface for full detector or part of it.
- *
- */
-public interface DetectorElement
-{
- String getName();
- /** @return transform to global or localPos if not implemented */
- double[] transformLocalToGlobal(double[] localPos);
- /*
- List<Materials> getMaterials();
- String getTypeName();
- List<DetectorElement> getChildren();
- Position Position();
- IDDecoder getIDDecoder();
- */
-}
\ No newline at end of file
GeomConverter/src/org/lcsim/geometry/compact
diff -u -r1.7 -r1.8
--- Subdetector.java 23 Jul 2005 00:41:33 -0000 1.7
+++ Subdetector.java 24 Jul 2005 06:47:42 -0000 1.8
@@ -1,109 +1,172 @@
-package org.lcsim.geometry.compact;
-
-import org.jdom.Attribute;
-import org.jdom.Element;
-import org.jdom.JDOMException;
-import org.lcsim.geometry.layer.Layering;
-import org.lcsim.geometry.IDDecoder;
-import org.lcsim.geometry.subdetector.SubdetectorIDDecoder;
-
-/**
- *
- * @author tonyj
- */
-public class Subdetector implements org.lcsim.geometry.Subdetector
-{
- private boolean reflect;
- private Readout readout;
- private String name;
- private int systemID;
-
- protected Subdetector(Element element) throws JDOMException
- {
- name = element.getAttributeValue("name");
- Attribute r = element.getAttribute("reflect");
- reflect = r != null && r.getBooleanValue();
- Attribute id = element.getAttribute("id");
- systemID = 0;
- if (id != null) systemID = id.getIntValue();
- }
-
- protected void setReadout(Readout r)
- {
- this.readout = r;
- }
-
- /**
- * Get the readout associated with this detector.
- * @return The readout, or <CODE>null</CODE> if no readout is associated with the detector.
- */
- public Readout getReadout()
- {
- return readout;
- }
-
- /* org.lcsim.geometry.Subdetector */
- public IDDecoder getIDDecoder()
- {
- return getReadout().getIDDecoder();
- }
-
- public SubdetectorIDDecoder getSubdetectorIDDecoder()
- {
- return (SubdetectorIDDecoder)getIDDecoder();
- }
-
- /* org.lcsim.geometry.Subdetector */
- public String getName()
- {
- return name;
- }
-
- public int getSystemID()
- {
- return(systemID);
- }
-
- public boolean isBarrel()
- {
- return false;
- }
-
- public boolean isEndcap()
- {
- return false;
- }
-
- /* org.lcsim.geometry.Subdetector */
- public boolean isCalorimeter()
- {
- return false;
- }
-
- /* org.lcsim.geometry.Subdetector */
- public boolean isTracker()
- {
- return false;
- }
-
- /* org.lcsim.geometry.Subdetector */
- public boolean isLayered()
- {
- return false;
- }
-
- public Layering getLayering()
- {
- return null;
- }
-
- public double[] transformLocalToGlobal(double[] locPos)
- {
- return locPos;
- }
-
- public boolean getReflect()
- {
- return reflect;
- }
+package org.lcsim.geometry.compact;
+
+import org.jdom.Attribute;
+import org.jdom.Element;
+import org.jdom.JDOMException;
+import org.lcsim.geometry.layer.Layering;
+import org.lcsim.geometry.IDDecoder;
+import org.lcsim.geometry.subdetector.SubdetectorIDDecoder;
+
+/**
+ *
+ * @author tonyj
+ */
+public class Subdetector implements org.lcsim.geometry.Subdetector
+{
+ private boolean reflect;
+ private Readout readout;
+ private String name;
+ private int systemID;
+
+ protected Subdetector(Element element) throws JDOMException
+ {
+ name = element.getAttributeValue("name");
+
+ Attribute r = element.getAttribute("reflect");
+ reflect = r != null && r.getBooleanValue();
+
+ Attribute id = element.getAttribute("id");
+ systemID = 0;
+ if (id != null) systemID = id.getIntValue();
+ }
+
+ protected void setReadout(Readout r)
+ {
+ this.readout = r;
+ }
+
+ /**
+ * Get the readout associated with this detector.
+ * @return The readout, or <CODE>null</CODE> if no readout is associated with the detector.
+ */
+
+ public Readout getReadout()
+ {
+ return readout;
+ }
+
+ /* org.lcsim.geometry.Subdetector */
+ public IDDecoder getIDDecoder()
+ {
+ return getReadout().getIDDecoder();
+ }
+
+
+
+ public SubdetectorIDDecoder getSubdetectorIDDecoder()
+
+ {
+
+ return (SubdetectorIDDecoder)getIDDecoder();
+
+ }
+
+
+
+ /* org.lcsim.geometry.Subdetector */
+
+ public String getName()
+
+ {
+
+ return name;
+
+ }
+
+
+
+ public int getSystemID()
+
+ {
+
+ return(systemID);
+
+ }
+
+
+
+ public boolean isBarrel()
+
+ {
+
+ return false;
+
+ }
+
+
+
+ public boolean isEndcap()
+
+ {
+
+ return false;
+
+ }
+
+
+
+ /* org.lcsim.geometry.Subdetector */
+
+ public boolean isCalorimeter()
+
+ {
+
+ return false;
+
+ }
+
+
+
+ /* org.lcsim.geometry.Subdetector */
+
+ public boolean isTracker()
+
+ {
+
+ return false;
+
+ }
+
+
+
+ /* org.lcsim.geometry.Subdetector */
+
+ public boolean isLayered()
+
+ {
+
+ return false;
+
+ }
+
+
+
+ public Layering getLayering()
+
+ {
+
+ return null;
+
+ }
+
+
+
+ public double[] transformLocalToGlobal(double[] locPos)
+
+ {
+
+ return locPos;
+
+ }
+
+
+
+ public boolean getReflect()
+
+ {
+
+ return reflect;
+
+ }
+
}
\ No newline at end of file
GeomConverter/src/org/lcsim/geometry/segmentation
diff -u -r1.13 -r1.14
--- GridXYZ.java 20 Jul 2005 22:03:13 -0000 1.13
+++ GridXYZ.java 24 Jul 2005 06:47:42 -0000 1.14
@@ -138,7 +138,7 @@
private void computeGlobalPosition()
{
- _globalPos = transformLocalToGlobal(_localPos);
+ _globalPos = getSubdetector().transformLocalToGlobal(_localPos);
}
private void computeLocalX()
GeomConverter/src/org/lcsim/geometry/subdetector
diff -u -r1.1 -r1.2
--- CalorimeterIDDecoder.java 20 Jul 2005 19:11:59 -0000 1.1
+++ CalorimeterIDDecoder.java 24 Jul 2005 06:47:42 -0000 1.2
@@ -24,12 +24,7 @@
}
return detector.getLayering().getDistanceToLayerSensorMid(layer);
}
-
- public double[] transformLocalToGlobal(double[] localPos)
- {
- return detector.transformLocalToGlobal(localPos);
- }
-
+
/* FIXME: Next 3 should be in CellNeighbours (or equiv) interface definition. */
public long[] getNeighbourIDs(int deltaLayer, int deltaTheta, int deltaPhi)
{
GeomConverter/src/org/lcsim/geometry/subdetector
diff -u -r1.9 -r1.10
--- MultiLayerTracker.java 23 Jul 2005 00:42:23 -0000 1.9
+++ MultiLayerTracker.java 24 Jul 2005 06:47:42 -0000 1.10
@@ -1,93 +1,93 @@
-package org.lcsim.geometry.subdetector;
-
-import org.lcsim.geometry.subdetector.TrackerIDDecoder;
-
-import java.util.Iterator;
-import java.util.List;
-import org.jdom.DataConversionException;
-import org.jdom.Element;
-import org.jdom.JDOMException;
-
-import hep.graphics.heprep.HepRep;
-import hep.graphics.heprep.HepRepFactory;
-import hep.graphics.heprep.HepRepInstance;
-import hep.graphics.heprep.HepRepInstanceTree;
-import hep.graphics.heprep.HepRepType;
-import hep.graphics.heprep.HepRepTypeTree;
-
-/**
- *
- * @author tonyj
- *
- */
-public class MultiLayerTracker extends TrackerBase
-{
- private double[] innerR;
- private double[] outerZ;
- private double[] thickness;
-
- public double[] getInnerR()
- {
- return(innerR);
- }
-
- public double[] getOuterZ()
- {
- return(outerZ);
- }
-
- MultiLayerTracker(Element node) throws JDOMException
- {
- super(node);
- build(node);
- }
-
- public boolean isBarrel()
- {
- return true;
- }
-
- private void build(Element node) throws DataConversionException
- {
- List layers = node.getChildren("layer");
- int n = layers.size();
- innerR = new double[n];
- outerZ = new double[n];
- thickness = new double[n];
- for (int i=0; i<n; i++)
- {
- Element layer = (Element) layers.get(i);
- innerR[i] = layer.getAttribute("inner_r").getDoubleValue();
- outerZ[i] = layer.getAttribute("outer_z").getDoubleValue();
- thickness[i] = 0;
- for (Iterator iter = layer.getChildren("slice").iterator(); iter.hasNext();)
- {
- Element slice = (Element) iter.next();
- thickness[i] += slice.getAttribute("thickness").getDoubleValue();
- }
- }
- }
-
- public void appendHepRep(HepRepFactory factory, HepRep heprep)
- {
- HepRepInstanceTree instanceTree = heprep.getInstanceTreeTop("Detector","1.0");
- HepRepTypeTree typeTree = heprep.getTypeTree("DetectorType","1.0");
- HepRepType barrel = typeTree.getType("Barrel");
-
- HepRepType type = factory.createHepRepType(barrel, getName());
- type.addAttValue("drawAs","Cylinder");
-
- for (int i=0; i<innerR.length; i++)
- {
- HepRepInstance instance = factory.createHepRepInstance(instanceTree, type);
- instance.addAttValue("radius",innerR[i]);
- factory.createHepRepPoint(instance,0,0,-outerZ[i]);
- factory.createHepRepPoint(instance,0,0,outerZ[i]);
-
- HepRepInstance instance2 = factory.createHepRepInstance(instanceTree, type);
- instance2.addAttValue("radius",innerR[i]+thickness[i]);
- factory.createHepRepPoint(instance2,0,0,-outerZ[i]);
- factory.createHepRepPoint(instance2,0,0,outerZ[i]);
- }
- }
+package org.lcsim.geometry.subdetector;
+
+import org.lcsim.geometry.subdetector.TrackerIDDecoder;
+import java.util.Iterator;
+import java.util.List;
+import org.jdom.DataConversionException;
+import org.jdom.Element;
+import org.jdom.JDOMException;
+import hep.graphics.heprep.HepRep;
+import hep.graphics.heprep.HepRepFactory;
+import hep.graphics.heprep.HepRepInstance;
+import hep.graphics.heprep.HepRepInstanceTree;
+import hep.graphics.heprep.HepRepType;
+import hep.graphics.heprep.HepRepTypeTree;
+
+/**
+ *
+ * @author tonyj
+ *
+ */
+public class MultiLayerTracker extends TrackerBase
+{
+ private double[] innerR;
+ private double[] outerZ;
+
+ private double[] thickness;
+
+
+ public double[] getInnerR()
+ {
+ return(innerR);
+ }
+
+ public double[] getOuterZ()
+ {
+ return(outerZ);
+ }
+
+ MultiLayerTracker(Element node) throws JDOMException
+ {
+ super(node);
+ build(node);
+ }
+
+ public boolean isBarrel()
+ {
+ return true;
+ }
+
+ private void build(Element node) throws DataConversionException
+ {
+ List layers = node.getChildren("layer");
+ int n = layers.size();
+ innerR = new double[n];
+ outerZ = new double[n];
+ thickness = new double[n];
+ for (int i=0; i<n; i++)
+ {
+ Element layer = (Element) layers.get(i);
+ innerR[i] = layer.getAttribute("inner_r").getDoubleValue();
+ outerZ[i] = layer.getAttribute("outer_z").getDoubleValue();
+ thickness[i] = 0;
+ for (Iterator iter = layer.getChildren("slice").iterator(); iter.hasNext();)
+ {
+ Element slice = (Element) iter.next();
+ thickness[i] += slice.getAttribute("thickness").getDoubleValue();
+ }
+ }
+ }
+
+ public void appendHepRep(HepRepFactory factory, HepRep heprep)
+ {
+ HepRepInstanceTree instanceTree = heprep.getInstanceTreeTop("Detector","1.0");
+ HepRepTypeTree typeTree = heprep.getTypeTree("DetectorType","1.0");
+ HepRepType barrel = typeTree.getType("Barrel");
+
+ HepRepType type = factory.createHepRepType(barrel, getName());
+ type.addAttValue("drawAs","Cylinder");
+
+ for (int i=0; i<innerR.length; i++)
+ {
+ HepRepInstance instance = factory.createHepRepInstance(instanceTree, type);
+ instance.addAttValue("radius",innerR[i]);
+ factory.createHepRepPoint(instance,0,0,-outerZ[i]);
+ factory.createHepRepPoint(instance,0,0,outerZ[i]);
+
+ HepRepInstance instance2 = factory.createHepRepInstance(instanceTree, type);
+ instance2.addAttValue("radius",innerR[i]+thickness[i]);
+ factory.createHepRepPoint(instance2,0,0,-outerZ[i]);
+ factory.createHepRepPoint(instance2,0,0,outerZ[i]);
+ }
+ }
}
\ No newline at end of file
GeomConverter/src/org/lcsim/geometry/util
diff -u -r1.1 -r1.2
--- IDDecoderBase.java 18 Jul 2005 18:00:08 -0000 1.1
+++ IDDecoderBase.java 24 Jul 2005 06:47:43 -0000 1.2
@@ -8,15 +8,11 @@
/**
*
- * Base class for extensions to ID encoding
+ * Base class for extensions to ID encoding.
*
* See also CalorimeterIDDecoder, TrackerIDDecoder
* for base classes to extend.
*
- * Many functions have default implementations so that user classes aren't
- * forced to implement missing methods. But most extensions of this
- * class should override all methods.
- *
*/
public class IDDecoderBase implements org.lcsim.geometry.IDDecoder
{
@@ -28,11 +24,6 @@
public IDDecoderBase()
{}
- public double[] transformLocalToGlobal(double[] localPos)
- {
- return localPos;
- }
-
public double getX()
{
return 0;
GeomConverter/src/org/lcsim/material
diff -u -r1.9 -r1.10
--- MaterialManager.java 20 Jul 2005 01:01:29 -0000 1.9
+++ MaterialManager.java 24 Jul 2005 06:47:43 -0000 1.10
@@ -77,6 +77,8 @@
{
_materials.put(material.getName(), material);
}
+
+ // FIXME: Should throw an exception or notify if material already exists.
}
public static Material getMaterial(String materialName)
@@ -156,9 +158,9 @@
Material material = new Material( me.fullName(),
1,
me.getDensity(),
- MaterialState.UNKNOWN,
- Material.DEFAULT_TEMPERATURE,
- Material.DEFAULT_PRESSURE );
+ MaterialState.UNKNOWN, // FIXME: set material state (see CEPack)
+ Material.DEFAULT_TEMPERATURE, // FIXME: set a temperature?
+ Material.DEFAULT_PRESSURE ); // FIXME: set the pressure?
material.addElement( me, 1.0);
}
GeomConverter/src/org/lcsim/material
diff -u -r1.1 -r1.2
--- MaterialNotFoundException.java 5 Jul 2005 22:45:27 -0000 1.1
+++ MaterialNotFoundException.java 24 Jul 2005 06:47:43 -0000 1.2
@@ -10,7 +10,7 @@
*
* @author jeremym
*/
-public class MaterialNotFoundException extends Exception
+public final class MaterialNotFoundException extends Exception
{
MaterialNotFoundException(String materialName)
{
GeomConverter/test/org/lcsim/geometry
diff -u -r1.2 -r1.3
--- GeometryReaderTest.xml 19 Jul 2005 20:31:38 -0000 1.2
+++ GeometryReaderTest.xml 24 Jul 2005 06:47:43 -0000 1.3
@@ -14,9 +14,9 @@
<info name="GeometryReaderTest"
title="GeometryReaderTest from sdjan03"
author="Jeremy McCormick"
- url="http://www.example.com">
+ url="http://www.lcsim.org">
<comment>
- Test comment.
+ Test of org.lcsim.geometry.GeometryReader
</comment>
</info>
CVSspam 0.2.8