Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,34 +74,29 @@ public List<FittedCluster> 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 :
Expand All @@ -123,7 +118,7 @@ public List<FittedCluster> 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]++;
Expand Down Expand Up @@ -177,7 +172,7 @@ public List<FittedCluster> 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]) {
Expand Down