I am not an expert in root but I use it quite extensively. Instead of using hadd to merge them all, have you tried using TChain->Add("file_name.root") command in a loop? It will give you equivalent result to add all the histogram using one loop