Hi,
I want to draw a function obtained out of a fitting. For that, I’m fitting first the function within a range and then I get the parameters. After, I am defining a new function with the same parameter values from the previous one but I want to draw it in an extended range. I get some error concerning the FixParameter, and, I cannot see the extended function in my histogram. Here is the code that I’m trying to fix:
TF1 *powvar=new TF1("powvar","[0]+[1]*x^2",27,50);
powvar->SetParName(0,"c0");
powvar->SetParName(1,"c1");
powvar->SetParameter(0, 1);
powvar->SetParameter(1, 0);
powvar->SetLineColor(2);
powvar->SetLineWidth(2);
ADC8->Fit("powvar","R");
Double_t param[2];
powvar->GetParameters(param);
TF1 *powvarfull=new TF1("powvarfull","[0]+[1]*x^2",0,75);
powvarfull->SetParameters(param);
powvarfull->FixParameter(0,¶m[0]);
powvarfull->FixParameter(1,¶m[1]);
powvarfull->SetLineColor(3);
powvarfull->SetLineWidth(2);
ADC8->Fit("powvarfull","RB+");
Does someone has some clue about how to solve it?
Thanks in advance,
psc