-
Notifications
You must be signed in to change notification settings - Fork 10
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
Correct phi0 due to expected output range from HTF #854
Conversation
Fixes the phi0 bug reported on recon-tracking slack channel. |
FYI, this PR will need the reference plots for 2015 and 2016 integration tests changed when it is merged. I already prepared them and placed them in the appropriate directories at JLab with the label 20210428. |
I'm confused as to why any of the reference plots have to be changed. I thought it was claimed that the integration tests did not catch this bug. If that's true, then the plots didn't change when the bug was introduced, so why are they changing when the bug is fixed? If the bug did change the plots (as it seems now they did), then it appears due diligence was not paid when the tests failed last time around and the reference plots were simply updated. |
Hi, Maybe we should check these plots before updating the reference. And to help clarify the claim "the tests didn't catch this", maybe would be more fair to say that I, personally, didn't catch this issue when running tests. When we merged the tracking PR some of the integration tests plots were checked in detail, but probably i didn't check the phi0 distribution (so another error from my side). So we checked that some of the FEE / V0 distributions were close enough (within stats errors/ and we proceeded to update them. Again, would make sense to recheck these plots (a plotting validation should become good practice when integration tests fail from now on, i think) by plotting before/after this change. |
@pbutti I concur. We should check the before/after plots using your tool and use that to document any changes to the reference plots. |
The phi0 distributions are not one of the variables included in the integration test plots. |
I can clarify a bit what happened. We did expect the reference plots to change with the changes to the math libraries as you expect small (negligible) differences using a new method of calculating trig, etc. functions. It is simply untrue that the reference plots were not carefully checked when they failed before this code was merged: https://indico.slac.stanford.edu/event/6753/contributions/1685/attachments/763/2107/validation_latex.pdf @normangraf was also in attendance during this meeting where we discussed at length the change to the reference plots and everyone agreed then that we should move forward with updating them during that meeting. Due to the nature of this bug, it really only essentially numerically puts phi0 in a different range than expected (that which is used by the karimaki fit is not the same that we end up plotting). The change in the plots the first time around was NOT only due to this bug, as @normangraf appears to be assuming. The plots are still not back to the same as they were before merging the code, as is expected. The integration test plots do not include a track phi0 plot, this is why this bug slipped through. I am pretty happy we managed to catch (and fix) it before doing any serious production. |
IMO, going through the whole exercise of carefully checking them again is more work than it is worth, since we only reverted code to what it was before merging any of this code, and I am already doing a more fully encompassing check by running on the sample partitions (how we noticed the bug in the first place). |
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.
Does this really need to be changed? If so, you should get rid of the comment, but the comment is there because I wasn't sure. If this method isn't used, probably just get rid of it.
return FastMath.atan2(y, x);// mg 9/20/17...I think this is the wrong order...should be atan2(y,x)
@bloodyyugo I checked this by adding a print statement and running a few steering files to see if I see the warning print. I do think there are likely a bunch of unused methods sprinkled throughout the project, but the best way to check if this one in particular is really unused is to just completely remove it and try to compile. I will look into this. |
As a reference, here is the set of plots checked for PhysRun2016MollerReconTest (note the absence of track phi0)
|
It does really need to change: https://commons.apache.org/proper/commons-math/javadocs/api-3.3/org/apache/commons/math3/util/FastMath.html#atan2(double,%20double)
|
Hi! What's the plan with this PR? |
@pbutti I've been too busy with other tracking issues to look into this. I was expecting @bloodyyugo or @omar-moreno to approve this once they are convinced. |
Fix bug that slipped through our checks.