Chris Jillings wrote:
>
> Hi,
> I am running Root 1.03/07 19 November 1997 on Linux.
> The problem I have occurs when I try to work with a user-defined
> function. I type the following...
>
> .L cjjFit.C
> TF1* cjjFit = new TF1("cjjFit",cjjFit,-1,1,4);
> cjjFit->SetParameters(0,1,1,1);
> cjjFit->Draw();
>
> This works. I then decide to edit cjjFit.C to change the function.
> But when I type
>
> delete cjjFit;
> .U cjjFit.C
>
> I get a message saying
> Error: G__unloadfile() File "cjjFit.C" not loaded FILE: LINE:0
>
> I now edit the file and save it. Then I type
>
> .L cjjFit.C
> TF1* cjjFit = new TF1("cjjFit",cjjFit,-1,1,4);
> cjjFit->SetParameters(0,1,1,1);
> cjjFit->Draw();
>
> The draw fails. The function is simply a line at y=0. Note this occurs
> even if I do not edit the file.
You should not Unload the file. The instruction
.L cjjFit.C
will take care of reloading the new version of the file.
I tested your example with a trivial function cjjFit using
your macro without the .U cjjFit.C instruction.
The results are OK.
It could be that you get a line at y=0 because one of your
parameters really sets the function to 0.
If this is not the case, I will need a real copy of your cjjFit
to investigate.
Rene Brun