I have a file f1.root with a Tree “mytree” with one Branch "Branch1"
How can I add a new branch to this Tree in this file?
[code]TFile *f1 = new TFile(“data.root”, “update”);
TTree tree = (TTree)f1->Get(“mytree”);
br = tree->Branch(“Branch2”,&A,"…");
tree -> Write(“mytree”);
But when I run it once more it creates an additional Branch2;2 in a Tree.
I need to overwrite it.
How can I do it?