lcsim/src/org/lcsim/recon/cluster/directedtree
diff -u -r1.2 -r1.3
--- ClusterBuilder.java 9 Feb 2006 21:17:57 -0000 1.2
+++ ClusterBuilder.java 22 May 2006 18:52:47 -0000 1.3
@@ -7,8 +7,13 @@
public class ClusterBuilder {
+ int _minClusterSize = RunControlParameters.getInstance().getMinimumSize();
HitWeightingClusterPropertyCalculator _hitWeightingCPC = new HitWeightingClusterPropertyCalculator();
+ public void setMinimumSize(int newMinimum) {
+ _minClusterSize = newMinimum;
+ }
+
public List<BasicCluster> makeClusters(Collection<? extends Collection<CalorimeterHit>> inClusters)
{
int nclus = inClusters.size();
@@ -21,14 +26,17 @@
int cluSize = hits.size();
assert cluSize > 0 : "ClusterBuilder: zero-hits cluster found.";
- // create cluster
- BasicCluster clus = new BasicCluster();
- for( CalorimeterHit hit : hits ) clus.addHit( hit );
+ // require minimum cluster size
+ if(cluSize >= _minClusterSize) {
+ // create cluster
+ BasicCluster clus = new BasicCluster();
+ for( CalorimeterHit hit : hits ) clus.addHit( hit );
- // change cluster's hit-weighting scheme
- clus.setPropertyCalculator( _hitWeightingCPC );
+ // change cluster's hit-weighting scheme
+ clus.setPropertyCalculator( _hitWeightingCPC );
- outClusters.add(clus);
+ outClusters.add(clus);
+ }
}
return outClusters;
}
lcsim/src/org/lcsim/recon/cluster/directedtree
diff -u -r1.3 -r1.4
--- RunControlParameters.java 20 Feb 2006 22:48:12 -0000 1.3
+++ RunControlParameters.java 22 May 2006 18:52:47 -0000 1.4
@@ -12,6 +12,8 @@
private RunControlParameters() {
if(_me==null) _me=this;
+ _minHits= 0;
+
// sidaug05_tcmt (and SDNPHOct04 certification)
_EMsampWt = 1.0/0.012366;
_HDsampWt = 1.0/0.03136;
@@ -182,6 +184,12 @@
return this._phiContractionHD;
}
+ public int getMinimumSize(){
+ return this._minHits;
+ }
+
+ // ***** FIELDS *****
+
private static RunControlParameters _me=null;
private double _EMsampWt;
@@ -205,5 +213,5 @@
private int[] _lyrContractionEM,_lyrContractionHD;
private int[] _zContractionEM,_zContractionHD;
private int[] _phiContractionEM,_phiContractionHD;
-
+ private int _minHits;
}