Commit in lcsim/src/org/lcsim/recon/cluster/analysis on MAIN
ClusterAnalysisDriver.java+4-71.1 -> 1.2
ClusterMCPInfo.java+4-41.5 -> 1.6
CreateClusterAnalysisLists.java+10-131.5 -> 1.6
+18-24
3 modified files
GL: Fix some warnings and make better use of event.get() methods

lcsim/src/org/lcsim/recon/cluster/analysis
ClusterAnalysisDriver.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- ClusterAnalysisDriver.java	17 Feb 2006 17:11:36 -0000	1.1
+++ ClusterAnalysisDriver.java	21 Jun 2006 18:34:18 -0000	1.2
@@ -79,12 +79,9 @@
         {
             gotit = false;
             first = false;
-            List<List<MCParticle>> mclists = event.get(MCParticle.class);
-            for(List<MCParticle> mclist:mclists)
-            {
-                if(event.getMetaData(mclist).getName().compareTo(fsParticleListName) == 0)
-                gotit = true;
-            }
+            Collection<MCParticle> mclist = event.get(MCParticle.class, fsParticleListName);
+	    if(mclist!=null && mclist.size()>0) gotit = true;
+
             if(!gotit)
             {
                 fsDriver = new CreateFinalStateMCParticleList("Sim");
@@ -94,7 +91,7 @@
                 fsDriver.setKeepContinuousHadrons();
             }
         }
-        
+
 //
 // Create the Final state particle list, if needed
 //

lcsim/src/org/lcsim/recon/cluster/analysis
ClusterMCPInfo.java 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- ClusterMCPInfo.java	27 Feb 2006 17:09:09 -0000	1.5
+++ ClusterMCPInfo.java	21 Jun 2006 18:34:18 -0000	1.6
@@ -29,7 +29,7 @@
     private MCParticle[] primaries;
     private MCParticle[] fragments;
     private MCPClusterInfo maxMCPC;
-    
+
     /**
      *@param c - cluster for which this object is created
      *@param fsmap - map of MCParticle to final state MCParticle
@@ -37,7 +37,7 @@
     public ClusterMCPInfo(Cluster c, Map<MCParticle,MCParticle> fsmap)
     {
         thisCluster = c;
-        contributers = new HashMap();
+        contributers = new HashMap<MCParticle,Contributions>();
 //
 // Loop over all the Calorimeter hits in this cluster
 //
@@ -248,7 +248,7 @@
     }
     public Cluster getCluster()
     {return thisCluster;}
-    
+
 }
 /**
  * Class to store contribution information while ClusterMCPInfo being filled
@@ -297,4 +297,4 @@
     {return eraw;}
     public double getEcorrected()
     {return ecorr;}
-}
\ No newline at end of file
+}

lcsim/src/org/lcsim/recon/cluster/analysis
CreateClusterAnalysisLists.java 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- CreateClusterAnalysisLists.java	17 Feb 2006 17:11:36 -0000	1.5
+++ CreateClusterAnalysisLists.java	21 Jun 2006 18:34:18 -0000	1.6
@@ -1,6 +1,7 @@
 package org.lcsim.recon.cluster.analysis;
 
 import org.lcsim.recon.cluster.util.*;
+import java.util.Collection;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -15,9 +16,9 @@
 
 /**
  * Class to create and write to event list of objects referencing MCParticles
- * to Clusters, and Clusters to MCParticles. 
+ * to Clusters, and Clusters to MCParticles.
  * @author Ron Cassell
- * @version $Id: CreateClusterAnalysisLists.java,v 1.5 2006/02/17 17:11:36 cassell Exp $
+ * @version $Id: CreateClusterAnalysisLists.java,v 1.6 2006/06/21 18:34:18 lima Exp $
  */
 public class CreateClusterAnalysisLists
 {
@@ -63,15 +64,11 @@
 //
 // Get the Lists from event
 //
-       List<MCParticle> mcpall = null;
-       List<MCParticle> mcpfs = null;
+       List<MCParticle> mcpall = event.getMCParticles();
+       Collection<MCParticle> mcpfs = event.get(MCParticle.class,fslistname);
+
        List<Cluster> clusters = new ArrayList<Cluster>();
-       List<List<MCParticle>> mclists = event.get(MCParticle.class);
-       for(List<MCParticle> mclist:mclists)
-       {
-          if(event.getMetaData(mclist).getName().compareTo("MCParticle") == 0)mcpall = mclist;
-          if(event.getMetaData(mclist).getName().compareTo(fslistname) == 0)mcpfs = mclist;
-       }
+
        List<List<Cluster>> cllists = event.get(Cluster.class);
        for(List<Cluster> cllist:cllists)
        {
@@ -117,7 +114,7 @@
           if(mcpfs == null)lnames += "final state particles "+fslistname+" ";
           if(clusters.size() == 0)lnames += "clusters ";
           System.err.println("CreateClusterAnalysisLists:: Input lists"+lnames+"do not exist in event: Empty analysis lists written");
-          return; 
+          return;
        }
 //
 // Create the map of MCParticle to MCPClusterInfo, and a map of MCParticle to final state MCParticle
@@ -239,7 +236,7 @@
      * @param p - particle to trace
      * @param fs - List of final state particles
      */
-    public MCParticle traceit(MCParticle p, List<MCParticle> fs)
+    public MCParticle traceit(MCParticle p, Collection<MCParticle> fs)
     {
        MCParticle rp = null;
 //
@@ -260,4 +257,4 @@
 //
        return rp;
     }
-}
\ No newline at end of file
+}
CVSspam 0.2.8