-
Notifications
You must be signed in to change notification settings - Fork 13
Add unit tests and validation plots for bxdecay #457
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
Conversation
slightly wrong. the vertex output scheme is only registered if there are any other output schemes registered, not depending on the persistence mode (you still can register output schemes and force no persistence, for example). Anyhow, we could actually port the vertex scheme to an optional scheme, and still activate it by default (but also have an option to just enable the vertex scheme) |
|
I guess i also have to add some conditional code to the |
yes. we already have something similar for some other tests here: remage/tests/hades/CMakeLists.txt Lines 29 to 32 in f5b726f
|
|
Also see https://remage.readthedocs.io/en/stable/developer.html#configuring-cmake for CMake tips related to plots for the validation report. |
236d767 to
0a8068c
Compare
|
Changes i made to speed the tests up:
But my tests on my local pc did only show like a 20% improvement at best |
|
I wonder if we should implement some mode to only record the primary vertex/particle info on disk, without any actual tracking. To be used only for debugging / validation of generators. This could be useful for many checks, including #435. Ideas? |
|
I think it would be pretty useful, but i can not think of a simple solution... You can either
|
why do you think this would be inefficient? I think this is the best solution |
|
Well Geant4 has to set up the entire world, physics databases etc. anyways. I am not really talking about a quantitative inefficiency, which might only be a few %. I more meant a logical/qualitative inefficiency. As you are initializing the entire Framework and then only access a small isolated part. From a logical point of view the "cleanest" way would be to just access the isolated part on its own (at least from my point of view)... But that would be rather difficult to implement i think |
|
But the speedup actually seems to be pretty good. ~15s seems reasonable. Although the statistics is not the best as you can see in the plots above |
|
I think we should try to simulate a lot, for smooth histograms. Much more than what's in your tests here. In such a case, the app initialization time would be much lower than initialization time. |
I think that could be implemented with a single macro of if(flag) step->GetTrack->SetTrackStatus(fKillTrackAndSecondaries); |
|
yes, could you quickly test it? |
|
The speedup looks good. From ~132secs to ~42secs on my local pc. I will quickly push something with the old version and increased statistics, wait for the pipeline to run the test and then push with the new version and compare |
|
In the pipeline the old version takes ~331s (only the one simulation not the entire pipeline) and the new version ~99s But 99s is still pretty long |
|
can you post again the plots? how's the stats now? |
|
You could reduce the binning, this will mean the CPU demands are less
…________________________________
From: Luigi Pertoldi ***@***.***>
Sent: Friday, August 8, 2025 5:10 PM
To: legend-exp/remage ***@***.***>
Cc: Subscribed ***@***.***>
Subject: Re: [legend-exp/remage] Add unit tests and validation plots for bxdecay (PR #457)
⚠ Caution: External sender
[https://avatars.githubusercontent.com/u/20358192?s=20&v=4]gipert left a comment (legend-exp/remage#457)<#457 (comment)>
can you post again the plots? how's the stats now?
—
Reply to this email directly, view it on GitHub<#457 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANSET46KYOHFAGZ2BLNDMYT3MS4XNAVCNFSM6AAAAACDLJQYWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCNRYGI3DCMJUGA>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
|
go back on holiday smart ass |
|
Yeah you have to somehow force using the original aspect ratio. We should still optimize the runtime. We want to validate many decay modes so it would take a long time, with the current settings. Maybe you can play a bit with bin size and number of events? For example, you could halve the number of bins, reduce the number of events by a factor 4 and then check if things still look reasonably smooth. Could you also already add more bb decay modes to at least the left plot? |
bb8e6a5 to
f1bb611
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive unit tests and validation plots for the bxdecay0 generator integration. It creates a test framework to verify different double beta decay modes (0vbb, 2vbb, 0vbb_M1, 0vbb_lambda_0) and generates validation plots showing electron energy distributions and angular correlations.
- Implements test suite for bxdecay0 generator with four decay modes
- Adds plotting functionality to visualize primary electron energies and opening angles
- Introduces SkipTracking feature to optimize test performance by skipping particle tracking
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/bxdecay/run_sims.py | Main simulation runner for different decay modes |
| tests/bxdecay/plot_decay_modes.py | Plotting script for energy and angular distributions |
| tests/bxdecay/macros/*.mac | Simulation configuration templates |
| tests/bxdecay/gdml/geometry.gdml | Simple germanium detector geometry |
| tests/bxdecay/CMakeLists.txt | Build configuration for bxdecay tests |
| src/RMGSteppingAction.cc | Implementation of SkipTracking feature |
| include/RMGSteppingAction.hh | Header for SkipTracking functionality |
| docs/validation/*.md | Documentation for bxdecay validation |
Comments suppressed due to low confidence (1)
3bb3fd3 to
c833e42
Compare
|
So all the comments are fixed except the two i left open. @gipert Do you still want the figures to have a double-beta specifier in their filename, although they are always stored under the /bxdecay0 folder? |
|
oke, everything fixed now |


This currently runs two tests which at the same time produce output for validation plots.
These are the energy of the two primary electrons (the neutrinos are not even created with bxdecay)

And the opening angle between the primary electrons.

I would say the energy looks good, i am not sure about the opening angles. I have to admit i have no idea what we would expect there.
The main issue is that we need high statistics for good plots, and that means longer simulation times.
I still need to add the plots to the validation suite, so this is just a draft, but i guess you can already comment on it.
Also i had to include the
/RMG/Geometry/RegisterDetector Germanium det1 001in the macros because otherwise the/RMG/Output/Vertex/StorePrimaryParticleInformationcommand would not exist. I assume this is because the simulation would run in non-persistency mode. But this means right now we write away information we do not need in the tests i added