Print

Print


Author: [log in to unmask]
Date: Thu Dec  3 16:56:15 2015
New Revision: 4008

Log:
Enabled method getClusterDistance for object type SSPCluster.

Modified:
    java/trunk/record-util/src/main/java/org/hps/record/triggerbank/TriggerModule.java

Modified: java/trunk/record-util/src/main/java/org/hps/record/triggerbank/TriggerModule.java
 =============================================================================
--- java/trunk/record-util/src/main/java/org/hps/record/triggerbank/TriggerModule.java	(original)
+++ java/trunk/record-util/src/main/java/org/hps/record/triggerbank/TriggerModule.java	Thu Dec  3 16:56:15 2015
@@ -449,8 +449,22 @@
      * be calculated.
      * @return Returns displacement of the cluster.
      */
-    // TODO: What defines cluster distance?
     public static double getClusterDistance(Cluster cluster) {
+    	// Get the variables from the cluster.
+    	double x = getClusterX(cluster);
+    	double y = getClusterY(cluster);
+    	
+    	// Perform the calculation.
+    	return getClusterDistance(x, y);
+    }
+    
+    /**
+     * Calculates the distance between the origin and a cluster.
+     * @param cluster - The cluster pair from which the value should
+     * be calculated.
+     * @return Returns displacement of the cluster.
+     */
+    public static double getClusterDistance(SSPCluster cluster) {
     	// Get the variables from the cluster.
     	double x = getClusterX(cluster);
     	double y = getClusterY(cluster);