Hi!
I have a code, it fit my histograms. I need in convolution for 2 histograms. If I use convolution only for phi, i have:
But if i use convolution for first and second, i have:
Why secnd fit is broken?! For convolution i use code:
TF1 *core3 = new TF1("core3", "CONV([0]*TMath::BreitWigner(x,[1],[2]), TMath::Exp(-0.5*((x-[0])/[1]*(x-[0])/[1]))/(sqrt(2*TMath::Pi())*[1]))",inf,sup);
//core3->Print();
TF1 *bg3 = new TF1("bg3","pol1", inf, sup);
int npar3 = core3->GetNpar();
TF1 *total3 = new TF1("tot3",[=](double* x, double* p){ return core3->EvalPar(x, p) * 0.001 + bg3->EvalPar(x, p+npar3);}, inf, sup, npar3 + bg3->GetNpar());
//total3->Print(); cout << endl;
total3->SetParameter(0, 800);
total3->SetParameter(1, 1.020);
//total3->SetParameter(2, 0.0045);
//total3->SetParameter(3, 0);
total3->SetParameter(4, 0.005);
total3->SetParameter(5, 6);
total3->SetParameter(6, 10);
//total3->FixParameter(0, 0.0045);
//total3->FixParameter(1, 1.020);
total3->FixParameter(2, 0.0043);
total3->FixParameter(3, 0);
//total3->FixParameter(4, 0.0045);
//total3->FixParameter(5, 0.0045);
//total3->FixParameter(6, 0.0045);
total3->SetParName(0, "N");
total3->SetParName(1, "M");
total3->SetParName(2, "#Gamma");
total3->SetParName(3, "#mu");
total3->SetParName(4, "#sigma");
total3->SetParName(5, "Const 1");
total3->SetParName(6, "Const 2");
// do a background only fit to get the parameters for bg3
//Mphi->Fit(bg3);
//total3->SetParameter(5, bg3->GetParameter(0));
//total3->SetParameter(6, bg3->GetParameter(1));
Mphi->Fit("tot3", "", "", inf, sup);//1.020 - 0.02, 1.020 + 0.02);
Please read tips for efficient and successful posting and posting code
ROOT Version: 6.22/08
Platform: Not Provided
Compiler: Not Provided