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

Filter out empty events #314

Merged
merged 2 commits into from
Nov 20, 2024
Merged

Conversation

NGoetz
Copy link
Member

@NGoetz NGoetz commented Nov 20, 2024

Due to sloppy implementation in #296 by @LucasConstantin and an at least equally sloppy review by myself, there were unused variables which didn't handle the case of inverted cut boundaries. Upon fixing and testing this, I noticed that we do not handle correctly empty events when filtering, namely we do not remove them. The multiplicity cut event removal was not done for constructors, only for manual filtering afterwards. This opened Pandora's box.
In the current state of affairs, I keep events which are fed into the constructor empty, and only remove such which are emptied by filtering. In future, this should maybe be customisable.

@NGoetz NGoetz requested a review from Hendrik1704 November 20, 2024 17:51
Copy link
Collaborator

@Hendrik1704 Hendrik1704 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I understand your comment correctly? If you load a file with 5 events and then filter everything out with the multiplicity_cut for example, then the number of events is 0, num_outputs_per_event is an empty list and the particle list contains only one empty list?

tests/test_Jetscape.py Outdated Show resolved Hide resolved
@NGoetz
Copy link
Member Author

NGoetz commented Nov 20, 2024

Do I understand your comment correctly? If you load a file with 5 events and then filter everything out with the multiplicity_cut for example, then the number of events is 0, num_outputs_per_event is an empty list and the particle list contains only one empty list?

Yes

@Hendrik1704 Hendrik1704 self-requested a review November 20, 2024 20:29
@Hendrik1704 Hendrik1704 merged commit e80062b into sparkx_devel Nov 20, 2024
2 checks passed
@Hendrik1704 Hendrik1704 deleted the ngoetz/fix_multiplicity_unused branch November 20, 2024 20:30
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