Print

Print


Commit in lcsim/src/org/lcsim/recon/cluster/fixedcone on MAIN
FixedConeClusterer.java+10-241.5 -> 1.6
Fix bug in moving hits from one cluster to another

lcsim/src/org/lcsim/recon/cluster/fixedcone
FixedConeClusterer.java 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- FixedConeClusterer.java	18 Jul 2005 03:06:18 -0000	1.5
+++ FixedConeClusterer.java	27 Jul 2005 16:06:21 -0000	1.6
@@ -274,7 +274,6 @@
         List<CalorimeterHit> cells2 = c2.getCalorimeterHits();
         int size2 = cells2.size();
         
-        List<CalorimeterHit> tmp = new ArrayList<CalorimeterHit>();
         // loop over cells in first cluster...
         for(int i=0; i<cells1.size(); ++i)
         {
@@ -297,19 +296,12 @@
             
             if (R2<R1)
             {
-                //add this cell to the vector of cells to remove
-                tmp.add(p2);
-            }
+				// remove this cell from cluster1
+				c1.removeHit(p2);
+				// add it to cluster2
+				c2.addHit(p2);
+			}
         }
-        for(int i=0; i<tmp.size(); ++i)
-        {
-            CalorimeterHit p2 = (CalorimeterHit) tmp.get(i);
-            // remove this cell from cluster1
-            cells1.remove(p2);
-            // add it to cluster2
-            cells2.add(p2);
-        }
-        tmp.clear();
         // repeat for cluster 2
         // only loop over cells in original cluster
         for(int i=0; i<size2; ++i)
@@ -333,17 +325,11 @@
             
             if (R1<R2)
             {
-                //add this cell to the vector of cells to remove
-                tmp.add(p2);
-            }
-        }
-        for(int i=0; i<tmp.size(); ++i)
-        {
-            CalorimeterHit p2 = (CalorimeterHit) tmp.get(i);
-            // remove this cell from cluster2
-            cells2.remove(p2);
-            // add it to cluster1
-            cells1.add(p2);
+				// remove this cell from cluster2
+				c2.removeHit(p2);
+				// add it to cluster1
+				c1.addHit(p2);
+			}
         }
         
         c1.calculateProperties();
CVSspam 0.2.8