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

Add JS partons #181

Merged
merged 11 commits into from
Jul 1, 2024
Merged

Add JS partons #181

merged 11 commits into from
Jul 1, 2024

Conversation

Hendrik1704
Copy link
Collaborator

This implements the possibility to read in JETSCAPE parton output files with the Jetscape class in SPARKX. To switch to the parton mode there is a keyword argument called particletype in the constructor, which can be set to parton.
By default, it is set to hadron, such that the current behavior in any script used so far does not change.
This closes #180.
The corresponding documentation is added and the CHANGELOG is updated.

I tested this with one of my current parton output files. However, I will add some more rigorous testing methods for the Jetscape class in the tests for SPARKX. This is part of #147.

@Hendrik1704 Hendrik1704 added the enhancement New feature or request label Jan 22, 2024
@Hendrik1704 Hendrik1704 added this to the SPARKX 1.2 milestone Jan 22, 2024
@Hendrik1704 Hendrik1704 self-assigned this Jan 22, 2024
@Hendrik1704 Hendrik1704 linked an issue Jan 22, 2024 that may be closed by this pull request
Copy link
Member

@NGoetz NGoetz left a comment

Choose a reason for hiding this comment

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

It looks good, I just wonder - does anything about particle class need to be changed for this? Like with respect to fractional charges etc. . Is the data represented correctly?

@Hendrik1704
Copy link
Collaborator Author

That is a good question, I have to check this. I just tested the reading of the input file. I guess I can just test the write to file function for some of the quantities. The other ones have to be tested by hand.
I think the PDGID package knows about quarks and their quantities. Maybe it is a problem that the charge is not int.

@Hendrik1704
Copy link
Collaborator Author

I did some further tests with the particle quantities:

print(had_epem_decays[0][0].ID) -> correct
print(had_epem_decays[0][0].pdg) -> correct
print(had_epem_decays[0][0].status) -> correct
print(had_epem_decays[0][0].E) -> correct
print(had_epem_decays[0][0].px) -> correct
print(had_epem_decays[0][0].py) -> correct
print(had_epem_decays[0][0].pz) -> correct
print(had_epem_decays[0][0].mass) -> correct
print(had_epem_decays[0][0].charge) -> wrong, always 0 (cast to int)
print(had_epem_decays[0][0].is_strange()) -> wrong, always gives False
print(had_epem_decays[0][0].is_heavy_flavor()) -> wrong, always gives False
print(had_epem_decays[0][0].spin()) -> correct
print(had_epem_decays[0][0].spin_degeneracy()) -> correct
print(had_epem_decays[0][0].is_hadron()) -> correct, always False
print(had_epem_decays[0][0].is_meson()) -> correct, always False
print(had_epem_decays[0][0].is_baryon()) -> correct, always False
print(had_epem_decays[0][0].compute_charge_from_pdg()) -> correct

I guess the charge function can be easily fixed. For the other functions it's probably more complicated. There we use the PDGID package.

@Hendrik1704 Hendrik1704 modified the milestones: SPARKX 1.2, SPARKX 1.3 Apr 18, 2024
@Hendrik1704
Copy link
Collaborator Author

This adds now a multiplication of parton charges by a factor 3 to make them integers. This is also reflected in the documentation. There are also tests for the Particle class added for this case and I test with Jetscape to read a parton file and filter for charged partons.

Copy link
Member

@NGoetz NGoetz left a comment

Choose a reason for hiding this comment

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

Thank you, this looks good!

@Hendrik1704 Hendrik1704 merged commit 2e946e7 into sparkx_devel Jul 1, 2024
1 check passed
@Hendrik1704 Hendrik1704 deleted the roch/add_JS_partons branch July 1, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow for JETSCAPE parton files in read in function
2 participants