1 #include "merge/extractEvt.C" 7 ::printf(
"Gaudi event extraction facility for ROOT tree based files.\n" 9 "extract_event -o <output-file> -i <input-file> ...]\n\n" 10 "input- and output files may specify any legal (ROOT) file name.\n" 11 " -output Specify output file name.\n" 12 " -input Specify input file name.\n" 13 " -event Specify the event entry number.\n" );
22 for (
int i = 1; i <
argc; ++i ) {
23 if ( *argv[i] ==
'-' ) {
24 switch (::
toupper( *( argv[i] + 1 ) ) ) {
26 if ( 1 != ::sscanf( argv[i + 1],
"%d", &evt_num ) ) {
27 ::printf(
"\nERROR: No valid event identifier given.\n\n" );
33 if ( i + 1 < argc ) output = argv[i + 1];
37 if ( i + 1 < argc ) input = argv[i + 1];
45 if ( input.empty() ) {
46 ::printf(
"\nERROR: No input file(s) supplied\n\n" );
48 }
else if ( output.empty() ) {
49 ::printf(
"\nERROR: No output file supplied.\n\n" );
51 }
else if ( evt_num < 0 ) {
52 ::printf(
"\nERROR: No valid event identifier given.\n\n" );
55 gROOT->SetBatch( kTRUE );
57 if ( extract_event( input.c_str(), output.c_str(), evt_num ) != EXTRACT_SUCCESS ) {
58 ::printf(
"\nERROR: Event extraction from file %s failed.\n", input.c_str() );
63 ::printf(
"\nERROR: Event extraction from file %s failed [%s]\n", input.c_str(), e.
what() );
65 ::printf(
"\nERROR: Event extraction from file %s failed [unknown reason]\n", input.c_str() );
void usage(std::string argv0)
void toupper(std::string &s)