20 using namespace HepMC3;
23 int main(
int argc,
char **argv) {
26 std::cout <<
"Usage: " << argv[0] <<
" <input_hepmc3_file> <output_root_file>" << std::endl;
33 int events_parsed = 0;
35 while( !text_input.
failed() ) {
41 if( text_input.
failed() )
break;
43 if( events_parsed == 0 ) {
44 std::cout <<
"First event: " << std::endl;
51 if( events_parsed%1000 == 0 ) {
52 std::cout <<
"Event: " << events_parsed << std::endl;
59 std::cout <<
"Events parsed and written: " << events_parsed << std::endl;
GenEvent I/O parsing for structured text files.
bool read_event(GenEvent &evt) override
Load event from file.
Definition of class WriterRootTree.
static void listing(std::ostream &os, const GenEvent &event, unsigned short precision=2)
Print event in listing (HepMC2) format.
void write_event(const GenEvent &evt) override
Write event to file.
Stores event-related information.
bool failed() override
Return status of the stream.
GenEvent I/O serialization for root files based on root TTree.
Definition of class ReaderAscii.
void close() override
Close file stream.
Definition of static class Print.
int main(int argc, char **argv)
Definition of class GenEvent.
void close() override
Close file stream.