Adding histograms to already made .root file


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


Hi so I am trying to add some new histograms to an already made .root file. I was wondering how can this be done?

You can open an existing ROOT file using the “UPDATE” option.

I am trying to code this. So I have created and old file and just need to merge the new file into the old file. I read you can use hadd to do this but I don’t see how hadd works ie. syntax to use it.

If you want to merge ROOT files then try:
rootcp -h
hadd -h

so it is “hadd -h targetfile.root file_to_add.root” ?

hadd -h

Gives you the help of the hadd command. Follow the instructions given there.