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 743 of file validation.py.
References _copyDir(), join(), and split.
Referenced by validation.Validation._doPlots().
744 def _copySubDir(oldfile, newfile, basenames, dirname):
745 """Copy a subdirectory from oldfile to newfile.
748 oldfile -- String for source TFile
749 newfile -- String for destination TFile
750 basenames -- List of strings for base directories, first existing one is picked
751 dirname -- String for directory name under the base directory
753 oldf = ROOT.TFile.Open(oldfile)
756 for basename
in basenames:
757 dirold = oldf.GetDirectory(basename)
761 raise Exception(
"Did not find any of %s directories from file %s" % (
",".
join(basenames), oldfile))
763 d = dirold.Get(dirname)
765 raise Exception(
"Did not find directory %s under %s" % (dirname, dirold.GetPath()))
768 newf = ROOT.TFile.Open(newfile,
"RECREATE")
770 for d
in basenames[0].
split(
"/"):
771 dirnew = dirnew.mkdir(d)
773 dirnew = dirnew.mkdir(dirname)
static std::string join(char **cmd)