Repository navigation
Conversation
JiveXML gives a track's polar angle as cotTheta, and the loader turns it into theta with atan(1 / cotTheta). For a backward track (cotTheta < 0, eta < 0) that is negative, and the shift into (0, PI) only happened after dparams had already been built from it. So backward tracks were stored with a negative theta in dparams[3] and, since |p| = pT / sin(theta) came out negative, with the sign of q/p in dparams[4] flipped. That gave every backward track the wrong charge wherever it is read from dparams (the q shown for a track, "Color by Charge", the kinematics panel), a wrong theta/angle, and made the Runge-Kutta extrapolation of tracks without polylines bend the wrong way. Shift theta into (0, PI) before dparams is built, and add tests for forward and backward tracks.
|
🚀 Preview deployed: http://phoenix-pr-1041.surge.sh Built from 90e6269. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JiveXML gives a track's polar angle as
cotTheta, andJiveXMLLoader.getTracksturns it into theta withMath.atan(1 / cotTheta). For backward tracks (cotTheta < 0, eta < 0) that is negative, and the shift into (0, PI) only ran aftertrack.dparamshad been built. So every backward track was stored with:dparams[3](e.g. -PI/4 instead of 3PI/4 forcotTheta = -1)dparams[4]flipped, because|p| = pT / sin(theta)came out negativetrack.etawas already right since it's computed after the shift.JiveXML tracks don't carry a
charge, so the q shown for a track, "Color by Charge" and the kinematics panel all read it fromdparams[4]and showed the wrong charge for every backward track. The RK extrapolation for collections without polylines also takes its charge fromdparams[4], so those tracks curved the wrong way.This moves the
theta < 0shift to right after theta is computed, beforemomentumanddparamsuse it. I dropped the old "check if we need to flip phi" TODO with it:atan(1 / cotTheta) + PIis just the actual polar angle in (0, PI), so phi doesn't need to change.Testing
Added
src/tests/loaders/jivexml-loader.test.tswith one forward (cotTheta = 1) and one backward (cotTheta = -1) track, both with positivept. It checks theta is PI/4 and 3PI/4, q/p is positive for both, and eta is +/-0.8814.-0.785vs2.356, and-7.07e-5vs+7.07e-5). The eta test passes.src/tests/loadersandsrc/tests/helpersstill pass, includingjivexml-menu-integration,rk-helperandphoenix-objects.yarn test:ci, andatlasesd-loader/jsroot-event-loaderdid not run locally because I did not havejsrootinstalled. Neither of those touches this code.