Hi,
I’m opening a root file in “update” mode and adding one new branch to a tree of about 90 branches. I write the tree out using “TObject::kOverwrite” as it says in the manual, and after the code has run the size of the rootfile is doubled. The number of entries in each branch remains the same before and after the adding of the new branch, but I’m worried that the original tree is being duplicated but not writen over. Is it normal for the file size to increase this much? The method I’m using is detailed below.
Thanks for any help you can give.
Rob
Double_t var = 1.0;
TFile f(filename,“update”);
TTree tree = (TTree)f.Get(Tree);
TBranch *new_var = tree->Branch(“var”,&var,“var/D”);
new_var->Fill();
tree->Write("",TObject::kOverwrite);