11 excludeTrees: bool):
12 """Recurse to copy all objects except those of regex"""
13 for k in thisdir.GetListOfKeys():
14 if k.GetClassName().startswith('TDirectory'):
15 targetsubdirname = thisdir.GetPath()[len(prefix):] + '/' + k.GetName()
16 if regex.fullmatch(targetsubdirname):
17 print(
'Now skipping', targetsubdirname)
18 continue
19 targetsubdir = targetdir.mkdir(k.GetName())
20 iterate(o := k.ReadObj(), targetsubdir, prefix, regex, excludeTrees)
21 ROOT.SetOwnership(o, True)
22 else:
23 if k.GetClassName().startswith('TTree'):
24 if not args.excludeTrees or k.GetName() == 'metadata':
25 targetdir.WriteObject(o := k.ReadObj().CloneTree(), k.GetName())
26 ROOT.SetOwnership(o, True)
27 else:
28 targetdir.WriteObject(o := k.ReadObj(), k.GetName())
29 ROOT.SetOwnership(o, True)
30
void print(char *figname, TCanvas *c1)