|
MARLEY (Model of Argon Reaction Low Energy Yields) v2.0.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
|
GenEvent I/O serialization for structured text files. More...
#include <WriterAscii.h>
Public Member Functions | |
| WriterAscii (const std::string &filename, std::shared_ptr< GenRunInfo > run=std::shared_ptr< GenRunInfo >()) | |
| Constructor. | |
| WriterAscii (std::ostream &stream, std::shared_ptr< GenRunInfo > run=std::shared_ptr< GenRunInfo >()) | |
| Constructor from ostream. | |
| WriterAscii (std::shared_ptr< std::ostream > s_stream, std::shared_ptr< GenRunInfo > run=std::shared_ptr< GenRunInfo >()) | |
| Constructor from temp ostream. | |
| ~WriterAscii () | |
| Destructor. | |
| void | close () override |
| Close file stream. | |
| bool | failed () override |
| Return status of the stream. | |
| int | precision () const |
| Return output precision. | |
| void | set_precision (const int &prec) |
| Set output precision. | |
| void | write_event (const GenEvent &evt) override |
| Write event to file. | |
| void | write_run_info () |
| Write the GenRunInfo object to file. | |
Public Member Functions inherited from HepMC3::Writer | |
| Writer () | |
| Constructor. | |
| Writer (const Writer &)=delete | |
| deleted copy constructor | |
| virtual | ~Writer () |
| Virtual destructor. | |
| virtual std::map< std::string, std::string > | get_options () const |
| Set options. | |
| Writer & | operator= (const Writer &)=delete |
| deleted copy assignment operator | |
| virtual std::shared_ptr< GenRunInfo > | run_info () const |
| Get the global GenRunInfo object. | |
| virtual void | set_options (const std::map< std::string, std::string > &options) |
| Set options. | |
| virtual void | set_run_info (std::shared_ptr< GenRunInfo > run) |
| Set the global GenRunInfo object. | |
Additional Inherited Members | |
Protected Attributes inherited from HepMC3::Writer | |
| std::map< std::string, std::string > | m_options |
| options | |
GenEvent I/O serialization for structured text files.
Definition at line 25 of file WriterAscii.h.
| HepMC3::WriterAscii::WriterAscii | ( | const std::string & | filename, |
| std::shared_ptr< GenRunInfo > | run = std::shared_ptr<GenRunInfo>() ) |
Constructor.
Definition at line 1762 of file marley_hepmc3.cc.
References HepMC3::Writer::run_info(), HepMC3::Writer::set_run_info(), and write_run_info().
| HepMC3::WriterAscii::WriterAscii | ( | std::ostream & | stream, |
| std::shared_ptr< GenRunInfo > | run = std::shared_ptr<GenRunInfo>() ) |
Constructor from ostream.
Definition at line 1786 of file marley_hepmc3.cc.
References HepMC3::Writer::run_info(), HepMC3::Writer::set_run_info(), and write_run_info().
| HepMC3::WriterAscii::WriterAscii | ( | std::shared_ptr< std::ostream > | s_stream, |
| std::shared_ptr< GenRunInfo > | run = std::shared_ptr<GenRunInfo>() ) |
Constructor from temp ostream.
Definition at line 1804 of file marley_hepmc3.cc.
References HepMC3::Writer::run_info(), HepMC3::Writer::set_run_info(), and write_run_info().
| HepMC3::WriterAscii::~WriterAscii | ( | ) |
Destructor.
Definition at line 1823 of file marley_hepmc3.cc.
References close().
|
overridevirtual |
Close file stream.
Implements HepMC3::Writer.
Definition at line 2085 of file marley_hepmc3.cc.
Referenced by ~WriterAscii().
|
overridevirtual |
Return status of the stream.
Implements HepMC3::Writer.
Definition at line 2095 of file marley_hepmc3.cc.
| int HepMC3::WriterAscii::precision | ( | ) | const |
Return output precision.
Definition at line 2102 of file marley_hepmc3.cc.
| void HepMC3::WriterAscii::set_precision | ( | const int & | prec | ) |
Set output precision.
So far available range is [2,24]. Default is 16.
Definition at line 2097 of file marley_hepmc3.cc.
|
overridevirtual |
Write event to file.
| [in] | evt | Event to be serialized |
Implements HepMC3::Writer.
Definition at line 1829 of file marley_hepmc3.cc.
References HepMC3::GenEvent::attributes(), HepMC3::GenEvent::event_number(), HepMC3::GenEvent::event_pos(), HepMC3::FourVector::is_zero(), HepMC3::GenEvent::length_unit(), HepMC3::Writer::m_options, HepMC3::GenEvent::momentum_unit(), HepMC3::Units::name(), HepMC3::GenEvent::particles(), HepMC3::GenEvent::run_info(), HepMC3::Writer::run_info(), HepMC3::Writer::set_run_info(), HepMC3::FourVector::t(), HepMC3::GenEvent::vertices(), HepMC3::GenEvent::weights(), write_run_info(), HepMC3::FourVector::x(), HepMC3::FourVector::y(), and HepMC3::FourVector::z().
| void HepMC3::WriterAscii::write_run_info | ( | ) |
Write the GenRunInfo object to file.
Definition at line 2020 of file marley_hepmc3.cc.
References HepMC3::Writer::run_info(), and HepMC3::Writer::set_run_info().
Referenced by WriterAscii(), WriterAscii(), WriterAscii(), and write_event().