GeomConverter/src/org/lcsim/geometry/segmentation
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
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()