Rename Branch

Dear Rooters

I have a root file(xyz.root) with Tree name ‘t’ and leaf name ‘vertex_m’. I need to rename them . I am able to rename Tree but failed for leaf(branch).
how to rename the branch ? I am looking for support.

Kalakhety

see Rename Branch

Hi
I have seen this page and use it, but it failed to rename branch.

--------my macro is:---------

TFile *oldfile = new TFile(“himali_dimuon_data_4076invpb.root”);
TTree oldtree = (TTree)oldfile->Get(“t”);

TFile *newfile = new TFile(“himali_dimuon_data_4076invpb_Aug292012.root”,“recreate”);
TTree *newtree = oldtree->CloneTree();

newtree->Write(“dimuon”);
newtree->SetAlias(“vertex_m”,“mass”);
newfile->Close();

It rename the tree but not branch. is there any thing missing?

Kalakhety

http://root.cern.ch/root/html/TTree.html#TTree:SetAlias