23 if (argc<3 || (argc>1 && (!strcmp(argv[1],
"-h") || !strcmp(argv[1],
"--help")))) {
24 std::cout <<
"Syntax:" << std::endl;
25 std::cout <<
"LArSamplesMerge file1 file2 ... outFile" << std::endl;
30 TROOT root (
"root",
"root");
31 gSystem->Load(
"libLArCafJobsDict.so");
33 std::vector<TString> inFileNames;
34 std::string outFileName(argv[argc-1]);
38 for (
int i=1;i<argc-1;++i)
39 inFileNames.emplace_back(argv[i]);
42 std::vector<const PersistentAccessor*> accessors;
44 for (
const TString& fileName : inFileNames) {
47 std::cout <<
"ERROR failed to open " << fileName << std::endl;
51 std::cout <<
"Open file " << fileName <<
" with " << acc->nEvents() <<
" events." << std::endl;
52 accessors.push_back(acc);
58 std::cout <<
"ERROR: Failed to merge files" << std::endl;
62 std::cout <<
"Wrote output file " << outFileName <<
" with " << output->nEvents() <<
" events." << std::endl;
63 output->file()->Close();
64 std::cout <<
"Out file closed"<<std::endl;