Don't save one object to file

Hi,

I create a lot of histos and trees after opening a writable TFile. At the end I wan’t to save everything but one tree. I’d really like to continue doing f->Write(), because the number of stuff I create is allways changing. Is there a way (set bit or something) to tell something inheriting from TObject to NOT be wriiten to the file?

Thanks,
Rui

For the tree that you do not want to write, do
mytree->SetDirectory(0);

Rene