Merging TTrees

I have two TTrees each with the same structure. TTree* t1 has n1 entries, TTree* t2 has n2 entries. I would like to merge these two trees into a third TTree* t3 such that when I read back t3, I get entries which are randomly sampled from t1 and t2.

Is there a TTree method which accomplishes this?

Thanks in advance for your help,

William Lockman

root.cern.ch/root/htmldoc/TChain.html
ftp://root.cern.ch/root/doc/12Trees.pdf , page 231
$ROOTSYS/tutorials/tree/h1chain.C

Jan

Doing random access may be resource consuming.
My recommendation (if possible) is to:
-merge your 2 trees into one single tree.
-Open the merged Tree *mtree and do mtree->LoadBaskets()
see: root.cern.ch/root/htmldoc/TTree. … oadBaskets
-Now you can access randomly any entry in mtree

Rene