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

update_num_output_per_event_after_filter does not work for multiplicity_cuts. #294

Closed
LucasConstantin opened this issue Oct 23, 2024 · 1 comment
Assignees
Labels
bug Something isn't working urgent
Milestone

Comments

@LucasConstantin
Copy link
Collaborator

When calling Oscar.multiplicity_cut() the num_output_per_event is not updated correctly. This is because the particle_list_ is reduced in size, but the update_num_output_per_event_after_filter() function only updates the entries in range(len(self.particle_list_)) without removing the remaining entries. This also causes problems with the print_particle_lists_to_file() function.

This code produces the errors:
path = '..' + os.sep + 'data' +os.sep+ 'SMASH_min_bias_alpha_clustering.oscar' oscar = sparkx.Oscar(path, events=(0,200)).participants() mult_cut = oscar.multiplicity_cut(1) #keep events with N >= 1 print(oscar.num_output_per_event()) mult_cut.print_particle_lists_to_file('test.oscar')

Traceback (most recent call last):
File "/mnt/c/Users/lucas/Desktop/Masterarbeit_project/sparkx_flow_checks/multiplicity_folders.py", line 11, in
mult_cut.print_particle_lists_to_file('test.oscar')
File "/usr/local/lib/python3.9/dist-packages/sparkx/Oscar.py", line 1078, in print_particle_lists_to_file
particle_output = np.asarray(self.particle_list()[i])
File "/usr/local/lib/python3.9/dist-packages/sparkx/Oscar.py", line 634, in particle_list
particle = self.particle_list_[i_ev][i_part]
IndexError: list index out of range

@NGoetz NGoetz added bug Something isn't working urgent labels Oct 23, 2024
@NGoetz NGoetz added this to the SPARKX 2.0 milestone Oct 23, 2024
@NGoetz
Copy link
Member

NGoetz commented Nov 18, 2024

Closed by #296

@NGoetz NGoetz closed this as completed Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working urgent
Projects
None yet
Development

No branches or pull requests

2 participants