Saving a TGraph in a root file

I skipped your long post. The object Lara saved in a file is a TGraph. I do not know if it’s difficult for you to do or not (obj->Write():wink: - but Lara was able to write a TGraph object into a file, and there is no reason to confuse Lara with other irrelevant problems here.

P.S.:

This statement is simply wrong and misleading. TFile can become an owner for some objects (the ownership policy is well described in the ROOT’s User’s guide), but it NEVER writes your histogram unless you call Write. Try not to misinform people.

I would recommend you (re)read this-
root.cern.ch/download/doc/ROOTUs … Output.pdf it explains all what you need.

For example:

Read:
1.2.4 Saving Histograms to Disk
or
1.2.6 Saving Objects to Disk.
or
1.2.7 Saving Collections to Disk
or
1.2.8 A TFile Object Going Out of Scope.