Using TH1::AddDirectory(kFALSE) to avoid opening thousands of files