Skip to content

Commit 5e05f4d

Browse files
tongtongcaobaltzell
authored andcommitted
update ClusterCleanerUtilities::OverlappingClusterResolver() and apply it twice
1 parent a768fc0 commit 5e05f4d

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed

reconstruction/dc/src/main/java/org/jlab/rec/dc/cluster/ClusterCleanerUtilities.java

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public List<FittedCluster> ClusterSplitter(FittedCluster clus, int nextClsStartI
222222
}
223223
}
224224

225-
// make new clusters
225+
// make new clusters with application of OverlappingClusterResolver
226226
List<FittedCluster> selectedClusList = new ArrayList<>();
227227

228228
int newcid = nextClsStartIndex;
@@ -240,19 +240,36 @@ public List<FittedCluster> ClusterSplitter(FittedCluster clus, int nextClsStartI
240240
}
241241
}
242242
}
243+
244+
// Apply OverlappingClusterResolver again
245+
List<FittedCluster> selectedClusList2 = new ArrayList<>();
246+
for (FittedCluster cluster : selectedClusList) {
247+
cluster.set_Id(newcid++);
248+
cf.SetFitArray(cluster, "LC");
249+
cf.Fit(cluster, true);
250+
251+
FittedCluster bestCls = OverlappingClusterResolver(cluster, selectedClusList);
252+
253+
if (bestCls != null) {
254+
255+
if (!(selectedClusList2.contains(bestCls))) {
256+
selectedClusList2.add(bestCls);
257+
}
258+
}
259+
}
243260

244261
int splitclusId = 1;
245-
if (!selectedClusList.isEmpty()) {
246-
for (FittedCluster cl : selectedClusList) {
262+
if (!selectedClusList2.isEmpty()) {
263+
for (FittedCluster cl : selectedClusList2) {
247264
cl.set_Id(clus.get_Id() * 1000 + splitclusId);
248265
splitclusId++;
249266
}
250267
}
251268

252-
if (selectedClusList.isEmpty()) {
253-
selectedClusList.add(clus); // if the splitting fails, then return the original cluster
269+
if (selectedClusList2.isEmpty()) {
270+
selectedClusList2.add(clus); // if the splitting fails, then return the original cluster
254271
}
255-
return selectedClusList;
272+
return selectedClusList2;
256273
}
257274

258275
public List<List<Hit>> byLayerListSorter(List<Hit> DCHits, int sector, int superlyr) {
@@ -732,8 +749,8 @@ public FittedCluster OverlappingClusterResolver(FittedCluster thisclus, List<Fit
732749
// passCls = false;
733750
//}
734751
}
735-
if((!isExceptionalFittedCluster(cls) && hitOvrl.size() < 3)
736-
|| (isExceptionalFittedCluster(cls) && hitOvrl.size() < 2)) {
752+
if((!isExceptionalFittedCluster(cls) && !isExceptionalFittedCluster(thisclus) && hitOvrl.size() < 3)
753+
|| ((isExceptionalFittedCluster(cls) || isExceptionalFittedCluster(thisclus)) && hitOvrl.size() < 2)) {
737754
passCls = false;
738755
}
739756

0 commit comments

Comments
 (0)