lcsim/src/org/lcsim/recon/tracking/seedtracker
diff -u -r1.7 -r1.8
--- MultipleScattering.java 18 Apr 2011 16:05:43 -0000 1.7
+++ MultipleScattering.java 12 Jul 2013 20:49:58 -0000 1.8
@@ -28,9 +28,10 @@
* @version 1.0
*/
public class MultipleScattering {
- private MaterialManager _materialmanager;
- private double _bfield = 0.;
+ protected MaterialManager _materialmanager;
+ protected double _bfield = 0.;
private int _mxint = 10;
+ protected boolean _debug = false;
/**
* Creates a new instance of MultipleScattering
@@ -47,7 +48,7 @@
* @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");
@@ -132,7 +133,7 @@
// 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();
@@ -150,7 +151,7 @@
// 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;
@@ -169,19 +170,22 @@
// 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) {
+ protected double msangle(double p, double radlength) {
double angle = (0.0136 / p) * Math.sqrt(radlength) * (1.0 + 0.038 * Math.log(radlength));
return angle;
}
-}
\ No newline at end of file
+
+ public void setDebug(boolean debug) {
+ _debug = debug;
+ }
+ }