Skip to content

Commit e0bdeb0

Browse files
committed
reduce calculations
1 parent ec2c936 commit e0bdeb0

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public List<FittedCluster> ClusterSplitter(FittedCluster clus, int nextClsStartI
8686
// From this calculate the bin size in the theta accumulator array
8787
final double RMin = -130;
8888
final double RMax = 130;
89+
final double dR = RMax - RMin;
8990

9091
int[][] R_Phi_Accumul = new int[N_r][N_t];
9192

@@ -117,7 +118,7 @@ public List<FittedCluster> ClusterSplitter(FittedCluster clus, int nextClsStartI
117118
// r_j corresponding to that theta_j:
118119
double r_j = rho * cosTheta_RPhi_array[j_t] + phi * sinTheta_RPhi_array[j_t];
119120
// this value of r_j falls into the following bin in the r array:
120-
int j_r = (int) Math.floor(N_r * (r_j - RMin) / (float) (RMax - RMin));
121+
int j_r = (int) Math.floor(N_r * (r_j - RMin) / dR);
121122

122123
// increase this accumulator cell:
123124
R_Phi_Accumul[j_r][j_t]++;
@@ -171,7 +172,7 @@ public List<FittedCluster> ClusterSplitter(FittedCluster clus, int nextClsStartI
171172
// r_j corresponding to that theta_j:
172173
double r_j = rho * cosTheta_RPhi_array[j_t] + phi * sinTheta_RPhi_array[j_t];
173174
// this value of r_j falls into the following bin in the r array:
174-
int j_r = (int) Math.floor(N_r * (r_j - RMin) / (float) (RMax - RMin));
175+
int j_r = (int) Math.floor(N_r * (r_j - RMin) / dR);
175176

176177
// match bins:
177178
if (j_r == binrMaxR_Phi[p] && j_t == bintMaxR_Phi[p]) {

0 commit comments

Comments
 (0)