Skip to content

feat: add in-browser histogram panel using jsroot (#840)#843

Open
rx18-eng wants to merge 1 commit intoHSF:mainfrom
rx18-eng:feat/histogram-panel-840
Open

feat: add in-browser histogram panel using jsroot (#840)#843
rx18-eng wants to merge 1 commit intoHSF:mainfrom
rx18-eng:feat/histogram-panel-840

Conversation

@rx18-eng
Copy link
Copy Markdown
Collaborator

@rx18-eng rx18-eng commented Mar 21, 2026

Summary

  • added histogram panel to the toolbar — shows invariant mass distributions live using jsroot
  • students tag particles, compute mass, histogram fills in real-time (the Z peak at ~91 GeV emerges as they work)
  • event bus on EventDisplay (on/emit) connects the masterclass panel to the histogram

What changed since first push

  • dark theme fix — gStyle is now saved/restored around jsroot draw calls so it doesn't leak into geometry rendering
  • no more ngDoCheck — replaced with proper @input setter, was firing every change detection cycle
  • removed ViewEncapsulation.None — styles no longer leak globally, uses scoped ::ng-deep
  • removed Higgs hint line — Z-path masterclass data won't have Higgs events, a line at 125 with nothing near it confuses
    students. added separate ATLAS_JPSI_HISTOGRAM and ATLAS_WIDE_HISTOGRAM configs for other exercises
  • configurable event name — config.eventName defaults to 'result-recorded', LHCb can use 'd0-lifetime-recorded' or whatever they
    want
  • HistogramConfig threaded via @input — ui-menu → histogram-panel → overlay, same pattern as masterclass config. experiments pass
    their own config
  • localStorage persistence — histogram data survives page refresh/crash. raw values stored and restored on load. critical for
    3-hour masterclass sessions
  • reset confirmation — asks "Clear all N entries?" before wiping, prevents accidental data loss
  • debounced redraw — 50ms coalesce so bulk-loading 100+ events doesn't cause lag
  • hint labels show units — Z (91.2 GeV) instead of just Z
  • TSV export — tab-separated instead of comma, avoids European locale decimal issues. filename derived from config title
  • brighter fill color — ROOT color 857, more visible on dark background
  • narrowed default range — 20-120 GeV instead of 0-150, Z peak is front and center

Test

Simulated a realistic Z-path masterclass session in the browser console ->175 events in 3 phases:

  • Phase A (40 events, 200ms each): careful student pair, mostly correct Z→μμ and Z→ee with realistic detector resolution, a few wrong combinations and off-shell Z*
  • Phase B (35 events, 250ms each): less experienced pair, more mistakes — same-sign lepton pairs, jets misidentified as leptons,boundary/overflow values
  • Phase C (100 events, instant): instructor bulk-loads pre-analyzed results to test debounce
    Uses Breit-Wigner + Gaussian smearing for realistic Z line shape. Includes wrong combos, out-of-range values, and edge cases.

video link

Closes #840

@rx18-eng
Copy link
Copy Markdown
Collaborator Author

rx18-eng commented Mar 21, 2026

hey @sponce @EdwardMoyse , this adds the histogram panel from #840. @cohm mentioned he wants to test this with students in Stockholm on Monday so it would be great if you could take a quick look before then. happy to make changes if anything needs fixing!

@rx18-eng rx18-eng force-pushed the feat/histogram-panel-840 branch 2 times, most recently from 07629ba to 324c861 Compare March 23, 2026 20:36
Signed-off-by: Jyotiraditya Patel <jyotiraditya.dev@gmail.com>
@rx18-eng rx18-eng force-pushed the feat/histogram-panel-840 branch from 324c861 to ece3b86 Compare March 24, 2026 21:16
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 histogram panel for masterclass invariant mass results

1 participant