Skip to content

fix(event-display): place edm4hep track states at their impact parameters - #1078

Merged
EdwardMoyse merged 1 commit into
HSF:mainfrom
SajalDevX:fix/edm4hep-track-state-impact-parameters
Dec 1, 2026
Merged

EdwardMoyse merged 1 commit into
HSF:mainfrom
SajalDevX:fix/edm4hep-track-state-impact-parameters

Conversation

@SajalDevX

Copy link
Copy Markdown
Contributor

When an EDM4hep track has no usable tracker hits, Edm4hepJsonLoader builds its points from the track states, but it only used each state's referencePoint. For the AtIP state the reference point is normally the origin and the real position of the track is given by D0 and Z0 relative to it, so every such track was drawn starting at (0, 0, 0). That also made calculateTrackParams give d0 = 0 and z0 = 0 for all of them, so the d0/z0 cuts and the track info did nothing for these collections.

You can see it with the CLD ttbar sample from the FCC tutorials (tops_cld.edm4hep.json, made with edm4hep2json). Its SiTracks reference hit collections that are not in the file, so all tracks go through the track state fallback. In event 0, loaded through buildEventData:

track D0, Z0 (mm) first point before first point after
0 0.87, -27.08 (0, 0, 0) (0.01, -0.09, -2.71)
26 -0.10, 58.22 (0, 0, 0) (0.00, 0.01, 5.82)
34 13.80, -11.26 (0, 0, 0) (-0.37, -1.33, -1.13)
44 -4.87, -71.72 (0, 0, 0) (-0.07, 0.48, -7.17)

The fix uses the point of closest approach, referencePoint + (-D0 sin(phi), D0 cos(phi), Z0), as the position of a track state. I checked the convention on the same file: starting the helix from that point lands on the AtFirstHit reference point to within a few microns. The other states (first hit, last hit, calorimeter) have D0 and Z0 of about zero, so they don't move, and states without these fields behave as before.

Testing

  • Added a test in edm4hep-json-loader.test.ts with an AtIP state that has a non zero D0 and Z0. It fails on main (first point [0, 0, 0] instead of [0, 1, -5]) and passes with the fix.
  • jest src/tests/loaders: 11 suites, 97 tests pass.
  • eslint and prettier are clean on the changed files.

This only touches how the points are built; it doesn't overlap with #1075, which fills in the track metadata from the AtIP state.

@github-actions

Copy link
Copy Markdown

@EdwardMoyse

Copy link
Copy Markdown
Member

Looks good - thanks!

@EdwardMoyse
EdwardMoyse merged commit 8026f6e into HSF:main Dec 1, 2026
4 checks passed
Shivansh1205 added a commit to Shivansh1205/phoenix that referenced this pull request Dec 1, 2026
HSF#1075 copied D0 and Z0 from the AtIP track state as they are, in mm,
while every other EDM4hep length in the loader, including the track
positions, is scaled by 0.1. When a track has no IP state, Phoenix
derives d0 and z0 from those scaled positions, so one collection could
mix both units under the same cut. HSF#1078 tests z0 in the scaled units,
which made main fail once both were merged.

Scale D0 and Z0 by 0.1 as well.

This branch was successfully deployed

1 active deployment
pull-request — 1a82ad35 Deployed Nov 22, 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