Saving intermediate objects and results

I am filling a number of 2D histograms. What I would like to do is from time to time flush the current one from memory to file, delete it and then start filling a new one.

I tried using HFile::Write with the name of the histogram of interest and it saved all objects. Is there a suggested way of doing this?

Regards
Chris

Hi Chris,

Instead of calling TFile::Write that writes
all objects in the directory to the file,
you can write one single object with
h.Write();
or
h.Write("",TObject::kOverWrite)

see TObject::Write doc

Rene