Add a new branch to an existing root file by getting data from a text file

Hi,

I have some data in a text file named angleList.txt with columns pixlNbr, theta, phi, omega, x, y, z and I have an existing root file Simuldata.root. I want to add branches in this root file named pixlNbr, theta, phi, omega, x, y, z using the angleList.txt file. How to do it?

Thank you in advance for your help.

_ROOT Version: 6
_Platform: Ubuntu 16.04 LTS
Compiler: Not Provided


SimulData.root (2.0 KB)

angleList.txt (259.2 KB)

You can try to create a new tree and use the TTree::AddFriend() approach (see for example the $(ROOTSYS)/tutorials/tree/treefriend.C tutorial)

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