Hi all
Having a list of strings that represent file names, I wanted to loop over the filename list, open the files, get the tree from each file and append it to a “tree storage” list, so something like
filenames = ["file1.root" , "file2.root", "file3.root"]
treename = "treename"
treeslist = []
for infile in filenames:
tmp_tree = ROOT.TFile.Open(infile, "read").Get(treename)
treelist.append(tmp_tree)
This results in something like
I tried setting the ownership, tmp_tree.Reset(), and also creating a new tree and cloning the old using something lile:
newTree = ROOT.TTree("atree","atree")
newTree= tmp_tree.CloneTree(0)
I also tried the gc.disable() from the gc module.
However, I still got a list containing all None’s but the last index.
Is it possible to do such an operation with TTree objects?
[ ROOT v6.04 and v5.34.25, python 2.7.10 under macosx64 and x86_64 GNU/Linux machines ]
Cheers
N.