MARLEY (Model of Argon Reaction Low Energy Yields)
v1.2.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
|
Object that parses MARLEY output files written in any of the available formats, including ROOT format. More...
#include <RootEventFileReader.hh>
Public Member Functions | |
RootEventFileReader (const std::string &file_name) | |
virtual bool | next_event (marley::Event &ev) override |
Read the next MARLEY event record from the file. More... | |
virtual | operator bool () const override |
Implicit boolean conversion allows the state of the input stream (or ROOT file) to be tested for readiness to read in another event. | |
![]() | |
EventFileReader (const std::string &file_name) | |
double | flux_averaged_xsec (bool natural_units=false) |
Returns the flux-averaged total cross section used to produce the events in the file. More... | |
EventFileReader & | operator>> (marley::Event &ev) |
Stream operator for reading in the next event. | |
Protected Member Functions | |
virtual bool | deduce_file_format () override |
Helper function that auto-detects which of the available output formats is appropriate for the requested file. | |
virtual void | initialize () override |
Prepares the file for reading the events. | |
![]() | |
void | ensure_initialized () |
This function should be called at the beginning of all public member functions of EventFileReader that interact with data in the file. More... | |
Protected Attributes | |
std::unique_ptr< marley::Event > | event_ |
Temporary storage for reading events in from a TFile. | |
long | event_num_ = -1 |
The index of the last TTree entry that was read. More... | |
marley::Event * | event_ptr_ |
Bare pointer used to interface the event_ data member with a branch of ttree_ without requiring a manual delete statement anywhere. | |
std::unique_ptr< TFile > | tfile_ |
TFile used to read ROOT format output files. | |
TTree * | ttree_ |
![]() | |
std::string | file_name_ |
Name of the file (with any needed path specification) to be read. | |
double | flux_avg_tot_xs_ = 0. |
Flux-averaged total cross section (MeV -2) used to produce the events in the file, or zero if that information is not included in a particular format. | |
OutputFile::Format | format_ |
Format of the output file being read. More... | |
std::ifstream | in_ |
Input stream used to read from textual output formats. | |
bool | initialized_ = false |
Flag that indicates whether initialize() has been called or not. More... | |
marley::JSON | json_event_array_ |
Used to parse events from JSON-format files. | |
marley::JSON::JSONWrapper< std::deque< marley::JSON > > | json_event_array_wrapper_ |
Used to iterate over events from JSON-format files. | |
std::deque< marley::JSON >::iterator | json_event_iter_ |
Iterator to the next JSON event in json_event_array. | |
Object that parses MARLEY output files written in any of the available formats, including ROOT format.
|
overridevirtual |
Read the next MARLEY event record from the file.
[out] | ev | Reference to the object that will be filled with the next event record |
Reimplemented from marley::EventFileReader.
|
protected |
The index of the last TTree entry that was read.
If no events have been read from the TTree yet, then this variable will have the value -1