hps-java/src/main/java/org/lcsim/hps/users/phansson
diff -u -r1.3 -r1.4
--- WTrackUtils.java 7 Nov 2012 20:54:13 -0000 1.3
+++ WTrackUtils.java 15 Nov 2012 02:46:15 -0000 1.4
@@ -15,22 +15,27 @@
* @author phansson
*/
public class WTrackUtils {
- private boolean _debug = false;
+ private int _debug = 0;
List<Double> _delta_point = new ArrayList<Double>();
public WTrackUtils() {
}
public WTrackUtils(boolean debug) {
+ _debug = debug?1:0;
+ }
+
+ public WTrackUtils(int debug) {
_debug = debug;
}
+
public void setDebug(boolean debug) {
- _debug = debug;
+ _debug = debug?1:0;
}
public boolean getDebug() {
- return _debug;
+ return _debug>0?true:false;
}
public List<Double> getDeltas() {
@@ -96,7 +101,7 @@
// System.out.println(this.getClass().getSimpleName() + ": I should never get here! (root1=" + root1 + " root2=" + root2+")");
// System.exit(1);
// }
- if(_debug) {
+ if((_debug>1)) {
System.out.println(this.getClass().getSimpleName() + ": getPathLengthToPlaneApprox ");
System.out.println(this.getClass().getSimpleName() + ": " + track.toString());
System.out.println(this.getClass().getSimpleName() + ": xp " + xp.toString());
@@ -167,7 +172,7 @@
Hep3Vector p_tmp = this.getMomentumOnHelix(track, s);
Hep3Vector x_tmp = this.getPointOnHelix(track, s);
- if(_debug) {
+ if((_debug>1)) {
System.out.println(this.getClass().getSimpleName() + ": point on helix at s");
System.out.println(this.getClass().getSimpleName() + ": p " + p.toString() + " p_tmp " + p_tmp.toString());
System.out.println(this.getClass().getSimpleName() + ": x " + x.toString() + " x_tmp " + x_tmp.toString());
@@ -208,7 +213,7 @@
List<WTrack> tracks = new ArrayList<WTrack>();
WTrack trk = new WTrack(track);
while(iteration<=max_it && Math.abs(s_prev)>epsilon) {
- if(_debug) {
+ if((_debug>1)) {
System.out.println(this.getClass().getSimpleName() + ": iteration " + iteration + " --- ");
System.out.println(this.getClass().getSimpleName() + ": s_prev " + s_prev + " delta_s " + delta_s);
System.out.println(this.getClass().getSimpleName() + ": " + trk.toString());
@@ -216,7 +221,7 @@
// Start by approximating the path length to the point
double s = this.getPathLengthToPlaneApprox(trk, xp, eta, h);
- if(_debug) {
+ if((_debug>1)) {
System.out.println(this.getClass().getSimpleName() + ": Approx. path s " + s);
}
@@ -225,7 +230,7 @@
// update the track parameters
trk.setTrackParameters(params);
- if(_debug) {
+ if((_debug>1)) {
System.out.println(this.getClass().getSimpleName() + ": updated params " + trk.toString());
}
@@ -241,7 +246,7 @@
}
- if(_debug) {
+ if((_debug>1)) {
System.out.println(this.getClass().getSimpleName() + ": Final s " + s_prev + " delta_s " + delta_s);
System.out.println(this.getClass().getSimpleName() + ": Final track params " + trk.toString());
}