[Fwd: Re: Loading and re-loading files]

Rene Brun (Rene.Brun@cern.ch)
Tue, 10 Feb 1998 10:38:02 +0100


Message-ID: <34DC6FFA.1A4C@mail.cern.ch>
Date: Sat, 07 Feb 1998 15:30:18 +0100
From: Rene Brun <brun@mail.cern.ch>
Organization: CERN. European Lab. for Particle Physics
X-Mailer: Mozilla 3.01Gold (X11; I; HP-UX B.10.20 9000/755)
MIME-Version: 1.0
To: Chris Jillings <chris@loon.phy.queensu.ca>
CC: roottalk@hpsalo.cern.ch
Subject: Re: Loading and re-loading files
References: <Pine.BSD.3.91.980204084009.25429A-100000@loon>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

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