Commit in lcsim/src/org/lcsim/contrib/uiowa on MAIN
ReclusterDTreeDriver.java+10-61.23 -> 1.24
MJC: (contrib) Fix couple of bugs in reassignment pass that were introduced when refactoring

lcsim/src/org/lcsim/contrib/uiowa
ReclusterDTreeDriver.java 1.23 -> 1.24
diff -u -r1.23 -r1.24
--- ReclusterDTreeDriver.java	18 Jun 2008 18:29:50 -0000	1.23
+++ ReclusterDTreeDriver.java	26 Jun 2008 19:15:05 -0000	1.24
@@ -34,7 +34,7 @@
   * in this package, which uses the implementation in
   * org.lcsim.recon.cluster.directedtree developed by NIU).
   *
-  * @version $Id: ReclusterDTreeDriver.java,v 1.23 2008/06/18 18:29:50 mcharles Exp $
+  * @version $Id: ReclusterDTreeDriver.java,v 1.24 2008/06/26 19:15:05 mcharles Exp $
   * @author Mat Charles <[log in to unmask]>
   */
 
@@ -536,7 +536,11 @@
 	if (m_fixSingleTracksWithCone) {
 	    // First, try to fix the simplest case: single tracks with E/p < 1
 	    for (Track tr : tracksSortedByMomentum) {
-		checkTrackForReassignments(tr, newMapTrackToShowerComponents, newMapShowerComponentToTrack, allSharedClusters, unassignedClusters, newMapTrackToTolerance.get(tr), algorithm);
+		// Only process tracks that aren't part of a jet:
+		Set<Track> jetOfTrack  = mapTrackToJet.get(tr);
+		if (jetOfTrack == null) {
+		    checkTrackForReassignments(tr, newMapTrackToShowerComponents, newMapShowerComponentToTrack, allSharedClusters, unassignedClusters, newMapTrackToTolerance.get(tr), algorithm);
+		}
 	    }
 	}
 	if (m_fixJetsWithCone) {
@@ -566,7 +570,7 @@
 	m_event = null;
     }
 
-    boolean checkIfReassignmentNeeded(Set<Track> jet, Set<Cluster> showerComponents, List<SharedClusterGroup> allSharedClusters)
+    boolean checkIfReassignmentNeeded(Set<Track> jet, Set<Cluster> showerComponents, List<SharedClusterGroup> allSharedClusters, double tolerance)
     {
 	double jetMomentum = jetScalarMomentum(jet);
 	boolean punchThrough = isPunchThrough(showerComponents, allSharedClusters);
@@ -576,7 +580,7 @@
 	    return false;
 	}
 	double jetEnergy = energy(showerComponents, allSharedClusters);
-	boolean passesEoverP = testEoverP_twoSided(jetEnergy, jetMomentum, m_jetTolerance);
+	boolean passesEoverP = testEoverP_twoSided(jetEnergy, jetMomentum, tolerance);
 	if (passesEoverP) {
 	    System.out.println("DEBUG: Ignoring jet with total p="+jetMomentum+" since it passes E/p (E="+jetEnergy+")");
 	    // Passes E/p check -- ignore
@@ -602,7 +606,7 @@
 	Set<Cluster> showerComponents = newMapTrackToShowerComponents.get(tr);
 	Set<Track> tmpJet = new HashSet<Track>();
 	tmpJet.add(tr);
-	if ( checkIfReassignmentNeeded(tmpJet, showerComponents, allSharedClusters) ) {
+	if ( checkIfReassignmentNeeded(tmpJet, showerComponents, allSharedClusters, toleranceOfTrack) ) {
 	    List<Cluster> reassignedClusters = reassignClustersToTrack(tr, showerComponents, unassignedClusters, allSharedClusters, toleranceOfTrack, algorithm);
 	    if (reassignedClusters != null && reassignedClusters.size()>0) {
 		for (Cluster clus : reassignedClusters) {
@@ -622,7 +626,7 @@
 					    ReassignClustersAlgorithm algorithm)
     {
 	Set<Cluster> showerComponents = newMapJetToShowerComponents.get(jet);
-	if ( checkIfReassignmentNeeded(jet, showerComponents, allSharedClusters) ) {
+	if ( checkIfReassignmentNeeded(jet, showerComponents, allSharedClusters, m_jetTolerance) ) {
 	    List<Cluster> reassignedClusters = reassignClustersToJet(jet, showerComponents, unassignedClusters, allSharedClusters, m_jetTolerance, algorithm);
 	    if (reassignedClusters != null && reassignedClusters.size()>0) {
 		for (Cluster clus : reassignedClusters) {
CVSspam 0.2.8