Hi,
I ran into a problem that I haven’t encountered before. I have a histogram and fit function, which I fit histogram:
TCanvas* c1 = new TCanvas("Window 1", "Masses", 20, 20, 600, 600);
...
TH1D* mass_D = new TH1D("m_D","Mass D^{#pm};m_{D^{#pm}}, GeV", 70, 1.86966 - 0.016, 1.86966 + 0.016);
...
TF1* f1 = new TF1("f1","gausn(0) + pol1(3)", 1.86966 - 0.016, 1.86966 + 0.016);
f1->SetParameter(0, 8.5); //f1->SetParLimits(0, 0, 1000); //f1->FixParameter(0, 8);
f1->SetParameter(1, 1.186966); //f1->FixParameter(1, 1.186966);
f1->SetParameter(2, 0.007); //f1->FixParameter(2, 0.007);
f1->SetParameter(3, 70); //f1->FixParameter(3, 0);
f1->SetParameter(4, 280);
mass_D->Fit(f1);
c1->cd();
mass_D->Draw();
I get a normal rusalts o fitting:
But root print onle pol1 part:
I can’t undersend why. I tried fix some parameters and this didn’t help.
Please read tips for efficient and successful posting and posting code
ROOT Version: 6.26/06
Platform: Ubuntu 22.04.1 LTS
Compiler: Not Provided