I am a theorist and not very familiar with root. I want to merge two related root to one root file, but the branches in two root files are different. Concretely, one root (lep.root) has branches Lep_pt, Lep_eta, and the other has branches Jet_pt , Jet_eta (Jet.root), but the entry number corresponding to the event number are same for these two roots. The variable such as Lep_pt is vector. Please kindly find the attached root files.
I have tried merge.C script , AddFriend, TBranchClone, but I failed. AddFriend is helpful to load the Branch information to cache and good for drawing histogram. But I want to use the merged root file for further analysis. Could anybody help me. Thanks a lot. If you could provide a example, I would be much grateful.
jet.root (413 KB)
lep.root (39.6 KB)