HepMC3 event record library
|
GenEvent I/O output to dot files that should be processed by graphviz or other software. More...
#include <WriterDOT.h>
Public Member Functions | |
WriterDOT (const std::string &filename, std::shared_ptr< GenRunInfo > run=std::shared_ptr< GenRunInfo >()) | |
Constructor. More... | |
WriterDOT (std::ostream &stream, std::shared_ptr< GenRunInfo > run=std::shared_ptr< GenRunInfo >()) | |
Constructor from ostream. More... | |
void | write_event (const GenEvent &evt) |
Write event to file. More... | |
bool | failed () |
Return status of the stream. More... | |
void | close () |
Close file stream. More... | |
void | set_style (const int &istyle) |
Close file stream. More... | |
void | set_run_info (std::shared_ptr< GenRunInfo > run) |
Set the global GenRunInfo object. More... | |
std::shared_ptr< GenRunInfo > | run_info () const |
Get the global GenRunInfo object. More... | |
void | set_options (const std::map< std::string, std::string > &options) |
Set options. More... | |
std::map< std::string, std::string > | get_options () const |
Set options. More... | |
Protected Attributes | |
std::map< std::string, std::string > | m_options |
options More... | |
Private Member Functions | |
void | allocate_buffer () |
allocates buffer for output More... | |
void | flush () |
flushes output buffer More... | |
void | forced_flush () |
flushes output buffer More... | |
Private Attributes | |
std::ofstream | m_file |
Output file. More... | |
std::ostream * | m_stream |
Output stream. More... | |
int | m_style |
style of dot file More... | |
char * | m_buffer |
Stream buffer. More... | |
char * | m_cursor |
Cursor inside stream buffer. More... | |
unsigned long | m_buffer_size |
Buffer size. More... | |
GenEvent I/O output to dot files that should be processed by graphviz or other software.
Definition at line 21 of file WriterDOT.h.
WriterDOT | ( | const std::string & | filename, |
std::shared_ptr< GenRunInfo > | run = std::shared_ptr<GenRunInfo>() |
||
) |
Constructor.
Definition at line 4 of file WriterDOT.cc.
References HEPMC3_ERROR, and WriterDOT::m_file.
WriterDOT | ( | std::ostream & | stream, |
std::shared_ptr< GenRunInfo > | run = std:: shared_ptr<GenRunInfo>() |
||
) |
Constructor from ostream.
Definition at line 16 of file WriterDOT.cc.
|
private |
allocates buffer for output
Definition at line 100 of file WriterDOT.cc.
References HEPMC3_ERROR, HEPMC3_WARNING, WriterDOT::m_buffer, WriterDOT::m_buffer_size, and WriterDOT::m_cursor.
|
virtual |
Close file stream.
Implements Writer.
Definition at line 26 of file WriterDOT.cc.
References WriterDOT::forced_flush(), and WriterDOT::m_stream.
|
inlinevirtual |
Return status of the stream.
Implements Writer.
Definition at line 34 of file WriterDOT.h.
References WriterDOT::m_file.
|
inlineprivate |
flushes output buffer
Definition at line 118 of file WriterDOT.cc.
References WriterDOT::m_buffer, WriterDOT::m_buffer_size, WriterDOT::m_cursor, and WriterDOT::m_stream.
|
inlineprivate |
flushes output buffer
Definition at line 129 of file WriterDOT.cc.
References WriterDOT::m_buffer, WriterDOT::m_cursor, and WriterDOT::m_stream.
|
inlineinherited |
|
inlineinherited |
Get the global GenRunInfo object.
Definition at line 47 of file Writer.h.
References Writer::m_run_info.
|
inlineinherited |
|
inlineinherited |
Set the global GenRunInfo object.
Definition at line 42 of file Writer.h.
References Writer::m_run_info.
|
inline |
|
virtual |
Write event to file.
[in] | evt | Event to be serialized |
Implements Writer.
Definition at line 46 of file WriterDOT.cc.
References HepMC3::abs(), WriterDOT::allocate_buffer(), GenEvent::beams(), GenEvent::event_number(), WriterDOT::flush(), WriterDOT::forced_flush(), HepMC3::is_parton(), WriterDOT::m_buffer, WriterDOT::m_cursor, WriterDOT::m_style, GenEvent::particles(), and GenEvent::vertices().
|
private |
Stream buffer.
Definition at line 51 of file WriterDOT.h.
|
private |
Buffer size.
Definition at line 53 of file WriterDOT.h.
|
private |
Cursor inside stream buffer.
Definition at line 52 of file WriterDOT.h.
|
private |
Output file.
Definition at line 48 of file WriterDOT.h.
|
protectedinherited |
|
private |
Output stream.
Definition at line 49 of file WriterDOT.h.
|
private |
style of dot file
Definition at line 50 of file WriterDOT.h.