13 int main(
int argc,
char** argv)
16 vector<stdhep_entry> new_event;
21 while ((c = getopt(argc,argv,
"hi:")) != -1)
25 printf(
"-h: print this help\n");
26 printf(
"-i: PDG ID of mother\n");
33 printf(
"Invalid option or missing option argument; -h to list options\n");
41 printf(
"<input stdhep filename> <output stdhep filename>\n");
49 n_events =
open_read(argv[optind], istream);
63 for (
int j = 0; j < 2; j++) temp->
jmohep[j] = 0;
64 for (
int j = 0; j < 2; j++) temp->
jdahep[j] = 0;
65 for (
int j = 0; j < 5; j++) temp->
phep[j] = 0.0;
68 for (
int j = 0; j < 4; j++) temp->
vhep[j] = 0.0;
69 new_event.push_back(*temp);
73 for (
int i = 1; i < new_event.size(); i++) {
74 if (new_event[i].
jmohep[0] == 0 && new_event[i].
jmohep[1] == 0) {
75 new_event[i].jmohep[0] = 1;
76 new_event[i].jmohep[1] = 1;
77 if (new_event[0].
jdahep[0] == 0) new_event[0].jdahep[0] = i+1;
78 new_event[0].jdahep[1] = i+1;
int main(int argc, char **argv)
void open_write(char *filename, int ostream, int n_events)
int open_read(char *filename, int istream, int n_events)
void write_stdhep(vector< stdhep_entry > *new_event, int nevhep)
int read_stdhep(vector< stdhep_entry > *new_event)
bool read_next(int istream)
void close_read(int istream)
void write_file(int ostream)
void close_write(int ostream)