Please read tips for efficient and successful posting and posting code
ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided
Hi experts,
In brief, there is a root file containing many trees. I want to get a tree, slim it by some cuts, then add a new branch in the tree with a pdarray in ready, finally, write this tree into the file.
I chose Rdataframe, since it is convenient to add cuts. But I met problems when filling a branch with a pdfarray and save the tree to the rootfile. This is what I tried:
def array2tree(outArray, outName, outTree):
outTree.Define(outName,"for(auto w : outArray) return w;")// wrong here!!!
outTree.Define(outName,1)
outTree.Write()//for rdataframe, no Write attribute.!!!
As you can see above, outArray is a pdArray. outTree is a rdataframe. My doing to fill a branch is not proper...And I also don't know how to write the rdataframe into a file.
If you have some experience, could you please share it with me? Thanks a lot!