Error when trying to clone a TTree

Hello,

I have a tree named oldtree, which contains a few entires, from which I am only interested in the first one.
What I’m trying to do is copy the first entry to another tree (newtree)

root[0] TTree* newtree;
root[1] newtree = oldtree->CloneTree(1);

But I receive the error

Error: Symbol G__exception is not defined in current scope  (tmpfile)(1)
Error: type G__exception not defined FILE:(tmpfile) LINE:1
(class TTree*)0x0
*** Interpreter error recovered ***

This error pops whenever I try to do

root[2] oldtree->CloneTree(1);

(which should simply return a pointer to that clone…)

P.S.
not sure if thats relevant but oldtree contains A LOT of data.

Thank you.

The error message seems to indicate that the value of the pointer oldtree is 0 (i.e. nullptr). Make sure that this pointer is properly initialized.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.