Compare trees in two different files with same structure

Hello

I would like to compare value by value two trees which have the same number of entries. I’m sure that’s possible without writing loops etc.

According to the documentation it can be done with AddFriends. However, it doesn’t seem to work as the variables I want to compare have the same name. In /afs/cern.ch/user/h/heineman/public/CompareTrees.C my attempt is shown.

What am I doing wrong? I’m using Root Version 5.10.

Thanks,
Florian

When calling tree.AddFriend, give an alias to your Tree.
See documentation of TTree::addFriend

Rene

Ok, I see. It works now. Thanks for the hint! Cheers, Florian :smiley: