22 #include "marley/JSON.hh"
23 #include "marley/OutputFile.hh"
69 virtual operator bool()
const;
Object that parses MARLEY output files written in any of the available formats, except for ROOT forma...
Definition: EventFileReader.hh:34
marley::JSON json_event_array_
Used to parse events from JSON-format files.
Definition: EventFileReader.hh:86
virtual void initialize()
Prepares the file for reading the events.
Definition: EventFileReader.cc:109
virtual bool deduce_file_format()
Helper function that auto-detects which of the available output formats is appropriate for the reques...
Definition: EventFileReader.cc:37
EventFileReader & operator>>(marley::Event &ev)
Stream operator for reading in the next event.
Definition: EventFileReader.hh:61
bool initialized_
Flag that indicates whether initialize() has been called or not.
Definition: EventFileReader.hh:103
marley::JSON::JSONWrapper< std::deque< marley::JSON > > json_event_array_wrapper_
Used to iterate over events from JSON-format files.
Definition: EventFileReader.hh:89
double flux_avg_tot_xs_
Flux-averaged total cross section (MeV -2) used to produce the events in the file,...
Definition: EventFileReader.hh:97
void ensure_initialized()
This function should be called at the beginning of all public member functions of EventFileReader tha...
Definition: EventFileReader.cc:223
std::string file_name_
Name of the file (with any needed path specification) to be read.
Definition: EventFileReader.hh:75
double flux_averaged_xsec(bool natural_units=false)
Returns the flux-averaged total cross section used to produce the events in the file.
Definition: EventFileReader.cc:233
OutputFile::Format format_
Format of the output file being read.
Definition: EventFileReader.hh:80
std::ifstream in_
Input stream used to read from textual output formats.
Definition: EventFileReader.hh:83
std::deque< marley::JSON >::iterator json_event_iter_
Iterator to the next JSON event in json_event_array.
Definition: EventFileReader.hh:91
virtual bool next_event(marley::Event &ev)
Read the next MARLEY event record from the file.
Definition: EventFileReader.cc:160
Container for ingoing and outgoing momentum 4-vectors from a reaction.
Definition: Event.hh:66