Skip to content

fix(event-display): convert jivexml vertex positions from cm to mm - #1067

Merged
EdwardMoyse merged 1 commit into
HSF:mainfrom
SajalDevX:fix/jivexml-vertex-units
Nov 10, 2026
Merged

EdwardMoyse merged 1 commit into
HSF:mainfrom
SajalDevX:fix/jivexml-vertex-units

Conversation

@SajalDevX

Copy link
Copy Markdown
Contributor

JiveXML writes lengths in cm. JiveXMLLoader already multiplies hit positions and track polylines by 10 to get mm, but getVertices passed the RVx x, y and z through unchanged, so every vertex was drawn at a tenth of its real distance from the origin.

You can see it with the bundled JiveXML_336567_2327102923.xml:

before after
beam spot vertex (x, y) (-0.049, -0.091) mm (-0.494, -0.908) mm
pile-up vertex z -4.77 mm -47.73 mm
secondary vertex (x, y, z) (-3.5, 29.5, -61.0) mm (-35.4, 295.2, -610.1) mm

The last one is a secondary vertex at r = 297 mm that was being drawn inside the pixel detector at r = 30 mm, away from its tracks. As a cross check, in the same file the z at the beam line taken from the Tracks polylines (mm) is 10.0 times the raw z0 value (median over 158 tracks), so the raw JiveXML lengths really are cm.

The fix multiplies x, y and z by 10, the same way the hits and polylines are converted.

Testing

Added two tests to jivexml-loader.test.ts: one checks the cm to mm conversion, the other loads a track with a polyline plus a vertex linked to it and checks the vertex sits at the first polyline point.

  • Before the fix: yarn test src/tests/loaders/jivexml-loader gives 2 failed, 3 passed (vertex x is 0.1 instead of 1).
  • After the fix: 5 passed.
  • Full event-display suite (jest --maxWorkers=2): 48 suites, 442 tests passed.
  • ESLint and Prettier are clean on the two changed files.

I didn't run the phoenix-ng tests or check it in the app UI.

JiveXML writes lengths in cm, and the loader already multiplies hit
positions and track polylines by 10 to get Phoenix's mm. The RVx x, y
and z were passed through as they are, so every vertex was drawn at a
tenth of its real distance from the origin.

With the bundled JiveXML_336567_2327102923.xml the beam spot vertices
end up around (-0.05, -0.09) mm instead of (-0.5, -0.9) mm, pile-up
vertices are squeezed into a tenth of the luminous region, and a
secondary vertex at r = 297 mm is drawn inside the pixel detector at
r = 30 mm, away from the tracks that come out of it.

Multiply x, y and z by 10 like the other positions, and add tests that
check the conversion and that a vertex sits at the start of its linked
track's polyline.
@github-actions

Copy link
Copy Markdown

🚀 Preview deployed: http://phoenix-pr-1067.surge.sh

Built from 18ad7a1.

@EdwardMoyse
EdwardMoyse merged commit cfff19d into HSF:main Nov 10, 2026
4 checks passed
@EdwardMoyse

Copy link
Copy Markdown
Member

Ouch. Nice catch - thanks!

This branch was successfully deployed

1 active deployment
pull-request — 18ad7a15 Deployed Nov 10, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants