fix(event-display,app): make "Color Options → Color by" work for tracks and document the full event data format - #968
Merged
Merged
Conversation
…formation is supported
The "Color by" options had no visible effect (#948): - Default charge and momentum colors were all red, identical to the default track color. Charge now defaults to blue/grey/red and momentum to a blue-to-red gradient interpolated over the min/max range, replacing the previous midpoint bucketing which left tracks at or outside the range uncolored. - Color by vertex silently did nothing unless vertices linked to the collection. The option is now only offered for collections that vertices actually link to, each vertex and its linked tracks get a distinct deterministic color, tracks are matched by their original index when bad tracks were dropped on load, and a warning is logged if nothing could be colored. - Grouped "color by" swatches were applied when the menu was built, overriding collection colors on startup. They are now only applied when restoring a saved state. - The "Color by" selection is now stored in the select config so it survives saving/loading the menu state, and a saved state can no longer overwrite the structural options list of a select. Fixes #948 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Bind the select element to the config value so a "Color by" choice restored from a saved state is shown in the dropdown. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The saved menu state shipped with the ATLAS demo contained the old "Color by" select options and all-red charge/momentum colors, which overrode the defaults and the per-collection options when the config was loaded. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Fixes #948
Problem
As reported in #948, the "Color Options → Color by" feature for track collections
appeared in the UI but had no visible effect, and "Color by Vertex" in particular
seemed inactive. This turned out to be several compounding issues:
#ff0000—identical to the default track color — so applying them repainted red-on-red.
min/max range, with strict bounds that left tracks at or outside the range
uncolored entirely.
linkedTracks/linkedTrackCollectiondata (only produced by the JiveXML loader), but the option was offered for
every Tracks collection and silently did nothing otherwise. Even when links
existed, it could not match a collection named
Tracks(renamed toTracks_on load while the vertex links kept the raw name), track indices were
misaligned when bad tracks were dropped, and all vertices shared a single
color so "coloring by vertex" produced one uniform color.
stomping collection colors at startup.
atlas-config.json)overwrote the select's structural
optionslist and the color defaults withstale saved values, resurrecting the "Vertex" option for every collection.
Changes
phoenix-event-display
is a blue→red gradient interpolated over the min/max slider range
(replacing the midpoint bucketing), via a new
ColorManager.colorObjectsByComputedColor.colorTracksByVertexrewritten: each vertex and its linked tracks get adistinct deterministic color (golden-ratio hue steps, honoring an explicit
vertex
color), tracks are matched by their original index when available,and the number of colored tracks is returned so a warning can be logged when
nothing matched.
Tracks→Tracks_rename consistently tovertex
linkedTrackCollectionand records each track's original index.link to:
PhoenixLoaderinspects the event data and passes the applicableColorByOptionKeysthroughUIManager.addCollection(new optional trailingparameter, fully backward compatible).
applyConfigStateno longer fires grouped color configs when configs areadded (only when restoring a saved state), so collection colors are no longer
overridden at startup.
ConfigSelect.value)and re-applied on state load; a saved state can no longer overwrite a select's
structural
optionslist.phoenix-ng
"Color by" choice is reflected in the UI.
atlas-config.jsonhad its 64 stale color-by configsremoved (old 3-entry option lists and all-red swatches for 8 collections).
Documentation
guides/developers/event_data_format.mdnow documents every attribute theloaders actually read, verified against the loader code: previously missing
Track attributes (with a note on which are auto-derived), Jets origins, the
CircularPointhit type, CaloCluster/CaloCell placement and sizingattributes, an
IrregularCaloCellssection, Vertexsize/vertexType/vertex–track links, Muons/Electrons/Photons compound-object linking, the
per-type cut sliders, and the "Color by" attributes. It also fixes documented
keys that the code never read (
qOverP,lumiblockvslumiBlock).guides/users.mdis replacedwith a link to the format guide.
Tests
New jest suites (were previously none for this area):
ColorOptions(optionwiring, charge predicate, momentum gradient, vertex warning, select state),
ColorManager(computed coloring, per-vertex track coloring, index matching,graceful no-ops),
JiveXMLLoader(rename, original indices, vertex links),PhoenixMenuNode(state-load semantics), plus a full-chain integration test(JiveXML →
buildEventData→ realUIManager/PhoenixMenuUI→ menu tree).Manually verified on the ATLAS demo: charge/momentum/vertex coloring all have
visible effects on
InDetTrackParticles_xAOD; the Vertex option is absent forcollections without vertex links (e.g.
Tracks_), both with and without thedemo config being loaded.
🤖 Generated with Claude Code