-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix numeric issues in PFCand scaling, add some debug output #41550
Conversation
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-41550/35424
|
A new Pull Request was created by @kdlong (Kenneth Long) for master. It involves the following packages:
@cmsbuild, @mandrenguyen, @clacaputo can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
type pf |
type bug-fix |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-41550/35425
|
Pull request #41550 was updated. @cmsbuild, @mandrenguyen, @clacaputo can you please check and sign again. |
|
||
float e = std::sqrt(p() * p() * rescaleFactor * rescaleFactor + mass() * mass()); | ||
|
||
// Protect against invalid values (shouldn't happen, but could) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder whether with the new formulation above (no more differences that could lead to numerical instabilities) this check is still needed. Did you try in your test if e
can get some invalid value now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I didn't see invalid values after this fix. I think what happened is that the scaling was applied multiple times, the first time being screwed up by the precision, and the second time giving a negative value for e^2 due to a effectively having a negative mass from the inconsistent E value. Probably this check isn't needed, or it could raise and exception instead of silently correcting the value. I'm open to suggestions.
I suggest we roll back my hotfix (##41473) in this PR, as this solution should address the problem at the source. Please also prepare a 13_1_X backport for consistency |
Thanks @mandrenguyen, I'll do this ASAP. Should I leave in the nan check in the rescaling function or drop it there as well? |
I guess we should avoid checks that might end up obscuring problems. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-41550/35500
|
Pull request #41550 was updated. @cmsbuild, @mandrenguyen, @clacaputo can you please check and sign again. |
please test |
-1 Failed Tests: RelVals-INPUT RelVals-INPUT
Expand to see more relval errors ...
Comparison SummarySummary:
|
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-2822e8/32626/summary.html Comparison SummarySummary:
|
+1 |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @rappoccio (and backports should be raised in the release meeting by the corresponding L2) |
+1
|
PR description:
Fix candidate scaling in cases where momentum is a huge number, where the mass-aware scaling hits numeric issues. The fix is simple, just calculate E in a way without ratios involved. This should be a fix for #41397
PR validation:
Checked that the crash and nan candidate are fixed and the mass scaling works properly on the failing even from #41397