Skip to content

feat: add configurable masterclass panel with event bus for external integration#835

Open
rx18-eng wants to merge 1 commit intoHSF:mainfrom
rx18-eng:feat/masterclass-tagging-824
Open

feat: add configurable masterclass panel with event bus for external integration#835
rx18-eng wants to merge 1 commit intoHSF:mainfrom
rx18-eng:feat/masterclass-tagging-824

Conversation

@rx18-eng
Copy link

Closes #824 #826

Adds a configurable masterclass panel for tagging particles and computing
invariant masses, designed to be reusable across experiments.

What it does

Students can select tracks from any collection, tag them as particle types,
see kinematic values in a table, and compute invariant masses. Results can be
recorded across events and exported as a text file.

Architecture

The panel is experiment-agnostic. All experiment-specific details
(particle types, masses, hints, event classification) are defined in a
MasterclassConfig interface and passed as an input — not hardcoded.

  • MasterclassConfig — defines particle tags (id, symbol, color, mass),
    educational hints, and a classification callback
  • ATLAS_MASTERCLASS_CONFIG — default config for ATLAS Z-path exercises
    (e±/μ±/γ, Z/Higgs/J/ψ hints)
  • Adding a new experiment's masterclass (e.g. LHCb D0 → Kπ) requires only a
    config object — no component changes

Integration API

A lightweight event bus (on/emit) is added to EventDisplay, enabling
external frameworks to subscribe to live data:

typescript
eventDisplay.on('particle-tagged', (data) => { /* tag, uuid, fourMomentum, pT,
 eta, phi */ });
eventDisplay.on('result-recorded', (data) => { /* eventType, mass,
particleCount */ });

This allows external tools (e.g. histogram frameworks) to react to user
actions without modifying Phoenix.

Files

Core library (phoenix-event-display):

  • helpers/invariant-mass.ts — generic 4-momentum math +
    MasterclassConfig/ParticleTagDef types + ATLAS default config
  • event-display.ts — on(event, callback) / emit(event, data) event bus

UI components (phoenix-ui-components):

  • masterclass-panel/ — toolbar toggle + overlay panel, config-driven via
    @input()
  • ui-menu.component — threads masterclassConfig input to panel

App (phoenix-app):

  • atlas.component — passes ATLAS_MASTERCLASS_CONFIG to ui-menu

Test plan

  • Load ATLAS section with default JiveXML event
  • Open masterclass panel (atom icon), select tracks, tag particles
  • Verify invariant mass computation and hints display
  • Record results and export file
  • Verify no console errors on LHCb/other sections
Recording.2026-03-13.160329.mp4

…integration

Signed-off-by: rx18-eng <remopanda78@gmail.com>
@rx18-eng
Copy link
Author

rx18-eng commented Mar 18, 2026

Hey @EdwardMoyse @sponce , this account is my temporary replacement for my previous account remo-lab .
Also this pr was made based on my discussions with @sponce , please let me know your thoughts on this!

@rx18-eng rx18-eng changed the title feat: add configurable masterclass panel with event bus for external … feat: add configurable masterclass panel with event bus for external integration Mar 19, 2026
@sponce
Copy link
Collaborator

sponce commented Mar 19, 2026

Hi @rx18-eng, good to see you back ! I did not have time to look carefully to this PR yet, but I'll do it next week for sure.

@rx18-eng
Copy link
Author

Thanks @sponce for your review ! it really means a lot coming from you. I was honestly a bit worried due to the overnight GitHub situation, so I really appreciate your feedback!

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.

Add ability to tag objects as types, and display kinematics in separate windows

2 participants