Print

Print


Author: [log in to unmask]
Date: Thu Mar 12 15:10:20 2015
New Revision: 2419

Log:
Updated the GTPOnline clusterer such that it will no longer include hits that have negative energy into a cluster even if they would normally fall within the hit inclusion window. This more accurately mirrors the behavior of the hardware clusterer.

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

Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/GTPOnlineClusterer.java
 =============================================================================
--- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/GTPOnlineClusterer.java	(original)
+++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/GTPOnlineClusterer.java	Thu Mar 12 15:10:20 2015
@@ -158,30 +158,37 @@
                 // Iterate over the other hits and if the are within
                 // the clustering spatiotemporal window, compare their
                 // energies.
+                hitLoop:
                 for(CalorimeterHit hit : hitList) {
-                    // Do not perform the comparison if the hit is the
-                    // current potential seed.
-                    if(hit != seed) {
-                        // Check if the hit is within the spatiotemporal
-                        // clustering window.
-                        if(withinTimeVerificationWindow(seed, hit) && withinSpatialWindow(seed, hit)) {
-                            // Check if the hit invalidates the potential
-                            // seed.
-                            if(isValidSeed(seed, hit)) {
-                                // Make sure that the hit is also within
-                                // the hit add window; this may not be
-                                // the same as the verification window
-                                // if the asymmetric window is active.
-                                if(withinTimeClusteringWindow(seed, hit)) {
-                                    protoCluster.addHit(hit);
-                                }
+                	// Negative energy hits are never valid. Skip them.
+                	if(hit.getCorrectedEnergy() < 0) {
+                		continue hitLoop;
+                	}
+                	
+                	// Do not compare the potential seed hit to itself.
+                	if(hit == seed) {
+                		continue hitLoop;
+                	}
+                	
+                    // Check if the hit is within the spatiotemporal
+                    // clustering window.
+                    if(withinTimeVerificationWindow(seed, hit) && withinSpatialWindow(seed, hit)) {
+                        // Check if the hit invalidates the potential
+                        // seed.
+                        if(isValidSeed(seed, hit)) {
+                            // Make sure that the hit is also within
+                            // the hit add window; this may not be
+                            // the same as the verification window
+                            // if the asymmetric window is active.
+                            if(withinTimeClusteringWindow(seed, hit)) {
+                                protoCluster.addHit(hit);
                             }
-                            
-                            // If it is not, then skip the rest of the
-                            // loop; the potential seed is not really
-                            // a seed.
-                            else { continue seedLoop; }
                         }
+                        
+                        // If it is not, then skip the rest of the
+                        // loop; the potential seed is not really
+                        // a seed.
+                        else { continue seedLoop; }
                     }
                 }