Class LorentzianFitter

java.lang.Object
edu.cnu.mdi.splot.fit.ALeastSquaresFitter
edu.cnu.mdi.splot.fit.LorentzianFitter
All Implemented Interfaces:
IFitStringGetter, IFitter

public final class LorentzianFitter extends ALeastSquaresFitter
Nonlinear least-squares fitter for a Lorentzian (Cauchy / Breit-Wigner) peak with a constant baseline:
 y(x) = A * (Γ/2)² / [(x - x&sub0;)² + (Γ/2)²] + B
 

Normalisation

The parameter A is the peak height above baseline (i.e. y(x₀) = A + B), not the area. This matches the Gaussian fitter convention used elsewhere in splot, making it easy to switch between the two.

Parameter ordering

  • params[0] = A — peak height above baseline
  • params[1] = x₀ — peak center
  • params[2] = Γ — full-width at half-maximum (FWHM); enforced >= DEFAULT_MIN_GAMMA
  • params[3] = B — baseline offset

Relationship to Gaussian

A Lorentzian has heavier tails than a Gaussian of the same FWHM. For a Gaussian, FWHM = 2√(2 ln 2)·σ ≈ 2.355·σ. Both models have the same peak-height parameter A and baseline B, so they can be compared directly.

Typical applications

Resonance peaks in nuclear/particle physics (Breit-Wigner), spectral line shapes in atomic spectroscopy, quality-factor measurements in mechanical or electrical resonators, natural line widths.

Author:
heddle
  • Field Details

    • IDX_A

      public static final int IDX_A
      Index of peak-height parameter A.
      See Also:
    • IDX_X0

      public static final int IDX_X0
      Index of peak-center parameter x₀.
      See Also:
    • IDX_G

      public static final int IDX_G
      Index of FWHM parameter Γ.
      See Also:
    • IDX_B

      public static final int IDX_B
      Index of baseline parameter B.
      See Also:
    • PARAM_NAMES

      public static final String[] PARAM_NAMES
      Display names used in legend strings and fit summaries.
    • DEFAULT_MIN_GAMMA

      public static final double DEFAULT_MIN_GAMMA
      Minimum FWHM to avoid divide-by-zero in the Jacobian.
      See Also:
  • Constructor Details

    • LorentzianFitter

      public LorentzianFitter()
      Creates a fitter with the default Levenberg-Marquardt optimizer.
    • LorentzianFitter

      public LorentzianFitter(org.apache.commons.math3.fitting.leastsquares.LeastSquaresOptimizer optimizer)
      Creates a fitter with a custom optimizer.
      Parameters:
      optimizer - the least-squares optimizer to use (non-null)
  • Method Details