10#include "HepMC3TestUtils.h"
15 if(inputA.failed())
return 1;
17 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 evt.set_run_info(std::make_shared<GenRunInfo>());
28 std::vector<std::string> w_names;
29 std::vector<double> w_values;
30 for (
size_t i=0; i<n+2; i++) {
31 w_names.push_back(std::string(
"testname")+std::to_string(i));
32 w_values.push_back(1.0+0.1*i);
34 evt.run_info()->add_attribute(
"testrunattribute",std::make_shared<IntAttribute>(10000+n));
36 evt.run_info()->set_weight_names(w_names);
38 evt.run_info()->set_weight_names(std::vector<std::string>());
39 evt.weights() = w_values;
40 outputA.set_run_info(
nullptr);
41 outputA.write_event(evt);
50 if(inputB.failed())
return 3;
52 if(outputB.failed())
return 4;
53 while( !inputB.failed() )
56 inputB.read_event(evt);
57 if( inputB.failed() ) {
58 printf(
"End of file reached. Exit.\n");
61 outputB.set_run_info(
nullptr);
62 outputB.write_event(evt);
67 return COMPARE_ASCII_FILES(
"fromfrominputIO7.hepmc",
"frominputIO7.hepmc");
Definition of class GenEvent.
Definition of class ReaderAsciiHepMC2.
Definition of class ReaderAscii.
Definition of class WriterAscii.
Stores event-related information.
Parser for HepMC2 I/O files.
GenEvent I/O parsing for structured text files.
GenEvent I/O serialization for structured text files.