Repository navigation
fix(event-display): give single edm4hep calo hits a finite cell size - #1070
Merged
EdwardMoyse merged 1 commit intoNov 16, 2026
Merged
Conversation
The EDM4hep loader sizes calorimeter cells from the smallest distance between two cells of the collection. A collection with only one hit has no pair to measure, so the 1e9 start value was used and the cell was drawn as a 1e8 sized box covering the whole scene. Fall back to the existing minimum size of 1 when no distance could be measured.
Member
|
Thanks! |
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.
Title: fix(event-display): give single edm4hep calo hits a finite cell size
The EDM4hep JSON loader picks the calorimeter cell size from the smallest distance it finds between two cells of the same collection. When a collection has only one hit (for example a yoke or LumiCal collection with a single hit in the event), there is no pair to measure, so
drminkeeps its1e9start value and the cell getsside = length = 1e8. That one cell is then drawn as a giant box that covers the whole scene.To reproduce, load an event with one
edm4hep::SimCalorimeterHitCollection(orCalorimeterHitCollection) holding a single hit throughEdm4hepJsonLoaderand build it withPhoenixObjects.getCaloCellsInstanced: the cell hasside100000000 and the mesh bounding sphere radius is about 8.7e7. With two hits in the same collection the size is normal.The fix starts
drminatInfinityand falls back to the existing minimum size of 1 when no distance could be measured. Collections with two or more hits are unchanged.Testing
edm4hep-json-loader.test.tsthat loads a one-hit calorimeter collection and checks the cell size and the drawn mesh. It fails on main (Expected: 1, Received: 100000000) and passes with the fix.jest src/tests/loaders: 11 suites, 96 tests pass.