Hi!
I am trying to fit an alpha peak in my histogram, but the peak is asymmetrical and I don’t know what to do. I was thinking on doing a convolution of a gaussian and a lorentzian, but that is just a voigt function and I cannot get it to work either.
If it would be better to do just a sum, is it possible to sum an user defined Lorentzian with a TF1"gaus" fit?
Here’s part of the code in question:
//Lorentzian Function
TF1 *l1 = new TF1("l1","(1*[2]/(TMath::Pi()*2))*((TMath::Power([0],2))/(TMath::Power(x-[1],2)+TMath::Power([0],2)))",Pi,Pf);
//l1->SetParameters(0,dP,1000);
//Pseudo-voigt
TF1Convolution *f_conv = new TF1Convolution("m1","l1",Pi,Pf,true);
f_conv->SetRange(Pi,Pf);
f_conv->SetNofPointsFFT(1000);
//TF1 *f = new TF1("f",*f_conv, Pi, Pf, f_conv->GetNpar());
//Actual Voigt
TF1 *f = new TF1("f","[0] * TMath::Voigt(x, [1], [2], 4)",Pi,Pf);
and here’s the full code:
alpha1.C (4.1 KB)
Whenever I fit the gaussian and the lorentzian separately I get an ok fit and a converged fit, but neither look “nice”.
2.pdf (17.5 KB)
Now, when I try the convolution it simply fails:
1.pdf (16.5 KB)
What can i do to improve the fit of the big peak? and finally, the whole thing (the smaller peaks and the tail to the right)?
J