Port of TSpectrum2 class from root.cern.ch
