diff --git a/tree/treeplayer/src/TTreeProcessorMT.cxx b/tree/treeplayer/src/TTreeProcessorMT.cxx index c914bdf7793dee8cc830dd00bcce9e7094420856..025565dc37b28b3fd8daf4823bcd991a4d190146 100644 --- a/tree/treeplayer/src/TTreeProcessorMT.cxx +++ b/tree/treeplayer/src/TTreeProcessorMT.cxx @@ -171,6 +171,14 @@ static std::string GetTreeFullPath(const TTree &tree) // Case 2: this is a TTree: we get the full path of it if (auto motherDir = tree.GetDirectory()) { + // We have 2 subcases (ROOT-9948): + // - 1. motherDir is a TFile + // - 2. motherDir is a directory + // If 1. we just return the name of the tree, if 2. we reconstruct the path + // to the file. + if (motherDir->InheritsFrom("TFile")) { + return tree.GetName(); + } std::string fullPath(motherDir->GetPath()); fullPath += "/"; fullPath += tree.GetName();