Commit in lcsim/src/org/lcsim/recon/pfa/identifier on MAIN
LocalHelixExtrapolator.java+12-21.11 -> 1.12
MJC: Better check for flipped helix direction (credit TJ); sanity check for an error.

lcsim/src/org/lcsim/recon/pfa/identifier
LocalHelixExtrapolator.java 1.11 -> 1.12
diff -u -r1.11 -r1.12
--- LocalHelixExtrapolator.java	13 Aug 2008 00:39:46 -0000	1.11
+++ LocalHelixExtrapolator.java	15 Aug 2008 16:55:30 -0000	1.12
@@ -159,6 +159,16 @@
     }
 
     public Hep3Vector performExtrapolation(Track tr) {
+
+	// Sanity check -- check for a specific case where we try to
+	// extrapolate an unphysical track of class MultipleTrackTrack.
+	{
+	    Class cl = tr.getClass();
+	    String className = cl.getName();
+	    boolean fake = (className.contains("MultipleTrackTrack"));
+	    if (fake) { throw new AssertionError("Tried to do extrapolation of bogus track!"); }
+	}
+	
 	// Find hits. For now these are SimTrackerHits because
 	// of the inability to get hold of TrackerHits.
 	Collection<SimTrackerHit> trackerHits = findHits(tr);
@@ -399,7 +409,7 @@
     /** Assumes extrapolation has already been done. */
     public Hep3Vector getTangent() {
 	double dphi = 0.01;
-	if (m_track_dphi_negative) { dphi = -0.01; }
+	if (tr.getCharge() > 0) { dphi = -0.01; }
 	double dx = m_trackParam_radius * ( Math.cos(m_trackPoint_phi+dphi) - Math.cos(m_trackPoint_phi) );
 	double dy = m_trackParam_radius * ( Math.sin(m_trackPoint_phi+dphi) - Math.sin(m_trackPoint_phi) );
 	double dz = m_trackParam_dz_by_dphi * dphi;
@@ -435,7 +445,7 @@
 	}
                                                                                                                               
         double dphi = 0.01;
-        if (m_track_dphi_negative) { dphi = -0.01; }
+	if (tr.getCharge() > 0) { dphi = -0.01; }
         double dx = m_trackParam_radius * ( Math.cos(phi0+dphi) - Math.cos(phi0) );
         double dy = m_trackParam_radius * ( Math.sin(phi0+dphi) - Math.sin(phi0) );
         double dz = m_trackParam_dz_by_dphi * dphi;
CVSspam 0.2.8