Strange hadd behaviour

I don’t know what is going on but is the order of the files to add important in hadd?

Error:

hadd test1.root mueg-2015d-pr-2_1_ntuple_postproc_skimmed.root mueg_1_skimmed.root
hadd Target file: test1.root
hadd Source file 1: mueg-2015d-pr-2_1_ntuple_postproc_skimmed.root
hadd Source file 2: mueg_1_skimmed.root
hadd Target path: test1.root:/
Warning in <TTree::CopyAddresses>: Could not find branch named 'ele_miniisocharged' in tree named 'Events'
Warning in <TTree::CopyAddresses>: Could not find branch named 'ele_miniisoneutral' in tree named 'Events'
Warning in <TTree::CopyAddresses>: Could not find branch named 'ele_miniisopu' in tree named 'Events'
Warning in <TTree::CopyAddresses>: Could not find branch named 'mu_miniisocharged' in tree named 'Events'
Warning in <TTree::CopyAddresses>: Could not find branch named 'mu_miniisoneutral' in tree named 'Events'
Warning in <TTree::CopyAddresses>: Could not find branch named 'mu_miniisopu' in tree named 'Events'
Warning in <TTree::CopyEntries>: One of the export top level branches (mu_miniisopu) is not present in the import TTree.

and no error if I change the order of the 2 files to be added…

hadd test2.root mueg_1_skimmed.root mueg-2015d-pr-2_1_ntuple_postproc_skimmed.root
hadd Target file: test2.root
hadd Source file 1: mueg_1_skimmed.root
hadd Source file 2: mueg-2015d-pr-2_1_ntuple_postproc_skimmed.root
hadd Target path: test2.root:/

ls -l test*
… 8720529 Dec 12 20:45 test1.root
… 14469033 Dec 12 20:45 test2.root

So with the first try it didn’t work while it’s ok with the other way around… is that normal?

It seems to me that the “Events” tree in one of your files contains more branches than in the other one (the tree structure will be copied from the first file that contains it).

Right… my fault… in principle all the files shall have the same branches… I don’t know why this is not the case… Thanks for helping!