8"""Command line to move objects from ROOT files to another"""
14description = "Move objects from ROOT files to another"
17- rootmv source.root:hist* dest.root
18 Move all histograms whose named starts with 'hist' from 'source.root' to 'dest.root'.
20- rootmv source1.root:hist1 source2.root:hist2 dest.root
21 Move histograms 'hist1' from 'source1.root' and 'hist2' from 'source2.root' to 'dest.root'.
23- rootmv --recreate source.root:hist dest.root
24 Recreate the destination file 'dest.root' and move the histogram named 'hist' from 'source.root' into it.
26- rootmv -c 101 source.root:hist dest.root
27 Change the compression settings of the destination file 'dest.root' to ZLIB algorithm with compression level 1 and move the histogram named 'hist' from 'source.root' into it.
28 Meaning of the '-c' argument is given by 'compress = 100 * algorithm + level'.
29 Other examples of usage:
30 * -c 509 : ZSTD with compression level 9
31 * -c 404 : LZ4 with compression level 4
32 * -c 207 : LZMA with compression level 7
33 For more information see https://root.cern.ch/doc/master/classTFile.html#ad0377adf2f3d88da1a1f77256a140d60
34 and https://root.cern.ch/doc/master/structROOT_1_1RCompressionSetting.html
39 # Collect arguments with the module argparse
40 parser = cmdLineUtils.getParserSourceDest(description, EPILOG)
41 parser.prog = 'rootmv'
42 parser.add_argument("-c","--compress", type=int, help=cmdLineUtils.COMPRESS_HELP)
43 parser.add_argument("-i","--interactive", help=cmdLineUtils.INTERACTIVE_HELP, action="store_true")
44 parser.add_argument("--recreate", help=cmdLineUtils.RECREATE_HELP, action="store_true")
48 parser = get_argparse()
50 # Put arguments in shape
51 sourceList, destFileName, destPathSplit, optDict = cmdLineUtils.getSourceDestListOptDict(parser)
54 return cmdLineUtils.rootMv(sourceList, destFileName, destPathSplit, \
55 compress=optDict["compress"], interactive=optDict["interactive"], \
56 recreate=optDict["recreate"])
57if __name__ == "__main__":