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 b93809da55..e82f9a1414 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 @@ -74,34 +74,29 @@ public List ClusterSplitter(FittedCluster clus, int nextClsStartI /// determined. /// This is a preliminary pattern recognition method used to identify /// reconstructed hits belonging to the same track-segment. - int N_t = 180; + final int N_t = 180; // From this calculate the bin size in the theta accumulator array - double ThetaMin = 0.; - double ThetaMax = 2. * Math.PI; - double SizeThetaBin = (ThetaMax - ThetaMin) / ((double) N_t); + final double ThetaMin = 0.; + final double ThetaMax = 2. * Math.PI; + final double SizeThetaBin = (ThetaMax - ThetaMin) / ((double) N_t); // Define the dimension of the r accumulator array - int N_r = 130; + final int N_r = 130; // From this calculate the bin size in the theta accumulator array - double RMin = -130; - double RMax = 130; + final double RMin = -130; + final double RMax = 130; + final double dR = RMax - RMin; - int[][] R_Phi_Accumul; - R_Phi_Accumul = new int[N_r][N_t]; + int[][] R_Phi_Accumul = new int[N_r][N_t]; // cache the cos and sin theta values [for performance improvement] - double[] cosTheta_RPhi_array; - double[] sinTheta_RPhi_array; + double[] cosTheta_RPhi_array = new double[N_t]; + double[] sinTheta_RPhi_array = new double[N_t]; // the values corresponding to the peaks in the array - double[] binrMaxR_Phi; - double[] bintMaxR_Phi; - binrMaxR_Phi = new double[N_r * N_t]; - bintMaxR_Phi = new double[N_r * N_t]; - - cosTheta_RPhi_array = new double[N_t]; - sinTheta_RPhi_array = new double[N_t]; + double[] binrMaxR_Phi = new double[N_r * N_t]; + double[] bintMaxR_Phi = new double[N_r * N_t]; for (int j_t = 0; j_t < N_t; j_t++) { // theta_j in the middle of the bin : @@ -123,7 +118,7 @@ public List ClusterSplitter(FittedCluster clus, int nextClsStartI // r_j corresponding to that theta_j: double r_j = rho * cosTheta_RPhi_array[j_t] + phi * sinTheta_RPhi_array[j_t]; // this value of r_j falls into the following bin in the r array: - int j_r = (int) Math.floor(N_r * (r_j - RMin) / (float) (RMax - RMin)); + int j_r = (int) Math.floor(N_r * (r_j - RMin) / dR); // increase this accumulator cell: R_Phi_Accumul[j_r][j_t]++; @@ -177,7 +172,7 @@ public List ClusterSplitter(FittedCluster clus, int nextClsStartI // r_j corresponding to that theta_j: double r_j = rho * cosTheta_RPhi_array[j_t] + phi * sinTheta_RPhi_array[j_t]; // this value of r_j falls into the following bin in the r array: - int j_r = (int) Math.floor(N_r * (r_j - RMin) / (float) (RMax - RMin)); + int j_r = (int) Math.floor(N_r * (r_j - RMin) / dR); // match bins: if (j_r == binrMaxR_Phi[p] && j_t == bintMaxR_Phi[p]) {