TF1 called from member funciton of a Class not working properly

Dear Expert:
I am trying to declare TF1 inside a class member and want to fit the signal by calling memebr function

void RsnAnalysisPostProcessing::fitFunction(TH1D *fMassHisto,Double_t lfit,Double_t hfit){

fitFcnSgBg = new TF1("voigtianppoly2",this,&RsnAnalysisPostProcessing::voignpoly2,lfit,hfit,7,"RsnAnalysisPostProcessing","voignpoly2");//,"RsnAnalysisPostProcessing","voignpoly2");
fitFcnSgBg->SetParameter(0,1000);//norm factor

Double_t RsnAnalysisPostProcessing::voignpoly2(Double_t *x ,Double_t *par)
  Double_t voig_poly2 =(par[0]*TMath::Voigt(x[0]-par[1],par[2],par[3],4))+(par[4]+par[5]*x[0]+par[6]*x[0]*x[0]);
  return voig_poly2;

I am attached here the results of the fit:-
unnamed.pdf (65.2 KB)
It seem the fitting doesnot able to work properly. I am not able to find out what I am missing here. Any Suggestion?
ROOT Version: 6.26/10
Platform: Not Provided
Compiler: Not Provided

Maybe @couet can help you with that.

I guess @moneta will know.

1 Like

Thank you very much: When I played with these paremters results is much better now.
unnamed1.pdf (65.3 KB)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.