lcsim-contrib/src/main/java/org/lcsim/contrib/onoprien/crux
diff -u -r1.1 -r1.2
--- SiD02Geometry.java 24 Mar 2009 20:12:41 -0000 1.1
+++ SiD02Geometry.java 26 Mar 2009 20:58:39 -0000 1.2
@@ -26,7 +26,7 @@
* 6 modules are created, one for each endcap and one for the barrel, both for ECAL and HCAL.
*
* @author D. Onoprienko
- * @version $Id: SiD02Geometry.java,v 1.1 2009/03/24 20:12:41 onoprien Exp $
+ * @version $Id: SiD02Geometry.java,v 1.2 2009/03/26 20:58:39 onoprien Exp $
*/
public class SiD02Geometry extends CalGeometry implements JobEventListener {
@@ -243,4 +243,12 @@
throw new UnsupportedOperationException();
}
+ /**
+ * Returns a list of layers the specified trajectory might cross next - more likely first
+ * (but excluding the most likely one that would be returned by <tt>nextLayer</tt>).
+ */
+ public List<CalLayer> nextLayers(Trajectory trajectory){
+ throw new UnsupportedOperationException();
+ }
+
}
lcsim-contrib/src/main/java/org/lcsim/contrib/onoprien/crux/geom
diff -u -r1.7 -r1.8
--- CalGeometry.java 24 Mar 2009 20:12:41 -0000 1.7
+++ CalGeometry.java 26 Mar 2009 20:58:40 -0000 1.8
@@ -9,7 +9,6 @@
import org.lcsim.detector.solids.Tube;
import org.lcsim.event.CalorimeterHit;
import org.lcsim.geometry.Detector;
-import org.lcsim.geometry.IDDecoder;
import org.lcsim.contrib.onoprien.util.job.JobEvent;
import org.lcsim.contrib.onoprien.util.job.JobEventListener;
@@ -25,9 +24,11 @@
* Singleton of this class is available at run time through {@link JobManager} by
* calling <tt>JobManager.defaultInstance().get(CalGeometry.class)</tt>.
* <p>
- * An object of a concrete extension of this class must be instantiated and passed
- * to {@link org.lcsim.contrib.onoprien.crux.recon.CalorimeterDriver}. The extending
- * class must implement abstract methods {@link #getModules()},
+ * An object of a concrete extension of this class must be instantiated and registered with the
+ * {@link JobManager}. Usually, this is done by passing the <tt>CalGeometry</tt> instance to
+ * {@link org.lcsim.contrib.onoprien.crux.recon.CalorimeterDriver}.
+ * <p>
+ * The extending class must implement abstract methods {@link #getModules()},
* {@link #nextLayers(Trajectory) nextLayers(Trajectory)}, and
* {@link #nextLayers(CalLayer, Trajectory) nextLayers(CalLayer, Trajectory)}, dividing
* the calorimeter into modules and defining neighbor relations between them. If a subclass
@@ -38,7 +39,7 @@
* calorimeters is available - see {@link SiD02Geometry}.
*
* @author D. Onoprienko
- * @version $Id: CalGeometry.java,v 1.7 2009/03/24 20:12:41 onoprien Exp $
+ * @version $Id: CalGeometry.java,v 1.8 2009/03/26 20:58:40 onoprien Exp $
*/
abstract public class CalGeometry implements JobEventListener {
@@ -89,11 +90,11 @@
*/
abstract public List<CalLayer> nextLayers(CalLayer layer, Trajectory trajectory);
-// /**
-// * Returns a list of layers the specified trajectory might cross next - more likely first
-// * (but excluding the most likely one that would be returned by <tt>nextLayer</tt>).
-// */
-// abstract public List<CalLayer> nextLayers(Trajectory trajectory);
+ /**
+ * Returns a list of layers the specified trajectory might cross next - more likely first
+ * (but excluding the most likely one that would be returned by <tt>nextLayer</tt>).
+ */
+ abstract public List<CalLayer> nextLayers(Trajectory trajectory);
// -- Getters : ---------------------------------------------------------------
@@ -145,7 +146,7 @@
// Try immediate neighbor
- CalLayer immediateNeighbor = nextLayer(currentLayer, trajectory);
+ CalLayer immediateNeighbor = (currentLayer == null) ? nextLayer(trajectory) : nextLayer(currentLayer, trajectory);
if (immediateNeighbor != null) {
Hep3Vector pos = propagateToLayer(trajectory, immediateNeighbor);
if (pos != null) return immediateNeighbor;
@@ -153,7 +154,7 @@
// Try others
- List<CalLayer> nextLayers = nextLayers(currentLayer, trajectory);
+ List<CalLayer> nextLayers = (currentLayer == null) ? nextLayers(trajectory) : nextLayers(currentLayer, trajectory);
double sNext = Double.MAX_VALUE;
CalLayer nextLayer = null;
for (CalLayer layer : nextLayers) {
@@ -184,11 +185,13 @@
* does not enter calorimeter, <tt>null</tt> is returned and the trajectory is not changed.
*/
public CalLayer propagateFromTracker(Trajectory trajectory) {
+ System.out.println("Entered propagateFromTracker");
double sNext = Double.MAX_VALUE;
CalLayer nextLayer = null;
for (CalModule module : getModules()) {
if (module.isEntry()) {
CalLayer layer = module.firstLayer();
+ System.out.println(" Trying layer "+ layer);
Intersection inter = trajectory.intersect(layer.getReferenceSurface());
if (inter.hasNext()) {
double s = inter.getPathLength();
@@ -199,6 +202,7 @@
}
}
}
+ System.out.println("Exiting propagateFromTracker with "+ nextLayer);
if (nextLayer == null) {
return null;
} else {
@@ -215,7 +219,7 @@
* calorimeter layers, <tt>null</tt> is returned and the trajectory is not changed.
*/
public CalLayer propagateToNextLayer(Trajectory trajectory) {
- throw new UnsupportedOperationException(); // FIXME
+ return propagateToNextLayer(null, trajectory);
}
// -- Point to layer projection : ---------------------------------------------
lcsim-contrib/src/main/java/org/lcsim/contrib/onoprien/crux/geom
diff -u -r1.3 -r1.4
--- CalLayer.java 19 Mar 2009 06:08:03 -0000 1.3
+++ CalLayer.java 26 Mar 2009 20:58:40 -0000 1.4
@@ -9,7 +9,7 @@
* Class that represents a layer inside a calorimeter module.
*
* @author D. Onoprienko
- * @version $Id: CalLayer.java,v 1.3 2009/03/19 06:08:03 onoprien Exp $
+ * @version $Id: CalLayer.java,v 1.4 2009/03/26 20:58:40 onoprien Exp $
*/
public class CalLayer implements Comparable<CalLayer> {
@@ -74,6 +74,12 @@
public int compareTo(CalLayer layer) {
return _id - layer._id;
}
+
+// -- Overriding Object : -----------------------------------------------------
+
+ public String toString() {
+ return "CalLayer:" + _detEl.getName();
+ }
// -- Private parts : ---------------------------------------------------------