HepMC3 event record library: WriterHEPEVTZEUS Class Reference

HepMC3 event record library

Public Member Functions | Protected Attributes | Private Attributes
WriterHEPEVTZEUS Class Reference

## Detailed Description

GenEvent I/O output to files readable by ZEUS software.

Definition at line 23 of file WriterHEPEVTZEUS.h.

`#include <WriterHEPEVTZEUS.h>`

Inheritance diagram for WriterHEPEVTZEUS:
[legend]
Collaboration diagram for WriterHEPEVTZEUS:
[legend]

## Public Member Functions
| WriterHEPEVTZEUS (const std::string &filename)
| Constructor.
void | write_hepevt_event_header () override
| Write the header.
void | write_hepevt_particle (int index, bool iflong=true) override
| Write particles.
void | write_event (const GenEvent &evt) override
| Write event to file.
void | close () override
| Close file stream.
bool | failed () override
| Get stream error state flag.
void | set_vertices_positions_present (bool iflong)
| set flag if vertex positions are available. Effectively this adds or removes key "vertices_positions_are_absent" to/from the m_options.
bool | get_vertices_positions_present () const
| get flag if vertex positions are available. The flag is deduced from m_options. If the m_options have the key "vertices_positions_are_absent" the result if false. True otherwise.
virtual void | set_run_info (std::shared_ptr< GenRunInfo > run)
| Set the global GenRunInfo object.
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 std::map< std::string, std::string > | get_options () const
| Set options.

## Protected Attributes
std::ofstream | m_file
| Output file.
std::shared_ptr< std::ostream > | m_shared_stream
| Output temp. stream.
std::ostream * | m_stream
| Output stream.
char * | hepevtbuffer = nullptr
| Pointer to HEPEVT Fortran common block/C struct.
int | m_events_count = 0
| Events count. Needed to generate unique object name.
HEPEVT_Wrapper_Template< 100000 > | m_hepevt_interface
| Templated HEPEVT interface.
std::map< std::string, std::string > | m_options
| options

## Private Attributes
std::shared_ptr< GenRunInfo > | m_run_info
| The global GenRunInfo object.

## Constructor & Destructor Documentation

## ◆ WriterHEPEVTZEUS()

WriterHEPEVTZEUS | ( | const std::string & | filename | ) |

Constructor.

Definition at line 11 of file WriterHEPEVTZEUS.cc.

References WriterHEPEVT::WriterHEPEVT().

## Member Function Documentation

## ◆ close()

void close | ( |  | ) |
| overridevirtualinherited

Close file stream.

Implements Writer.

Definition at line 81 of file WriterHEPEVT.cc.

References m_stream.

## ◆ failed()

bool failed | ( |  | ) |
| overridevirtualinherited

Get stream error state flag.

Implements Writer.

Definition at line 88 of file WriterHEPEVT.cc.

References m_file.

## ◆ get_options()

virtual std::map< std::string, std::string > get_options | ( |  | ) | const
| inlinevirtualinherited

Set options.

Reimplemented in WriterPlugin.

Definition at line 54 of file Writer.h.

References m_options.

## ◆ get_vertices_positions_present()

bool get_vertices_positions_present | ( |  | ) | const
| inherited

get flag if vertex positions are available. The flag is deduced from m_options. If the m_options have the key "vertices_positions_are_absent" the result if false. True otherwise.

Definition at line 95 of file WriterHEPEVT.cc.

References Writer::m_options.

## ◆ run_info()

virtual std::shared_ptr< GenRunInfo > run_info | ( |  | ) | const
| inlinevirtualinherited

Get the global GenRunInfo object.

Reimplemented in WriterGZ< T, C >, and WriterPlugin.

Definition at line 45 of file Writer.h.

References m_run_info.

## ◆ set_options()

virtual void set_options | ( | const std::map< std::string, std::string > & | options | ) |
| inlinevirtualinherited

Set options.

Reimplemented in WriterPlugin.

Definition at line 52 of file Writer.h.

References m_options.

## ◆ set_run_info()

virtual void set_run_info | ( | std::shared_ptr< GenRunInfo > | run | ) |
| inlinevirtualinherited

Set the global GenRunInfo object.

Reimplemented in WriterGZ< T, C >, and WriterPlugin.

Definition at line 42 of file Writer.h.

References m_run_info.

## ◆ set_vertices_positions_present()

void set_vertices_positions_present | ( | bool | iflong | ) |
| inherited

set flag if vertex positions are available. Effectively this adds or removes key "vertices_positions_are_absent" to/from the m_options.

Definition at line 93 of file WriterHEPEVT.cc.

References Writer::m_options.

## ◆ write_event()

void write_event | ( | const GenEvent & | evt | ) |
| overridevirtualinherited

Write event to file.

Parameters

  [in] | evt | Event to be serialized

Implements Writer.

Definition at line 72 of file WriterHEPEVT.cc.

References get_vertices_positions_present(), m_events_count, m_hepevt_interface, write_hepevt_event_header(), and write_hepevt_particle().

## ◆ write_hepevt_event_header()

void write_hepevt_event_header | ( |  | ) |
| overridevirtual

Write the header.

Reimplemented from WriterHEPEVT.

Definition at line 12 of file WriterHEPEVTZEUS.cc.

References WriterHEPEVT::m_hepevt_interface, and WriterHEPEVT::m_stream.

## ◆ write_hepevt_particle()

void write_hepevt_particle | ( | int | index,
|  | bool | iflong = true )
| overridevirtual

Write particles.

Reimplemented from WriterHEPEVT.

Definition at line 19 of file WriterHEPEVTZEUS.cc.

References WriterHEPEVT::m_hepevt_interface, and WriterHEPEVT::m_stream.

## Field Documentation

## ◆ hepevtbuffer

char* hepevtbuffer = nullptr
| protectedinherited

Pointer to HEPEVT Fortran common block/C struct.

Definition at line 87 of file WriterHEPEVT.h.

## ◆ m_events_count

int m_events_count = 0
| protectedinherited

Events count. Needed to generate unique object name.

Definition at line 88 of file WriterHEPEVT.h.

## ◆ m_file

std::ofstream m_file
| protectedinherited

Output file.

Definition at line 84 of file WriterHEPEVT.h.

## ◆ m_hepevt_interface

HEPEVT_Wrapper_Template<100000> m_hepevt_interface
| protectedinherited

Templated HEPEVT interface.

Definition at line 89 of file WriterHEPEVT.h.

## ◆ m_options

std::map<std::string, std::string> m_options
| protectedinherited

options

Definition at line 59 of file Writer.h.

## ◆ m_run_info

std::shared_ptr<GenRunInfo> m_run_info
| privateinherited

The global GenRunInfo object.

Definition at line 64 of file Writer.h.

## ◆ m_shared_stream

std::shared_ptr<std::ostream> m_shared_stream
| protectedinherited

Output temp. stream.

Definition at line 85 of file WriterHEPEVT.h.

## ◆ m_stream

std::ostream* m_stream
| protectedinherited

Output stream.

Definition at line 86 of file WriterHEPEVT.h.

The documentation for this class was generated from the following files:

- WriterHEPEVTZEUS.h
- WriterHEPEVTZEUS.cc