lcsim/src/org/lcsim/fit/helicaltrack
diff -u -r1.13 -r1.14
--- HelixUtils.java 11 Apr 2011 17:21:07 -0000 1.13
+++ HelixUtils.java 18 Apr 2011 16:05:42 -0000 1.14
@@ -137,12 +137,12 @@
double xc=helix.xc();
double yc=helix.yc();
double RC = helix.R();
- double safeslope = helix.slope();
- if (Math.abs(safeslope) < _minslope) safeslope = _minslope * Math.signum(safeslope);
- double y=yc+Math.sqrt(RC*RC-Math.pow(x-xc,2));
- double dphi=Math.atan2(y-y0, x-x0);
- Double s = dphi * Math.abs(RC);
- // Loop over crossings until we exceed one of the limits
+ double y=yc+Math.signum(RC)*Math.sqrt(RC*RC-Math.pow(x-xc,2));
+
+ double s=PathCalc(xc,yc,RC,x0,y0,x,y);
+
+// System.out.println("PathToXPlane : s = "+s+"; sFromClass = "+sFromClass);
+ /*
while (s < smax && pathlist.size() < mxint) {
// Add this odd-numbered crossing to the list
pathlist.add(s);
@@ -152,7 +152,9 @@
if (s < smax && pathlist.size() < mxint) pathlist.add(s);
// Add this even-numbered crossing to the list
s += 2. * dphi * Math.abs(RC);
- }
+ }*/
+ pathlist.add(s);
+
return pathlist;
}
lcsim/src/org/lcsim/recon/tracking/seedtracker
diff -u -r1.6 -r1.7
--- MultipleScattering.java 11 Apr 2011 17:21:07 -0000 1.6
+++ MultipleScattering.java 18 Apr 2011 16:05:43 -0000 1.7
@@ -31,7 +31,7 @@
private MaterialManager _materialmanager;
private double _bfield = 0.;
private int _mxint = 10;
-
+
/**
* Creates a new instance of MultipleScattering
* @param materialmanager MaterialManager provides access to the scattering material
@@ -39,7 +39,7 @@
public MultipleScattering(MaterialManager materialmanager) {
_materialmanager = materialmanager;
}
-
+
/**
* Find the path lengths and multiple scattering angles for each
* intersection of the helix with tracker material
@@ -47,21 +47,21 @@
* @return List of path lengths and scattering angles
*/
public List<ScatterAngle> FindScatters(HelicalTrackFit helix) {
-
+
// Check that B Field is set
if (_bfield == 0.) throw new RuntimeException("B Field must be set before calling FindScatters method");
-
+
// Create a new list to contain the mutliple scatters
List<ScatterAngle> scatters = new ArrayList<ScatterAngle>();
-
+
// Retrieve the cylinder and disk material models from the material manager
List<MaterialCylinder> matcyl = _materialmanager.getMaterialCylinders();
List<MaterialDisk> matdsk = _materialmanager.getMaterialDisks();
List<MaterialXPlane> matxpl = _materialmanager.getMaterialXPlanes();
-
+
// Find the largest path length to a hit
double smax = 9999.;
-
+
// We can't go further than the ECal, however
double rmax = _materialmanager.getRMax();
List<Double> slist = HelixUtils.PathToCylinder(helix, rmax, smax, 1);
@@ -69,7 +69,7 @@
double zmax = _materialmanager.getZMax();
if (helix.slope() < 0.) zmax = -zmax;
smax = Math.min(smax, HelixUtils.PathToZPlane(helix, zmax));
-
+
for (MaterialDisk disk : matdsk) {
double s = HelixUtils.PathToZPlane(helix, disk.z());
if (s > 0. && s < smax) {
@@ -83,7 +83,7 @@
}
}
}
-
+
for (MaterialCylinder cyl : matcyl) {
double r = cyl.radius();
double scmin = HelixUtils.PathToZPlane(helix, cyl.zmin());
@@ -104,17 +104,10 @@
double angle = msangle(helix.p(_bfield), radlen);
scatters.add(new ScatterAngle(s, angle));
}
- }
+ }
}
//mg 3/14/11 add in XPlanes
- for (MaterialXPlane xpl : matxpl) {
- double scmin = HelixUtils.PathToZPlane(helix, xpl.zmin());
- double scmax = HelixUtils.PathToZPlane(helix, xpl.zmax());
- if (scmin > scmax) {
- double temp = scmin;
- scmin = scmax;
- scmax = temp;
- }
+ for (MaterialXPlane xpl : matxpl) {
List<Double> pathlist = HelixUtils.PathToXPlane(helix, xpl.x(), smax, _mxint);
for (Double s : pathlist) {
Hep3Vector dir = HelixUtils.Direction(helix, s);
@@ -126,7 +119,6 @@
double cth = Math.abs(VecOp.dot(dir, xhat));
double radlen = xpl.ThicknessInRL() / Math.max(cth, .001);
double angle = msangle(helix.p(_bfield), radlen);
-// System.out.println("MultipleScatter: angle="+angle);
scatters.add(new ScatterAngle(s, angle));
}
}
@@ -135,41 +127,41 @@
Collections.sort(scatters);
return scatters;
}
-
+
public static MultipleScatter CalculateScatter(HelicalTrackHit hit, HelicalTrackFit helix, List<ScatterAngle> scatters) {
-
+
// Retreive the x-y path length and calculate sin^2(theta) for this helix
double sth2 = Math.pow(helix.sth(), 2);
-
+
// Make sure the hit has an x-y path lengths. Hits added since the last fit
// won't have path lengths, so estimate the path length measured from the DCA
Map<HelicalTrackHit, Double> pathmap = helix.PathMap();
if (!pathmap.containsKey(hit)) {
pathmap.put(hit, (Double) HelixUtils.PathLength(helix, hit));
}
-
+
double hitpath = pathmap.get(hit);
-
+
// Loop over scattering points and sum in quadrature ms errors for this hit.
// It is assumed that we can ignore ms correlations during the track-finding stage.
double rphi_ms2 = 0.;
double z_ms2 = 0.;
for (ScatterAngle scat : scatters) {
-
+
// Find the x-y path length to this scatter
double scatpath = scat.PathLen();
-
+
// If the scatter is before the hit, calculate the ms errors for this scatter
if (scatpath > hitpath) break;
-
+
// Get the multiple scattering plane angle for this scatter
double angle = scat.Angle();
-
+
// Sum in quadrature the r-phi ms errors. It is assumed that we
// can ignore track curvature in calculating these errors during
// the track-finding stage.
rphi_ms2 += Math.pow((hitpath - scatpath) * angle, 2);
-
+
// Sum in quadrature the z ms errors assuming a barrel geometry where
// the path length is fixed. While z is fixed for disk detectors, we
// still do a z vs s fit by assuming the track direction is reasonably
@@ -177,16 +169,16 @@
// z coordinate error.
z_ms2 += Math.pow((hitpath - scatpath) * angle / sth2, 2);
}
-
+
// Return the requested MultipleScatter
return new MultipleScatter(Math.sqrt(rphi_ms2), Math.sqrt(z_ms2));
}
-
+
public void setBField(double bfield) {
_bfield = bfield;
return;
}
-
+
// Calculate the multiple scattering angle for a given momentum and thickness
private double msangle(double p, double radlength) {
double angle = (0.0136 / p) * Math.sqrt(radlength) * (1.0 + 0.038 * Math.log(radlength));
lcsim/src/org/lcsim/recon/tracking/seedtracker
diff -u -r1.11 -r1.12
--- MaterialManager.java 12 Apr 2011 18:00:16 -0000 1.11
+++ MaterialManager.java 18 Apr 2011 16:05:43 -0000 1.12
@@ -41,7 +41,7 @@
* @author Jeremy McCormick
* @author Matt Graham
*
- * @version $Id: MaterialManager.java,v 1.11 2011/04/12 18:00:16 jeremy Exp $
+ * @version $Id: MaterialManager.java,v 1.12 2011/04/18 16:05:43 mgraham Exp $
*/
public class MaterialManager
{
@@ -382,7 +382,7 @@
double zlen = vgi.zmax - vgi.zmin;
double ylen = vgi.ymax - vgi.ymin;
double thickness = vtot / (ylen * zlen * vgi.X0);
- double x=(vgi.xmax-vgi.xmin)/2;
+ double x=(vgi.xmax+vgi.xmin)/2;
if (DEBUG) {
System.out.println("Treating as a XPlane...x0: " + vgi.X0 + "| zmin: " + vgi.zmin +