Quarkonium-System

3. Data and fit

Data

Two inputs, deliberately separate: the PDG SQLite file (numbers) and the state files (which number is which model level). The reader converts MeV to GeV at the boundary and takes summary-table values. Where the PDG gives no partial width it forms branching fraction × total width and marks it.

A problem is residuals and a Jacobian

The minimiser knows nothing about physics:

class LeastSquaresProblem {
  virtual int n_data() const = 0;
  virtual int n_free() const = 0;
  virtual Result<Vec> residuals(const Vec& u) = 0;   // whitened
  virtual Result<Mat> jacobian(const Vec& u) = 0;
};

That made it possible to test the whole fit machinery on a straight line before any quark was involved, and later to compose problems: Chi2Problem (masses), WidthProblem, MassWidthProblem (stacked), JointProblem (two systems with shared parameters). Priors enter as extra residuals.

Levenberg–Marquardt

--8<-- "src/fit/least_squares.cpp:lm"

A failed or non-finite trial point is just a rejected step: (\lambda) grows and a shorter step is tried. With ROOT, Minuit2 can replace this loop through a single function pointer (FitOptions::engine).

Chi2Problem adds the physics-aware safety checks: a negative mass signals a collapsed Hamiltonian; a level far below its neighbours in an uncoupled channel signals a spurious state; levels are tracked by overlap.

The floor loop

fit_with_floor alternates fit and floor until (\sigma) stops moving. Because (\chi^2(\sigma^2)) is monotonic, the inner solve is a bisection that cannot fail.

Uncertainty

On top of the converged fit: covariance by pseudo-inverse, leverages, exact held-out refits (one function, refit_held_out, serves leave-one-out, leave-multiplet-out and folds), bootstrap, MCMC, and the closure test absorb_shift behind the a-priori error.

Reproducible randomness

std::normal_distribution is allowed to differ between standard libraries. The engine uses mt19937_64 (which is fully specified) with its own Box–Muller transform, and derives an independent stream per replica with splitmix64. Results do not depend on the number of threads or the platform’s library.

Basis optimisation

Every basis energy is an upper bound, so the sum of the levels used by a fit (a trace) is a variational objective: hyper/ minimises it over (\ln r_1,\ln r_{\max}) with Nelder–Mead.