14 namespace po = boost::program_options;
16 std::string
usage =
"usage: " + std::string(argv[0]) +
" <files>..."
17 +
" -o <output> [-h] [opts...]\n";
18 po::options_description opt(
usage +
"\nConvert a root tree to HDF5");
21 po::value(&app.
file.
in)->required()->multitoken(),
24 po::value(&app.
file.
out)->required(),
27 po::value(&app.
file.
tree)->default_value(
"",
"found"),
28 "tree to use, use whatever is there by default (or crash if multiple)")
29 (
"help,h",
"Print help messages")
32 "regex to filter branches")
35 "max size of vectors to write")
38 "print branches copied")
40 po::value(&app.
tree.
n_entries)->default_value(0,
"all")->implicit_value(1),
41 "number of entries to copy")
44 "chunk size in HDF5 file")
47 "selection string applied to ntuples")
49 po::value(&app.
tree.
print_interval)->default_value(0,
"never")->implicit_value(-1,
"1%"),
53 po::positional_options_description pos_opts;
54 pos_opts.add(
"in-file", -1);
58 po::store(po::command_line_parser(argc, argv).options(opt)
59 .positional(pos_opts).
run(), vm);
60 if ( vm.count(
"help") ) {
61 std::cout << opt << std::endl;
65 }
catch (po::error& err) {
66 std::cerr <<
usage <<
"ERROR: " << err.what() << std::endl;