4 added + 3 removed + 24 modified, total 31 files
GeomConverter/src/org/lcsim/geometry
diff -u -r1.4 -r1.5
--- Calorimeter.java 18 Jul 2005 18:00:01 -0000 1.4
+++ Calorimeter.java 20 Jul 2005 19:11:55 -0000 1.5
@@ -2,6 +2,8 @@
import org.jdom.Element;
import org.lcsim.geometry.layer.Layering;
+import org.lcsim.geometry.subdetector.LayeredSubdetector;
+import org.lcsim.geometry.subdetector.CalorimeterIDDecoder;
/**
*
GeomConverter/src/org/lcsim/geometry
diff -u -r1.6 -r1.7
--- CalorimeterIDDecoder.java 18 Jul 2005 18:00:01 -0000 1.6
+++ CalorimeterIDDecoder.java 20 Jul 2005 19:11:56 -0000 1.7
@@ -1,49 +1,29 @@
+/*
+ * CalorimeterIDDecoder.java
+ *
+ * Created on July 20, 2005, 3:04 AM
+ *
+ */
+
package org.lcsim.geometry;
+import org.lcsim.geometry.subdetector.SubdetectorIDDecoder;
/**
*
- * @author tonyj
- *
+ * @author jeremym
*/
-public class CalorimeterIDDecoder extends SubdetectorIDDecoder
+abstract public class CalorimeterIDDecoder extends SubdetectorIDDecoder
{
- public CalorimeterIDDecoder()
- {
- super();
- }
-
- public Calorimeter getCalorimeter()
- {
- return (Calorimeter) getSubdetector();
- }
-
- /**
- * FIXME: Should be renamed as it is actually returning the distance to the midpoint of the sensitive layer.
- */
- public double getDistanceToSensitive(int layer)
- {
- return detector.getLayering().getDistanceToLayerSensorMid(layer);
- }
-
- public double[] transformLocalToGlobal(double[] localPos)
- {
- return ((org.lcsim.geometry.Subdetector)detector).transformLocalToGlobal(localPos);
- }
+ abstract public Calorimeter getCalorimeter();
- /* FIXME: Next 3 should be in CellNeighbours (or equiv) interface definition. */
- public long[] getNeighbourIDs(int deltaLayer, int deltaTheta, int deltaPhi)
- {
- long[] dummyNeighbours = {0, 0, 0};
- return dummyNeighbours;
- }
+ /* FIXME: doesn't need to be at top-level */
+ abstract public double getDistanceToSensitive(int layer);
- public boolean supportsNeighbours()
- {
- return false;
- }
+ /* FIXME: whoever's calling should just use detector... */
+ abstract public double[] transformLocalToGlobal(double[] localPos);
- public long[] getNeighbourIDs()
- {
- return getNeighbourIDs(1,1,1);
- }
+ /* FIXME: Move to neighbors interface. */
+ abstract public boolean supportsNeighbours();
+ abstract public long[] getNeighbourIDs();
+ abstract public long[] getNeighbourIDs(int deltaLayer, int deltaTheta, int deltaPhi);
}
\ No newline at end of file
GeomConverter/src/org/lcsim/geometry
diff -u -r1.6 -r1.7
--- CylindricalSubdetector.java 19 Jul 2005 20:32:46 -0000 1.6
+++ CylindricalSubdetector.java 20 Jul 2005 19:11:56 -0000 1.7
@@ -1,7 +1,5 @@
package org.lcsim.geometry;
-import org.lcsim.geometry.layer.Layering;
-
/**
*
* @author tonyj
GeomConverter/src/org/lcsim/geometry
diff -u -r1.20 -r1.21
--- Detector.java 18 Jul 2005 18:00:01 -0000 1.20
+++ Detector.java 20 Jul 2005 19:11:56 -0000 1.21
@@ -1,5 +1,9 @@
package org.lcsim.geometry;
+import org.lcsim.geometry.compact.Field;
+import org.lcsim.geometry.compact.Readout;
+import org.lcsim.geometry.subdetector.SubdetectorIDDecoder;
+
import hep.graphics.heprep.HepRep;
import hep.graphics.heprep.HepRepFactory;
import hep.graphics.heprep.HepRepInstanceTree;
@@ -7,11 +11,6 @@
import hep.graphics.heprep.HepRepType;
import hep.graphics.heprep.HepRepTypeTree;
import org.jdom.Element;
-import org.lcsim.geometry.compact.Field;
-import org.lcsim.geometry.compact.Readout;
-import org.lcsim.geometry.compact.Segmentation;
-import org.lcsim.geometry.segmentation.SegmentationBase;
-import org.lcsim.geometry.subdetector.CalorimeterBase;
/**
*
@@ -23,11 +22,6 @@
{
private FieldMap fieldMap;
- public double[] transformLocalToGlobal(double[] localPos)
- {
- return localPos;
- }
-
Detector(Element node)
{
super(node);
@@ -41,24 +35,26 @@
}
public IDDecoder getDecoder(String readout)
- {
+ {
return getReadouts().get(readout).getIDDecoder();
}
protected void addSubdetector(org.lcsim.geometry.compact.Subdetector sub)
- {
+ {
super.addSubdetector(sub);
-
- Readout r = sub.getReadout();
-
- if (r != null)
- {
- /* set segmentation backlink to Subdetector */
- Segmentation s = r.getSegmentation();
+ setupSubdetectorIDDecoder(sub);
+ }
+
+ /* setup subdetector backlink in the iddecoder */
+ private void setupSubdetectorIDDecoder(org.lcsim.geometry.compact.Subdetector subdet)
+ {
+ if ( subdet.getReadout() != null )
+ {
+ SubdetectorIDDecoder decoder = subdet.getSubdetectorIDDecoder();
- if ( s != null )
+ if ( decoder != null )
{
- s.setSubdetector(sub);
+ decoder.setSubdetector(subdet);
}
}
}
@@ -103,4 +99,9 @@
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.2 -r1.3
--- DetectorElement.java 19 Jul 2005 20:34:41 -0000 1.2
+++ DetectorElement.java 20 Jul 2005 19:11:56 -0000 1.3
@@ -19,14 +19,14 @@
*/
public interface DetectorElement
{
- String getName();
-
+ 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
diff -u -r1.4 -r1.5
--- IDDecoder.java 18 Jul 2005 18:00:01 -0000 1.4
+++ IDDecoder.java 20 Jul 2005 19:11:56 -0000 1.5
@@ -1,18 +1,41 @@
package org.lcsim.geometry;
-import org.lcsim.geometry.util.*;
+import org.lcsim.geometry.util.IDDescriptor;
/**
*
* @author tonyj
*/
-public interface IDDecoder extends Identifier
+public interface IDDecoder
{
+ /* 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: duplicate from Subdet/DE */
public double[] transformLocalToGlobal(double[] localPos);
+
+ /* FIXME: use hep3vector */
+ public double[] getPosition();
+
+ /* FIXME: should really be called computeX(), etc. */
public double getX();
public double getY();
public double getZ();
- public int getLayer();
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.5 -r1.6
--- Subdetector.java 18 Jul 2005 18:00:01 -0000 1.5
+++ Subdetector.java 20 Jul 2005 19:11:56 -0000 1.6
@@ -1,19 +1,21 @@
package org.lcsim.geometry;
import org.lcsim.geometry.layer.Layering;
+import org.lcsim.geometry.subdetector.SubdetectorIDDecoder;
/**
- *
- * @author tonyj
+ * @author jeremym
*/
public interface Subdetector extends DetectorElement
-{
- boolean isTracker();
- boolean isCalorimeter();
- boolean isLayered();
-
+{
IDDecoder getIDDecoder();
/** @return Layering object or null if not implemented */
Layering getLayering();
+
+ boolean isTracker();
+ boolean isCalorimeter();
+ boolean isLayered();
+ boolean isBarrel();
+ boolean isEndcap();
}
\ No newline at end of file
GeomConverter/src/org/lcsim/geometry
diff -u -r1.3 -r1.4
--- Tracker.java 18 Jul 2005 18:00:01 -0000 1.3
+++ Tracker.java 20 Jul 2005 19:11:56 -0000 1.4
@@ -1,6 +1,6 @@
package org.lcsim.geometry;
-import org.jdom.Element;
-import org.lcsim.geometry.compact.Subdetector;
+
+import org.lcsim.geometry.subdetector.LayeredSubdetector;
/**
*
* @author tonyj
GeomConverter/src/org/lcsim/geometry
diff -u -r1.2 -r1.3
--- TrackerIDDecoder.java 18 Jul 2005 18:00:01 -0000 1.2
+++ TrackerIDDecoder.java 20 Jul 2005 19:11:56 -0000 1.3
@@ -1,18 +1,22 @@
+/*
+ * TrackerIDDecoder.java
+ *
+ * Created on July 20, 2005, 3:18 AM
+ *
+ */
package org.lcsim.geometry;
+import org.lcsim.geometry.subdetector.SubdetectorIDDecoder;
+
/**
*
- * @author tonyj
+ * @author jeremym
*/
-public class TrackerIDDecoder extends SubdetectorIDDecoder
+abstract public class TrackerIDDecoder extends SubdetectorIDDecoder
{
- public TrackerIDDecoder()
- {
- super();
- }
-
+ Tracker tracker;
Tracker getTracker()
{
- return (Tracker)getSubdetector();
+ return tracker;
}
}
\ No newline at end of file
GeomConverter/src/org/lcsim/geometry
diff -N Identifier.java
--- Identifier.java 19 Jul 2005 20:32:57 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,30 +0,0 @@
-/*
- * Identifier.java
- *
- * Created on July 17, 2005, 11:17 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;
-
-import org.lcsim.geometry.util.IDDescriptor;
-
-/**
- *
- * @author jeremym
- */
-public interface Identifier
-{
- public double[] getPosition();
- public void setID(long id); /* should be called setRawID() */
- public int getValue(String field);
- public int getValue(int index);
- public String getFieldName(int index);
- public int getFieldIndex(String name);
- public int getFieldCount();
- public void setIDDescription(IDDescriptor d);
- public IDDescriptor getIDDescription();
-}
\ No newline at end of file
GeomConverter/src/org/lcsim/geometry
diff -N LayeredSubdetector.java
--- LayeredSubdetector.java 18 Jul 2005 18:00:01 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,19 +0,0 @@
-/*
- * LayeredSubdetector.java
- *
- * Created on July 17, 2005, 4:32 PM
- *
- */
-
-package org.lcsim.geometry;
-
-import org.lcsim.geometry.layer.Layering;
-
-/**
- *
- * @author jeremym
- */
-public interface LayeredSubdetector extends Subdetector
-{
- Layering getLayering();
-}
\ No newline at end of file
GeomConverter/src/org/lcsim/geometry
diff -N SubdetectorIDDecoder.java
--- SubdetectorIDDecoder.java 18 Jul 2005 18:00:02 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,46 +0,0 @@
-/*
- * SubdetectorID.java
- *
- * Created on July 17, 2005, 4:58 PM
- *
- */
-package org.lcsim.geometry;
-
-import org.lcsim.geometry.util.IDDecoderBase;
-import org.lcsim.geometry.util.IDDescriptor;
-
-/**
- *
- * @author jeremym
- */
-public class SubdetectorIDDecoder extends IDDecoderBase
-{
- protected int layerIndex;
- protected Subdetector detector;
-
- public SubdetectorIDDecoder()
- {
- super();
- }
-
- public void setSubdetector(Subdetector d)
- {
- detector = d;
- }
-
- public Subdetector getSubdetector()
- {
- return detector;
- }
-
- public void setIDDescription(IDDescriptor id)
- {
- super.setIDDescription(id);
- layerIndex = id.indexOf("layer");
- }
-
- public int getLayer()
- {
- return values[layerIndex];
- }
-}
\ No newline at end of file
GeomConverter/src/org/lcsim/geometry/compact
diff -u -r1.11 -r1.12
--- Detector.java 18 Jul 2005 22:04:10 -0000 1.11
+++ Detector.java 20 Jul 2005 19:11:58 -0000 1.12
@@ -141,7 +141,7 @@
{
return fields;
}
-
+
public XMLMaterialManager getMaterialManager()
{
return materialMgr;
GeomConverter/src/org/lcsim/geometry/compact
diff -u -r1.3 -r1.4
--- Readout.java 18 Jul 2005 18:00:03 -0000 1.3
+++ Readout.java 20 Jul 2005 19:11:58 -0000 1.4
@@ -1,15 +1,13 @@
package org.lcsim.geometry.compact;
-
-import org.lcsim.geometry.IDDecoder;
+import org.lcsim.geometry.subdetector.TrackerIDDecoder;
import org.lcsim.geometry.util.IDDescriptor;
import org.lcsim.geometry.util.IDDescriptor.IDException;
import org.jdom.Element;
import org.jdom.JDOMException;
-import org.lcsim.geometry.TrackerIDDecoder;
+import org.lcsim.geometry.segmentation.SegmentationBase;
import org.lcsim.geometry.util.IDDecoderBase;
-
/**
*
* @author tonyj
@@ -20,12 +18,17 @@
private String name;
private IDDecoderBase decoder;
private IDDescriptor desc;
- private Segmentation segmentation;
public Readout(Element node) throws JDOMException
{
name = node.getAttributeValue("name");
+ setupIDDescriptor(node);
+ setupIDDecoder(node);
+ }
+
+ private void setupIDDescriptor(Element node) throws JDOMException
+ {
/* setup IDDescriptor */
try
{
@@ -35,33 +38,24 @@
{
throw new JDOMException("Invalid ID", x);
}
-
- /* setup IDDecoder */
- setupDecoder(node);
}
- private void setupDecoder(Element node)
+ private void setupIDDecoder(Element node)
{
- /* Setup trackerIDDecoder if no segmentation tag. */
- if ( node.getChildren("segmentation") == null)
- {
- if ( decoder == null ) {
- /* FIXME: Probably belongs in a tracker-specific class. */
- setIDDecoder(new TrackerIDDecoder() );
- }
- }
-
- /* Otherwise, we wait for the segmentation. */
- }
+ /* default to tracker if no segmentation tag */
+ if ( node.getChildren("segmentation") == null )
+ {
+ setIDDecoder( new TrackerIDDecoder() );
+ }
+ }
- public org.lcsim.geometry.compact.Segmentation getSegmentation()
+ public Segmentation getSegmentation()
{
- return segmentation;
+ return (Segmentation)decoder;
}
- protected void setSegmentation(Segmentation segmentation)
+ public void setSegmentation(Segmentation segmentation)
{
- this.segmentation = segmentation;
setIDDecoder((IDDecoderBase)segmentation);
}
@@ -75,9 +69,14 @@
return decoder;
}
- public void setIDDecoder(IDDecoderBase baseId)
+ private void setIDDecoder(IDDecoderBase d)
{
- decoder = baseId;
+ if ( d == null )
+ {
+ throw new IllegalArgumentException("IDDecoder was null.");
+ }
+
+ decoder = d;
decoder.setIDDescription(getIDDescriptor() );
}
GeomConverter/src/org/lcsim/geometry/compact
diff -u -r1.2 -r1.3
--- Segmentation.java 18 Jul 2005 18:00:03 -0000 1.2
+++ Segmentation.java 20 Jul 2005 19:11:58 -0000 1.3
@@ -6,7 +6,7 @@
*
* @author tonyj
*/
-public class Segmentation extends org.lcsim.geometry.CalorimeterIDDecoder
+public class Segmentation extends org.lcsim.geometry.subdetector.CalorimeterIDDecoder
{
protected Segmentation(Element segmentation)
{
GeomConverter/src/org/lcsim/geometry/compact
diff -u -r1.5 -r1.6
--- Subdetector.java 18 Jul 2005 18:00:03 -0000 1.5
+++ Subdetector.java 20 Jul 2005 19:11:58 -0000 1.6
@@ -5,6 +5,7 @@
import org.jdom.JDOMException;
import org.lcsim.geometry.layer.Layering;
import org.lcsim.geometry.IDDecoder;
+import org.lcsim.geometry.subdetector.SubdetectorIDDecoder;
/**
*
@@ -43,12 +44,27 @@
return getReadout().getIDDecoder();
}
+ public SubdetectorIDDecoder getSubdetectorIDDecoder()
+ {
+ return (SubdetectorIDDecoder)getIDDecoder();
+ }
+
/* org.lcsim.geometry.Subdetector */
public String getName()
{
return name;
}
+ public boolean isBarrel()
+ {
+ return false;
+ }
+
+ public boolean isEndcap()
+ {
+ return false;
+ }
+
/* org.lcsim.geometry.Subdetector */
public boolean isCalorimeter()
{
GeomConverter/src/org/lcsim/geometry/layer
diff -u -r1.6 -r1.7
--- LayerSlice.java 19 Jul 2005 18:48:29 -0000 1.6
+++ LayerSlice.java 20 Jul 2005 19:11:58 -0000 1.7
@@ -15,8 +15,7 @@
* @author jeremym
*/
public class LayerSlice
-{
-
+{
private boolean sensitive;
private Material material = null;
private double thickness;
GeomConverter/src/org/lcsim/geometry/layer
diff -u -r1.1 -r1.2
--- Layering.java 18 Jul 2005 18:00:04 -0000 1.1
+++ Layering.java 20 Jul 2005 19:11:58 -0000 1.2
@@ -58,6 +58,16 @@
return getLayerStack().getNumberOfLayers();
}
+ public int getNumberOfLayers()
+ {
+ return getLayerCount();
+ }
+
+ public int size()
+ {
+ return getLayerCount();
+ }
+
public double getDistanceToLayerSensorMid(int layer)
{
return getDistanceToLayer(layer) +
GeomConverter/src/org/lcsim/geometry/subdetector
diff -N CalorimeterIDDecoder.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ CalorimeterIDDecoder.java 20 Jul 2005 19:11:59 -0000 1.1
@@ -0,0 +1,49 @@
+package org.lcsim.geometry.subdetector;
+import org.lcsim.geometry.Calorimeter;
+
+/**
+ *
+ * @author tonyj
+ *
+ */
+public class CalorimeterIDDecoder extends org.lcsim.geometry.CalorimeterIDDecoder
+{
+ public Calorimeter getCalorimeter()
+ {
+ return (Calorimeter) getSubdetector();
+ }
+
+ /**
+ * FIXME: Should be renamed as it is actually returning the distance to the midpoint of the sensitive layer.
+ */
+ public double getDistanceToSensitive(int layer)
+ {
+ if ( detector.getLayering() == null )
+ {
+ throw new RuntimeException("layering is null");
+ }
+ 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)
+ {
+ long[] dummyNeighbours = {0, 0, 0};
+ return dummyNeighbours;
+ }
+
+ public boolean supportsNeighbours()
+ {
+ return false;
+ }
+
+ public long[] getNeighbourIDs()
+ {
+ return getNeighbourIDs(1,1,1);
+ }
+}
\ No newline at end of file
GeomConverter/src/org/lcsim/geometry/subdetector
diff -N LayeredSubdetectorBase.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ LayeredSubdetectorBase.java 20 Jul 2005 19:11:59 -0000 1.1
@@ -0,0 +1,44 @@
+/*
+ * LayeredSubdetector.java
+ *
+ * Created on July 17, 2005, 5:49 PM
+ *
+ */
+
+package org.lcsim.geometry.subdetector;
+
+import org.lcsim.geometry.layer.Layering;
+import org.jdom.Element;
+import org.jdom.JDOMException;
+
+/**
+ *
+ * @author jeremym
+ */
+class LayeredSubdetectorBase extends SubdetectorBase
+ implements org.lcsim.geometry.subdetector.LayeredSubdetector
+{
+ protected Layering layering;
+
+ /** Creates a new instance of a LayeredSubdetector */
+ public LayeredSubdetectorBase(Element node) throws JDOMException
+ {
+ super(node);
+ build(node);
+ }
+
+ private void build(Element node) throws JDOMException
+ {
+ layering = org.lcsim.geometry.layer.Layering.makeLayering(node);
+ }
+
+ public boolean isLayered()
+ {
+ return true;
+ }
+
+ public Layering getLayering()
+ {
+ return layering;
+ }
+}
\ No newline at end of file
GeomConverter/src/org/lcsim/geometry/subdetector
diff -N SubdetectorIDDecoder.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ SubdetectorIDDecoder.java 20 Jul 2005 19:11:59 -0000 1.1
@@ -0,0 +1,81 @@
+/*
+ * SubdetectorID.java
+ *
+ * Created on July 17, 2005, 4:58 PM
+ *
+ */
+package org.lcsim.geometry.subdetector;
+
+import org.lcsim.geometry.util.IDDecoderBase;
+import org.lcsim.geometry.util.IDDescriptor;
+import org.lcsim.geometry.*;
+
+/**
+ *
+ * @author jeremym
+ */
+public abstract class SubdetectorIDDecoder extends IDDecoderBase
+{
+ public static final int BARREL = 0;
+ public static final int ENDCAP_NORTH = 1;
+ public static final int ENDCAP_SOUTH = 2;
+
+ protected int layerIndex;
+ protected Subdetector detector;
+
+ public void setSubdetector(Subdetector d)
+ {
+ detector = d;
+ }
+
+ public Subdetector getSubdetector()
+ {
+ return detector;
+ }
+
+ public void setIDDescription(IDDescriptor id)
+ {
+ super.setIDDescription(id);
+ layerIndex = id.indexOf("layer");
+ }
+
+ public int getLayer()
+ {
+ return values[layerIndex];
+ }
+
+ private int getBarrelOrEndcapFlag()
+ {
+ return getValue("barrel");
+ }
+
+ /* subsystem identifier (unique???) */
+ public int getSystemNumber()
+ {
+ return getValue("system");
+ }
+
+ /* id from hit = barrel? */
+ public boolean isBarrel()
+ {
+ return ( getBarrelOrEndcapFlag() == BARREL );
+ }
+
+ /* id from hit = endcap? */
+ public boolean isEndcap()
+ {
+ return (!isBarrel());
+ }
+
+ /* endcap w/ pos Z */
+ public boolean isEndcapNorth()
+ {
+ return ( getBarrelOrEndcapFlag() == ENDCAP_NORTH );
+ }
+
+ /* endcap w/ neg Z */
+ public boolean isEndcapSouth()
+ {
+ return ( getBarrelOrEndcapFlag() == ENDCAP_SOUTH );
+ }
+}
\ No newline at end of file
GeomConverter/src/org/lcsim/geometry/subdetector
diff -N TrackerIDDecoder.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ TrackerIDDecoder.java 20 Jul 2005 19:11:59 -0000 1.1
@@ -0,0 +1,19 @@
+/*
+ * TrackerIDDecoder.java
+ *
+ * Created on July 20, 2005, 3:44 AM
+ *
+ */
+
+package org.lcsim.geometry.subdetector;
+
+/**
+ *
+ * @author jeremym
+ */
+public class TrackerIDDecoder extends org.lcsim.geometry.TrackerIDDecoder
+{
+ /** Creates a new instance of TrackerIDDecoder */
+ public TrackerIDDecoder()
+ {}
+}
GeomConverter/src/org/lcsim/geometry/subdetector
diff -u -r1.1 -r1.2
--- CalorimeterBase.java 18 Jul 2005 18:00:06 -0000 1.1
+++ CalorimeterBase.java 20 Jul 2005 19:11:59 -0000 1.2
@@ -5,7 +5,7 @@
*
*/
package org.lcsim.geometry.subdetector;
-import org.lcsim.geometry.CalorimeterIDDecoder;
+import org.lcsim.geometry.subdetector.CalorimeterIDDecoder;
import org.jdom.Element;
import org.jdom.JDOMException;
@@ -16,7 +16,7 @@
* @author jeremym
*/
public class CalorimeterBase
- extends LayeredSubdetector
+ extends LayeredSubdetectorBase
{
/** Creates a new instance of CalorimeterBase */
public CalorimeterBase(Element node) throws JDOMException
GeomConverter/src/org/lcsim/geometry/subdetector
diff -u -r1.5 -r1.6
--- CylindricalBarrelCalorimeter.java 18 Jul 2005 18:00:06 -0000 1.5
+++ CylindricalBarrelCalorimeter.java 20 Jul 2005 19:11:59 -0000 1.6
@@ -36,6 +36,11 @@
build(node);
}
+ public boolean isBarrel()
+ {
+ return true;
+ }
+
private void build(Element node) throws JDOMException
{
Element dimensions = node.getChild("dimensions");
GeomConverter/src/org/lcsim/geometry/subdetector
diff -u -r1.14 -r1.15
--- CylindricalEndcapCalorimeter.java 18 Jul 2005 18:00:06 -0000 1.14
+++ CylindricalEndcapCalorimeter.java 20 Jul 2005 19:11:59 -0000 1.15
@@ -23,6 +23,11 @@
build(node);
}
+ public boolean isEndcap()
+ {
+ return true;
+ }
+
private void build(Element node) throws JDOMException
{
Element dimensions = node.getChild("dimensions");
GeomConverter/src/org/lcsim/geometry/subdetector
diff -u -r1.6 -r1.7
--- DiskTracker.java 18 Jul 2005 18:00:06 -0000 1.6
+++ DiskTracker.java 20 Jul 2005 19:11:59 -0000 1.7
@@ -30,6 +30,11 @@
super(node);
build(node);
}
+
+ public boolean isEndcap()
+ {
+ return true;
+ }
private void build(Element node) throws DataConversionException
{
GeomConverter/src/org/lcsim/geometry/subdetector
diff -u -r1.2 -r1.3
--- LayeredSubdetector.java 19 Jul 2005 20:33:36 -0000 1.2
+++ LayeredSubdetector.java 20 Jul 2005 19:11:59 -0000 1.3
@@ -1,47 +1,20 @@
/*
* LayeredSubdetector.java
*
- * Created on July 17, 2005, 5:49 PM
+ * Created on July 17, 2005, 4:32 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.subdetector;
import org.lcsim.geometry.layer.Layering;
-import org.jdom.Element;
-import org.jdom.JDOMException;
+import org.lcsim.geometry.*;
/**
*
* @author jeremym
*/
-public class LayeredSubdetector extends SubdetectorBase
- implements org.lcsim.geometry.LayeredSubdetector
+public interface LayeredSubdetector extends Subdetector
{
- protected Layering layering;
-
- /** Creates a new instance of a LayeredSubdetector */
- public LayeredSubdetector(Element node) throws JDOMException
- {
- super(node);
- build(node);
- }
-
- private void build(Element node) throws JDOMException
- {
- layering = org.lcsim.geometry.layer.Layering.makeLayering(node);
- }
-
- public boolean isLayered()
- {
- return true;
- }
-
- public Layering getLayering()
- {
- return layering;
- }
+ Layering getLayering();
}
\ No newline at end of file
GeomConverter/src/org/lcsim/geometry/subdetector
diff -u -r1.7 -r1.8
--- MultiLayerTracker.java 18 Jul 2005 18:00:06 -0000 1.7
+++ MultiLayerTracker.java 20 Jul 2005 19:11:59 -0000 1.8
@@ -1,6 +1,6 @@
package org.lcsim.geometry.subdetector;
-import org.lcsim.geometry.TrackerIDDecoder;
+import org.lcsim.geometry.subdetector.TrackerIDDecoder;
import java.util.Iterator;
import java.util.List;
@@ -32,6 +32,11 @@
build(node);
}
+ public boolean isBarrel()
+ {
+ return true;
+ }
+
private void build(Element node) throws DataConversionException
{
List layers = node.getChildren("layer");
GeomConverter/src/org/lcsim/geometry/subdetector
diff -u -r1.2 -r1.3
--- SubdetectorBase.java 19 Jul 2005 20:34:15 -0000 1.2
+++ SubdetectorBase.java 20 Jul 2005 19:11:59 -0000 1.3
@@ -13,7 +13,7 @@
import org.jdom.Element;
import org.jdom.JDOMException;
import org.lcsim.geometry.HepRepProvider;
-import org.lcsim.geometry.layer.Layering;
+import org.lcsim.geometry.subdetector.SubdetectorIDDecoder;
/**
*
@@ -23,12 +23,12 @@
* implementation classes, which extend it.
*
*/
-class SubdetectorBase
+class SubdetectorBase
extends org.lcsim.geometry.compact.Subdetector
implements HepRepProvider
-{
- /**
- * FIXME: This means the JDOM reference is kept around until
+{
+ /**
+ * FIXME: This means the JDOM reference is kept around until
* corresponding object is deleted. It doesn't seem like a good idea.
*/
Element node;
@@ -37,8 +37,13 @@
public SubdetectorBase(Element node) throws JDOMException
{
super(node);
- }
-
+ }
+
+ public SubdetectorIDDecoder getSubdetectorIDDecoder()
+ {
+ return (SubdetectorIDDecoder)(getReadout().getIDDecoder() );
+ }
+
/** HepRepProvider: optional impl for subclass */
/** FIXME: Should live in org.lcsim.geometry.heprep or equivalent. */
public void appendHepRep(HepRepFactory factory, HepRep heprep)
GeomConverter/src/org/lcsim/geometry/subdetector
diff -u -r1.2 -r1.3
--- TrackerBase.java 19 Jul 2005 20:31:57 -0000 1.2
+++ TrackerBase.java 20 Jul 2005 19:11:59 -0000 1.3
@@ -7,9 +7,9 @@
package org.lcsim.geometry.subdetector;
import org.lcsim.geometry.Tracker;
-import org.lcsim.geometry.TrackerIDDecoder;
import org.jdom.Element;
import org.jdom.JDOMException;
+import org.lcsim.geometry.TrackerIDDecoder;
/**
*
@@ -18,18 +18,18 @@
* Assumes that all concrete Tracker types will implement Layering interface.
*/
public class TrackerBase
- extends LayeredSubdetector
+ extends LayeredSubdetectorBase
implements Tracker
-{
+{
/** Creates a new instance of TrackerBase */
public TrackerBase(Element node) throws JDOMException
{
super(node);
}
-
- public TrackerIDDecoder getTrackerIDDecoder()
+
+ public org.lcsim.geometry.TrackerIDDecoder getTrackerIDDecoder()
{
- return (TrackerIDDecoder)(getReadout().getIDDecoder() );
+ return (org.lcsim.geometry.TrackerIDDecoder)(getReadout().getIDDecoder() );
}
public boolean isTracker()
GeomConverter/test/org/lcsim/geometry
diff -u -r1.6 -r1.7
--- GeometryReaderTest.java 19 Jul 2005 20:31:38 -0000 1.6
+++ GeometryReaderTest.java 20 Jul 2005 19:12:00 -0000 1.7
@@ -9,6 +9,8 @@
import junit.framework.*;
import java.io.InputStream;
import org.lcsim.geometry.compact.Header;
+import org.lcsim.geometry.CalorimeterIDDecoder;
+import org.lcsim.geometry.TrackerIDDecoder;
/**
*
CVSspam 0.2.8