12 added files
GeomConverter/src/org/lcsim/detector
diff -N DetectorElement.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ DetectorElement.java 28 Feb 2007 21:52:00 -0000 1.1
@@ -0,0 +1,57 @@
+package org.lcsim.detector;
+
+import org.lcsim.detector.identifier.IIdentifier;
+
+public class DetectorElement
+implements IDetectorElement
+{
+ private IDetectorElementContainer children;
+ private IGeometryInfo geometry;
+ String name;
+ IDetectorElement parent;
+ IIdentifier id;
+
+ public DetectorElement(
+ String name,
+ IGeometryInfo geometry,
+ IDetectorElement parent,
+ IDetectorElementContainer children,
+ IIdentifier id)
+ {
+ this.name = name;
+ this.geometry=geometry;
+ this.parent=parent;
+ // Copy the DE from container. Don't use
+ // directly the passed reference.
+ for (IDetectorElement de : children)
+ {
+ children.add(de);
+ }
+ this.id = id;
+ }
+
+ public IDetectorElementContainer getChildren()
+ {
+ return children;
+ }
+
+ public IGeometryInfo getGeometry()
+ {
+ return geometry;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public IDetectorElement getParent()
+ {
+ return parent;
+ }
+
+ public IIdentifier getIdentifier()
+ {
+ return id;
+ }
+}
GeomConverter/src/org/lcsim/detector
diff -N IDetectorElement.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ IDetectorElement.java 28 Feb 2007 21:52:00 -0000 1.1
@@ -0,0 +1,38 @@
+package org.lcsim.detector;
+
+import org.lcsim.detector.identifier.IIdentifiable;
+
+/**
+ * A class to represent a node in the detector tree,
+ * based on Gaudi's IDetectorElement interface.
+ *
+ * @author Tim Nelson <[log in to unmask]>
+ * @author Jeremy McCormick <[log in to unmask]>
+ * @version $Id: IDetectorElement.java,v 1.1 2007/02/28 21:52:00 jeremy Exp $
+ */
+public interface IDetectorElement extends IIdentifiable
+{
+ /**
+ * Get the geometric information for this node.
+ * @return An IGeometryInfo object with geometry information.
+ */
+ public IGeometryInfo getGeometry();
+
+ /**
+ * Get the parent element of this node.
+ * @return This node's parent.
+ */
+ public IDetectorElement getParent();
+
+ /**
+ * Get a container with the DE's child DE's.
+ * @return An IDetectorElementContainer with this DE's children.
+ */
+ public IDetectorElementContainer getChildren();
+
+ /**
+ * Get the name of this DE.
+ * @return The name this DE.
+ */
+ public String getName();
+}
\ No newline at end of file
GeomConverter/src/org/lcsim/detector
diff -N IDetectorElementContainer.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ IDetectorElementContainer.java 28 Feb 2007 21:52:00 -0000 1.1
@@ -0,0 +1,7 @@
+package org.lcsim.detector;
+
+import java.util.Collection;
+
+interface IDetectorElementContainer
+extends Collection<IDetectorElement>
+{}
\ No newline at end of file
GeomConverter/src/org/lcsim/detector
diff -N IGeometryInfo.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ IGeometryInfo.java 28 Feb 2007 21:52:00 -0000 1.1
@@ -0,0 +1,192 @@
+package org.lcsim.detector;
+
+import hep.physics.vec.Hep3Vector;
+
+/**
+ *
+ * IGeometryInfo.java
+ *
+ * A port of Gaudi's IGeometryInfo, an abstract interface
+ * to a node in the geometry tree.
+ *
+ * @author Tim Nelson <[log in to unmask]>
+ * @author Jeremy McCormick <[log in to unmask]>
+ */
+public interface IGeometryInfo
+{
+ public ILogicalVolume getLogicalVolume();
+
+ public String getLogicalVolumeName();
+
+ public boolean hasLogicalVolume();
+
+ // global to local transformation
+ public CoordinateTransformation3D toLocal();
+
+ // local to global transformation
+ public CoordinateTransformation3D toGlobal();
+
+ // transform a point in local coordinates to global coordinates
+ public Hep3Vector toGlobal(Hep3Vector local_point);
+
+ // transform a point in global coordinates to local coordinates
+ public Hep3Vector toLocal(Hep3Vector global_point);
+
+ // get name of daughter volume containing a point in global coordinates
+ public String childVolumeName(Hep3Vector global_point);
+
+ // get daughter volume containing a point in global coordinates
+ public IPhysicalVolume getPhysicalVolume(Hep3Vector globalPoint);
+
+ public boolean isInside(Hep3Vector point);
+
+ public Hep3Vector getPosition();
+
+ String belongsToPath(Hep3Vector globalPoint);
+
+ String belongsToPath(Hep3Vector globalPoint, int level);
+
+ IGeometryInfo belongsTo(Hep3Vector globalPoint);
+
+ IGeometryInfo belongsTo(Hep3Vector globalPoint, int level);
+
+ /** find full geometry information for given point
+ * @param point input 3D point
+ * @param level number of levels to nagigate down the hierarchy
+ * @param start is the location (or path) of "nearest regular
+ * DetectorElement", which simultaneously contains the
+ * Point and has the connection with Actual Geometry Tree.
+ * @param volumePath retuned information
+ */
+ IPhysicalVolumePath getFullGeoInfoForPoint(
+ Hep3Vector point,
+ int level,
+ IGeometryInfo start);
+
+ /** find full geometry information for given point
+ * @param point input 3D point
+ * @param level number of levels to nagigate down the hierarchy
+ * @param start is the location (or path) of "nearest regular
+ * DetectorElement", which simultaneously contains the
+ * Point and has the connection with Actual Geometry Tree.
+ * @param replicaPath retuned information
+ */
+// virtual StatusCode fullGeoInfoForPoint
+// ( const Gaudi::XYZPoint& point ,
+// const int level ,
+// IGeometryInfo*& start ,
+// ILVolume::ReplicaPath& replicaPath ) = 0;
+
+ /** find full geometry information for given point
+ * @param point input 3D point
+ * @param level number of levels to nagigate down the hierarchy
+ * @param start is the location (or path) of "nearest regular
+ * DetectorElement", which simultaneously contains the
+ * Point and has the connection with Actual Geometry Tree.
+ * @param volumePath retuned information
+ */
+ IPhysicalVolumePath fullGeoInfoForPoint
+ ( Hep3Vector point, int level, String start);
+
+ /** find full geometry information for given point
+ * @param point input 3D point
+ * @param level number of levels to nagigate down the hierarchy
+ * @param start is the location (or path) of "nearest regular
+ * DetectorElement", which simultaneously contains the
+ * Point and has the connection with Actual Geometry Tree.
+ * @param replicaPath retuned information
+ */
+// virtual StatusCode fullGeoInfoForPoint
+// ( const Gaudi::XYZPoint& point ,
+// const int level ,
+// std::string& start ,
+// ILVolume::ReplicaPath& replicaPath ) = 0;;
+
+ /** the information about the support
+ * @param start "start" geometry info
+ * @param replicaPath replica path
+ * @return status code
+ */
+ //virtual StatusCode location
+ //( IGeometryInfo*& start ,
+ // ILVolume::ReplicaPath& replicaPath ) const = 0;
+
+ /** the information about the support
+ * @param start "start" geometry info
+ * @param replicaPath replica path
+ * @return status code
+ */
+ //virtual StatusCode location
+ //( std::string& start ,
+ // ILVolume::ReplicaPath& replicaPath ) const = 0;
+
+ /** the name of Logical Volume, addressed by start and Replica Path
+ * @param start start
+ * @param replicaPath replicaPath
+ * @return the name of Logical Volume
+ */
+ //virtual std::string lvolumePath
+ //( const std::string& start ,
+ // const ILVolume::ReplicaPath& replicaPath ) = 0;
+
+ /** the Logical Volume, addressed by start and Replica Path
+ * @param start start
+ * @param replicaPath replicaPath
+ * @return pointer to Logical Volume
+ */
+ //virtual const ILVolume* lvolume
+ //( const std::string& start ,
+ // const ILVolume::ReplicaPath& replicaPath ) = 0;
+
+ /** the name of Logical Volume, addressed by start and Replica Path
+ * @param start start
+ * @param replicaPath replicaPath
+ * @return the name of Logical Volume
+ */
+ //virtual std::string lvolumePath
+ //( IGeometryInfo* start ,
+ // const ILVolume::ReplicaPath& replicaPath ) = 0;
+
+ /** the Logical Volume, addressed by start and Replica Path
+ * @param start start
+ * @param replicaPath replicaPath
+ * @return pointer to Logical Volume
+ */
+ //virtual const ILVolume* lvolume
+ //( IGeometryInfo* start ,
+ // const ILVolume::ReplicaPath& replicaPath ) = 0;
+
+ /// retrive reference to replica path (mistrerious "rpath" or "npath")
+ //virtual const ILVolume::ReplicaPath& supportPath() const = 0;
+
+ /** @} */ // end of group LogVol
+
+ /** pointer to the parent IGeometryInfo (const version)
+ * @return pointer to the parent IGeometryInfo
+ */
+ IGeometryInfo parentIGeometryInfo();
+
+ // virtual IGeometryInfo* supportIGeometryInfo() = 0 ;
+
+ /** (reference to) container of children IGeometryInfo
+ * return reference to container of children IGeometryInfo
+ */
+ //virtual IGeometryInfo::IGIChildrens& childIGeometryInfos() = 0;
+
+ interface IGeometryInfoIterator
+ {
+ IGeometryInfo next();
+ IGeometryInfo prev();
+ IGeometryInfo end();
+ IGeometryInfo begin();
+ }
+
+ IGeometryInfoIterator childBegin();
+
+ IGeometryInfoIterator childEnd();
+
+ // Gaudi has "get the exact full geometry location" What does this mean???
+ // One interpretation, entire heirarchy as map of LVolumes to
+ // positions in coordinates of each volume
+ // public Map<ILVolume,Hep3Vector>
+}
\ No newline at end of file
GeomConverter/src/org/lcsim/detector
diff -N ILogicalVolume.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ILogicalVolume.java 28 Feb 2007 21:52:00 -0000 1.1
@@ -0,0 +1,11 @@
+package org.lcsim.detector;
+
+import java.util.List;
+
+public interface ILogicalVolume
+{
+ String getName();
+ ISolid getSolid();
+ IMaterial getMaterial();
+ List<IPhysicalVolume> getDaughterVolumes();
+}
GeomConverter/src/org/lcsim/detector
diff -N IMaterial.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ IMaterial.java 28 Feb 2007 21:52:00 -0000 1.1
@@ -0,0 +1,20 @@
+package org.lcsim.detector;
+
+public interface IMaterial
+{
+ public String getName();
+ public double getDensity();
+ public double Z();
+ public double A();
+ public double getNuclearInteractionLength();
+ public double getRadiationLength();
+ public double getIonizationPotential();
+ public State getState();
+ enum State
+ {
+ Gas,
+ Liquid,
+ Solid,
+ Unknown
+ }
+}
\ No newline at end of file
GeomConverter/src/org/lcsim/detector
diff -N IPhysicalVolume.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ IPhysicalVolume.java 28 Feb 2007 21:52:00 -0000 1.1
@@ -0,0 +1,13 @@
+package org.lcsim.detector;
+
+import hep.physics.vec.Hep3Vector;
+
+public interface IPhysicalVolume
+{
+ String getName();
+ ILogicalVolume getLogicalVolume();
+ ICoordinateTransformation3D getTransform();
+ Hep3Vector getPosition();
+ IRotation3D getRotation();
+ Hep3Vector parentToLocal(Hep3Vector point);
+}
\ No newline at end of file
GeomConverter/src/org/lcsim/detector
diff -N IPhysicalVolumeContainer.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ IPhysicalVolumeContainer.java 28 Feb 2007 21:52:00 -0000 1.1
@@ -0,0 +1,7 @@
+package org.lcsim.detector;
+
+import java.util.Collection;
+
+public interface IPhysicalVolumeContainer
+extends Collection<IPhysicalVolume>
+{}
GeomConverter/src/org/lcsim/detector
diff -N IPhysicalVolumePath.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ IPhysicalVolumePath.java 28 Feb 2007 21:52:00 -0000 1.1
@@ -0,0 +1,6 @@
+package org.lcsim.detector;
+
+import java.util.List;
+
+public interface IPhysicalVolumePath extends List<IPhysicalVolume>
+{}
GeomConverter/src/org/lcsim/detector
diff -N ISolid.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ISolid.java 28 Feb 2007 21:52:00 -0000 1.1
@@ -0,0 +1,10 @@
+package org.lcsim.detector;
+
+import hep.physics.vec.Hep3Vector;
+
+public interface ISolid
+{
+ public String getName();
+ public void setName(String name);
+ boolean isInside(Hep3Vector position);
+}
\ No newline at end of file
GeomConverter/src/org/lcsim/detector/identifier
diff -N IIdentifiable.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ IIdentifiable.java 28 Feb 2007 21:52:00 -0000 1.1
@@ -0,0 +1,8 @@
+package org.lcsim.detector.identifier;
+
+public interface IIdentifiable
+{
+ public IIdentifier getIdentifier();
+ //IdentifierHash identifyHash();
+ //IIdHelper getHelper();
+}
GeomConverter/src/org/lcsim/detector/identifier
diff -N IIdentifier.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ IIdentifier.java 28 Feb 2007 21:52:00 -0000 1.1
@@ -0,0 +1,68 @@
+package org.lcsim.detector.identifier;
+
+/**
+ * An interface for comparable identifiers.
+ *
+ * @author jeremym
+ *
+ */
+public interface IIdentifier
+{
+ /**
+ * True if the identifiers are equivalent.
+ * @param id
+ * @return
+ */
+ public boolean equals(IIdentifier id);
+
+ /**
+ * True if the identifiers are not equivalent.
+ * @param id
+ * @return
+ */
+ public boolean nequals(IIdentifier id);
+
+ /**
+ * True if this identifier is greater.
+ * @param id
+ * @return
+ */
+ public boolean greater(IIdentifier id);
+
+ /**
+ * True if this identifier is less.
+ * @param id
+ * @return
+ */
+ public boolean less(IIdentifier id);
+
+ // what should this return code represent?
+ // seems like lattitude here could be helpful
+ // for implementations/subclasses but maybe
+ // this isn't needed
+ public int compare(IIdentifier id);
+
+ // size in bits
+ public int sizeBits();
+
+ // size in 32-bit words
+ public int sizeWords();
+
+ // size in bytes
+ public int sizeBytes();
+
+ // hex rep
+ public String hexString();
+
+ // set from hex string
+ public void setHexString(String hexRep);
+
+ // set value from another IIdentifier
+ public void setIdentifier(IIdentifier id);
+
+ // clear state
+ public void clear();
+
+ // is id in valid state
+ public boolean isValid();
+}
\ No newline at end of file
CVSspam 0.2.8