CRPropa / CRPropa3

CRPropa is a public astrophysical simulation framework for propagating extraterrestrial ultra-high energy particles. https://crpropa.github.io/CRPropa3/
https://crpropa.desy.de
GNU General Public License v3.0
65 stars 66 forks source link

Candidate Splitting module #442

Closed sophieaerdker closed 9 months ago

sophieaerdker commented 9 months ago

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 the ModuleList.

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 independent CandidateSplitting 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 the Acceleration 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.