16 ::printf(
"Gaudi merge facility for ROOT tree based files.\n"
18 "gaudi_merge -o <output-file> -i <input-file 1> [ -i <input-file 2> ...]\n\n"
19 "input- and output files may specify any legal (ROOT) file name.\n"
20 " -output Specify output file name.\n"
21 " -input Specify input file name.\n"
22 " -debug Switch debug flag on.\n" );
26 static ErrorHandlerFunc_t s_err =
nullptr;
27 static void err_handler( Int_t
level, Bool_t abort_bool,
const char* location,
const char*
msg ) {
28 if (
msg &&
strstr(
msg,
"no dictionary for class" ) )
return;
29 s_err(
level, abort_bool, location,
msg );
33 bool dbg =
false, fixup =
true;
36 for (
int i = 1; i <
argc; ++i ) {
37 if ( *
argv[i] ==
'-' ) {
58 if ( input.
empty() ) {
59 ::printf(
"\nERROR: No input file(s) supplied\n\n" );
61 }
else if (
output.empty() ) {
62 ::printf(
"\nERROR: No output file supplied.\n\n" );
65 gROOT->SetBatch( kTRUE );
66 s_err = SetErrorHandler( err_handler );
67 for (
size_t i = 0; i < input.
size(); ++i ) {
68 const string& in = input[i];
69 bool do_fixup = fixup && ( ( i + 1 ) == input.
size() );
73 if ( result == MERGE_ERROR ) {
74 printf(
"\nERROR: File merge failed after %ld files.\n\n",
long( i + 1 ) );