#include "copyRootTree.h"
#include "getTree.h"
#include "treeCopyOpts.h"
#include "H5Cpp.h"
#include "TFile.h"
#include "TChain.h"
#include <iostream>
#include <memory>
Go to the source code of this file.
|
| int | run (int argc, char *argv[]) |
| int | main (int argc, char *argv[]) |
◆ main()
| int main |
( |
int | argc, |
|
|
char * | argv[] ) |
Definition at line 19 of file ttree2hdf5.cxx.
19 {
20 try {
21 return run(argc, argv);
22 } catch (std::logic_error& e) {
23 std::cerr <<
"ERROR: " <<
e.what() <<
", quitting." << std::endl;
24 return 1;
25 }
26}
◆ run()
| int run |
( |
int | argc, |
|
|
char * | argv[] ) |
Definition at line 28 of file ttree2hdf5.cxx.
28 {
31
32 if (
opts.exit_code != 0)
return opts.exit_code;
33
34
35
36 std::string tree_name =
opts.file.tree;
37 if (tree_name.size() == 0) tree_name =
getTree(
opts.file.in.at(0));
38 if (
opts.tree.verbose) std::cout <<
"tree: " << tree_name << std::endl;
39 std::unique_ptr<TChain>
chain(
new TChain(tree_name.c_str()));
40 for (
const auto& file_name:
opts.file.in) {
41 if (
opts.tree.verbose) std::cout <<
"adding " <<
file_name << std::endl;
43 if (ret_code != 1) {
44 std::cerr << "Tree '" << tree_name << "' is missing from "
46 return 1;
47 }
48 }
49
50
51 H5::H5File out_file(
opts.file.out, H5F_ACC_TRUNC);
52
53
55
56 return 0;
57}
std::string getTree(const std::string &file_name)
void copyRootTree(TTree &tt, H5::Group &fg, const TreeCopyOpts &opts)
AppOpts getTreeCopyOpts(int argc, char *argv[])