Skip to content

Remove Cherenkov threshold for LS detectors#71

Open
JostMigenda wants to merge 3 commits intomainfrom
JostMigenda/threshold
Open

Remove Cherenkov threshold for LS detectors#71
JostMigenda wants to merge 3 commits intomainfrom
JostMigenda/threshold

Conversation

@JostMigenda
Copy link
Copy Markdown
Member

Fixes #52. As a side effect (because the allowed eNu range for certain channels is now slightly larger), the event rate in es and c12e/c12eb channels increases by a few per cent for LS detectors.

(Not 100% happy with how I implemented this, but I think that’s about as good as it gets without a larger restructuring of the code base. At least I got to clean up the main() implementation slightly.)

Since gen_evts() is executed in separate processes for parallelisation, this needed to be done in that function, which required changes to the surrounding code.
* update hash of sample output file
* remove old sample output file from tests directory
* remove diff from CI (was left over from initial debugging) and set explicit exit code instead
@JostMigenda JostMigenda requested a review from mcolomerm March 19, 2026 21:35
@JostMigenda
Copy link
Copy Markdown
Member Author

Hmm … the integration test is failing under Ubuntu; the only difference I can see from the logs is in the c12e channel:

[c12e] Generated 64 particles (expected: 66.86 particles) (macOS/Windows)

[c12e] Generated 64 particles (expected: 66.82 particles) (Ubuntu)

Not sure what's going on there; I'll look into it (but am on annual leave this afternoon, so this will need to wait until next week).

Default method depends on OS and Python version and `fork` doesn’t work with the cherenkov_threshold hack in this PR.
@JostMigenda
Copy link
Copy Markdown
Member Author

Fixed the issue—turns out, ProcessPoolExecutor uses different ways to create new processes depending on OS and Python version. macOS and Windows use spawn by default, which creates a blank slate process; Linux uses fork which inherits existing module imports from the parent process (so updating sntools.interaction_channels.cherenkov_threshold inside gen_evts() was too late).

@mcolomerm Please go ahead and try this branch now; I’ll merge it sometime after the Easter holidays if you don’t discover any further issues.

@mcolomerm
Copy link
Copy Markdown

Fixed the issue—turns out, ProcessPoolExecutor uses different ways to create new processes depending on OS and Python version. macOS and Windows use spawn by default, which creates a blank slate process; Linux uses fork which inherits existing module imports from the parent process (so updating sntools.interaction_channels.cherenkov_threshold inside gen_evts() was too late).

@mcolomerm Please go ahead and try this branch now; I’ll merge it sometime after the Easter holidays if you don’t discover any further issues.

Thanks @JostMigenda for having a look at this. I will try to test it on the coming days.

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

Successfully merging this pull request may close these issues.

Remove Cherenkov threshold for LS detectors

2 participants