10#include "HepMC3/ReaderFactory.h"
11#include "HepMC3TestUtils.h"
15 std::shared_ptr<Reader> inputA =
deduce_reader(
"inputReaderFactory1.hepmc");
16 if(inputA->failed())
return 1;
17 WriterAscii outputA(
"frominputReaderFactory1.hepmc");
18 if(outputA.failed())
return 2;
19 while( !inputA->failed() )
22 inputA->read_event(evt);
23 if( inputA->failed() ) {
24 printf(
"End of file reached. Exit.\n");
27 outputA.write_event(evt);
34 std::shared_ptr<Reader> inputB =
deduce_reader(
"frominputReaderFactory1.hepmc");
35 if(inputB->failed())
return 3;
37 if(outputB.failed())
return 4;
38 while( !inputB->failed() )
41 inputB->read_event(evt);
42 if( inputB->failed() ) {
43 printf(
"End of file reached. Exit.\n");
46 outputB.write_event(evt);
51 return COMPARE_ASCII_FILES(
"fromfrominputReaderFactory1.hepmc",
"inputReaderFactory1.hepmc");
Definition of class GenEvent.
Definition of class ReaderAsciiHepMC2.
Definition of class WriterAsciiHepMC2.
Definition of class WriterAscii.
Stores event-related information.
GenEvent I/O serialization for structured text files.
GenEvent I/O serialization for structured text files.
std::shared_ptr< Reader > deduce_reader(std::istream &stream)
This function will deduce the type of input stream based on its content and will return appropriate R...