Skip to content

Commit 0972d7b

Browse files
tongtongcaobaltzell
authored andcommitted
fix issues in ClusterCleanerUtilities::OverlappingClusterResolver()
1 parent 1dd403b commit 0972d7b

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ public FittedCluster SecondariesRemover(DataEvent event, FittedCluster clus, Clu
706706
public FittedCluster OverlappingClusterResolver(FittedCluster thisclus, List<FittedCluster> clusters) {
707707
// Get list for overlapped clusters
708708
List<FittedCluster> overlapingClusters = new ArrayList<>();
709-
709+
710710
for (FittedCluster cls : clusters) {
711711

712712
List<FittedHit> hitOvrl = new ArrayList<>();
@@ -722,7 +722,7 @@ public FittedCluster OverlappingClusterResolver(FittedCluster thisclus, List<Fit
722722
//test
723723
boolean passCls = true;
724724
for (FittedCluster ovr : overlapingClusters) {
725-
if (ovr.get_Id() == cls.get_Id()) {
725+
if (ovr.equals(cls)) {
726726
passCls = false;
727727
continue;
728728
}
@@ -755,7 +755,7 @@ public FittedCluster OverlappingClusterResolver(FittedCluster thisclus, List<Fit
755755
}
756756

757757
Collections.sort(overlapingClusters); // Order overlapping clusters; 1st priortiy: cluster size; 2nd priority if same cluster size : fitting quality
758-
758+
759759
// return the largest cluster.
760760
return overlapingClusters.get(0);
761761

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,16 @@ public void set_Chisq(double _Chisq) {
191191
*/
192192
@Override
193193
public int compareTo(FittedCluster o) {
194-
if (this.size() > o.size()) {
194+
if (this.size() < o.size()) {
195195
return 1;
196196
}
197197
else if(this.size() == o.size()){
198-
if(this.get_fitProb() > o.get_fitProb()) return 1;
199-
else return 0;
198+
if(this.get_fitProb() < o.get_fitProb()) return 1;
199+
else if(this.get_fitProb() == o.get_fitProb()) return 0;
200+
else return -1;
200201
}
201202
else {
202-
return 0;
203+
return -1;
203204
}
204205
}
205206

0 commit comments

Comments
 (0)