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

Identify events directly from generator #126

Merged
merged 2 commits into from
May 1, 2024

Conversation

DavidDiezIb
Copy link
Member

@DavidDiezIb DavidDiezIb commented Apr 26, 2024

DavidDiezIb Ok: 2 Powered by Pull Request Badge

Events from generator appear in subEventPrimaryParticlename observable as empty category. Now they will be identified as coming from initial generator, so no secondary emission.

@DavidDiezIb DavidDiezIb requested a review from lobis April 26, 2024 13:34
@lobis
Copy link
Member

lobis commented Apr 26, 2024

Events from generator appear in subEventPrimaryParticlename observable as empty category. Now they will be identified as coming from initial generator, so no secondary emission.

I'm not sure if I under understand @DavidDiezIb.

subEventPrimaryParticlename is the name of the sub-event primary particle. For example, if our primary is a neutron that produces some radioactive isotope that decays after a long time, this decay event will be split into a separate event, it's primary particle will still be the neutron and the subEventPrimaryParticlename will be the isotope.

If the event is not a sub-event, subEventPrimaryParticlename should be empty.

If you want to check if the event came straight from the generator, you can just check the sub-event id, if it's 0 it came from the generator. If you find this hard to remember you can create an auxilary method such as CreatedByGenerator which computes this.

@DavidDiezIb
Copy link
Member Author

But the subEventPrimaryParticleName is just a variable created for this observable, isn't it?

What I want is that when I plot the observable, all events have a value. If they are not a sub event then just identify them as primary event, that's why I suggested "generator" which is quite generic. Or in that case do you need the observable empty?

@lobis
Copy link
Member

lobis commented Apr 29, 2024

But the subEventPrimaryParticleName is just a variable created for this observable, isn't it?

What I want is that when I plot the observable, all events have a value. If they are not a sub event then just identify them as primary event, that's why I suggested "generator" which is quite generic. Or in that case do you need the observable empty?

Yes if you want this information in the analysis tree it's true you need to add it as you did. It's already possible to check this by checking for an empty string but I guess writing "generator" is also fine.

Originally I was a bit hesitant because I thought this change was in the actual Geant4 Event itself.

@DavidDiezIb DavidDiezIb merged commit cb9a331 into master May 1, 2024
63 checks passed
@DavidDiezIb DavidDiezIb deleted the DavidDiezIb-Identify_subEvents_from_generator branch May 1, 2024 10:17
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.

2 participants