Trying to find peak areas using example FitAwmi.C

The attached “SpectrumFit.cxx” macro fits 1D spectra using either the AWMI method (an algorithm without matrix inversion) or the Stiefel-Hestens method (a conjugate gradient algorithm) from the TSpectrumFit class. The TSpectrum class is used to find peaks.

To try this macro, in a ROOT (5 or 6) prompt, do …
… for the “AWMI” method …

.x SpectrumFit.cxx ... or ... .x SpectrumFit.cxx++
SpectrumFit(); another random set of peaks (integer areas)
SpectrumFit(0, kFALSE); another random set of peaks (integer heights)

… for the “Stiefel-Hestens” method …

.x SpectrumFit.cxx(1) ... or ... .x SpectrumFit.cxx++(1)
SpectrumFit(1); another random set of peaks (integer areas)
SpectrumFit(1, kFALSE); another random set of peaks (integer heights)

SpectrumFit.cxx (7.2 KB)