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 699 of file validation.py.
References _copyDir(), join(), and split.
Referenced by validation.Validation._doPlots().
700 def _copySubDir(oldfile, newfile, basenames, dirname):
701 """Copy a subdirectory from oldfile to newfile.
704 oldfile -- String for source TFile
705 newfile -- String for destination TFile
706 basenames -- List of strings for base directories, first existing one is picked
707 dirname -- String for directory name under the base directory
709 oldf = ROOT.TFile.Open(oldfile)
712 for basename
in basenames:
713 dirold = oldf.GetDirectory(basename)
717 raise Exception(
"Did not find any of %s directories from file %s" % (
",".
join(basenames), oldfile))
719 d = dirold.Get(dirname)
721 raise Exception(
"Did not find directory %s under %s" % (dirname, dirold.GetPath()))
724 newf = ROOT.TFile.Open(newfile,
"RECREATE")
726 for d
in basenames[0].
split(
"/"):
727 dirnew = dirnew.mkdir(d)
729 dirnew = dirnew.mkdir(dirname)
static std::string join(char **cmd)