I want to copy the histograms from one file into a new one, with one additional branch included. There are no TDirectories and no trees, only histograms in the file. I copied and pasted into my macro the syntax from the tutorial CopyFiles.C (https://root.cern.ch/doc/v608/copyFiles_8C_source.html)
CopyFile calls CopyDir, and when the macro reaches line 29 it outputs the error:
Error in TFile::GetObjectChecked: The provided key name is invalid.
Followed quickly by *** Break *** segmentation violation.
What is the name it is trying to get from the source file? There are so many histograms in there, what would make one of those names invalid?
Hi! The additional branch is just one the rest of my macro is adding. rootcp does work. Actually I’m not sure if there’s something wrong with the root files I’m trying to copy, when I try to add a new branch to some of them I get
Error in TFile::WriteTObject: Directory Test/JZ12_MergedPythiaWithTrackSystematics_user.krybacki.23163599._000001.hist-output.root is not writable
Even though I’ve done chmod +x ./* in the directory, and rootcp works on this file.
Edit: sorry that last thing is just me incorrectly using ‘read’ not ‘recreate’ on the file!