Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing support for most current IRB fields & retrieval of CRPropa2 data tables for ElectronPairProduction #282

Open
MHoerbe opened this issue Apr 18, 2020 · 4 comments
Assignees

Comments

@MHoerbe
Copy link
Contributor

MHoerbe commented Apr 18, 2020

Hi everyone,

for the future custom photon fields to properly work on the ElectronPairProduction module, I need to be able to reproduce the data files being read in by this module. There is supposed to be one background photon file for each background, however, with only the CMB and the IRB_Kneiske04 existing for this module.

A look into the CRPropa3-data repo where there is a script calc_pairproduction.py responsible for generating data related to the ElectronPairProduction module revealed:

# Reformat CRPropa2 tables of differential spectrum of secondary electrons
# This should be reimplemented for extension to the other backgrounds,
# cross-checking and documentation.
# -------------------------------------------------
d1 = np.genfromtxt('tables/EPP/pair_spectrum_cmb.table', unpack=True)
d2 = np.genfromtxt('tables/EPP/pair_spectrum_cmbir.table', unpack=True)

The tables which are loaded to exist in the data repo yet I could not find any script producing these (and in particular not in the CRPropa2 repository). Hence, I see two ways to proceed here:

  1. Does anyone know where these scripts are and how they work?
  2. Does anyone have an idea what exact data these tables contain beyond "spectra of secondary electrons"? Since then we could try and construct our own, new ones?

Cheers,
Mario

@lukasmerten
Copy link
Member

Hi @Froehliche-Kernschmelze
For the moment I can just add to this discussion, that I alos stumbled over these lines a couple of month ago. I mentioned this briefly during the discussion of #255. However, I will help to investigate this.

@lukasmerten lukasmerten self-assigned this Apr 19, 2020
@ehlertdo
Copy link

ehlertdo commented Feb 4, 2025

Hi,
since CRPropa / CRPropa-data still does not provide the functionality to generate the secondary electrons & positrons for Bethe-Heitler pair production for arbitrary photon fields, I wrote a simple script to implement the Kelner & Aharonian (2008) parametrisation (Eq. 62) to pre-tabulate the electron SED for tabulated custom photon fields.

When comparing with the electron SED available in CRPropa for interactions with the CMB I noticed some very peculiar distributions in the CRPropa table for very low proton energies. At/Below ~5e15eV the tabulated distribution suddenly transitions to a very different shape. This is both in disagreement with the results of the K&A parametrisation and with basic physics -- when approaching the threshold for pair production the energy of the electron-positron pair should take on a fixed value and the distribution be very peaked instead of flat and extending all the way to the proton energy.

Image
(The SEDs in the plot are all normalised to peak at dNdE=1)

Irrespective of this particular issue, it would be great if CRPropa(-data) could generate the Bethe-Heitler electron SED for custom photon fields. Including the K&A parametrisation would be one way to do so.
Cheers,
Domenik

@lukasmerten
Copy link
Member

Hi @ehlertdo
Good that you took a look at that problem again.
We noticed in a Bachelor students projects similar issues with the secondary yields for BH, too.
I did not have time to look further into this. In case, you want to prepare a PR to implement your first approximation into the CRPropa-data repo, I will be happy to review it.
Here (https://arxiv.org/pdf/2401.05534) is another rather new parameterization of the BH yields, that we might take a look at.

@ehlertdo
Copy link

ehlertdo commented Feb 5, 2025

I linked a preliminary version in my comment above. At the moment it requires numba to achieve a reasonable performance since I implemented the triple integral as a series of nested 'for' loops. Initially I thought that the inner integrals could be vectorised in a similar way to what was done for the photopion production in interactionRate.py, however, because here we have a double-differential cross section the vectorisation is less straightforward to do. An alternative to numba would be to implement the loops in C/C++.

I will clean up the code and submit a pull request at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants