elenac
1
Hello,
I would like to know how to remove a histogram from a file in a root session:
if I open the file, for example:
TFile *f = TFile::Open(“histograms_file.root”);
and I list the objects in the file with the command:
f->ls();
and I have in the file, for example, the histogram “h1”, is it correct to do:
f->Delete(“h1;1”);
??
Thank you very much,
Elena
brun
2
You must open the file in “update” mode
Rene
pcanal
3
Hi,
Yes it is correct but you need to open the file in update mode:TFile *f = TFile::Open("histograms_file.root","UPDATE");
Cheers,
Philippe.
brun
4
Well, to open the file in update mode, you must do:
TFile *f = TFile::Open("histograms_file.root","update");
Rene