Adding two TTrees with versioned branches

Hi all,

I was hoping to merge two TTrees with branches that have a versioning system attached. In other words, if I have a TTree with a branch “variable_v1” and a second TTree with a branch “variable_v2” is there any way I can do some sort of string matching here to properly add these two trees together?

TChain::Merge(TFile, 0, “keep”) is essentially the functionality I’m looking for, but with the ability to specify which branches to merge.

Thanks.

Hi,

[quote]if I have a TTree with a branch “variable_v1” and a second TTree with a branch “variable_v2” is there any way I can do some sort of string matching here to properly add these two trees together?[/quote]This feature is only available if the two variable are part of an object. (In which case you can use the schema evolution rule to indicate the match). If they are not you will need to get inspiration from the implementation of TChain::Merge and at each file opening properly connect the input and output branches.

Cheers,
Philippe.