Hello,
I clone a TF1 with TObject::Clone and then I change the value of the parameters of the new TF1 using SetParameters. If I inspect the parameter value with GetParameter I get the new values but when I Draw the TF1 I always get the graph of the original TF1 with the original set of parameters. Does it make sense? I am using 5.22.00. An example of the macro is here:
{
MomentumDistribution md(MomentumDistribution::Ratio);
double p[]={20,50,100,200,500,1000};
TF1 ff(“ff”,&md,-15,20,5,“MomentumDistribution”);
ff.SetNpx(1000);
ff.SetParameters(100000,1000.,.002,.002,1.);
TObjArray farr(6);
for(int i=0;i<6;i++) {
char name[30];
sprintf(name,“f%d”,i);
farr.Add((TF1*)ff.Clone(name));
}
TIter it(&farr);
TF1* func=0;
int i=0;
while(func = (TF1*)it.Next()) {
cout << "Fill parameter " << p[i] << endl;
func->SetParameters(100000,p[i],.002,.002,1.);
i++;
}
}
cheers
Andrea