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.
This pull request adds a new module that splits candidates in a user-defined number of copies when energy boundaries are crossed. The candidates weights are lowered depending on the splitting number. Candidates can be split until a minimal weight is reached. To use, the
CandidateSplitting
module must be added to theModuleList
.Originally, the module was developed to enhance statistics at high energies for diffusive shock acceleration. For that, only the expected spectral index, minimal energy and number of energy bins needs to be specified. The energy bins are then calculated so that the decrease of candidates over the specified energy range is compensated by always splitting into two copies. This way of splitting was used in the 2023 ICRC proceedings to model time-dependent diffusive shock acceleration. Simulations are significantly faster when the
CandidateSplitting
module is used instead of just increasing the number of candidates to reach sufficiently high statistics. It is also possible to define splitting number, energy bins, and minimal weights.The
Acceleration
module already provides candidate splitting for acceleration at shocks, the new independentCandidateSplitting
module is more flexible. It does not depend on the shock surface and can be used in other scenarios as well. The code that performs splitting is adapted from theAcceleration
module.The
testCandidateSplitting
test checks the correct calculation of energy bins and if weights are set accordingly depending on the number of energy bins that are crossed.