lcsim/src/org/lcsim/recon/tracking/seedtracker
diff -u -r1.12 -r1.13
--- MaterialManager.java 18 Apr 2011 16:05:43 -0000 1.12
+++ MaterialManager.java 7 Jul 2011 20:54:44 -0000 1.13
@@ -32,6 +32,7 @@
import org.lcsim.geometry.subdetector.SiTrackerEndcap;
import org.lcsim.geometry.subdetector.SiTrackerEndcap2;
import org.lcsim.geometry.subdetector.SiTrackerFixedTarget2;
+import org.lcsim.geometry.subdetector.SiTrackerSpectrometer;
/**
* Rewrite and refactor of Rich's {@link MaterialManager} class to handle Subdetector types.
@@ -41,7 +42,7 @@
* @author Jeremy McCormick
* @author Matt Graham
*
- * @version $Id: MaterialManager.java,v 1.12 2011/04/18 16:05:43 mgraham Exp $
+ * @version $Id: MaterialManager.java,v 1.13 2011/07/07 20:54:44 mgraham Exp $
*/
public class MaterialManager
{
@@ -56,7 +57,7 @@
private HashMap<ISolid, Double> solid_vol_map = new HashMap<ISolid, Double>(400);
private static double _rmax;
private static double _zmax = 1800.;
-
+ private static ITransform3D _detToTrk;
/**
* VolumeGroup handlers for Subdetector types.
*/
@@ -140,7 +141,7 @@
}
}
- /**
+ /**
* Get the path groups for SiTrackerFixedTarget2
*/
static private class SiTrackerFixedTarget2VolumeGrouper implements SubdetectorVolumeGrouper
@@ -192,37 +193,39 @@
PhysicalVolumeNavigator.getLeafPaths(layerPaths, layer.getGeometry().getPhysicalVolume(), path);
pathGroups.add(layerPaths);
}
- }
+ }
return pathGroups;
}
-
+
}
-
+
/**
* Creates a new instance of MaterialManager
*/
public MaterialManager()
{
// Barrels.
- SubdetectorVolumeGrouper barrelGrouper = new BarrelLayerVolumeGroup();
+ SubdetectorVolumeGrouper barrelGrouper = new BarrelLayerVolumeGroup();
subdetGroups.put(SiTrackerBarrel.class, barrelGrouper);
subdetGroups.put(MultiLayerTracker.class, barrelGrouper);
-
+
// Endcaps.
SubdetectorVolumeGrouper endcapGrouper = new EndcapVolumeGrouper();
subdetGroups.put(SiTrackerEndcap.class, endcapGrouper);
subdetGroups.put(DiskTracker.class, endcapGrouper);
// SiTrackerEndcap2.
- subdetGroups.put(SiTrackerEndcap2.class, new SiTrackerEndap2VolumeGrouper());
-
+ SubdetectorVolumeGrouper endcap2Grouper = new SiTrackerEndap2VolumeGrouper();
+ subdetGroups.put(SiTrackerEndcap2.class, endcap2Grouper);
+ subdetGroups.put(SiTrackerSpectrometer.class, endcap2Grouper);
+
// SiTrackerFixedTarget2.
subdetGroups.put(SiTrackerFixedTarget2.class, new SiTrackerFixedTarget2VolumeGrouper());
// PolyconeSupport.
subdetGroups.put(PolyconeSupport.class, new PolyconeSupportVolumeGrouper());
}
-
+
/**
* Turn on/off debugging output.
* @param debug True if debugging should be enabled; false if not.
@@ -292,7 +295,7 @@
{
System.out.println("Found VolumeGrouper <" + subdetGrouper.getClass().getName() + ">.");
}
-
+
// Make the list of path groups for this Subdetector.
List<List<String>> pathGroups = subdetGrouper.getPathGroups(subdet, trackingVol);
@@ -475,7 +478,7 @@
{
return _zmax;
}
-
+
private boolean isCylinder(double rmin, double rmax, double zmin, double zmax)
{
return (rmax - rmin) * Math.abs(zmax + zmin) < (zmax - zmin) * (rmax + rmin);
@@ -486,6 +489,9 @@
return (xmax-xmin)<1.0;//1mm
}
+ public void setTransform(ITransform3D transform) {
+ _detToTrk = transform;
+ }
// special handling for Polycone...
private void handlePolycone(IPhysicalVolume pv)
{
@@ -684,6 +690,8 @@
for (Point3D p : box.getVertices())
{
Hep3Vector transformed = pv.localToGlobal(p.getHep3Vector());
+ if (_detToTrk != null)
+ _detToTrk.transform(transformed);
vi.zmin = Math.min(transformed.z(), vi.zmin);
vi.zmax = Math.max(transformed.z(), vi.zmax);
double r = Math.sqrt(transformed.x() * transformed.x() + transformed.y() * transformed.y());
@@ -698,6 +706,8 @@
for (Point3D p : box.getVertices())
{
Hep3Vector transformed = pv.localToGlobal(p.getHep3Vector());
+ if (_detToTrk != null)
+ _detToTrk.transform(transformed);
vi.zmin = Math.min(transformed.z(), vi.zmin);
vi.zmax = Math.max(transformed.z(), vi.zmax);
double r = Math.sqrt(transformed.x() * transformed.x() + transformed.y() * transformed.y());