Re: TFile

From: Otto Schaile (Otto.Schaile@Physik.uni-muenchen.de)
Date: Wed May 19 1999 - 14:36:34 MEST


On Wed, 19 May 1999, Thomas Eberl wrote:

> Dear rooters,
> 
> one simple question.
> I try to write a TVector object in a ROOT File. The usual way via simply
> saying Write(); does not have any effect (For Histograms it works for
> ex.).
> 
> Does somebody know what goes wrong ?

Hi Thomas,

you should do:
 TFile * file ...
 ...
 file->cd();
 object->Write("keyname")
 
Histograms are special, they belong to the directory of TFile file,
file->Write() writes all objects in that directory:

TFile *file = new TFile
TH1F * h = new TH1F(...        // this adds h to the cwd (which is: file)
..
cheers
Otto
> -- 
> Thomas Eberl                       Phone: (+49 89) 289 1 2425   
> Physik-Department E12, Technische Universitaet Muenchen
> James-Franck-Strasse *** 85748 Garching b. Muenchen
> Email: Thomas.Eberl@physik.tu-muenchen.de
> 

----------------------------------------------------------------------------
Otto Schaile                    Sektion Physik der LMU Muenchen
Phone: (+49 89)289 14070        Am Coulombwall 1, D-85748 Garching, Germany
FAX:   (+49 89)289 14072        EMail: Otto.Schaile@Physik.Uni-Muenchen.DE



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