suter_aandClaude Opus 5 9d1b6eac30 musrview: fix the segfault of the interactive "Save graphics"
RenderGraphics() flips gROOT's batch flag so that the export TCanvas is
built headless. That is enough for TCanvas to take its batch branch, but
not enough to make the session batch: an interactive musrview is a
non-batch ROOT session, hence TApplication has loaded the X11 graphics
and gVirtualX points at TGX11.

A batch TCanvas never obtains a drawable - its fPixmapID stays -1 - yet
TCanvas::Build() unconditionally paints the canvas background through
SelectDrawable(fPixmapID)/PaintBorder(). With the batch gVirtualX that is
a no-op, with TGX11 it selects window -1 and TGX11::DrawBoxW() segfaults.
Saving from the musrview window therefore crashed every time, while the
--png/--pdf/... batch export was never affected (there gVirtualX already
is the batch one).

Put the graphics interface into the same state a genuine batch session
has by pointing gVirtualX at ROOT's gGXBatch for the duration of the
export. Batch flag and gVirtualX are now handled by one RAII guard, which
also replaces the three hand-written restore points, and which is
declared before the canvas so that it outlives it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LVGQWoKNXByP2PSmMgPz3i
2026-09-18 16:39:25 +02:00
2019-05-15 10:14:39 +02:00
2026-09-11 14:49:04 +02:00
2025-10-15 07:58:50 +02:00
2025-11-06 14:13:08 +01:00

musrfit - muSR and beta-NMR data analysis package

Contents

This is a data analysis package to analyze time differential muSR and beta-NMR data. Currently it allows the following:

  • set up most commonly used fitting functions for muSR and beta-NMR
  • fit data, including global fits
  • show the fit results and the residuals
  • show the Fourier transform of the data
  • easily extract the fit parameters and import in other programs (gnuplot, qtiplot/origin, ...)
  • generate input fitting files for follow-up runs
  • generate global input fitting files based on a single run template
  • implement more sophisticated user functions (e.g. GL vortex lattice, Meissner screening including low-energy muon stopping profiles)

Currently supported platforms:

Documentation

For a more exhaustive user documentation see:

https://lmu.pages.psi.ch/musrfit-docu/index.html

Contacts

andreas.suter@psi.ch

For the beta-NMR related parts, please contact Zaher Salman zaher.salman@psi.ch

2026-07-22 08:24:31 +02:00
Languages
C++ 79.7%
C 11.6%
Wolfram Language 5.8%
CMake 1.9%
Perl 0.5%
Other 0.4%