10 #include "HepMC3/ReaderFactory.h"
11 #include "HepMC3TestUtils.h"
12 using namespace HepMC3;
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");
GenEvent I/O serialization for structured text files.
Definition of class WriterAscii.
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...
Definition of class ReaderAsciiHepMC2.
Stores event-related information.
Definition of class WriterAsciiHepMC2.
int main(int argc, char **argv)
Definition of class GenEvent.
GenEvent I/O serialization for structured text files.