8"""Command line to copy trees with subset of branches from source ROOT files to new trees on a destination ROOT file"""
14COMMAND_HELP =
"Copy trees with a subset of branches from source ROOT files"
17- rootslimtree source.root:tree dest.root
18 Copy the tree 'tree' from 'source.root' to 'dest.root'.
20- rootslimtree --recreate source.root:tree dest.root
21 Recreate the destination file 'dest.root' and copy the tree 'tree' from 'source.root' to 'dest.root'.
23- rootslimtree -c 1 source.root:tree dest.root
24 Change the compression factor of the destination file 'dest.root' and copy the tree 'tree' from 'source.root' to 'dest.root'. For more information about compression settings of ROOT file, please look at the reference guide available on the ROOT site.
26- rootslimtree -e "muon_*" source.root:tree dest.root
27 Copy the tree 'tree' from 'source.root' to 'dest.root' and remove branches matching "muon_*"
29- rootslimtree -e "*" -i "muon_*" source.root:tree dest.root
30 Copy the tree 'tree' from 'source.root' to 'dest.root' and only write branches matching "muon_*"
36 parser.prog =
'rootslimtree'
38 parser.add_argument(
"-c",
"--compress", type=int, help=cmdLineUtils.COMPRESS_HELP)
39 parser.add_argument(
"--recreate", help=cmdLineUtils.RECREATE_HELP, action=
"store_true")
40 parser.add_argument(
"-i",
"--branchinclude", default=
"")
41 parser.add_argument(
"-e",
"--branchexclude", default=
"")
53 compress=optDict[
"compress"], recreate=optDict[
"recreate"], \
56 branchinclude=optDict[
"branchinclude"],\
57 branchexclude=optDict[
"branchexclude"])
58if __name__ ==
"__main__":
rootEventselector(sourceList, destFileName, destPathSplit, compress=None, recreate=False, first=0, last=-1, selectionString="", branchinclude="", branchexclude="")
getParserSourceDest(theHelp, theEpilog="")
Get a commandline parser with the defaults of the commandline utils, a list of source files and a des...
getSourceDestListOptDict(parser, wildcards=True)
Get the list of tuples of sources, create destination name, destination pathSplit and the dictionary ...