Thanks for your help. I have no problem with the code. I uploaded my .root file so you can help me read it. I can’t get the data from the file, I need to get it to modify and work with it.
I tried to do it like this, but it didn’t work. The .txt file that was created in my folder does not have the data.
This was the file created: lines2.txt (78 Bytes)
The code is trying to read a TTree named “ntuple” from the file but such an tree does not exist. The file contains five histograms. You can check the contents of a ROOT file with a TBrowser.