HepMC3 event record library
Public Member Functions | Data Fields | Private Attributes
WriterHEPEVT Class Reference

Detailed Description

GenEvent I/O serialization for HEPEVT files.

Examples:
convert_example.cc.

Definition at line 27 of file WriterHEPEVT.h.

#include <WriterHEPEVT.h>

+ Inheritance diagram for WriterHEPEVT:
+ Collaboration diagram for WriterHEPEVT:

Public Member Functions

 WriterHEPEVT (const std::string &filename)
 Default constructor. More...
 
virtual void write_hepevt_particle (int index, bool iflong=true)
 Write particle to file. More...
 
virtual void write_hepevt_event_header ()
 Write event header to file. More...
 
void write_event (const GenEvent &evt)
 Write event to file. More...
 
void close ()
 Close file stream. More...
 
bool failed ()
 Get stream error state flag. More...
 
void set_run_info (shared_ptr< GenRunInfo > run)
 Set the global GenRunInfo object. More...
 
shared_ptr< GenRunInforun_info () const
 Get the global GenRunInfo object. More...
 

Data Fields

FILE * m_file
 File to write. Need to be public to be accessible by children. More...
 

Private Attributes

char * hepevtbuffer
 Pointer to HEPEVT Fortran common block/C struct. More...
 
int m_events_count
 Events count. Needed to generate unique object name. More...
 

Constructor & Destructor Documentation

◆ WriterHEPEVT()

WriterHEPEVT ( const std::string &  filename)

Default constructor.

Warning
If file exists, it will be overwritten

Definition at line 19 of file WriterHEPEVT.cc.

References WriterHEPEVT::hepevtbuffer, WriterHEPEVT::m_file, and HEPEVT_Wrapper::set_hepevt_address().

Member Function Documentation

◆ close()

void close ( )
virtual

Close file stream.

Implements Writer.

Definition at line 57 of file WriterHEPEVT.cc.

References WriterHEPEVT::m_file.

◆ failed()

bool failed ( )
virtual

Get stream error state flag.

Implements Writer.

Definition at line 62 of file WriterHEPEVT.cc.

◆ run_info()

shared_ptr<GenRunInfo> run_info ( ) const
inlineinherited

Get the global GenRunInfo object.

Definition at line 42 of file Writer.h.

References Writer::m_run_info.

◆ set_run_info()

void set_run_info ( shared_ptr< GenRunInfo run)
inlineinherited

Set the global GenRunInfo object.

Definition at line 37 of file Writer.h.

References Writer::m_run_info.

◆ write_event()

void write_event ( const GenEvent evt)
virtual

◆ write_hepevt_event_header()

void write_hepevt_event_header ( )
virtual

Write event header to file.

Reimplemented in WriterHEPEVTZEUS.

Definition at line 43 of file WriterHEPEVT.cc.

References HEPEVT_Wrapper::event_number(), WriterHEPEVT::m_file, and HEPEVT_Wrapper::number_entries().

◆ write_hepevt_particle()

void write_hepevt_particle ( int  index,
bool  iflong = true 
)
virtual

Field Documentation

◆ hepevtbuffer

char* hepevtbuffer
private

Pointer to HEPEVT Fortran common block/C struct.

Definition at line 70 of file WriterHEPEVT.h.

◆ m_events_count

int m_events_count
private

Events count. Needed to generate unique object name.

Definition at line 71 of file WriterHEPEVT.h.

◆ m_file

FILE* m_file

File to write. Need to be public to be accessible by children.

Definition at line 67 of file WriterHEPEVT.h.


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