LISTSERV mailing list manager LISTSERV 16.5

Help for HPS-SVN Archives


HPS-SVN Archives

HPS-SVN Archives


HPS-SVN@LISTSERV.SLAC.STANFORD.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

HPS-SVN Home

HPS-SVN Home

HPS-SVN  December 2016

HPS-SVN December 2016

Subject:

r4607 - /java/branches/branch-1116Fixes/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterUtilities.java

From:

[log in to unmask]

Reply-To:

Notification of commits to the hps svn repository <[log in to unmask]>

Date:

Wed, 7 Dec 2016 21:19:04 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (101 lines)

Author: [log in to unmask]
Date: Wed Dec  7 13:19:01 2016
New Revision: 4607

Log:
added a sorter that uses cluster seeds

Modified:
    java/branches/branch-1116Fixes/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterUtilities.java

Modified: java/branches/branch-1116Fixes/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterUtilities.java
 =============================================================================
--- java/branches/branch-1116Fixes/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterUtilities.java	(original)
+++ java/branches/branch-1116Fixes/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterUtilities.java	Wed Dec  7 13:19:01 2016
@@ -334,7 +334,7 @@
      * Apply HPS-specific energy and position corrections to a list of clusters in place.
      * @param clusters The list of clusters.
      */
-    public static void applyCorrections(HPSEcal3 ecal, List<Cluster> clusters) {
+    public static void applyCorrections(HPSEcal3 ecal, List<Cluster> clusters, boolean isMC) {
                 
         // Loop over the clusters.
         for (Cluster cluster : clusters) {
@@ -347,7 +347,7 @@
                 ClusterPositionCorrection.setCorrectedPosition(baseCluster);
             
                 // Apply PID based energy correction.
-                ClusterEnergyCorrection.setCorrectedEnergy(ecal, baseCluster);
+                ClusterEnergyCorrection.setCorrectedEnergy(ecal, baseCluster, isMC);
             }
         }
     }
@@ -356,7 +356,7 @@
      * Apply HPS-specific energy and position corrections to a cluster without track information.
      * @param cluster The input cluster.
      */
-    public static void applyCorrections(HPSEcal3 ecal, Cluster cluster) {
+    public static void applyCorrections(HPSEcal3 ecal, Cluster cluster, boolean isMC) {
                             
         if (cluster instanceof BaseCluster) {
             
@@ -366,7 +366,7 @@
             ClusterPositionCorrection.setCorrectedPosition(baseCluster);
             
             // Apply PID based energy correction.
-            ClusterEnergyCorrection.setCorrectedEnergy(ecal, baseCluster);
+            ClusterEnergyCorrection.setCorrectedEnergy(ecal, baseCluster, isMC);
         }        
     }   
     
@@ -374,7 +374,7 @@
      * Apply HPS-specific energy and position corrections to a cluster with track information.
      * @param cluster The input cluster.
      */
-    public static void applyCorrections(HPSEcal3 ecal, Cluster cluster, double ypos) {
+    public static void applyCorrections(HPSEcal3 ecal, Cluster cluster, double ypos, boolean isMC) {
         
         if (cluster instanceof BaseCluster) {
             
@@ -384,7 +384,7 @@
             ClusterPositionCorrection.setCorrectedPosition(baseCluster);
             
             // Apply PID based energy correction.
-            ClusterEnergyCorrection.setCorrectedEnergy(ecal, baseCluster, ypos);
+            ClusterEnergyCorrection.setCorrectedEnergy(ecal, baseCluster, ypos, isMC);
         }        
     }    
         
@@ -514,6 +514,31 @@
     }
     
     /**
+     * Comparator of cluster energies.
+     */
+    static final class ClusterSeedComparator implements Comparator<Cluster> {
+
+        /**
+         * Compare cluster seed energies.
+         * 
+         * @return -1, 0, or 1 if first cluster's seed energy is less than, equal to, or greater than the first's
+         */
+        @Override
+        public int compare(Cluster o1, Cluster o2) {
+            if (findSeedHit(o1).getCorrectedEnergy() < findSeedHit(o2).getCorrectedEnergy()){
+                return -1;
+            } else if (findSeedHit(o1).getCorrectedEnergy() > findSeedHit(o2).getCorrectedEnergy()) {
+                return 1;
+            } else {
+                return 0;
+            }
+        }       
+    }
+    
+    
+    
+    
+    /**
      * Sort a list of clusters.
      * 
      * @param clusters the list of clusters

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

November 2017
August 2017
July 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013

ATOM RSS1 RSS2



LISTSERV.SLAC.STANFORD.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager

Privacy Notice, Security Notice and Terms of Use