I’m currently trying to fit an obtained data spectrum (TH1) with two simulated spectra (each a TH1) that have different distinct peaks. So in principal I’d like to fit both MC spectra to the data by scaling in order to derive the fraction of SimSpectrum1 to SimSpectrum2.
I guess that the appropriate way is to minimize the residuals between Data and SimSpectrum1+SimSpectrum2.
Does such a fitting algorithm/method already exist in ROOT?
Or can you use TH1::Fit somehow, i.e. create a user-defined function aSimSpectrum1(TH1) + bSimSpectrum2(TH1)?
I have the feeling that the answer should be easy, however I couldn’t find anything in the Class References or by using Google.
Thank you very much!