Skip to content

Rationalise final jets#198

Merged
graeme-a-stewart merged 9 commits intoJuliaHEP:mainfrom
graeme-a-stewart:rationalise-final-jets
Aug 27, 2025
Merged

Rationalise final jets#198
graeme-a-stewart merged 9 commits intoJuliaHEP:mainfrom
graeme-a-stewart:rationalise-final-jets

Conversation

@graeme-a-stewart
Copy link
Member

@graeme-a-stewart graeme-a-stewart commented Aug 4, 2025

The default return values from exclusive and inclusive jet selectors were wrong, as the LorentzVectorCyl was created mistakenly with rapidity(jet) instead of eta(jet). This went unnoticed as the FinalJets reversed the mistake, treating eta() as if it was rapidity() (see #197).

In testing, there is quite a precision loss involved in conversion to a LorentzVectorCyl as this involves converting from (px,py,py,E) to (pT,eta,phi,m), then re-extracting (rapidity,phi,pT). It is the rapidity<->phi which is problematic. So, the default return type has been changed to be a LorentzVector as this matches better the internal representation of PseudoJet and EEJet as a (p,E) vector.

Also now import eta() and pt() methods for LorentzVectorCyl and LorentzVector.

Decrease the tolerance on the pT test from 1e-6 to 1e-7 (for Float64).

Fixes #170 #197

@graeme-a-stewart graeme-a-stewart added this to the 1.0.0 Release milestone Aug 4, 2025
@graeme-a-stewart graeme-a-stewart requested a review from m-fila August 4, 2025 15:11
@graeme-a-stewart graeme-a-stewart added bug Something isn't working interface change Breaking changes to any public interfaces cherry pick to main Patch fixes that should be also applied to the main branch labels Aug 4, 2025
@codecov
Copy link

codecov bot commented Aug 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.00%. Comparing base (58aac77) to head (50a40ec).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #198      +/-   ##
==========================================
+ Coverage   77.25%   80.00%   +2.74%     
==========================================
  Files          21       21              
  Lines        1319     1315       -4     
==========================================
+ Hits         1019     1052      +33     
+ Misses        300      263      -37     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This was referenced Aug 11, 2025
@graeme-a-stewart
Copy link
Member Author

I had a look at the nightly build failures and it looks like it's a bad build - I can hardly run anything on my laptop against the current nightly.

I checked 1.12 and it's fine with this PR.

@m-fila
Copy link
Member

m-fila commented Aug 27, 2025

Yes, at least LoopVectorization fails to build in with the nightlies

The default return values from exclusive and inclusive jet selectors
were wrong, as the LorentzVectorCyl was created mistakenly with
rapidity(jet) instead of eta(jet). This went unnoticed as the FinalJets
reversed the mistake, treating eta() as if it was rapidity().

In testing, there is quite a precision loss involved in conversion to a
LorentzVectorCyl as this involves converting from (px,py,py,E) to
(pT,eta,phi,m), then re-extracting (rapidity,phi,pT). It is the
rapidity<->phi which is problematic. So, the default return type has
been changed to be a LorentzVector as this matches better the internal
representation of PseudoJet and EEJet.

Also now import eta() and pt() methods for LorentzVectorCyl and
LorentzVector.

Decrease the tolerance on the pT test from 1e-6 to 1e-7 (for Float64).
Test if different struct selectors work for selected jets, both
inclusive and exclusive.

Add mass and mass2 "imports" for LorentzVector and LorentzVectorHEP.
Pass kwargs properly and don't rely on the ≈ alias.

Use the default equality implementation.
@graeme-a-stewart graeme-a-stewart merged commit d3c97f3 into JuliaHEP:main Aug 27, 2025
10 of 12 checks passed
@graeme-a-stewart graeme-a-stewart deleted the rationalise-final-jets branch August 27, 2025 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cherry pick to main Patch fixes that should be also applied to the main branch interface change Breaking changes to any public interfaces

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rationalise final_jets() implementation

2 participants