1 package org.lcsim.detector; 2 3 import hep.physics.vec.Hep3Vector; 4 5 import org.lcsim.detector.solids.Inside; 6 7 /** 8 * IGeometryInfo provides geometry information about an {@link IDetectorElement}. 9 * 10 * These are some of the important methods on {@link IGeometryInfo}. 11 * 12 * <ul> 13 * <li>{@link #getLogicalVolume()} - associated {@link ILogicalVolume}</li> 14 * <li>{@link #getGlobalToLocal()} - global to local {@link Transform3D}</li> 15 * <li>{@link #getLocalToGlobal()} - local to global {@link Transform3D}</li> 16 * <li>{@link #getParentToLocal()} - parent to local {@link Transform3D}</li> 17 * <li>{@link #getPath()} - {@link PhysicalVolumePath} associated with this {@link DetectorElement}</li> 18 * <li>{@link #isInside(Hep3Vector)} - check if a global point is inside this geometry</li> 19 * </ul> 20 * 21 * An {@link IDetectorElement} may have an {@link IGeometryInfo}, which means that it has a 22 * corresponding node in the geometry tree. Those DetectorElements without IGeometryInfo 23 * are ghost volumes that have no geometric correspondence, but may fill a logical roll 24 * in the detector hierarchy. 25 * 26 * @author Jeremy McCormick 27 * @author Tim Nelson 28 * @version $Id: IGeometryInfo.java,v 1.15 2007/08/06 19:09:31 jeremy Exp $ 29 */ 30 public interface IGeometryInfo 31 { 32 /** 33 * Get an {@link IGeometryInfoContainer} with the child DetectorElement's IGeometryInfo objects. 34 * @return Container of IGeometryInfos from the child DetectorElements. 35 */ 36 public IGeometryInfoContainer getChildGeometries(); 37 38 /** 39 * Get the {@link IPhysicalVolumePath} at a global point. 40 * @param globalPoint A point in global coordinates. 41 * @return A path of physical volumes at the global point. 42 */ 43 public IPhysicalVolumePath getPath(Hep3Vector globalPoint); 44 45 /** 46 * Get the associated {@link ILogicalVolume}. 47 * @return A LogicalVolume associated with this geometry. 48 */ 49 public ILogicalVolume getLogicalVolume(); 50 51 /** 52 * Get the PhysicalVolume at the global point 53 * using the IPhysicalVolumePath of this IGeometryInfo. 54 * 55 * @param globalPoint A point in global coordinates. 56 * @return The PhysicalVolume at the point. 57 */ 58 public IPhysicalVolume getPhysicalVolume(Hep3Vector globalPoint); 59 60 /** 61 * Get the leaf PhysicalVolume in this 62 */ 63 64 /** 65 * Get the center position of the DetectorElement in global coordinates. 66 * @return Center position of DetectorElement in global coordinates. 67 */ 68 public Hep3Vector getPosition(); 69 70 /** 71 * Get the {@link IPhysicalVolumePath} assigned to this GeometryInfo. 72 * This path points to a unique node in the geometry tree 73 * and determines the basic global to local transform 74 * of the DetectorElement. 75 * 76 * @return The path of this DetectorElement. 77 */ 78 public IPhysicalVolumePath getPath(); 79 80 /** 81 * Get the {@link IPhysicalVolumePath} from {@link #getPath} 82 * as a {@link String}. 83 * 84 * @return The path string. 85 */ 86 public String getPathString(); 87 88 /** 89 * Get the combined global to local transform. 90 * 91 * @return The global to local transform. 92 */ 93 public ITransform3D getGlobalToLocal(); 94 95 /** 96 * Transform the global point from global coordinates to local. 97 * 98 * @param globalPoint 99 * @return Global point transformed to local. 100 */ 101 public Hep3Vector transformGlobalToLocal(Hep3Vector globalPoint); 102 103 /** 104 * True if this IGeometryInfo has an associated LogicalVolume. 105 * @return True if the IGeomInfo has a non-<code>null</code> LogicalVolume. 106 */ 107 public boolean hasLogicalVolume(); 108 109 /** 110 * True if this IGeometryInfo has an associated full path 111 * or geometry node. 112 * 113 * @return True if this IGeometryInfo has an IPhysicalVolumePath. 114 */ 115 public boolean hasPath(); 116 117 /** 118 * True if the global point is inside this DetectorElement 119 * or any of its descendants. 120 * @param globalPoint A global point. 121 * @return True if the global point is inside this DetectorElement 122 * or any of its descendants. 123 */ 124 public Inside inside(Hep3Vector globalPoint); 125 126 /** 127 * Get the combined local to global transform. 128 * @see ITransform3D 129 * @return The local to global transform. 130 */ 131 public ITransform3D getLocalToGlobal(); 132 133 /** 134 * Get the transformation from parent geometry 135 * into local geometry. 136 * @return The parent to local transform. 137 */ 138 public ITransform3D getParentToLocal(); 139 140 /** 141 * Transform a local point into global coordinates. 142 * @param localPoint A local point. 143 * @return Point transformed into global coordinate system. 144 */ 145 public Hep3Vector transformLocalToGlobal(Hep3Vector localPoint); 146 147 /** 148 * Get the parent DetectorElement's IGeometryInfo. 149 * @return The parent's IGeometryInfo or <code>null</code> 150 * if none exists. 151 */ 152 public IGeometryInfo parentGeometry(); 153 154 /** 155 * Transform point in parent geometry to local coordinate system. 156 * 157 * @param parentPoint A point in the parent coordinate system. 158 * @return Point transformed from parent to local coordinates. 159 */ 160 public Hep3Vector transformParentToLocal(Hep3Vector parentPoint); 161 162 /** 163 * Return the associated {@link DetectorElement}. 164 * 165 * @return The associated DetectorElement. 166 */ 167 public IDetectorElement getDetectorElement(); 168 169 /** 170 * Get the associated {@link IPhysicalVolume} or 171 * <code>null</code> if none exists. 172 */ 173 public IPhysicalVolume getPhysicalVolume(); 174 }