# `AAfrag201`: Interpolation routines for Monte Carlo results on secondary production in proton-proton, proton-nucleus and nucleus-nucleus interactions
`AAfrag 201` is a tool that interpolates results relevant for secondary interactions in cosmic ray studies from the Monte Carlo simulation QGSJET-II-04m. The calculation of the production cross section of photons, neutrinos, electrons, positrons, protons, antiprotons in p-p, p-He, He-p, He-He, C-p-, Al-p, Fe-p interactions, as well as production cross section of antideuteron and antihelium-3 in p-p, p-He, He-p, He-He, pbar-p and pbar-He interactions, are included. The tool allows the users to benefit from the advantages of a Monte Carlo simulation, with minimal computational effort. The results from the Monte Carlo simulations were stored in tables, and the main purpose of `AAfrag 2` is to provide the user with convenient interpolation routines. The interpolation is performed using binomial interpolation, with a fill value 0 outside the data range.
The program includes five functions that are intended to be used by the user (`spec_gam`, `spec_nu`, `spec_elpos`, `spec_pap`, `spec_nan`, `spec_ad`, `spec_ah`) which interpolate the production spectra of secondaries {photons, neutrinos, electrons, positrons, protons, antiprotons, neutrons, antineutrons, antideuterons and antihelium-3} in various cosmic ray interactions. The functions have the same input parameters: `(E_p, E_s, q, k)`. An example of their uses is given in the example programs.
## Installation
To compile the Fortran version program, run
> make AAfrag
Then,
> ./AAfrag.out
runs the example program.
The Python 3 version for the common pedestrian can be found in AAfrag.py.
It can be run with
> python3 AAfrag.py
The script can either be executed as a standalone script, or imported as a
Python module.
## Documentation
For full documentation see [https://sourceforge.net/projects/aafrag/](https://sourceforge.net/projects/aafrag/).
## References
When using this program, please cite
- M. Kachelrieß, S. Ostapchenko and J. Tjemsland, submitted to *Comput. Phus. Commun.* [arXiv:2206.00998]
- M. Kachelrieß, I. V. Moskalenko and S. Ostapchenko, *Comput. Phys. Commun.* **245** (2019), 106846 [arXiv:1904.05129]
The program is based on work published in the following references:
- S. Ostapchenko, *Phys. Rev. D* **83**, 014018 (2011) [arXiv:1010.1869]; *EPJ Web Conf.* **52**, 02001 (2013)
- M. Kachelrieß, I. V. Moskalenko, and S. S. Ostapchenko, *Astrophys. J.* **803**, 54 (2015) [arXiv: 1502.04158]
- M. Kachelrieß, S. Ostapchenko and J. Tjemsland, *JCAP* **08** (2020), 048 [arXiv:2002.10481]; J. Tjemsland, *PoS* **TOOLS2020** (2021), 006 [arXiv:2012.12252]
You may consider to cite these works if they are of relevance to your application.
---
This work is licensed under a [Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License](http://creativecommons.org/licenses/by-nc-nd/4.0/)