2 added + 13 modified, total 15 files
GeomConverter/src/org/lcsim/detector
diff -N DetectorElementStore.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ DetectorElementStore.java 6 Mar 2007 20:22:17 -0000 1.1
@@ -0,0 +1,17 @@
+package org.lcsim.detector;
+
+public class DetectorElementStore
+implements IDetectorElementStore
+extends ArrayList<IDetectorElement>
+{
+ DetectorElementStore store = null;
+
+ public static IDetectorElementStore getInstance()
+ {
+ if ( store == null )
+ {
+ store = new DetectorElementStore();
+ }
+ return store;
+ }
+}
GeomConverter/src/org/lcsim/detector
diff -N IDetectorElementStore.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ IDetectorElementStore.java 6 Mar 2007 20:22:17 -0000 1.1
@@ -0,0 +1,7 @@
+package org.lcsim.detector;
+
+import java.util.List;
+
+public interface IDetectorElementStore
+extends List<IDetectorElement>
+{}
\ No newline at end of file
GeomConverter/src/org/lcsim/detector
diff -u -r1.3 -r1.4
--- DetectorElement.java 4 Mar 2007 05:03:00 -0000 1.3
+++ DetectorElement.java 6 Mar 2007 20:22:16 -0000 1.4
@@ -29,6 +29,8 @@
this.parent = parent;
this.geometry=new GeometryInfo(this,support);
this.id = id;
+
+ DetectorElementStore.getInstance().add(this);
}
/**
GeomConverter/src/org/lcsim/detector
diff -u -r1.2 -r1.3
--- GeometryInfo.java 4 Mar 2007 12:08:15 -0000 1.2
+++ GeometryInfo.java 6 Mar 2007 20:22:16 -0000 1.3
@@ -245,7 +245,7 @@
/* (non-Javadoc)
* @see org.lcsim.detector.IGeometryInfoTest#setSupport(org.lcsim.detector.IPhysicalVolumePath)
*/
- public void setSupport(IPhysicalVolumePath support)
+ public void setPhysicalVolumePath(IPhysicalVolumePath support)
{
this.support = support;
}
GeomConverter/src/org/lcsim/detector
diff -u -r1.3 -r1.4
--- IDetectorFactory.java 4 Mar 2007 05:03:00 -0000 1.3
+++ IDetectorFactory.java 6 Mar 2007 20:22:16 -0000 1.4
@@ -8,17 +8,28 @@
public interface IDetectorFactory
{
IDetectorElement createDetectorElement(String name);
+
IGeometryInfo createGeometryInfo(IDetectorElement de);
- ILogicalVolume createLogicalVolume(String name, ISolid solid, IMaterial material);
-
- IPhysicalVolumeNavigator createPhysicalVolumeNavigator(IPhysicalVolume world);
- IPhysicalVolume createPhysicalVolume();
+
+ ILogicalVolume createLogicalVolume(
+ String name,
+ ISolid solid,
+ IMaterial material);
+
+ IPhysicalVolume createPhysicalVolume(
+ ICoordinateTransformation3D transform,
+ String name,
+ ILogicalVolume logicalVolume,
+ ILogicalVolume motherLogicalVolume,
+ int copyNum);
+
+ IPhysicalVolumeNavigator createPhysicalVolumeNavigator(IPhysicalVolume world);
IRotation3D createRotation3D();
ICoordinateTransformation3D createTransform3D();
- IMaterial createMaterialElement();
+ IMaterial createMaterialElement(String name,double Z,double A,double density);
IMaterial createMaterialMixture();
- Box createBox();
- Tube createTube();
+ Box createBox(String name, double xHalfLength, double yHalfLength, double zHalfLength);
+ Tube createTube(String name, double innerRadius, double outerRadius, double zHalfLength);
}
\ No newline at end of file
GeomConverter/src/org/lcsim/detector
diff -u -r1.5 -r1.6
--- IGeometryInfo.java 4 Mar 2007 12:08:15 -0000 1.5
+++ IGeometryInfo.java 6 Mar 2007 20:22:16 -0000 1.6
@@ -160,5 +160,5 @@
*
* @param support
*/
- public void setSupport(IPhysicalVolumePath support);
+ public void setPhysicalVolumePath(IPhysicalVolumePath support);
}
\ No newline at end of file
GeomConverter/src/org/lcsim/detector
diff -u -r1.3 -r1.4
--- IPhysicalVolume.java 3 Mar 2007 01:19:38 -0000 1.3
+++ IPhysicalVolume.java 6 Mar 2007 20:22:16 -0000 1.4
@@ -5,11 +5,46 @@
public interface IPhysicalVolume
extends INamed
{
+ /**
+ * Get the associated LogicalVolume.
+ * @return
+ */
public ILogicalVolume getLogicalVolume();
+
+ /**
+ * Get the mother's LogicalVolume.
+ * @return
+ */
public ILogicalVolume getMotherLogicalVolume();
+
+ /**
+ * Get the transformation from mother's coordinate system.
+ * @return
+ */
public ICoordinateTransformation3D getTransform();
+
+ /**
+ * Get the translation component of the coordinate transform.
+ * @return
+ */
public Hep3Vector getTranslation();
+
+ /**
+ * Get the rotation component of the coordinate transform.
+ * @return
+ */
public IRotation3D getRotation();
+
+ /**
+ * Get the copy number.
+ * @return
+ */
public int getCopyNumber();
+
+ /**
+ * Transform a point from parent to this volume.
+ * @param point
+ * @return
+ */
public Hep3Vector transformParentToLocal(Hep3Vector point);
}
\ No newline at end of file
GeomConverter/src/org/lcsim/detector
diff -u -r1.3 -r1.4
--- IPhysicalVolumeNavigator.java 3 Mar 2007 13:33:56 -0000 1.3
+++ IPhysicalVolumeNavigator.java 6 Mar 2007 20:22:16 -0000 1.4
@@ -11,7 +11,7 @@
* transform of an IPhysicalVolumePath.
*
* @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: IPhysicalVolumeNavigator.java,v 1.3 2007/03/03 13:33:56 jeremy Exp $
+ * @version $Id: IPhysicalVolumeNavigator.java,v 1.4 2007/03/06 20:22:16 jeremy Exp $
*/
public interface IPhysicalVolumeNavigator
{
@@ -51,7 +51,7 @@
* @param path
* @return
*/
- CoordinateTransformation3D getTransform(String path);
+ public CoordinateTransformation3D getTransform(String path);
/**
* Get the full transformation from the origin of
@@ -71,7 +71,7 @@
* @param level Max depth. -1 will go to bottom.
* @return
*/
- IPhysicalVolumePath getPath(Hep3Vector globalPoint, int level);
+ public IPhysicalVolumePath getPath(Hep3Vector globalPoint, int level);
/**
* Same as above with no depth arg.
@@ -79,5 +79,5 @@
* @param globalPoint
* @return
*/
- IPhysicalVolumePath getPath(Hep3Vector globalPoint);
+ public IPhysicalVolumePath getPath(Hep3Vector globalPoint);
}
\ No newline at end of file
GeomConverter/src/org/lcsim/detector
diff -u -r1.2 -r1.3
--- LogicalVolume.java 3 Mar 2007 01:19:38 -0000 1.2
+++ LogicalVolume.java 6 Mar 2007 20:22:16 -0000 1.3
@@ -15,7 +15,11 @@
{
IMaterial material;
ISolid solid;
- IPhysicalVolumeContainer physicalVolumes = new PhysicalVolumeContainer(true,true,true);
+
+ // The same PhysicalVolume cannot be added twice.
+ // The volumes must have unique names within their mother.
+ // PhysicalVolume copy numbers are allowed to be duplicated.
+ IPhysicalVolumeContainer physicalVolumes = new PhysicalVolumeContainer(true,true,false);
public LogicalVolume(String name, ISolid solid, IMaterial material)
{
@@ -89,9 +93,4 @@
}
return isDaughter;
}
-
- protected void finalize()
- {
- LogicalVolumeStore.getInstance().remove(this);
- }
}
\ No newline at end of file
GeomConverter/src/org/lcsim/detector
diff -u -r1.2 -r1.3
--- PhysicalVolume.java 3 Mar 2007 01:19:38 -0000 1.2
+++ PhysicalVolume.java 6 Mar 2007 20:22:16 -0000 1.3
@@ -73,11 +73,6 @@
return transform.getTranslation();
}
- protected void finalize()
- {
- PhysicalVolumeStore.getInstance().remove(this);
- }
-
public Hep3Vector transformParentToLocal(Hep3Vector point)
{
return getTransform().transformed(point);
GeomConverter/src/org/lcsim/detector
diff -u -r1.5 -r1.6
--- PhysicalVolumeNavigator.java 4 Mar 2007 12:08:15 -0000 1.5
+++ PhysicalVolumeNavigator.java 6 Mar 2007 20:22:17 -0000 1.6
@@ -211,9 +211,6 @@
*/
public IPhysicalVolumePath getPath(String[] path)
{
- //System.out.println("getPath");
- //System.out.println("path: " + path.toString());
-
// The path to be returned to user.
IPhysicalVolumePath physvols = new PhysicalVolumePath();
@@ -225,16 +222,7 @@
// Loop over the names in the path.
for (String name : path)
- {
- //System.out.println("looking for physvol <" + name + "> in <"+pv.getLogicalVolume().getName()+">.");
- //System.out.println("ndau : " + pv.getLogicalVolume().getNumberOfDaughters());
-
- // DEBUG
- //for (IPhysicalVolume dau : pv.getLogicalVolume().getDaughters())
- //{
- // System.out.println("dau : " + dau.getName());
- //}
-
+ {
PhysicalVolumeContainer pvSearch =
pv.getLogicalVolume().getDaughters().findByName(name);
GeomConverter/src/org/lcsim/detector/material
diff -u -r1.2 -r1.3
--- IMaterial.java 3 Mar 2007 13:33:57 -0000 1.2
+++ IMaterial.java 6 Mar 2007 20:22:17 -0000 1.3
@@ -36,6 +36,14 @@
public String toString()
{
return state;
- }
+ }
}
+
+ // Defaults for non-mandatory parameters.
+ static public final double defaultTemperature=273.15;
+ static public final State defaultState=Unknown;
+ static public final double defaultBoilingPoint=0.0;
+ static public final double defaultMeltingPoint=0.0;
+ static public final double defaultPressure=1.0;
+ static public final double defaultIonizationPotential=0.0;
}
\ No newline at end of file
GeomConverter/src/org/lcsim/detector/material
diff -u -r1.2 -r1.3
--- MaterialElement.java 3 Mar 2007 13:33:57 -0000 1.2
+++ MaterialElement.java 6 Mar 2007 20:22:17 -0000 1.3
@@ -19,15 +19,7 @@
*/
public class MaterialElement
implements IMaterial
-{
- // Defaults for non-mandatory parameters.
- static private final double defaultTemperature=273.15;
- static private final State defaultState=Unknown;
- static private final double defaultBoilingPoint=0.0;
- static private final double defaultMeltingPoint=0.0;
- static private final double defaultPressure=1.0;
- static private final double defaultIonizationPotential=0.0;
-
+{
// From constructor.
private String name;
private double Z;
@@ -66,6 +58,8 @@
// Compute derived.
computeDerivedQuantities();
+
+ MaterialStore.getInstance().add(this);
}
public MaterialElement(
@@ -97,6 +91,8 @@
// Compute derived.
computeDerivedQuantities();
+
+ MaterialStore.getInstance().add(this);
}
private void computeDerivedQuantities()
GeomConverter/src/org/lcsim/detector/material
diff -u -r1.1 -r1.2
--- MaterialMixture.java 3 Mar 2007 13:33:57 -0000 1.1
+++ MaterialMixture.java 6 Mar 2007 20:22:17 -0000 1.2
@@ -22,7 +22,7 @@
public static final double MAX_NUCLEAR_INTERACTION_LENGTH = java.lang.Double.MAX_VALUE;
// Corresponds to single MaterialElement?
- boolean isElement;
+ boolean isElement=false;
// Effective, computed Z value.
public double Zeff;
@@ -31,13 +31,13 @@
public double Aeff;
// Number of components added.
- int nComponentsAdded;
+ int nComponentsAdded=0;
// Number of components that are allowed to be added.
- int nComponentsMax;
+ int nComponentsMax=0;
// Number of elements in the mass fraction list.
- int nElements;
+ int nElements=0;
// The list of elements making up the mixture.
private List<MaterialElement> elementList = new ArrayList<MaterialElement>();
@@ -61,12 +61,17 @@
if ( nComponents <= 0 )
{
throw new IllegalArgumentException("nComponents must be >= 0.");
- }
-
- nComponentsMax = nComponents;
- nComponentsAdded = nElements = 0;
- isElement = false;
+ }
}
+
+ /** Construct a material with a number of components. */
+ public MaterialMixture(String name,
+ int nComponents,
+ double density,
+ State state)
+ {
+ super(name,0,0,density,0.0,state,defaultTemperature,defaultPressure,0,0);
+ }
public double getZ()
{
GeomConverter/src/org/lcsim/detector/solids
diff -u -r1.2 -r1.3
--- AbstractSolid.java 3 Mar 2007 01:19:39 -0000 1.2
+++ AbstractSolid.java 6 Mar 2007 20:22:17 -0000 1.3
@@ -14,8 +14,8 @@
SolidStore.getInstance().add(this);
}
- protected void finalize()
- {
- SolidStore.getInstance().remove(this);
- }
+ //protected void finalize()
+ //{
+ // SolidStore.getInstance().remove(this);
+ //}
}
\ No newline at end of file
CVSspam 0.2.8