Allow automatic grouping of hits based on a group_distance
when creating an Event
#461
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Following the discussion on #460, this PR provides a method to automatically group hits in subarrays based on their distances, such that charge clouds close to each other can interact, but the interactions between charge clouds far apart can still be neglected.
@apmypb Thanks for taking care of the core implementation of
group_points_by_distance
using breadth-first search, which was optimized to have little allocations and fast run times.To stick to the same example as in #460, where two points are
1mm
apart, see the results for passing nogroup_distance
(the previous default),group_distance = 0.5mm
(where the charge clouds are not grouped) andgroup_distance = 2mm
(where the charge clouds are grouped).The grouping results in some extra runtime when creating the
Event
, but can help saving time when calculatingself_repulsion
later in the pipeline. Ifself_repulsion = false
, I would still recommend to use the method withoutgroup_distance
to achieve the previous results and run times.