Skip to content

Commit 23256fa

Browse files
committed
reduce getter calls
1 parent 685a3b0 commit 23256fa

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

‎reconstruction/dc/src/main/java/org/jlab/rec/dc/cluster/ClusterFitter.java‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,28 +238,29 @@ public FittedCluster BestClusterSelector(List<FittedCluster> clusters, String sy
238238

239239
int size = clusters.size();
240240
for (int i=0; i<size; i++) {
241-
if (isBrickWall(clusters.get(i))) {
241+
FittedClusters cluster = clusters.get(i);
242+
if (isBrickWall(cluster)) {
242243
int LRSum=0;
243-
int size2 = clusters.get(i).size();
244+
int size2 = cluster.size();
244245
for (int j=0; j<size2; j++) {
245-
LRSum += clusters.get(i).get(j).get_LeftRightAmb();
246+
LRSum += cluster.get(j).get_LeftRightAmb();
246247
}
247248
if (LRSum != 0) {
248249
continue;
249250
}
250251
}
251252
// set the array of measurements according to the system used in the analysis
252-
SetFitArray(clusters.get(i), system);
253+
SetFitArray(cluster, system);
253254
// do the fit and get the chisq
254-
Fit(clusters.get(i), true);
255+
Fit(cluster, true);
255256
if (FitPars == null) {
256257
continue;
257258
}
258259
double chisq = FitPars.chisq();
259260

260261
if (chisq < bestChisq) {
261262
bestChisq = chisq;
262-
BestCluster = clusters.get(i);
263+
BestCluster = cluster;
263264
}
264265
}
265266

@@ -306,7 +307,7 @@ private boolean isBrickWall(FittedCluster clusCand) {
306307
sumWireNum += clusCand.get(i).get_Wire();
307308
}
308309
for (int i=0; i<size; i++) {
309-
if (clusCand.get(i).get_Wire()*clusCand.size()!=sumWireNum) {
310+
if (clusCand.get(i).get_Wire()*size != sumWireNum) {
310311
isBW = false;
311312
break;
312313
}

0 commit comments

Comments
 (0)