13 #include "HepMC/GenEvent.h" 14 #include "HepMC/WriterAscii.h" 16 #include "HepMC/Print.h" 20 using namespace HepMC;
25 int main(
int argc,
char **argv) {
28 cout <<
"Usage: " << argv[0] <<
" <input_root_file> <output_hepmc3_file>" << endl;
35 int events_parsed = 0;
37 while( !root_input.
failed() ) {
43 if( root_input.
failed() )
break;
45 if( events_parsed == 0 ) {
46 cout <<
"First event: " << endl;
53 if( events_parsed%1000 == 0 ) {
54 cout <<
"Event: " << events_parsed << endl;
61 std::cout <<
"Events parsed and written: " << events_parsed << std::endl;
void close()
Close file stream.
void write_event(const GenEvent &evt)
Write event to file.
bool failed()
Get stream error state.
static void listing(const GenEvent &event, unsigned short precision=2)
Print event in listing (HepMC2) format.
GenEvent I/O parsing and serialization for root files.
Definition of class ReaderRoot.
Stores event-related information.
GenEvent I/O serialization for structured text files.
bool read_event(GenEvent &evt)
Read event from file.
void close()
Close file stream.
int main(int argc, char **argv)
Definition of template class SmartPointer.