Skip to content

Commit

Permalink
Change nearest higher found criteria (cms-patatrack#28)
Browse files Browse the repository at this point in the history
* Add check on `rho_j` in calc of nearest higher

* Fix typo
  • Loading branch information
sbaldu authored Mar 8, 2024
1 parent b0b8344 commit d81f74a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CLUEstering/alpaka/CLUE/CLUEAlpakaKernels.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
float rho_j{dev_points->rho[j]};
bool found_higher{(rho_j > rho_i)};
// in the rare case where rho is the same, use detid
found_higher = found_higher || ((rho_j == rho_i) && (j > point_id));
found_higher = found_higher || ((rho_j == rho_i) && (rho_j > 0.f) && (j > point_id));

// Calculate the distance between the two points
VecArray<float, Ndim> coords_j{dev_points->coords[j]};
Expand Down Expand Up @@ -200,8 +200,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
VecArray<VecArray<float, 2>, Ndim> searchbox_extremes;
for (int dim{}; dim != Ndim; ++dim) {
VecArray<float, 2> dim_extremes;
dim_extremes.push_back_unsafe(coords_i[dim] - dc);
dim_extremes.push_back_unsafe(coords_i[dim] + dc);
dim_extremes.push_back_unsafe(coords_i[dim] - dm);
dim_extremes.push_back_unsafe(coords_i[dim] + dm);

searchbox_extremes.push_back_unsafe(dim_extremes);
}
Expand Down

0 comments on commit d81f74a

Please sign in to comment.