Skip to content

Commit

Permalink
Merge pull request #242 from smash-transport/ngoetz/flow_poi
Browse files Browse the repository at this point in the history
Make POI for differential flow truly optional
  • Loading branch information
NGoetz committed Jul 1, 2024
2 parents 08459e8 + cb9c401 commit 0ad6000
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Date: 2024-05-08

### Fixed
* Jetscape: Fix for Jetscape charged particle filtering
* QCumulantFlow and LeeYangZeroFlow: Fix bug in the calculation of the differential flow

[Link to diff from previous version](https://github.com/smash-transport/sparkx/compare/v1.2.0...v1.2.1)

Expand Down
5 changes: 3 additions & 2 deletions src/sparkx/flow/LeeYangZeroFlow.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,9 @@ def differential_flow(self,particle_data,bins,flow_as_function_of, poi_pdg=None)
val = particle.momentum_rapidity_Y()
elif flow_as_function_of == "pseudorapidity":
val = particle.pseudorapidity()
if val >= bins[bin] and val < bins[bin+1] and particle.pdg in poi_pdg:
particles_event.append(particle)
if val >= bins[bin] and val < bins[bin+1]:
if poi_pdg == None or particle.pdg in poi_pdg:
particles_event.append(particle)
if len(particles_event) > 0:
events_bin.extend([particles_event])
particle_data_bin.extend([events_bin])
Expand Down
2 changes: 1 addition & 1 deletion src/sparkx/flow/QCumulantFlow.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ def differential_flow(self, particle_data, bins, flow_as_function_of, poi_pdg=No
val = particle.pseudorapidity()
if val >= bins[bin] and val < bins[bin+1]:
particles_event.append(particle.phi()+self.rand_reaction_planes_[event])
if particle.pdg in poi_pdg:
if poi_pdg == None or particle.pdg in poi_pdg:
particles_event_poi.append(particle.phi()+self.rand_reaction_planes_[event])
events_bin.extend([particles_event])
events_bin_poi.extend([particles_event_poi])
Expand Down

0 comments on commit 0ad6000

Please sign in to comment.