fix(loaders): handle missing tracker hits and fallback to track state - #1029
Open
lavjeetrai wants to merge 1 commit into
Open
lavjeetrai wants to merge 1 commit into
lavjeetrai wants to merge 1 commit into
Conversation
lavjeetrai
force-pushed
the
fix/edm4hep-track-fallback
branch
from
September 13, 2026 18:38
2095a21 to
9c6fa06
Compare
|
🚀 Preview deployed: http://phoenix-pr-1029.surge.sh Built from a4a1c4f. |
Contributor
Author
|
@EdwardMoyse could u take a look to this. |
EdwardMoyse
reviewed
Sep 16, 2026
| @@ -210,27 +210,33 @@ export class Edm4hepJsonLoader extends PhoenixLoader { | |||
| trackCollection.forEach((rawTrack: edm4hep.Track) => { | |||
| const pos: number[][] = []; // An array of positions is needed to render the tracks as bars | |||
|
|
|||
| // @todo trackerhits might always exist | |||
| if ('trackerHits' in rawTrack && rawTrack.trackerHits.length > 0) { | |||
| if (rawTrack.trackerHits?.length > 0) { | |||
Member
There was a problem hiding this comment.
Isn't this less protection than before? Do we know that trackerHits are guaranteed to exist in rawTrack? What is the harm in checking?
…s in edm4hep loader
lavjeetrai
force-pushed
the
fix/edm4hep-track-fallback
branch
from
September 16, 2026 18:55
9c6fa06 to
a4a1c4f
Compare
Contributor
Author
|
@EdwardMoyse please take a look again |
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.
Description
Fixes an issue where missing
trackerHitscollections or out-of-bound hit indices cause unhandledTypeErrorexceptions during EDM4hep JSON event loading. Additionally, enables graceful fallback totrackStateswhen tracker hit coordinates cannot be resolved.Changes Made
trackerHitsandtrackStatesarray access and sub-properties (hit?.position,trackState?.referencePoint).trackerHitsandtrackStatesbranches so tracks with unresolvable hit references fall back totrackStates(if (pos.length === 0 && ...)).packages/phoenix-event-display/src/tests/loaders/edm4hep-json-loader.test.ts.Test Plan
trackerHitsreferences.collectionIDis missing fromrawEvent.trackStates.