TFile::Write() writes all the objects entered into the list
of objects in memory associated with this file.
Assume TFile *file:
the file object has a list(TList) of objects that you can find at
TList *list = file->GetList();
By default, TH1 objects and TTree objects are automatically inserted
in this list when these objects are created.
TFile::Write scans all the objects in this list and for each object
executes obj->Write.
You can insert your own objects in this list if you want with a
statement like
file->GetList()->Add(object);
and your object will be automatically saved by TFile::Write.
Note that this is only convenient for objects derived from TNamed,
such as TH1, TTree, TF1.
Rene Brun