Example of use of HepMC2 adapter.
Example of use of HepMC2 adapterConverts selected HepMC2 file to HepMC3 file
#include <iostream>
#include <cstdlib>
int main(
int argc,
char **argv) {
if( argc < 3 ) {
cout<<"Usage: " << argv[0] <<" <input_hepmc2_file> <output_hepmc3_file> [<optional_events_limit>]" << endl;
exit(-1);
}
int events_parsed = 0;
int events_limit = 0;
if( argc >= 4 ) events_limit = atoi(argv[3]);
if(events_parsed==0) {
cout << " First event: " << endl;
Print::listing(evt);
}
++events_parsed;
if( events_parsed%100 == 0 ) cout<<"Events parsed: "<<events_parsed<<endl;
if( events_limit && events_parsed >= events_limit ) break;
}
return 0;
}
Definition of class GenEvent.
Definition of static class Print.
Definition of class ReaderAsciiHepMC2.
Definition of class WriterAscii.
Stores event-related information.
Parser for HepMC2 I/O files.
bool read_event(GenEvent &evt)
Implementation of Reader::read_event.
void close()
Close file stream.
bool failed()
Return status of the stream.
GenEvent I/O serialization for structured text files.
void close()
Close file stream.
void write_event(const GenEvent &evt)
Write event to file.
int main(int argc, char **argv)