Print

Print


Author: [log in to unmask]
Date: Wed Jan 14 12:18:30 2015
New Revision: 1926

Log:
Add method for sorting list of recon cluster hits from hit list.

Modified:
    java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterUtilities.java

Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterUtilities.java
 =============================================================================
--- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterUtilities.java	(original)
+++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterUtilities.java	Wed Jan 14 12:18:30 2015
@@ -243,6 +243,16 @@
         for (Cluster cluster : clusters) {
             Collections.sort(cluster.getCalorimeterHits(), comparator);
         }
+    }
+    
+    /**
+     * Sort in place a list of hits by their corrected energy.
+     * If energy is equal then position is used to disambiguate.
+     * @param hits The list of hits.
+     */
+    public static void sortHitsUniqueEnergy(List<CalorimeterHit> hits) {
+        Comparator<CalorimeterHit> comparator = Collections.reverseOrder(new UniqueEnergyComparator());
+        Collections.sort(hits, comparator);
     }
     
     /**