RE: [ROOT] Write all histograms problem

From: Philippe Canal (pcanal@fnal.gov)
Date: Fri Jul 11 2003 - 22:39:30 MEST


Hi Martin,

You could try:
	TIter next(dir->GetList());
	while( (TObject *obj = next()) ) {
          if (obj->InheritsFrom(TH1::Class()) obj->Write();
       }

Cheers,
Philippe.

-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Martin Simard
Sent: Friday, July 11, 2003 3:21 PM
To: roottalk@pcroot.cern.ch
Subject: [ROOT] Write all histograms problem



Hello,

In my code I read a ntuple and do the following to write all histograms
(objects);


TDirectory *dir = gDirectory;
TFile *f = new TFile("file.root","recreate");
->Write();
delete f;


The file.root contain all histograms but he contain also the ntuple that I
read...
I don't want to save the ntuple in the file. Writing histogram one by one
works but do you have another solution.

Martin



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:13 MET