lcsim/src/org/lcsim/recon/tracking/seedtracker
diff -u -r1.15 -r1.16
--- MaterialManager.java 25 Jan 2012 19:07:51 -0000 1.15
+++ MaterialManager.java 16 Apr 2012 19:04:41 -0000 1.16
@@ -20,12 +20,14 @@
import org.lcsim.detector.solids.ISolid;
import org.lcsim.detector.solids.Point3D;
import org.lcsim.detector.solids.Polycone;
+import org.lcsim.detector.solids.Polycone.ZPlane;
import org.lcsim.detector.solids.Trd;
import org.lcsim.detector.solids.Tube;
-import org.lcsim.detector.solids.Polycone.ZPlane;
import org.lcsim.geometry.Detector;
import org.lcsim.geometry.Subdetector;
import org.lcsim.geometry.subdetector.DiskTracker;
+import org.lcsim.geometry.subdetector.HPSTracker;
+import org.lcsim.geometry.subdetector.HPSTracker2;
import org.lcsim.geometry.subdetector.MultiLayerTracker;
import org.lcsim.geometry.subdetector.PolyconeSupport;
import org.lcsim.geometry.subdetector.SiTrackerBarrel;
@@ -33,7 +35,6 @@
import org.lcsim.geometry.subdetector.SiTrackerEndcap2;
import org.lcsim.geometry.subdetector.SiTrackerFixedTarget2;
import org.lcsim.geometry.subdetector.SiTrackerSpectrometer;
-import org.lcsim.geometry.subdetector.HPSTracker;
/**
* Rewrite and refactor of Rich's {@link MaterialManager} class to handle Subdetector types.
@@ -43,7 +44,7 @@
* @author Jeremy McCormick
* @author Matt Graham
*
- * @version $Id: MaterialManager.java,v 1.15 2012/01/25 19:07:51 mgraham Exp $
+ * @version $Id: MaterialManager.java,v 1.16 2012/04/16 19:04:41 jeremy Exp $
*/
public class MaterialManager
{
@@ -109,6 +110,34 @@
return pathGroups;
}
}
+
+ /**
+ * Get the path groups for SiTrackerEndcap2, which has modules placed directly in the tracking volume.
+ */
+ static private class HPSTracker2VolumeGrouper implements SubdetectorVolumeGrouper
+ {
+ public List<List<String>> getPathGroups(Subdetector subdet, IPhysicalVolume topVol)
+ {
+ System.out.println(this.getClass().getSimpleName() + ".getPathGroups()");
+ List<List<String>> pathGroups = new ArrayList<List<String>>();
+ // Layer loop.
+ for (IDetectorElement layer : subdet.getDetectorElement().getChildren())
+ {
+ List<String> modulePaths = new ArrayList<String>();
+
+ // Module loop.
+ for (IDetectorElement module : layer.getChildren())
+ {
+ String path = "";
+ PhysicalVolumeNavigator.getLeafPaths(modulePaths, module.getGeometry().getPhysicalVolume(), path);
+ }
+
+ // Add module paths to this layer.
+ pathGroups.add(modulePaths);
+ }
+ return pathGroups;
+ }
+ }
/**
* Get the path groups for SiTrackerEndcap2, which has modules placed directly in the tracking volume.
@@ -125,15 +154,18 @@
for (IDetectorElement layer : endcaps.getChildren())
{
List<String> modulePaths = new ArrayList<String>();
- // System.out.println(layer.getName());
// Module loop.
for (IDetectorElement module : layer.getChildren())
{
String path = "";
- PhysicalVolumeNavigator.getLeafPaths(modulePaths, module.getGeometry().getPhysicalVolume(),
- path);
+ PhysicalVolumeNavigator.getLeafPaths(modulePaths, module.getGeometry().getPhysicalVolume(), path);
+ }
+
+ for (String p : modulePaths) {
+ System.out.println("adding path: " + p);
}
+
// Add module paths to this layer.
pathGroups.add(modulePaths);
}
@@ -219,7 +251,9 @@
SubdetectorVolumeGrouper endcap2Grouper = new SiTrackerEndap2VolumeGrouper();
subdetGroups.put(SiTrackerEndcap2.class, endcap2Grouper);
subdetGroups.put(SiTrackerSpectrometer.class, endcap2Grouper);
- subdetGroups.put(HPSTracker.class, endcap2Grouper);
+ subdetGroups.put(HPSTracker.class, endcap2Grouper);
+
+ subdetGroups.put(HPSTracker2.class, new HPSTracker2VolumeGrouper());
// SiTrackerFixedTarget2.
subdetGroups.put(SiTrackerFixedTarget2.class, new SiTrackerFixedTarget2VolumeGrouper());