Copy a subdirectory from oldfile to newfile.
Arguments:
oldfile -- String for source TFile
newfile -- String for destination TFile
basenames -- List of strings for base directories, first existing one is picked
dirname -- String for directory name under the base directory
Definition at line 593 of file validation.py.
References _copyDir(), join(), and split.
Referenced by validation.Validation._doPlots().
594 def _copySubDir(oldfile, newfile, basenames, dirname):
595 """Copy a subdirectory from oldfile to newfile.
598 oldfile -- String for source TFile
599 newfile -- String for destination TFile
600 basenames -- List of strings for base directories, first existing one is picked
601 dirname -- String for directory name under the base directory
603 oldf = ROOT.TFile.Open(oldfile)
606 for basename
in basenames:
607 dirold = oldf.GetDirectory(basename)
611 raise Exception(
"Did not find any of %s directories from file %s" % (
",".
join(basenames, oldfile)))
613 d = dirold.Get(dirname)
615 raise Exception(
"Did not find directory %s under %s" % (dirname, dirold.GetPath()))
618 newf = ROOT.TFile.Open(newfile,
"RECREATE")
620 for d
in basenames[0].
split(
"/"):
621 dirnew = dirnew.mkdir(d)
623 dirnew = dirnew.mkdir(dirname)
static std::string join(char **cmd)