Dear Root Talk,
I am trying to fit an exponential over two ranges following the User’s Guide. The only difference is I don’t use the built in “expo” (which does work for this case). Instead I defined my own, yet I get an error message when trying to run the macro:
Error in : can not find any function at the address 0x337fbe0. This function requested for Fit1
Error in : can not find any function at the address 0x337fbe0. This function requested for Fit2
Error in : Bad numerical expression : “fitup(0)”
The relevant code would be:
Double_t par[6];
TF1 *fitup = new TF1("fitup", "[0]*exp(-1*20e-9*x/[1])+[2]");
fitup->SetParameters(155, 2e-6, 1);
TF1 *g1 = new TF1("Fit1", fitup,20,28, 3);
TF1 *g2 = new TF1("Fit2", fitup,35,300, 3);
total = new TF1("mstotal","fitup(0)+fitup(3)",20,306);
histup->Fit(g1,"R");
histup->Fit(g2,"R+");
g1->GetParameters(&par[0]);
g2->GetParameters(&par[3]);
total->SetParameters(par);
histup->Fit(total,"R+");
Any thoughts on what I am doing wrong…
Thanks[/code]