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

feat: Add support for POWHEG weights #220

Merged
merged 17 commits into from
Jan 25, 2024
Merged

Conversation

APN-Pucky
Copy link
Member

@APN-Pucky APN-Pucky commented Dec 14, 2023

powheg uses plain text weights in lhe, like:

<event>
      7  10001  1.11453E+07  2.42132E+00 -1.00000E+00  3.21830E-01
      -2    -1     0     0     0   502  0.000000000E+00  0.000000000E+00  1.596673772E-01  1.596673772E-01  0.000000000E+00  0.00000E+00  9.000E+00
      21    -1     0     0   502   501  0.000000000E+00  0.000000000E+00 -1.979087573E+01  1.979087573E+01  0.000000000E+00  0.00000E+00  9.000E+00
      23     2     1     2     0     0 -2.715131942E-01 -6.004246500E-01 -3.272239123E+00  3.504354871E+00  1.067110589E+00  0.00000E+00  9.000E+00
      11     1     3     3     0     0 -9.921110112E-02  2.574546034E-01 -3.072708859E-01  4.129665530E-01  5.110000000E-04  0.00000E+00  9.000E+00
     -11     1     3     3     0     0 -1.723020930E-01 -8.578792534E-01 -2.964968237E+00  3.091388318E+00  5.110000000E-04  0.00000E+00  9.000E+00
      -2     1     1     2     0   511 -3.204270527E-01  4.049849988E-01 -1.767181124E+00  1.841090837E+00  0.000000000E+00  0.00000E+00  9.000E+00
      21     1     1     2   511   501  5.919402469E-01  1.954396512E-01 -1.459178811E+01  1.460509740E+01  1.685873940E-07  0.00000E+00  9.000E+00
#rwgt            2         101   3933017.7360749426                3         267           0
<weights>
0.11148E+08
0.11098E+08
0.10961E+08
0.13534E+08
0.87849E+07
0.91411E+07
0.13910E+08
0.11218E+08
0.11076E+08
0.10925E+08
0.10971E+08
0.10997E+08
0.11103E+08
0.10964E+08
0.10974E+08
0.11205E+08
0.11144E+08
0.11317E+08
0.11325E+08
0.11321E+08
0.11305E+08
0.11320E+08
0.11363E+08
0.11194E+08
0.11332E+08
0.11284E+08
0.11069E+08
0.11289E+08
0.11223E+08
0.11280E+08
0.11332E+08
0.11131E+08
0.11219E+08
0.11152E+08
0.11150E+08
0.11264E+08
0.11044E+08
0.10938E+08
0.11302E+08
0.11118E+08
0.11175E+08
0.11155E+08
0.11140E+08
0.11353E+08
0.10951E+08
</weights>
</event>

pwgevents-0001.lhe.zip

* Add support for reading POWHEG weights.
* Add tests for POWHEG.
   - Update scikit-hep-testdata test dependency to include
     version with POWHEG file.

@APN-Pucky APN-Pucky changed the title Add POWHEG weights feat: Add support for POWHEG weights Dec 14, 2023
@APN-Pucky APN-Pucky marked this pull request as draft December 14, 2023 14:11
Copy link

codecov bot commented Dec 14, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (c5503c2) 88.18% compared to head (c25df6e) 91.48%.

Files Patch % Lines
src/pylhe/__init__.py 93.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #220      +/-   ##
==========================================
+ Coverage   88.18%   91.48%   +3.30%     
==========================================
  Files           2        2              
  Lines         220      235      +15     
  Branches       48       54       +6     
==========================================
+ Hits          194      215      +21     
+ Misses         23       16       -7     
- Partials        3        4       +1     
Flag Coverage Δ
unittests-3.10 91.06% <93.33%> (+3.33%) ⬆️
unittests-3.8 91.06% <93.33%> (+3.33%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@APN-Pucky APN-Pucky marked this pull request as ready for review December 14, 2023 14:24
@eduardo-rodrigues
Copy link
Member

Hello @APN-Pucky, Thank you for this addition 👍. I think it would be very important to add your test file to scikit-hep-testdata and have it used in the test suite here, to enhance what is covered. Can you kindly take care of that?

Agree and any comments, @matthewfeickert?

@APN-Pucky
Copy link
Member Author

So just PR a simple LHE file to https://github.com/scikit-hep/scikit-hep-testdata and wait for a release then included that here?

@eduardo-rodrigues
Copy link
Member

Precisely :)

I will not be much available until Wednesday but you can ping Jim or Matthew for example. Advance thanks.

src/pylhe/__init__.py Outdated Show resolved Hide resolved
@eduardo-rodrigues
Copy link
Member

FYI I've now made a release with your files - https://github.com/scikit-hep/scikit-hep-testdata/releases/tag/v0.4.36. I hope it will show up in PyPI soon.

I'm not sure if @matthewfeickert is still around for a review. I will not be working much more until the new year :-).

Enjoy the Christmas break and "talk to you" in 2024!

@APN-Pucky
Copy link
Member Author

APN-Pucky commented Dec 22, 2023

Thank you for the effort of getting this through in this year. It is by no means in a hurry, so lets wait for next year.

Merry Christmas and happy new year to everyone reading this.

@APN-Pucky
Copy link
Member Author

Thanks for adding me to the particle contributors. What's the status of this MR?

@eduardo-rodrigues
Copy link
Member

Hi. Seems @matthewfeickert and/or @lukasheinrich as experts have been overlooking this. Let's see now with a reping ...

As for your question above, it sounds good to me.

Is there anything else you intend to change in this PR or else it is totally ready from your side?

@APN-Pucky
Copy link
Member Author

Is there anything else you intend to change in this PR or else it is totally ready from your side?

This PR is done from my side since I already changed the access to the weighs to be by the id name.

Copy link
Member

@eduardo-rodrigues eduardo-rodrigues 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 for the nice additions. I'm approving and will be merging tomorrow unless we hear from @matthewfeickert on other feedback.

Copy link
Member

@matthewfeickert matthewfeickert left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @APN-Pucky! This is great, and we should cut a new relase after this. I just have a few questions and requested changes, but this is looking good overall!

setup.py Show resolved Hide resolved
src/pylhe/__init__.py Outdated Show resolved Hide resolved
src/pylhe/__init__.py Outdated Show resolved Hide resolved
Copy link
Member

@matthewfeickert matthewfeickert left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you @APN-Pucky!

@matthewfeickert matthewfeickert merged commit 83a1f51 into scikit-hep:main Jan 25, 2024
13 checks passed
@matthewfeickert
Copy link
Member

@all-contributors please add @APN-Pucky for code.

Copy link
Contributor

@matthewfeickert

I've put up a pull request to add @APN-Pucky! 🎉

@matthewfeickert
Copy link
Member

@APN-Pucky Release v0.8.0 is now out on PyPI with this contribution in it. Thanks!

This was referenced Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants