void addBranch() { TFile f("kapu.root","update"); Float_t pt[16]; TTree *t3 = (TTree*)f.Get("Tchep"); TBranch *newBranch = t3-> Branch("pt",&pt,"pt"); //read the number of entries in the t3 Int_t nentries = (Int_t)t3->GetEntries(); /*for (Int_t i = 0; i < nentries; i++){ new_v= gRandom->Gaus(0,1); newBranch->Fill(); } */ t3->Write("",TObject::kOverwrite); // save only the new version of the tree }