Print

Print


Commit in lcsim/src/org/lcsim/contrib/uiowa/MuonFinder on MAIN
MipTrackMap.java+6-41.4 -> 1.5
bug fixed

lcsim/src/org/lcsim/contrib/uiowa/MuonFinder
MipTrackMap.java 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- MipTrackMap.java	30 Sep 2008 01:40:59 -0000	1.4
+++ MipTrackMap.java	30 Sep 2008 02:38:06 -0000	1.5
@@ -30,7 +30,7 @@
     protected Set<CalorimeterHit> m_allhits;
     protected HelixExtrapolator m_extrap;
     protected int exam = 0; //to test neighbour
-    protected boolean debug = false;
+    protected boolean debug = true;
     protected TrackClusterMatcher m_trackClusterMatcher;
     protected HitMap hitsInTree = null;
 
@@ -219,9 +219,11 @@
 
         //Simple way by looking at direction of two clusters
         List<Cluster> muonmip = new Vector<Cluster>();
+        List<Cluster> removed = new Vector<Cluster>();
         if(output.size() > 1){
             for(int i = 0 ; i < output.size() ; i ++){
                 Cluster cluster1 = output.get(i);
+                if(removed.contains(cluster1)) continue;
                 Hep3Vector v1 = getClusterDirection(output.get(i));
                 BasicCluster tmpClus = new BasicCluster();
                 for(CalorimeterHit hit : cluster1.getCalorimeterHits()){
@@ -230,6 +232,7 @@
 
                 for(int j = 1 ; j < output.size()-1 ; j ++){
                     Cluster cluster2 = output.get(j);
+                    if(removed.contains(cluster2)) continue;
                     Hep3Vector v2 = getClusterDirection(output.get(j));
                     double cos = -1;
                     if( v1 != null && v2 !=null){ cos =  VecOp.dot(v1, v2); }
@@ -237,16 +240,15 @@
                         for(CalorimeterHit hit : cluster2.getCalorimeterHits()){
                            tmpClus.addHit(hit);
                         }
-                        output.remove(cluster2);
+                        removed.add(cluster2);
                     } 
                 }
                 muonmip.add(tmpClus);
-                output.remove(cluster1);
+                removed.add(cluster1);
            }
         }else { muonmip.addAll(output); }
 
 
-
         if (m_removePoorQualityMips) {
             removePoorQualityMips(muonmip);
         }
CVSspam 0.2.8