10 def find_histo(root_file, path, should_delete=False):
11 obj = root_file.Get(path)
14 raise RuntimeError(f
"Object not found at path: {path}")
16 logging.warning(f
"Object not found at path: {path}")
20 path_parts = path.strip(
"/").
split(
"/")
21 *dirs, name = path_parts
22 current_dir = root_file
24 current_dir = current_dir.Get(d)
27 raise RuntimeError(f
"Directory '{d}' not found in path '{'/'.join(dirs)}' for deletion.")
29 logging.warning(f
"Directory '{d}' not found in path '{'/'.join(dirs)}' for deletion.")
32 current_dir.Delete(f
"{name};*")