Re: TFile Problem

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Apr 30 1999 - 15:24:24 MEST


Hi Jeff,
After the TFile statement in your code, add the following line
   TTree *h666 = (TTree*)f.Get("h666"); // required by standard C++

In version 2.21, CINT is confused in case the compiled code
destroys an object allocated by CINT (h666)

Rene Brun

On Fri, 30 Apr 1999, Jeff Patterson wrote:

> Hey Rooters,
> 
> 	I don't understand what going on here.  I have a function that
> open up a TFile, that contains a root tree made with h2root.  It works
> fine the first time the function is called, but on subsquent calls, it
> can't open up the file.  h666 is the tree pointer.  Here's the code
> 
> main()
> {
>   TFile f("/drax/usr/diskb/chaos/root_tree/ntup4953.root");
>   h666->Print();
>   f.Close();
> }
> 
> If I quit root, and restart it, it works fine, but I would like to be able
> to run main() many times in a row without having to start a new root
> session each time.  Any ideas of where I am going wrong ?
> 
> 
> 				Jeff Patterson
> 				Univ. of Colorado
> 



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:32 MET