13 #include "HepMC/GenEvent.h" 14 #include "HepMC/ReaderAscii.h" 16 #include "HepMC/Print.h" 20 using namespace HepMC;
25 int main(
int argc,
char **argv) {
28 cout <<
"Usage: " << argv[0] <<
" <input_hepmc3_file> <output_root_file>" << endl;
35 int events_parsed = 0;
37 while( !text_input.failed() ) {
41 text_input.read_event(evt);
43 if( text_input.failed() )
break;
45 if( events_parsed == 0 ) {
46 cout <<
"First event: " << endl;
50 root_output.write_event(evt);
53 if( events_parsed%1000 == 0 ) {
54 cout <<
"Event: " << events_parsed << endl;
61 std::cout <<
"Events parsed and written: " << events_parsed << std::endl;
static void listing(const GenEvent &event, unsigned short precision=2)
Print event in listing (HepMC2) format.
Definition of class WriterRootTree.
Stores event-related information.
GenEvent I/O serialization for root files based on root TTree.
int main(int argc, char **argv)
Definition of template class SmartPointer.
GenEvent I/O parsing for structured text files.