Commit in lcsim/src/org/lcsim/contrib/uiowa on MAIN
ReclusterDriver.java+6-71.12 -> 1.13
MJC: Reclusterer Mk I: Re-enable final pass (over-rides to force E/p into balance); remove some debug printout by default.

lcsim/src/org/lcsim/contrib/uiowa
ReclusterDriver.java 1.12 -> 1.13
diff -u -r1.12 -r1.13
--- ReclusterDriver.java	19 Dec 2007 22:37:58 -0000	1.12
+++ ReclusterDriver.java	20 Dec 2007 04:06:16 -0000	1.13
@@ -30,7 +30,7 @@
   *
   * This version is PRELIMINARY.
   *
-  * @version $Id: ReclusterDriver.java,v 1.12 2007/12/19 22:37:58 mcharles Exp $
+  * @version $Id: ReclusterDriver.java,v 1.13 2007/12/20 04:06:16 mcharles Exp $
   * @author Mat Charles
   */
 
@@ -750,7 +750,6 @@
 	//   * The E/p for track T would be OK if cluster C was added
 	// We could also generalize this to a group of clusters (C1+C2+...+Cn) to be connected to T.
 	boolean noOverridesOnPreviousPass = false;
-	noOverridesOnPreviousPass = true; // DISABLE OVER-RIDES
 	while (!noOverridesOnPreviousPass) {
 	    noOverridesOnPreviousPass = true;
 	    for (Cluster clus : linkableClusters) {
@@ -763,20 +762,20 @@
 		    MCParticle domPartOfClus = quoteDominantParticle(clus);
 		    int domPDG = domPartOfClus.getPDGID();
 		    double domMom = domPartOfClus.getMomentum().magnitude();
-		    System.out.println("DEBUG: Considering a link over-ride for cluster ["+clus.getCalorimeterHits().size()+" hits] with no track.");
+		    if (m_debug) { System.out.println("DEBUG: Considering a link over-ride for cluster ["+clus.getCalorimeterHits().size()+" hits] with no track."); }
 		    // What was the best-scoring link available?
 		    List<ScoredLink> potentialLinks = m_potentialLinks.get(clus);
 		    if (potentialLinks != null && potentialLinks.size()>0) {
 			ScoredLink bestLink = potentialLinks.get(0);
 			Cluster matchedClusterOfBestLink = bestLink.counterpart(clus);
 			Track trackOfMatchedClusterOfBestLink = newMapShowerComponentToTrack.get(matchedClusterOfBestLink);
-			System.out.println("DEBUG: Potential link from cluster ["+clus.getCalorimeterHits().size()+" hits] to a cluster ["+matchedClusterOfBestLink.getCalorimeterHits().size()+" hits] with score="+bestLink.score());
+			if (m_debug) { System.out.println("DEBUG: Potential link from cluster ["+clus.getCalorimeterHits().size()+" hits] to a cluster ["+matchedClusterOfBestLink.getCalorimeterHits().size()+" hits] with score="+bestLink.score()); }
 			if (trackOfMatchedClusterOfBestLink != null) {
 			    // OK, there's a track. We might have vetoed this for E/p before... check that
 			    double trackMomentum = new BasicHep3Vector(trackOfMatchedClusterOfBestLink.getMomentum()).magnitude();
 			    if (newMapTrackToVetoedAdditions.get(trackOfMatchedClusterOfBestLink).contains(clus)) {
 				// We vetoed it before -- ignore it for now
-				System.out.println("DEBUG: Potential link from cluster ["+clus.getCalorimeterHits().size()+" hits] to a cluster ["+matchedClusterOfBestLink.getCalorimeterHits().size()+" hits] vetoed due to E/p");
+				if (m_debug) { System.out.println("DEBUG: Potential link from cluster ["+clus.getCalorimeterHits().size()+" hits] to a cluster ["+matchedClusterOfBestLink.getCalorimeterHits().size()+" hits] vetoed due to E/p"); }
 			    } else {
 				// OK, good to go.
 				Set<Cluster> currentShowerOfTrack = newMapTrackToShowerComponents.get(trackOfMatchedClusterOfBestLink);
@@ -785,7 +784,7 @@
 				double energyOfExistingShower = energy(currentShowerOfTrack, allSharedClusters);
 				double energyOfNewShower = energy(newShowerOfTrack, allSharedClusters);
 				double tolerance = newMapTrackToTolerance.get(trackOfMatchedClusterOfBestLink).doubleValue();
-				System.out.println("DEBUG: Potential link from cluster ["+clus.getCalorimeterHits().size()+" hits] to a cluster ["+matchedClusterOfBestLink.getCalorimeterHits().size()+" hits] would move shift energy "+energyOfExistingShower+" --> "+energyOfNewShower+" (p="+trackMomentum);
+				if (m_debug) { System.out.println("DEBUG: Potential link from cluster ["+clus.getCalorimeterHits().size()+" hits] to a cluster ["+matchedClusterOfBestLink.getCalorimeterHits().size()+" hits] would move shift energy "+energyOfExistingShower+" --> "+energyOfNewShower+" (p="+trackMomentum); }
 				if (testEoverP(energyOfNewShower, trackOfMatchedClusterOfBestLink, tolerance)) {
 				    // OK, add it
 				    newMapTrackToShowerComponents.put(trackOfMatchedClusterOfBestLink, newShowerOfTrack);
@@ -807,7 +806,7 @@
 					    mistake += " [but no cost]";
 					}
 				    }
-				    System.out.println("DEBUG: Over-rode scoring to make a link: Track with p="+trackMomentum+" to clus with "+clus.getCalorimeterHits().size()+" hits from "+domPDG+" with p="+domMom+mistake);
+				    if (m_debug) { System.out.println("DEBUG: Over-rode scoring to make a link: Track with p="+trackMomentum+" to clus with "+clus.getCalorimeterHits().size()+" hits from "+domPDG+" with p="+domMom+mistake); }
 				}
 			    }
 			}
CVSspam 0.2.8