diff --git a/reconstruction/dc/src/main/java/org/jlab/rec/dc/cluster/ClusterCleanerUtilities.java b/reconstruction/dc/src/main/java/org/jlab/rec/dc/cluster/ClusterCleanerUtilities.java index b2b37c20f1..6ab72f997e 100644 --- a/reconstruction/dc/src/main/java/org/jlab/rec/dc/cluster/ClusterCleanerUtilities.java +++ b/reconstruction/dc/src/main/java/org/jlab/rec/dc/cluster/ClusterCleanerUtilities.java @@ -188,34 +188,20 @@ public List ClusterSplitter(FittedCluster clus, int nextClsStartI } } } - //no gaps - List contigArrayOfHits = new ArrayList<>(); //contiguous cluster - - boolean passCluster = true; - for (int l = 1; l <= Constants.NLAYR; l++) { - for (int i = 0; i < newClus.size(); i++) { - if (newClus.get(i).get_Layer() == l) { - contigArrayOfHits.add(newClus.get(i)); - } - } - } - for (int i = 0; i < contigArrayOfHits.size() - 1; i++) { //if there is a gap do not include in list - if (contigArrayOfHits.get(i + 1).get_Layer() - contigArrayOfHits.get(i).get_Layer() > 1) { - passCluster = false; + + //Limits for cluster candiates + boolean passCluster = false; + int nLayers = count_nlayers_in_cluster(newClus); + if((!isExceptionalCluster(newClus) && nLayers >= Constants.DC_MIN_NLAYERS) + || (isExceptionalCluster(newClus) && nLayers >= Constants.DC_MIN_NLAYERS - 1)) { + //require consistency with line + cf.SetFitArray(newClus, "LC"); + cf.Fit(newClus, true); + if ((nLayers == 6 && newClus.get_fitProb() > 0.9) || (nLayers == 5 && newClus.get_fitProb() > 0.85) + || (nLayers == 4 && newClus.get_fitProb() > 0.75) || (nLayers == 3 && newClus.get_fitProb() > 0.65)) { + passCluster = true; } } - //require 4 layers to make a cluster - if ((!isExceptionalCluster(contigArrayOfHits) && count_nlayers_in_cluster(contigArrayOfHits) < Constants.DC_MIN_NLAYERS) - || (isExceptionalCluster(contigArrayOfHits) && count_nlayers_in_cluster(contigArrayOfHits) < Constants.DC_MIN_NLAYERS - 1)) { - passCluster = false; - } - - //require consistency with line - cf.SetFitArray(newClus, "LC"); - cf.Fit(newClus, true); - if (newClus.get_fitProb() < 0.9) { - passCluster = false; - } if (!(splitclusters.contains(newClus)) && passCluster) { splitclusters.add(newClus); @@ -314,7 +300,7 @@ public int count_nlayers_hit(Hit[] hits_inlayer) { * @param hitsInClus the hits in a cluster * @return the number of layers in a cluster */ - int count_nlayers_in_cluster(List hitsInClus) { + int count_nlayers_in_cluster(List hitsInClus) { // count hits in each layer int nlayr = 6; int[] nlayers = new int[nlayr]; diff --git a/reconstruction/dc/src/main/java/org/jlab/rec/dc/cluster/ClusterFinder.java b/reconstruction/dc/src/main/java/org/jlab/rec/dc/cluster/ClusterFinder.java index d9b8eb2ab8..a2d1b735fe 100644 --- a/reconstruction/dc/src/main/java/org/jlab/rec/dc/cluster/ClusterFinder.java +++ b/reconstruction/dc/src/main/java/org/jlab/rec/dc/cluster/ClusterFinder.java @@ -236,7 +236,8 @@ public List FindHitBasedClusters(List allhits, ClusterCleane int idSharedHits = numTDCBankRows + 10000; for (FittedCluster clus : fittedClusList) { if (clus != null && ((!ct.isExceptionalFittedCluster(clus) && clus.size() >= Constants.DC_MIN_NLAYERS) || - (ct.isExceptionalFittedCluster(clus) && clus.size() >= Constants.DC_MIN_NLAYERS-1)) && clus.get_fitProb()>Constants.HITBASEDTRKGMINFITHI2PROB) { + (ct.isExceptionalFittedCluster(clus) && clus.size() >= Constants.DC_MIN_NLAYERS-1)) + && ((ct.count_nlayers_in_cluster(clus) < Constants.DC_MIN_NLAYERS && clus.get_fitProb() > 0.4) || (ct.count_nlayers_in_cluster(clus) >= Constants.DC_MIN_NLAYERS && clus.get_fitProb()>Constants.HITBASEDTRKGMINFITHI2PROB))) { // update the hits for (FittedHit fhit : clus) {