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
72 stars 69 forks source link

Large differeces in secondary photon spectra between CRPropa 3.1.5 and 3.2 #463

Closed cPapior closed 9 months ago

cPapior commented 10 months ago

Hi everyone, I recently tried to recreate some results from a colleague made with CRPropa 3.1.5 with my current version 3.2 and came across some differences between the versions that occur when propagating protons while having interactions with an IRB-background active.

My code for CRPropa 3.2 (slight adjustments for CRPropa 3.1.5: IRB_Gilmore12 instead of IRB_Gilmore12(), etc.):

sim = ModuleList() sim.add( SimplePropagation(0.01kpc, 0.1kpc) ) sim.add(FutureRedshift() ) sim.add( PhotoPionProduction(IRB_Gilmore12(), True, False, False, False) )

swapped IRB_Gilmore12() for other IRB models (IRB_Stecker16_upper(), IRB_Stecker16_lower(), IRB_Dominguez11())

sim.add(MinimumEnergy( 1e-8 * EeV ) )

obs = Observer() obs.add( ObserverPoint() ) output = TextOutput(filename, Output.Event1D) obs.onDetection(output) sim.add(obs)

source = Source() source.add( SourcePosition(40Mpc) ) source.add( SourceParticleType(nucleusId(1,1)) ) source.add( SourceEnergy(50EeV) ) source.add( SourceRedshift1D() ) #this line is not present in my colleagues version but I ran into issues when I omitted it in m code

sim.setShowProgress(True)
sim.run(source, 100000, True)

From the output-file I counted the number of secondary photons and displayed their energies in a histogram. Plot with photon numbers in legend for CRPropa 3.2: 50EeV_40Mpc_CRPropa32.pdf

Plot with photon numbers in legend for CRPropa 3.1.5: 50EeV_40Mpc_CRPropa315.pdf

Is there a reason why the photon number is so much higher for CRPropa version 3.2, especially in the lower energy range? Or is there possibly an issue with my code or a line which I cannot use for both CRPropa versions in the same way?

Thank you, Chiara Papior

lukasmerten commented 9 months ago

Hi Chiara (@cPapior)

Thanks for your report. This behavior is more or less expected when comparing the old (v3.1.5) against the newer versions. This is mainly due to an update to the target photon sampling routine (see #368 for more of the discussion). The quintessence is, that the old samapling routing was not properly sampling the low energy tail of the target field distribution. Leading to less produced photons.