There are 2 methods TFormula::SetParameters (TF1 is derived from TFormula):
void TFormula::SetParameters(Double_t p0,Double_t p1,Double_t p2,Double_t p3,Double_t p4
,Double_t p5,Double_t p6,Double_t p7,Double_t p8,Double_t p9)
void TFormula::SetParameters(Double_t *params)
and neither of them accepts floats.
Hope this will help you.
Regards, Pasha.
--------------------------------------------------------------------------------
Jayoung Wu writes:
> I tried 1 dim function plot using TF1 in two ways:
> 1.
> ...
>
> TF1 *gline = new TF1("gline","-3*x+5",-25.,25.);
> gline->SetLineWidth(2.0);
> gline->Draw("SAME");
>
> ...
>
> ---> It works fine.
>
>
> 2.
> ...
>
> Float_t b0=5,b1=-3;
> TF1 *gline = new TF1("gline","pol1",-25.,25.);
> Float_t par[2];
> par[0] = -b0/b1;
> par[1] = 1/b1;
> gline->SetParameters(par);
> gline->GetParameters(par);
> gline->SetLineWidth(2.0);
> gline->Draw("SAME");
>
> ---> Error???
> Error: Can't call TF1::SetParameters() in current scope FILE:ytrack.C
> Error: No symbol gline->SetParameters(par) in current scope FILE:ytrack.C
>
> Error: Can't call TF1::GetParameters() in current scope FILE:ytrack.C
> Error: No symbol gline->GetParameters(par) in current scope FILE:ytrack.C
>
> ========================================
> Do you have any idea how I can plot 1dim function such as "a*x +b" (a and
> b are variable)?
>
> ---
> Thanks a lot!
> Jayoung
>