Author: [log in to unmask] Date: Fri Jan 30 11:08:46 2015 New Revision: 2006 Log: Updated the GTPClusterDriver to allow for all parameters to be set through a steering file and also modified the clustering algorithm to support the writing of diagnostic text. Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/GTPClusterDriver.java java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/GTPClusterer.java Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/GTPClusterDriver.java ============================================================================= --- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/GTPClusterDriver.java (original) +++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/GTPClusterDriver.java Fri Jan 30 11:08:46 2015 @@ -1,18 +1,28 @@ package org.hps.recon.ecal.cluster; /** - * This is a Driver to wrap the GTPClusterer algorithm, - * allowing the <code>limitClusterRange</code> to be - * set publicly. + * Class <code>GTPClusterDriver</code> instantiates an instance of + * the clustering algorithm framework for the Monte Carlo version + * of the GTP algorithm. This version assumes that events are equal + * to 2 ns beam bunches. The class also allows the seed energy threshold + * and cluster window to be set as well as whether or not the algorithm + * should employ an asymmetric time window and write out verbose debug + * text. * + * @author Kyle McCarty <[log in to unmask]> + * @author Jeremy McCormick <[log in to unmask]> * @see GTPClusterer - * - * @author Jeremy McCormick <[log in to unmask]> */ public class GTPClusterDriver extends ClusterDriver { - + // The GTP clustering algorithm. + private final GTPClusterer gtp; + + /** + * Instantiates a new <code>GTPClusterer</code>. + */ public GTPClusterDriver() { clusterer = ClustererFactory.create("GTPClusterer"); + gtp = (GTPClusterer) clusterer; } /** @@ -24,20 +34,55 @@ * the asymmetric clustering window should be used and <code> * false</code> that the symmetric window should be used. */ + @Deprecated void setLimitClusterRange(boolean limitClusterRange) { - GTPClusterer gtpClusterer = getClusterer(); - gtpClusterer.setLimitClusterRange(limitClusterRange); + gtp.setLimitClusterRange(limitClusterRange); } + /** + * Sets the number of clock-cycles (4 ns) before and after a hit + * in which the hit must be the maximum energy hit in its 3 x 3 + * window in order to be considered a seed hit and form a cluster. + * @param clusterWindow - The number of clock-cycles around the + * hit in one direction; i.e. a value of 1 indicates that the full + * window will include the current clock-cycle, plus one cycle both + * before and after the current cycle. This gives a total number + * of cycles equal to (2 * clusterWindow) + 1. + */ public void setClusterWindow(int clusterWindow) { - getClusterer().getCuts().setValue("clusterWindow", clusterWindow); + gtp.getCuts().setValue("clusterWindow", clusterWindow); } + /** + * Sets the minimum energy needed for a seed hit to form a cluster. + * @param seedEnergyThreshold - The minimum seed energy in GeV. + */ public void setSeedEnergyThreshold(double seedEnergyThreshold) { - getClusterer().getCuts().setValue("seedEnergyThreshold", seedEnergyThreshold); + gtp.getCuts().setValue("seedEnergyThreshold", seedEnergyThreshold); } + /** + * Sets whether the clustering algorithm should use an asymmetric + * clustering window. The asymmetric window will include hits in + * a cluster that are present within the full time window ahead of + * the seed hit, but only one clock-cycle behind it. This is to + * allow for variation in hit timing with respect to the seed due + * to jitter in the hardware. + * @param asymmetricWindow - <code>true</code> indicates that the + * asymmetric window should be used and <code>false</code> that it + * should not. + */ public void setAsymmetricWindow(boolean asymmetricWindow) { - ((GTPClusterer) getClusterer()).setLimitClusterRange(asymmetricWindow); + gtp.setLimitClusterRange(asymmetricWindow); + } + + /** + * Sets whether the clustering algorithm should output diagnostic + * text or not. + * @param verbose <code>true</code> indicates that the driver should + * output diagnostic text and <code>false</code> that it should not. + */ + public void setVerbose(boolean verbose) { + gtp.setVerbose(verbose); } } Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/GTPClusterer.java ============================================================================= --- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/GTPClusterer.java (original) +++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/GTPClusterer.java Fri Jan 30 11:08:46 2015 @@ -344,6 +344,16 @@ } /** + * Sets whether diagnostic text should be written out or not. + * @param verbose - <code>true</code> indicates that diagnostic + * text will be written out and <code>false</code> that it will + * not. + */ + void setVerbose(boolean verbose) { + this.verbose = verbose; + } + + /** * Indicates the type of cluster that is generated by this algorithm. * @return Returns the type of cluster as a <code>ClusterType</code> * object, specifically, <code>ClusterType.GTP</code>.