1 added + 24 modified, total 25 files
GeomConverter/src/org/lcsim/detector
diff -u -r1.22 -r1.23
--- DetectorElement.java 7 May 2007 22:32:48 -0000 1.22
+++ DetectorElement.java 9 May 2007 00:59:57 -0000 1.23
@@ -9,6 +9,12 @@
import org.lcsim.detector.identifier.IExpandedIdentifier;
import org.lcsim.detector.identifier.IIdentifierHelper;
+/**
+ * Implementation of {@link IDetectorElement}.
+ *
+ * @author Jeremy McCormick
+ * @version $Id: DetectorElement.java,v 1.23 2007/05/09 00:59:57 jeremy Exp $
+ */
public class DetectorElement
extends Named
implements IDetectorElement
@@ -461,17 +467,22 @@
}
}
- public <T extends IDetectorElement> List<T> getAncestors(Class<T> klass)
+ public <T extends IDetectorElement> List<T> findAncestors(Class<T> klass)
{
TypeSearch<T> search = new TypeSearch<T>( klass );
traverseAncestors( search );
return search.getResult();
}
- public <T extends IDetectorElement> List<T> getDescendants(Class<T> klass)
+ public <T extends IDetectorElement> List<T> findDescendants(Class<T> klass)
{
TypeSearch<T> search = new TypeSearch<T>( klass );
traverseDescendantsPreOrder( search );
return search.getResult();
}
-}
+
+ public boolean isAncestor(IDetectorElement de)
+ {
+ return getAncestry().contains(de);
+ }
+}
\ No newline at end of file
GeomConverter/src/org/lcsim/detector
diff -u -r1.3 -r1.4
--- DetectorElementContainer.java 2 May 2007 01:58:18 -0000 1.3
+++ DetectorElementContainer.java 9 May 2007 00:59:57 -0000 1.4
@@ -3,7 +3,7 @@
import java.util.ArrayList;
/**
- *
+ * Implementation of {@link IDetectorElementContainer}.
*/
public class DetectorElementContainer
extends ArrayList<IDetectorElement>
GeomConverter/src/org/lcsim/detector
diff -u -r1.12 -r1.13
--- GeometryInfo.java 4 May 2007 10:23:37 -0000 1.12
+++ GeometryInfo.java 9 May 2007 00:59:57 -0000 1.13
@@ -11,7 +11,6 @@
*
* @author Jeremy McCormick <[log in to unmask]>
* @author Tim Nelson <[log in to unmask]>
- *
*/
public class GeometryInfo
implements IGeometryInfo
@@ -19,7 +18,7 @@
IDetectorElement de;
IGeometryInfoContainer childIGeometryInfos;
IGeometryInfo parentIGeometryInfo;
- IPhysicalVolumePath support;
+ IPhysicalVolumePath path;
ILogicalVolume logicalVolume;
ITransform3D globalToLocal;
ITransform3D localToGlobal;
@@ -82,26 +81,26 @@
// information.
if ( support != null )
{
- setupSupport(support);
+ setupPath(support);
}
}
- private void setupSupport(
- IPhysicalVolumePath support
+ private void setupPath(
+ IPhysicalVolumePath path
)
{
- if ( this.support != null )
+ if ( this.path != null )
{
throw new RuntimeException("The DetectorElement already has support in the geometry!");
}
- if ( support == null )
+ if ( path == null )
{
throw new IllegalArgumentException("The IPhysicalVolumePath is null!");
}
// Set the support reference.
- this.support = support;
+ this.path = path;
// Get the current geometry navigator.
IPhysicalVolumeNavigator navigator =
@@ -110,26 +109,24 @@
// Set the LogicalVolume from the path if it hasn't been setup already.
if ( this.logicalVolume == null )
{
- logicalVolume = support.getLeafVolume().getLogicalVolume();
+ logicalVolume = this.path.getLeafVolume().getLogicalVolume();
}
// Cache the local to global transform.
- localToGlobal = navigator.getTransform(support);
+ localToGlobal = navigator.getTransform(this.path);
// Cache the global to local transform.
globalToLocal = localToGlobal.inverse();
// Cache the parent to global transform.
- if ( parentIGeometryInfo() != null ) {
+ if ( parentGeometry() != null ) {
parentToLocal = Transform3D.multiply(
getGlobalToLocal(),
- parentIGeometryInfo().getLocalToGlobal());
+ parentGeometry().getLocalToGlobal());
}
// Cache the global position.
- globalPosition = localToGlobal.transformed(new BasicHep3Vector(0.,0.,0.));
-
- //System.out.println(getDetectorElement().getName() + " = " + globalPosition);
+ globalPosition = localToGlobal.transformed(new BasicHep3Vector(0.,0.,0.));
}
/**
@@ -181,7 +178,7 @@
setup(de,null,support);
}
- public IGeometryInfoContainer getChildGeometryInfos()
+ public IGeometryInfoContainer getChildGeometries()
{
return childIGeometryInfos;
}
@@ -196,24 +193,29 @@
return logicalVolume;
}
- public String getLogicalVolumeName()
- {
- return getLogicalVolume().getName();
- }
-
public IPhysicalVolume getPhysicalVolume(Hep3Vector globalPoint)
{
return getPath(globalPoint).getLeafVolume();
}
+
+ public IPhysicalVolume getPhysicalVolume()
+ {
+ IPhysicalVolume pv = null;
+ if ( hasPath() )
+ {
+ pv = path.getLeafVolume();
+ }
+ return pv;
+ }
public Hep3Vector getPosition()
{
return globalPosition;
}
- public IPhysicalVolumePath getPhysicalVolumePath()
+ public IPhysicalVolumePath getPath()
{
- return support;
+ return path;
}
public ITransform3D getGlobalToLocal()
@@ -236,7 +238,6 @@
* Check the daughters recursively if this GeometryInfo does not
* have a corresponding node in the geometry tree, i.e. if it
* is a "ghost" that is just a container for other DetectorElements.
- *
*/
public boolean isInside(Hep3Vector globalPoint)
{
@@ -270,7 +271,7 @@
return localToGlobal.transformed(local_point);
}
- public IGeometryInfo parentIGeometryInfo()
+ public IGeometryInfo parentGeometry()
{
return parentIGeometryInfo;
}
@@ -284,15 +285,10 @@
{
return parentToLocal.transformed(parentPoint);
}
-
- public boolean isGhost()
- {
- return support == null && logicalVolume == null;
- }
public boolean isOrphan()
{
- return support == null && logicalVolume != null;
+ return path == null && logicalVolume != null;
}
public IDetectorElement getDetectorElement()
@@ -307,6 +303,16 @@
public boolean hasPath()
{
- return support != null;
+ return path != null;
}
+
+ public String getPathString()
+ {
+ String pathString = null;
+ if ( hasPath() )
+ {
+ pathString = path.toString();
+ }
+ return pathString;
+ }
}
GeomConverter/src/org/lcsim/detector
diff -u -r1.17 -r1.18
--- IDetectorElement.java 7 May 2007 22:32:48 -0000 1.17
+++ IDetectorElement.java 9 May 2007 00:59:57 -0000 1.18
@@ -26,7 +26,7 @@
*
* @author jeremym
* @author tknelson
- * @version $Id: IDetectorElement.java,v 1.17 2007/05/07 22:32:48 jeremy Exp $
+ * @version $Id: IDetectorElement.java,v 1.18 2007/05/09 00:59:57 jeremy Exp $
*/
public interface IDetectorElement
extends IIdentifiable, INamed
@@ -161,6 +161,11 @@
public IDetectorElementContainer getAncestry();
/**
+ * True if the DetectorElement is an ancestor of this one.
+ */
+ public boolean isAncestor(IDetectorElement de);
+
+ /**
* Clear the {@link IReadout} of this {@link DetectorElement}
* and recursively visit and clear the children..
*
@@ -204,7 +209,7 @@
*
* @param klass Class to match.
*/
- public <T extends IDetectorElement> List<T> getAncestors(Class<T> klass);
+ public <T extends IDetectorElement> List<T> findAncestors(Class<T> klass);
/**
* Find descendants matching a class.
@@ -212,5 +217,5 @@
* @param klass The class of the descendant DetectorElement.
* @return Get a list of descendants with matching class.
*/
- public <T extends IDetectorElement> List<T> getDescendants(Class<T> klass);
+ public <T extends IDetectorElement> List<T> findDescendants(Class<T> klass);
}
GeomConverter/src/org/lcsim/detector
diff -u -r1.12 -r1.13
--- IGeometryInfo.java 4 May 2007 10:23:37 -0000 1.12
+++ IGeometryInfo.java 9 May 2007 00:59:57 -0000 1.13
@@ -5,24 +5,24 @@
/**
* IGeometryInfo provides geometry information about an {@link IDetectorElement}.
*
- * This information includes the following:
+ * These are some of the important methods on {@link IGeometryInfo}.
*
* <ul>
- * <li>associated {@link ILogicalVolume}</li>
- * <li>name of associated {@link LogicalVolume}</li>
- * <li>global to local {@link Transform3D}</li>
- * <li>local to global {@link Transform3D}</li>
- * <li>parent to local {@link Transform3D}</li>
- * <li>{@link PhysicalVolumePath} associated with this {@link DetectorElement}</li>
- * <li>{@link #isInside(Hep3Vector)} on a global point which checks if the point is inside the leaf geometry node in the path</li>
+ * <li>{@link #getLogicalVolume()} - associated {@link ILogicalVolume}</li>
+ * <li>{@link #getLogicalVolumeName()} - name of associated {@link LogicalVolume}</li>
+ * <li>{@link #getGlobalToLocal()} - global to local {@link Transform3D}</li>
+ * <li>{@link #getLocalToGlobal()} - local to global {@link Transform3D}</li>
+ * <li>{@link #getParentToLocal()} - parent to local {@link Transform3D}</li>
+ * <li>{@link #getPath()} - {@link PhysicalVolumePath} associated with this {@link DetectorElement}</li>
+ * <li>{@link #isInside(Hep3Vector)} - check if a global point is inside this geometry</li>
* </ul>
*
- * An {@link IDetectorElement} may have an IGeometryInfo, which means that it has support in the geometry tree.
- * Those DetectorElements without IGeometryInfo are ghost volumes that have no geometric correspondence, but
- * fill a logical roll in the detector hierarchy.
+ * An {@link IDetectorElement} may have an IGeometryInfo, which means that it has support
+ * in the geometry tree. Those DetectorElements without IGeometryInfo are ghost volumes
+ * that have no geometric correspondence, but fill a logical roll in the detector hierarchy.
*
- * @author Jeremy McCormick <[log in to unmask]>
- * @author Tim Nelson <[log in to unmask]>
+ * @author Jeremy McCormick
+ * @author Tim Nelson
*/
public interface IGeometryInfo
{
@@ -30,15 +30,14 @@
* Get an {@link IGeometryInfoContainer} with the child DetectorElement's IGeometryInfo objects.
* @return Container of IGeometryInfos from the child DetectorElements.
*/
- public IGeometryInfoContainer getChildGeometryInfos();
+ public IGeometryInfoContainer getChildGeometries();
/**
* Get the {@link IPhysicalVolumePath} at a global point.
* @param globalPoint A point in global coordinates.
* @return A path of physical volumes at the global point.
*/
- public IPhysicalVolumePath getPath(
- Hep3Vector globalPoint);
+ public IPhysicalVolumePath getPath(Hep3Vector globalPoint);
/**
* Get the associated {@link ILogicalVolume}.
@@ -47,12 +46,6 @@
public ILogicalVolume getLogicalVolume();
/**
- * Get the name of the associated LogicalVolume.
- * @return The name of the associated LogicalVolume.
- */
- public String getLogicalVolumeName();
-
- /**
* Get the PhysicalVolume at the global point
* using the IPhysicalVolumePath of this IGeometryInfo.
*
@@ -60,6 +53,10 @@
* @return The PhysicalVolume at the point.
*/
public IPhysicalVolume getPhysicalVolume(Hep3Vector globalPoint);
+
+ /**
+ * Get the leaf PhysicalVolume in this
+ */
/**
* Get the center position of the DetectorElement in global coordinates.
@@ -75,7 +72,15 @@
*
* @return The path of this DetectorElement.
*/
- public IPhysicalVolumePath getPhysicalVolumePath();
+ public IPhysicalVolumePath getPath();
+
+ /**
+ * Get the {@link IPhysicalVolumePath} from {@link #getPath}
+ * as a {@link String}.
+ *
+ * @return The path string.
+ */
+ public String getPathString();
/**
* Get the combined global to local transform.
@@ -141,7 +146,7 @@
* @return The parent's IGeometryInfo or <code>null</code>
* if none exists.
*/
- public IGeometryInfo parentIGeometryInfo();
+ public IGeometryInfo parentGeometry();
/**
* Transform point in parent geometry to local coordinate system.
@@ -150,23 +155,17 @@
* @return Point transformed from parent to local coordinates.
*/
public Hep3Vector transformParentToLocal(Hep3Vector parentPoint);
-
- /**
- * Set the {@link IPhysicalVolumePath} with full geometry information
- * for this DetectorElement.
- *
- * @param path The path assigned to this DetectorElement.
- */
- //public void setPath(IPhysicalVolumePath path);
-
+
/**
- * True if the IGeometryInfo does not have an associated path in the geometry tree.
+ * Return the associated {@link DetectorElement}.
+ *
+ * @return The associated DetectorElement.
*/
- public boolean isGhost();
+ public IDetectorElement getDetectorElement();
/**
- * Return the associated DetectorElement.
- * @return The associated DetectorElement.
+ * Get the associated {@link IPhysicalVolume} or
+ * <code>null</code> if none exists.
*/
- public IDetectorElement getDetectorElement();
-}
+ public IPhysicalVolume getPhysicalVolume();
+}
\ No newline at end of file
GeomConverter/src/org/lcsim/detector
diff -u -r1.7 -r1.8
--- IRotation3D.java 4 May 2007 10:23:37 -0000 1.7
+++ IRotation3D.java 9 May 2007 00:59:57 -0000 1.8
@@ -2,21 +2,16 @@
import hep.physics.vec.BasicHep3Matrix;
import hep.physics.vec.Hep3Matrix;
-import hep.physics.vec.Hep3Vector;
/**
* An interface to rotations in 3D space,
- * using interfaces and base classes within
- * the {@link hep.physics.vec} package.
+ * using interfaces and base classes from
+ * <a href="http://java.freehep.org/freehep-physics/">freehep physics</a>.
*
- * @see hep.physics.vec
- * @see hep.physics.vec.BasicHep3Matrix
- * @see hep.physics.vec.Hep3Matrix
- * @see hep.physics.vec.Hep3Vector
+ * @author Tim Nelson
+ * @author Jeremy McCormick
*
- * @author tknelson
- * @author jeremym
- * @version $Id: IRotation3D.java,v 1.7 2007/05/04 10:23:37 jeremy Exp $
+ * @version $Id: IRotation3D.java,v 1.8 2007/05/09 00:59:57 jeremy Exp $
*/
public interface IRotation3D
{
GeomConverter/src/org/lcsim/detector
diff -u -r1.12 -r1.13
--- PhysicalVolumeNavigator.java 24 Mar 2007 01:02:49 -0000 1.12
+++ PhysicalVolumeNavigator.java 9 May 2007 00:59:57 -0000 1.13
@@ -228,7 +228,7 @@
* access to the complete geometric tree.
*
* @param path
- * @return
+ * @return The path associated with this array of volume names.
*/
public IPhysicalVolumePath getPath(String[] path)
{
@@ -284,13 +284,13 @@
/**
* Set the top volume of this navigator.
- * @param A PhysicalVolume that cannot be null.
+ * @param physvol A PhysicalVolume that cannot be null.
*/
public void setTopPhysicalVolume(IPhysicalVolume physvol)
{
if (physvol == null)
{
- throw new IllegalArgumentException("Top PhysicalVolume cannot be null ref!");
+ throw new IllegalArgumentException("Top volume points to null!");
}
pvTop = physvol;
}
@@ -403,8 +403,7 @@
* calling the given IPhysicalVolumeVisitor's visit method
* for each node.
*
- * @param physicalVolume
- * @param visitor
+ * @param visitor A visitor to process the nodes.
*/
public void traversePostOrder(IPhysicalVolumeVisitor visitor)
GeomConverter/src/org/lcsim/detector
diff -u -r1.4 -r1.5
--- PhysicalVolumePath.java 15 Mar 2007 02:09:14 -0000 1.4
+++ PhysicalVolumePath.java 9 May 2007 00:59:57 -0000 1.5
@@ -63,7 +63,7 @@
* are different PhysicalVolume objects.
*
* @param path
- * @return
+ * @return True if the the paths are equal.
*/
public boolean equals(IPhysicalVolumePath path)
{
@@ -90,9 +90,16 @@
/**
* Compare the smallest prefix set of PhysicalVolumes together.
+ *
+ * For instance, these two IDs would return true.
+ *
+ * <code>
+ * ExpandedIdentifier id1 = ExpandedIdentifier("/1/2/3");
+ * ExpandedIdentifier id2 = ExpandedIdentifier("/1/2/");
+ * </code>
*
* @param path
- * @return
+ * @return True if the set of prefix fields is equal.
*/
public boolean equals_prefix(IPhysicalVolumePath path)
{
GeomConverter/src/org/lcsim/detector/converter/compact
diff -N DeSubdetector.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ DeSubdetector.java 9 May 2007 00:59:58 -0000 1.1
@@ -0,0 +1,42 @@
+package org.lcsim.detector.converter.compact;
+
+import org.lcsim.detector.DetectorElement;
+import org.lcsim.detector.IPhysicalVolumePath;
+import org.lcsim.geometry.compact.Detector;
+import org.lcsim.geometry.compact.Subdetector;
+
+/**
+ * Wraps an {@link org.lcsim.geometry.compact.Subdetector}
+ * in a {@link org.lcsim.detector.DetectorElement}.
+ *
+ * @author Jeremy McCormick
+ * @version $Id: DeSubdetector.java,v 1.1 2007/05/09 00:59:58 jeremy Exp $
+ */
+public class DeSubdetector
+extends DetectorElement
+{
+ private Subdetector subdetector;
+
+ public DeSubdetector(Detector detector, Subdetector subdetector, String path)
+ {
+ super( subdetector.getName(), detector.getDetectorElement(), path);
+ this.subdetector = subdetector;
+ }
+
+ public DeSubdetector(Detector detector, Subdetector subdetector, IPhysicalVolumePath path)
+ {
+ super( subdetector.getName(), detector.getDetectorElement(), path);
+ this.subdetector = subdetector;
+ }
+
+ public DeSubdetector(Detector detector, Subdetector subdetector)
+ {
+ super( subdetector.getName(), detector.getDetectorElement() );
+ this.subdetector = subdetector;
+ }
+
+ public Subdetector getSubdetector()
+ {
+ return subdetector;
+ }
+}
\ No newline at end of file
GeomConverter/src/org/lcsim/detector/converter/compact
diff -u -r1.7 -r1.8
--- CylindricalBarrelCalorimeterConverter.java 20 Apr 2007 00:16:53 -0000 1.7
+++ CylindricalBarrelCalorimeterConverter.java 9 May 2007 00:59:58 -0000 1.8
@@ -54,7 +54,7 @@
IPhysicalVolumePath path = nav.getPath( cal.getName() );
// Create the Subdetector's DetectorElement.
- cal.setDetectorElement( new DetectorElement( cal.getName(), detector.getDetectorElement(), path) );
+ cal.setDetectorElement( new DeSubdetector(detector, cal, path) );
// Build the layers.
buildLayers(cal, envelope);
GeomConverter/src/org/lcsim/detector/converter/compact
diff -u -r1.7 -r1.8
--- CylindricalEndcapCalorimeterConverter.java 20 Apr 2007 00:16:54 -0000 1.7
+++ CylindricalEndcapCalorimeterConverter.java 9 May 2007 00:59:58 -0000 1.8
@@ -27,7 +27,7 @@
{
CylindricalEndcapCalorimeter cal = (CylindricalEndcapCalorimeter)subdet;
- subdet.setDetectorElement( new DetectorElement(subdet.getName(), detector.getDetectorElement() ) );
+ subdet.setDetectorElement( new DeSubdetector( detector, subdet ) );
IPhysicalVolume world = detector.getWorldVolume();
GeomConverter/src/org/lcsim/detector/converter/compact
diff -u -r1.1 -r1.2
--- DeDetector.java 2 May 2007 01:58:19 -0000 1.1
+++ DeDetector.java 9 May 2007 00:59:58 -0000 1.2
@@ -9,13 +9,12 @@
* Wraps a compact detector in a DetectorElement.
*
* @see org.lcsim.geometry.Detector
- * @see org.lcsim.geometry.DetectorElement
+ * @see org.lcsim.detector.DetectorElement
* @see org.lcsim.geometry.FieldMap
*
* @author Jeremy McCormick
- * @version $Id: DeDetector.java,v 1.1 2007/05/02 01:58:19 jeremy Exp $
+ * @version $Id: DeDetector.java,v 1.2 2007/05/09 00:59:58 jeremy Exp $
*/
-
public class DeDetector
extends DetectorElement
{
@@ -30,4 +29,9 @@
{
return detector.getFieldMap().getField(position);
}
+
+ public Detector getCompactDetector()
+ {
+ return detector;
+ }
}
\ No newline at end of file
GeomConverter/src/org/lcsim/detector/converter/compact
diff -u -r1.15 -r1.16
--- DetectorConverter.java 8 May 2007 00:53:30 -0000 1.15
+++ DetectorConverter.java 9 May 2007 00:59:58 -0000 1.16
@@ -135,7 +135,8 @@
// Lookup a registered converter for this Subdetector class.
ISubdetectorConverter cnv = getSubdetectorConverter( subdet.getClass() );
- if ( cnv != null )
+ // Convert to detailed description if a suitable converter exists.
+ if ( cnv != null && subdet.getReadout() != null )
{
// Build the IdentifierDictionary for this Subdetector.
// Subdetector converters may need this to be done first.
@@ -155,13 +156,14 @@
}
/**
- * Creates an {@see IIdentifierDictionary} from an existing {@see org.lcsim.geometry.Subdetector}.
+ * Creates an {@link IIdentifierDictionary} from an existing
+ * {@link org.lcsim.geometry.compact.Subdetector}.
*
- * @see org.lcsim.geometry.Readout
- * @see org.lcsim.detector.identifier
- * @see org.lcsim.detector.identifier.IIdentifierDictionary
- * @see org.lcsim.detector.identifier.IIdentifierDictionaryManager
- * @see org.lcsim.detector.identifier.IIdentifierField
+ * @link org.lcsim.geometry.Readout
+ * @link org.lcsim.detector.identifier
+ * @link org.lcsim.detector.identifier.IIdentifierDictionary
+ * @link org.lcsim.detector.identifier.IIdentifierDictionaryManager
+ * @link org.lcsim.detector.identifier.IIdentifierField
*
* @param subdet The Subdetector.
*/
GeomConverter/src/org/lcsim/detector/converter/compact
diff -u -r1.8 -r1.9
--- DiskTrackerConverter.java 20 Apr 2007 00:16:54 -0000 1.8
+++ DiskTrackerConverter.java 9 May 2007 00:59:58 -0000 1.9
@@ -34,7 +34,7 @@
DiskTracker tracker = (DiskTracker)subdet;
- subdet.setDetectorElement( new DetectorElement( subdet.getName(), detector.getDetectorElement() ) );
+ subdet.setDetectorElement( new DeSubdetector( detector, subdet ) );
Layering layering = tracker.getLayering();
String name = tracker.getName();
GeomConverter/src/org/lcsim/detector/converter/compact
diff -u -r1.5 -r1.6
--- MultiLayerTrackerConverter.java 20 Apr 2007 00:16:54 -0000 1.5
+++ MultiLayerTrackerConverter.java 9 May 2007 00:59:58 -0000 1.6
@@ -29,7 +29,7 @@
ILogicalVolume trackingVolume =
detector.getTrackingVolume().getLogicalVolume();
- tracker.setDetectorElement( new DetectorElement( subdet.getName(), detector.getDetectorElement() ) );
+ tracker.setDetectorElement( new DeSubdetector( detector, subdet ) );
Layering layering = tracker.getLayering();
GeomConverter/src/org/lcsim/detector/converter/compact
diff -u -r1.13 -r1.14
--- SiTrackerBarrelConverter.java 8 May 2007 06:41:53 -0000 1.13
+++ SiTrackerBarrelConverter.java 9 May 2007 00:59:58 -0000 1.14
@@ -46,7 +46,7 @@
{
//System.out.println("SiTrackerBarrelConverter.convert");
- subdet.setDetectorElement( new DetectorElement( subdet.getName(), detector.getDetectorElement() ) );
+ subdet.setDetectorElement( new DeSubdetector( detector, subdet ) );
Map<String, ILogicalVolume> modules = buildModules(subdet);
@@ -477,7 +477,7 @@
for ( IDetectorElement module : layer.getChildren() )
{
IPhysicalVolumePath modulePath =
- module.getGeometry().getPhysicalVolumePath();
+ module.getGeometry().getPath();
IPhysicalVolume modulePhysVol =
modulePath.getLeafVolume();
@@ -497,7 +497,7 @@
expId.addValue(0);
// Set the layer number.
- expId.addValue(layer.getGeometry().getPhysicalVolumePath().getLeafVolume().getCopyNumber());
+ expId.addValue(layer.getGeometry().getPath().getLeafVolume().getCopyNumber());
// Set the module id from the DetectorElement.
expId.addValue(((SiTrackerBarrelModule)module).getModuleId());
GeomConverter/src/org/lcsim/detector/identifier
diff -u -r1.4 -r1.5
--- IExpandedIdentifier.java 4 May 2007 10:23:38 -0000 1.4
+++ IExpandedIdentifier.java 9 May 2007 00:59:58 -0000 1.5
@@ -3,14 +3,14 @@
import java.util.List;
/**
- * An ID that has been unpacked from an {@link org.lcsim.detector.IIdentifier}
+ * An ID that has been unpacked from an {@link IIdentifier}
* so that individual field values are available by index.
*
- * Use the appropriate {@link org.lcsim.detector.IIdentifierDictionary} to
+ * Use the appropriate {@link IIdentifierDictionary} to
* see which indices correspond to which field labels.
*
* @author jeremym
- * @version $Id: IExpandedIdentifier.java,v 1.4 2007/05/04 10:23:38 jeremy Exp $
+ * @version $Id: IExpandedIdentifier.java,v 1.5 2007/05/09 00:59:58 jeremy Exp $
*/
public interface IExpandedIdentifier
GeomConverter/src/org/lcsim/detector/identifier
diff -u -r1.4 -r1.5
--- IIdentifier.java 2 May 2007 23:43:33 -0000 1.4
+++ IIdentifier.java 9 May 2007 00:59:58 -0000 1.5
@@ -3,53 +3,54 @@
/**
* An interface defining comparable 64-bit identifiers
* using for uniquely defining components of the
- * detector.
+ * detector.
*
- * @see DetectorElement
- *
- * @author jeremym
- * @version $Id: IIdentifier.java,v 1.4 2007/05/02 23:43:33 jeremy Exp $
+ * @author Jeremy McCormick
+ * @version $Id: IIdentifier.java,v 1.5 2007/05/09 00:59:58 jeremy Exp $
*/
public interface IIdentifier
extends Comparable
{
/**
* Get the value of this identifier as a long.
+ * @return The long value.
*/
long getValue();
/**
* Set the value of this identifier from a long.
*
- * @param id
+ * @param id The long value.
*/
void setValue(long id);
/**
* Get a raw hex string representation.
*
- * @return
+ * @return The raw hex string.
*/
public String toHexString();
/**
* Set the value from a raw hex string.
*
- * @param hexRep
+ * @param hexRep The hex representation.
*/
public void fromHexString(String hexRep);
/**
- * Clear the state of this identifier.
+ * Clear the state of this identifier,
+ * setting the value to 0.
*/
public void clear();
/**
* True if this ID has been set;
* False if it has not been set
- * or was set and then cleared.
+ * or was set and {@link #clear()}
+ * was called.
*
- * @return
+ * @return True if this ID is valid.
*/
public boolean isValid();
}
\ No newline at end of file
GeomConverter/src/org/lcsim/detector/identifier
diff -u -r1.3 -r1.4
--- Identifier.java 3 May 2007 21:51:27 -0000 1.3
+++ Identifier.java 9 May 2007 00:59:58 -0000 1.4
@@ -5,15 +5,15 @@
* Implementation of {@link IIdentifier}.
*
* @author Jeremy McCormick
- * @version $Id: Identifier.java,v 1.3 2007/05/03 21:51:27 jeremy Exp $
+ * @version $Id: Identifier.java,v 1.4 2007/05/09 00:59:58 jeremy Exp $
*/
package org.lcsim.detector.identifier;
/**
- * Implementation of a 64-bit packed identifier.
+ * Implementation of {@link IIdentifier}.
*
- * @see DetectorElement
- * @see IIdentifier
+ * @author Jeremy McCormick
+ * @version $Id: Identifier.java,v 1.4 2007/05/09 00:59:58 jeremy Exp $
*/
public class Identifier
implements IIdentifier
GeomConverter/src/org/lcsim/detector/identifier
diff -u -r1.4 -r1.5
--- IdentifierHelper.java 6 May 2007 07:19:09 -0000 1.4
+++ IdentifierHelper.java 9 May 2007 00:59:58 -0000 1.5
@@ -11,7 +11,7 @@
* @see IdentifierUtil
*
* @author Jeremy McCormick
- * @version $Id: IdentifierHelper.java,v 1.4 2007/05/06 07:19:09 jeremy Exp $
+ * @version $Id: IdentifierHelper.java,v 1.5 2007/05/09 00:59:58 jeremy Exp $
*/
public class IdentifierHelper
@@ -38,4 +38,16 @@
{
return IdentifierUtil.unpack( id, iddict );
}
-}
+
+ /*
+
+ FIXME: Need to support the following methods from IDDecoder.
+
+ public int getValue(String field);
+ public int getValue(int index);
+ public int getFieldCount();
+ public String getFieldName(int index);
+ public int getFieldIndex(String name);
+
+ */
+}
\ No newline at end of file
GeomConverter/src/org/lcsim/geometry
diff -u -r1.7 -r1.8
--- GeometryReader.java 17 Mar 2007 00:10:41 -0000 1.7
+++ GeometryReader.java 9 May 2007 00:59:58 -0000 1.8
@@ -35,6 +35,8 @@
*/
public class GeometryReader extends CompactReader
{
+ boolean buildDetailed;
+
public GeometryReader()
{
super(new GeometryFactory());
@@ -57,6 +59,16 @@
return detector;
}
+
+ public boolean buildDetailed()
+ {
+ return buildDetailed;
+ }
+
+ public void setBuildDetailed(boolean buildDetailed)
+ {
+ this.buildDetailed = buildDetailed;
+ }
static class GeometryFactory extends CompactElementFactory
{
GeomConverter/src/org/lcsim/geometry
diff -u -r1.16 -r1.17
--- IDDecoder.java 29 Nov 2006 08:33:28 -0000 1.16
+++ IDDecoder.java 9 May 2007 00:59:58 -0000 1.17
@@ -7,89 +7,98 @@
/**
*
- * @author tonyj
+ * Compact detector description interface for identifier handling.
+ *
+ * @author Tony Johnson
+ * @author Jeremy McCormick
*/
public interface IDDecoder
{
- /** Constant that flags an invalid index, i.e. for a field that does not exist. */
+ /**
+ * Constant that flags an invalid index, i.e. for a field that does not exist.
+ */
public static final int INVALID_INDEX = -1;
- /* /\/\/\ ID decoding /\/\/\ */
-
- /** Load the decoder with a 64-bit id value from the hit. */
+ /**
+ * Load the decoder with a 64-bit id value from the hit.
+ */
public void setID(long id);
- /** Get an expanded identifier that maps strings to integer values. */
- //public ExpandedIdentifier getExpandedIdentifier();
-
- /** Same as getIDExpanded() except sets id. */
- //public ExpandedIdentifier getExpandedIdentifier(long id);
-
- /*/\/\/\ Access to field data /\/\/\ */
public int getValue(String field);
public int getValue(int index);
- /* /\/\/\ ID description /\/\/\ */
public int getFieldCount();
public String getFieldName(int index);
public int getFieldIndex(String name);
public void setIDDescription(IDDescriptor id);
public IDDescriptor getIDDescription();
- /** @return layer number */
+ /**
+ * Get the layer number.
+ * @return layer number
+ */
public int getLayer();
- /* /\/\/\ Position interface /\/\/\ */
-
- // FIXME: change to Hep3Vector and eliminate the X/Y/Z/theta/phi methods
-
- /** @return Hep3Vector representing the position of the current ID. */
+ /**
+ * @return Hep3Vector representing the position of the current ID.
+ */
public Hep3Vector getPositionVector();
- /** @return position as double array of length 3 */
+ /**
+ * @return position as double array of length 3
+ */
public double[] getPosition();
- /** @return X coordinate */
+ /**
+ * @return X coordinate
+ */
public double getX();
- /** @return Y coordinate */
+ /**
+ * @return Y coordinate
+ */
public double getY();
- /** @return Z coordinate */
+ /**
+ * @return Z coordinate
+ */
public double getZ();
- /** @return phi angle */
+ /**
+ * @return phi angle
+ */
public double getPhi();
- /** @return theta angle */
+ /**
+ * @return theta angle
+ */
public double getTheta();
- /* /\/\/\ Reverse Decoding: Position to Cell /\/\/\ */
-
public long findCellContainingXYZ(Hep3Vector pos);
public long findCellContainingXYZ(double[] pos);
public long findCellContainingXYZ(double x, double y, double z);
- /* /\/\/\ Miscellaneous /\/\/\ */
-
- /** Get the flag that indicates barrel or endcap, i.e. the "barrel" field. */
+ /**
+ * Get the flag that indicates barrel or endcap, i.e. the "barrel" field.
+ */
public BarrelEndcapFlag getBarrelEndcapFlag();
- /** Get the system ID, i.e. the "system" field. */
+ /**
+ * Get the system ID, i.e. the "system" field.
+ */
public int getSystemID();
- /** @Deprecated use getSystemID() instead */
+ /**
+ * @deprecated Use {@link #getSystemID()} instead
+ */
public int getSystemNumber();
- /** Get the Subdetector associated with this IDDecoder, or null if not applicable. */
+ /**
+ * Get the Subdetector associated with this IDDecoder, or null if not applicable.
+ */
public Subdetector getSubdetector();
- /* /\/\/\ Neighbours /\/\/\ */
-
public boolean supportsNeighbours();
public long[] getNeighbourIDs();
- public long[] getNeighbourIDs(int deltaLayer, int deltaTheta, int deltaPhi);
-
- // comparison
- //int compareTo(IDDecoder decoder);
+ public long[] getNeighbourIDs(int deltaLayer, int deltaTheta, int deltaPhi);
}
GeomConverter/src/org/lcsim/geometry/compact
diff -u -r1.22 -r1.23
--- Detector.java 20 Apr 2007 00:16:54 -0000 1.22
+++ Detector.java 9 May 2007 00:59:58 -0000 1.23
@@ -13,7 +13,9 @@
/**
* Default class created to represent the parsed detector.
+ *
* @author tonyj
+ * @author jeremym
*/
public class Detector
{
@@ -35,16 +37,23 @@
private IDetectorElement de;
+ String name;
+
/**
* Called by the reader to create a new Detector
* @param element The JDOM element corresponding to the detector definition in the XML file.
*/
protected Detector(Element element)
{
- //super(element == null ? "ImNotReallyADetectorElement" : element.getChild("info").getAttributeValue("name"));
+ name = element.getChild("info").getAttributeValue("name");
materialMgr = XMLMaterialManager.create(XMLMaterialManager.materials() );
}
+ public String getName()
+ {
+ return name;
+ }
+
public IPhysicalVolume getWorldVolume()
{
return worldVolume;
GeomConverter/test/org/lcsim/detector
diff -u -r1.11 -r1.12
--- SimpleDetectorTest.java 2 May 2007 23:46:10 -0000 1.11
+++ SimpleDetectorTest.java 9 May 2007 00:59:58 -0000 1.12
@@ -130,7 +130,7 @@
// Create a dummy DE that has the "box1" volume as its node.
IDetectorElement dummyDE = new DummyDE(nav.getPath("/box1"));
IGeometryInfo gi = dummyDE.getGeometry();
- assertTrue("/box1".equals(gi.getPhysicalVolumePath().toString()));
+ assertTrue("/box1".equals(gi.getPath().toString()));
// Check isInside for positive points on the "box1" DE.
for (double x : xpoints)
GeomConverter/test/org/lcsim/detector/converter/compact
diff -u -r1.9 -r1.10
--- DetectorConverterTest.java 2 May 2007 23:46:10 -0000 1.9
+++ DetectorConverterTest.java 9 May 2007 00:59:59 -0000 1.10
@@ -77,7 +77,7 @@
assertTrue("The expected DetectorElement <" + de + "> is missing!", deDetector.getChildren().get(de) != null);
// Check that the DeDetector is findable from this DE.
- List<DeDetector> detectorSearch = deDetector.getChildren().get(de).getAncestors(DeDetector.class);
+ List<DeDetector> detectorSearch = deDetector.getChildren().get(de).findAncestors(DeDetector.class);
assertTrue( detectorSearch.size() == 1);
assertTrue( detectorSearch.get(0).getName().equals("test_detector"));
}
CVSspam 0.2.8