Commit in lcsim/src/org/lcsim/recon/pfa/cheat on MAIN
PerfectIdentifier.java+22-31.6 -> 1.7
MJC: Add some more features to perfect identifier track-matching

lcsim/src/org/lcsim/recon/pfa/cheat
PerfectIdentifier.java 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- PerfectIdentifier.java	16 May 2007 17:30:21 -0000	1.6
+++ PerfectIdentifier.java	13 Oct 2007 20:07:00 -0000	1.7
@@ -14,7 +14,7 @@
 
 /**
  * 
- * @version $Id: PerfectIdentifier.java,v 1.6 2007/05/16 17:30:21 mcharles Exp $
+ * @version $Id: PerfectIdentifier.java,v 1.7 2007/10/13 20:07:00 mcharles Exp $
  */
 
 public class PerfectIdentifier extends Driver
@@ -31,6 +31,10 @@
 	if (m_inputTrackListName != null) {
 	    trackList = event.get(Track.class, m_inputTrackListName);
 	}
+	List<Track> outputTrackList = new Vector<Track>();
+	if (trackList != null) {
+	    outputTrackList.addAll(trackList);
+	}
 	
 	for (Cluster clus : inputClusterList) {
 	    // Identify
@@ -79,6 +83,7 @@
 			Particle cheatTrackParticle = cheatTrack.getMCParticle();
 			if (cheatTrackParticle == truthID) {
 			    part.addTrack(currentTrack);
+			    outputTrackList.remove(currentTrack);
 			}
 		    }
 		}
@@ -93,9 +98,15 @@
 	    part.setReferencePoint(truthID.getOrigin());
 	    part.setCharge(truthID.getCharge());
 	    // Add to the output list
-	    outputParticleList.add(part);
+	    if (!m_requireTrack || part.getTracks().size()>0) {
+		outputParticleList.add(part);
+	    }
 	}
 	event.put(m_outputParticleListName, outputParticleList);
+
+	if (outputTrackList != null && m_outputTrackListName != null) {
+	    event.put(m_outputTrackListName, outputTrackList);
+	}
     }
     
     protected MCParticle findTruthID(Cluster clus, List<MCParticle> mcList) {
@@ -178,8 +189,16 @@
     public void setInputTrackList(String name) {
 	m_inputTrackListName = name;
     }
-    
+    public void setOutputTrackList(String name) {
+	m_outputTrackListName = name;
+    }
+    public void requireTrack(boolean b) {
+	m_requireTrack = b;
+    }
+
+    boolean m_requireTrack = false;
     String m_inputTrackListName;
+    String m_outputTrackListName;
     String m_inputClusterListName;
     String m_outputParticleListName;
     String m_mcName;
CVSspam 0.2.8