Hi,
I’m fitting a distribution with a function (pol2+gaus+pol2). I want to fix the width of the gaussian (width=0.006), but I can’t. I took a look in several examples, but none works for me. I’ve tryied g2->SetParameter(3,0.006), g2->FixParameter(3,0.006) and also total->SetParameter(5,0.006) and other combinations. Here is what I’m trying:
Double_t par[9];
g1 = new TF1("m1","pol2",1.523,1.631);
g2 = new TF1("m2","gaus",1.637,1.661);
//g2->SetParameter(3,0.006)
g3 = new TF1("m3","pol2",1.667,1.775);
total = new TF1("mctotal","pol2(0)+gaus(3)+pol2(6)",1.523,1.775);
total->SetLineColor(4);
gr1->Fit(g1,"R");
gr1->Fit(g2,"R+");
gr1->Fit(g3,"R+");
g1->GetParameters(&par[0]);
g2->GetParameters(&par[3]);
g3->GetParameters(&par[6]);
total->SetParameters(par);
total->SetParNames ("PL1","PL2","PL3","Counts","Mean","Width","PL1","PL2","PL3");
gr1->Fit(total,"R+");
g2->SetParameter(5,0.006);
gr1->Fit(total,"","",1.523,1.775);
Does anyone knows how can a fix a specific parameter? Or two parameters?
Thanks
I’m running ROOT 4.00/08 in a Linux RH9.