Hello experts,
I am trying to add two root trees from different root files using weights. I see that hadd can be used to add two root tress from different files. But I cannot put weight there. Is there any way I can add two trees using different weights?
do you mean “adding” branch by branch 2 trees of N entries and obtain a tree with N entries or chaining two trees of N and M entries into a third one of N+M entries?
The easiest is to make the 2 TTree friend (see TTree::AddFriend) and to use RDataFrame SnapShot capablity to create a new TTree with the branch you want resulting from the calculation you are thinking of.