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

correctly compute energy even after event data update (e.g. via quenc… #110

Merged
merged 11 commits into from
Aug 28, 2023

Conversation

lobis
Copy link
Member

@lobis lobis commented Aug 19, 2023

lobis Large: 455

I noticed a problem when computing observables such as energy deposition via the TRestGeant4AnalysisProcess after the geant4 event has been modified (for example via the quenching process). Even though the process updates the energy of each individual hit, the energy deposited is retrieved from a pre-computed store. This is done for efficiency but it can be problematic as processes that modify the event will also need to update these stores.

On top of that, currently there are two stores that serve a similar purpose: one only for energy in volume, one newer that serves for everything and gets proyected into whatever the user requests (energy per particle, per process, etc.). The newer store is more computationally expensive but at the end both are fast enough not to be a problem. We should aim to remove this redundancy (I tried but it was very complex, it needs a deep revision).

In general the problem lies with the usage of volume ids (which can be active volume ids or just volume ids...) instead of just using the volume names (which would lower confusion). I think we should just use volume names everywhere possible unless there is a good reason not to.

@lobis lobis added the bug Something isn't working label Aug 19, 2023
@lobis lobis marked this pull request as ready for review August 28, 2023 11:59
@lobis lobis merged commit 37fdf02 into master Aug 28, 2023
62 of 63 checks passed
@lobis lobis deleted the lobis-fix-energy-compute branch August 28, 2023 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants