Solution of Root Program

Fit the following data:

const int nBins = 60; Double_t data[nBins] = {6,1,10,12,6,13,23,22,15,21,23,26,36,25,27,35,40,44,66,81,75,57,48,45,46,41,35,36,53,32,40,37,38,31,36,44,42,37,32,32,43,44,35,33,33,39,29,41,32,44,26,39,29,35,32,21,21,15,25,15 }; to the following function:
a) gaussian
b) Lorenzian peak

// Lorenzian peak function Double_t lorentzianPeak(Double_t *x, Double_t *par){ return (0.5*par[0]*par[1]/Tmath::Pi())/ TMath::Max(1.e-10,(x[0]-par[2])*(x[0]-par[2]) + .25*par[1]*par[1]); } c) a gaussian + a cuadratic background
d) a Lorenzian peak + a quadratic background

Comment on the results

That’s an exam question ? :slight_smile: