Re: Loading a user-defined function in ROOT

From: Germano Percossi <>
Date: Thu, 20 Jan 2005 13:26:52 +0100

Germano Percossi wrote:
> Rene BRUN wrote:

>> Germano,
>> Could you send the shortest possible (but RUNNING) version of your 
>> script that gives a problem?
>> Rene Brun

> In attachment there is what you asked for (I hope, I had to write it
> again because I unfortunately overwrote it). The function uses also a
> variable Enestrip that is a Float_t array of 4224 elements that has been
> initialized out of the function via
> tree->SetBranchAddress("Enestrip",Enestrip).
> I would stress also that this function is not the only one that gives me
> problem (this is why I think my precompiled version gives problems): in
> attachment there's also a macro that trying to fill an ntuple returns a
> segmantation fault.
> Thank you,
> Ciao, Germano

I think to have found what's wrong with macro EneSum.C (last my e-mail).
Segmentation fault happens because calling function 'Fill' on a 'TNtuple' object with only 1 argument the function that is called is that working with pointers and not with the variable itself.
A workaround is to use a dummy variable, like the counter in the loop, like a variable of the NTuple object and to fill both variables avoiding confusion between the two instances of Fill function. I attach the new macro (I apologize for the space occupied).
The problems with the other function (EneFunc.C) stay, I'll try to unload the function with .U every time I modify it.

Regards, Germano

P.S: why do my messages takes 2 hours to be delivered to the ML? Is it normal?

     \ | /
     (@ @)
Germano Percossi
University of Rome "Tor Vergata" and INFN Roma2
Via della Ricerca Scientifica 1
I-00133 Rome Italy
Phone     : 06 7259 4824
Room      : c0 28b
Received on Thu Jan 20 2005 - 13:31:12 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:04 MET