18#include "HepMC3/GenEvent.h"
21#include "cmd_helpers.hh"
22#include "marley/Error.hh"
23#include "marley/EventFileReader.hh"
24#include "marley/hepmc3_utils.hh"
27 const std::vector< std::string >& input_files,
29 double,
const std::shared_ptr< HepMC3::GenRunInfo >& ) > callback )
31 std::shared_ptr< HepMC3::GenRunInfo > first_run_info;
32 double flux_avg_xsec = 0.;
33 bool first_event =
true;
34 bool first_file =
true;
36 for (
const auto& input_file : input_files ) {
39 while ( reader >> ev ) {
40 if ( !first_run_info ) {
42 flux_avg_xsec = reader.flux_averaged_xsec(
true );
44 else if ( !first_file ) {
45 std::string issue = marley_hepmc3::check_run_info_compatibility(
47 if ( !issue.empty() ) {
49 +
"' has incompatible run information: " + issue );
53 callback( ev, first_event, flux_avg_xsec, first_run_info );
Stores event-related information.
std::shared_ptr< GenRunInfo > run_info() const
Get a pointer to the the GenRunInfo object.
Base class for all exceptions thrown by MARLEY functions.
Object that parses MARLEY output files.