HepMC3 event record library
ReaderGZ Class Reference

Detailed Description

GenEvent I/O parsing for structured text files compressed with gzip.

Examples
convert_example.cc.

Definition at line 34 of file ReaderGZ.h.

#include <ReaderGZ.h>

Inheritance diagram for ReaderGZ:
Collaboration diagram for ReaderGZ:

Public Member Functions

 ReaderGZ (const std::string &filename)
 Construcor.
bool read_event (GenEvent &evt)
 Read event.
bool failed ()
 State.
void close ()
 Close.
shared_ptr< GenRunInforun_info () const
 Get the global GenRunInfo object.

Protected Member Functions

void set_run_info (shared_ptr< GenRunInfo > run)
 Set the global GenRunInfo object.

Private Member Functions

std::shared_ptr< Readerdeduce_reader (std::istream &stream_test, std::istream &stream)
 THis function will deduce the type of input file based on the name/URL and it's content and will return appropriate Reader.

Private Attributes

igzstream m_gzstream
 Stream to read.
igzstream m_gzstream_test
 Stream to test.
std::shared_ptr< Readerm_reader
 Actual reader.
shared_ptr< GenRunInfom_run_info
 The global GenRunInfo object.

Constructor & Destructor Documentation

◆ ReaderGZ()

ReaderGZ ( const std::string & filename)
inline

Construcor.

Definition at line 37 of file ReaderGZ.h.

References magic_t::bytes, deduce_reader(), m_gzstream, m_gzstream_test, m_reader, and magic_t::number.

◆ ~ReaderGZ()

~ReaderGZ ( )
inline

Definition at line 57 of file ReaderGZ.h.

Member Function Documentation

◆ close()

void close ( )
inlinevirtual

Close.

Implements Reader.

Definition at line 67 of file ReaderGZ.h.

References m_reader.

◆ deduce_reader()

std::shared_ptr< Reader > deduce_reader ( std::istream & stream_test,
std::istream & stream )
inlineprivate

THis function will deduce the type of input file based on the name/URL and it's content and will return appropriate Reader.

Definition at line 75 of file ReaderGZ.h.

◆ failed()

bool failed ( )
inlinevirtual

State.

Implements Reader.

Definition at line 63 of file ReaderGZ.h.

References m_gzstream.

◆ read_event()

bool read_event ( GenEvent & evt)
inlinevirtual

Read event.

Implements Reader.

Definition at line 59 of file ReaderGZ.h.

References m_reader.

◆ run_info()

shared_ptr< GenRunInfo > run_info ( ) const
inlineinherited

Get the global GenRunInfo object.

Examples
LHEF_example_cat.cc, and convert_example.cc.

Definition at line 39 of file Reader.h.

References m_run_info.

◆ set_run_info()

void set_run_info ( shared_ptr< GenRunInfo > run)
inlineprotectedinherited

Set the global GenRunInfo object.

Definition at line 46 of file Reader.h.

References m_run_info.

Field Documentation

◆ m_gzstream

igzstream m_gzstream
private

Stream to read.

Definition at line 71 of file ReaderGZ.h.

◆ m_gzstream_test

igzstream m_gzstream_test
private

Stream to test.

Definition at line 72 of file ReaderGZ.h.

◆ m_reader

std::shared_ptr<Reader> m_reader
private

Actual reader.

Definition at line 73 of file ReaderGZ.h.

◆ m_run_info

shared_ptr<GenRunInfo> m_run_info
privateinherited

The global GenRunInfo object.

Definition at line 53 of file Reader.h.


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