#include "merge/extractEvt.C"
#include <stdexcept>
#include <cstdlib>
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 17 of file extractEvt.cpp.
22 if ( *
argv[
i] ==
'-' ) {
25 if ( 1 != ::sscanf(
argv[
i+1],
"%d",&evt_num) ) {
26 ::printf(
"\nERROR: No valid event identifier given.\n\n");
32 if (
i+1 < argc ) output =
argv[
i+1];
36 if (
i+1 < argc ) input =
argv[
i+1];
44 if ( input.empty() ) {
45 ::printf(
"\nERROR: No input file(s) supplied\n\n");
48 else if ( output.empty() ) {
49 ::printf(
"\nERROR: No output file supplied.\n\n");
52 else if ( evt_num < 0 ) {
53 ::printf(
"\nERROR: No valid event identifier given.\n\n");
56 gROOT->SetBatch(kTRUE);
58 if ( extract_event(input.c_str(),output.c_str(),evt_num) != EXTRACT_SUCCESS ) {
59 ::printf(
"\nERROR: Event extraction from file %s failed.\n",input.c_str());
64 catch (
const std::exception& e) {
65 ::printf(
"\nERROR: Event extraction from file %s failed [%s]\n",input.c_str(),e.what());
68 ::printf(
"\nERROR: Event extraction from file %s failed [unknown reason]\n",input.c_str());
void usage(std::string argv0)
void toupper(std::string &s)