Hadd fails to merge two histogram files

Hello,

I have a problem with merging two files using hadd which have only TH2F histograms inside. Any ideas what may cause this ? I am using 5.30/05.

atlas.inp.nsk.su/kskovpen/temp/test1.root
atlas.inp.nsk.su/kskovpen/temp/test2.root

hadd test.root test1.root test2.root

Error in TClass::New: cannot create object of class TH1

Not sure why it claims about TH1 as there are only TH2F histograms in those files.

Thanks !

Kirill

Hello again,

Maybe for some reason hadd stopped working for TH2 as I have no problems with TH1 … ?

Thanks,

Kirill

Hi!

I can confirm your observation using ROOT 5.34.04. It seems to be an issue with the tree you’ve also in the file. When you ommit it with option “-T”, the merging works:

$ hadd -T -f test.root test1.root test2.root
hadd Target file: test.root
hadd Source file 1: test1.root
hadd Source file 2: test2.root
hadd Target path: test.root:/

Best,

Sebastian