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

make interactions problem for specific energy cuts #375

Open
pascalgutjahr opened this issue Jun 26, 2023 · 2 comments
Open

make interactions problem for specific energy cuts #375

pascalgutjahr opened this issue Jun 26, 2023 · 2 comments
Assignees

Comments

@pascalgutjahr
Copy link
Collaborator

The function collection.interaction = pp.make_interaction(cross, True) seems to be an infinite loop for v_cut = 0.01. In my case, v_cut = 0.05 worked totally fine. This was also tested for three different energy cuts.

I have tested this with the following script example:

import proposal as pp
import numpy as np

e_cut = 500
v_cut = 0.01 # 0.05 
cont_rand = True

args = {
        "particle_def": pp.particle.MuMinusDef(),
        "target": pp.medium.Ice(),
        "interpolate": True,
        "cuts": pp.EnergyCutSettings(e_cut, v_cut, cont_rand)
        }

cross = pp.crosssection.make_std_crosssection(**args)
collection = pp.PropagationUtilityCollection()
collection.interaction = pp.make_interaction(cross, True)
@Jean1995
Copy link
Member

Very weird... I can confirm this issue. But I can easily create the table from C++, and I can even read the created table from python...

@Jean1995
Copy link
Member

Jean1995 commented Jun 26, 2023

It looks likes this happens because PROPOSAL tries to print out too many logging warnings at once (due to dNdx becoming negative at specific points), which somehow breaks python...

I've never seen such a problem before. The "quick fix" solution would be to just suppress these messages by using

pp.logging.set_loglevel(pp.logging.loglevel.off).

You may also just put this command before you invoke make_interaction, and directly restore the default by calling

pp.logging.set_loglevel(pp.logging.loglevel.warn) afterwards.

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

No branches or pull requests

2 participants