HepMC3 event record library
ReaderLHEF Class Reference

Detailed Description

GenEvent I/O parsing and serialization for LHEF files.

Definition at line 34 of file ReaderLHEF.h.

#include <ReaderLHEF.h>

+ Inheritance diagram for ReaderLHEF:
+ Collaboration diagram for ReaderLHEF:

Public Member Functions

 ReaderLHEF (std::istream &)
 The ctor to read from stream.
 
 ReaderLHEF (const std::string &filename)
 Constructor.
 
 ReaderLHEF (std::shared_ptr< std::istream > s_stream)
 The ctor to read from temp stream.
 
bool skip (const int) override
 skip events
 
bool read_event (GenEvent &ev) override
 Reading event.
 
void close () override
 Close.
 
bool failed () override
 State.
 
 ~ReaderLHEF ()
 Destructor.
 
virtual std::shared_ptr< GenRunInforun_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
 Get options.
 
virtual void set_run_info (std::shared_ptr< GenRunInfo > run)
 Set the global GenRunInfo object.
 

Protected Attributes

std::map< std::string, std::string > m_options
 Options.
 

Private Member Functions

void init ()
 Init helper.
 

Private Attributes

std::shared_ptr< std::istream > m_shared_stream
 Holds temporary stream.
 
std::shared_ptr< LHEF::Readerm_reader
 The actual reader.
 
std::shared_ptr< HEPRUPAttributem_hepr
 Holder of attributes.
 
int m_neve = 0
 Event counter.
 
bool m_failed = false
 State of reader.
 
std::deque< GenEventm_storage
 storage used for subevents.
 
std::shared_ptr< GenRunInfom_run_info
 The global GenRunInfo object.
 

Constructor & Destructor Documentation

◆ ReaderLHEF() [1/3]

ReaderLHEF ( std::istream & stream)

The ctor to read from stream.

Definition at line 19 of file ReaderLHEF.cc.

References init(), and m_reader.

◆ ReaderLHEF() [2/3]

ReaderLHEF ( const std::string & filename)

Constructor.

Definition at line 14 of file ReaderLHEF.cc.

References init(), and m_reader.

◆ ReaderLHEF() [3/3]

ReaderLHEF ( std::shared_ptr< std::istream > s_stream)

The ctor to read from temp stream.

Definition at line 25 of file ReaderLHEF.cc.

References init(), m_reader, and m_shared_stream.

◆ ~ReaderLHEF()

~ReaderLHEF ( )

Destructor.

Definition at line 124 of file ReaderLHEF.cc.

References close().

Member Function Documentation

◆ close()

void close ( )
overridevirtual

Close.

Close file stream.

Implements Reader.

Definition at line 250 of file ReaderLHEF.cc.

◆ failed()

bool failed ( )
overridevirtual

State.

Return status of the stream.

Implements Reader.

Definition at line 247 of file ReaderLHEF.cc.

References m_reader, and m_storage.

◆ get_options()

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

Get options.

Reimplemented in ReaderPlugin.

Definition at line 53 of file Reader.h.

References m_options.

◆ init()

◆ read_event()

bool read_event ( GenEvent & ev)
overridevirtual

Reading event.

Cross-section

In this order the number of cross-sections will match the number of weights

PDF info

Implements Reader.

Definition at line 126 of file ReaderLHEF.cc.

References GenEvent::add_attribute(), GenEvent::add_vertex(), XMLTag::findXMLTags(), m_hepr, m_neve, m_reader, m_storage, GenEvent::set_beam_particles(), GenEvent::set_event_number(), and GenEvent::weights().

◆ run_info()

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

Get the global GenRunInfo object.

Reimplemented in ReaderPlugin.

Examples
LHEF_example_cat.cc.

Definition at line 44 of file Reader.h.

References m_run_info.

◆ set_options()

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

Set options.

Reimplemented in ReaderPlugin.

Definition at line 51 of file Reader.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 ReaderPlugin.

Definition at line 56 of file Reader.h.

References m_run_info.

◆ skip()

bool skip ( const int n)
overridevirtual

skip events

Reimplemented from Reader.

Definition at line 32 of file ReaderLHEF.cc.

References GenEvent::clear(), failed(), and read_event().

Field Documentation

◆ m_failed

bool m_failed = false
private

State of reader.

Definition at line 59 of file ReaderLHEF.h.

◆ m_hepr

std::shared_ptr<HEPRUPAttribute> m_hepr
private

Holder of attributes.

Definition at line 57 of file ReaderLHEF.h.

◆ m_neve

int m_neve = 0
private

Event counter.

Definition at line 58 of file ReaderLHEF.h.

◆ m_options

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

Options.

Definition at line 60 of file Reader.h.

◆ m_reader

std::shared_ptr<LHEF::Reader> m_reader
private

The actual reader.

Definition at line 56 of file ReaderLHEF.h.

◆ m_run_info

std::shared_ptr<GenRunInfo> m_run_info
privateinherited

The global GenRunInfo object.

Definition at line 63 of file Reader.h.

◆ m_shared_stream

std::shared_ptr<std::istream> m_shared_stream
private

Holds temporary stream.

Definition at line 55 of file ReaderLHEF.h.

◆ m_storage

std::deque<GenEvent> m_storage
private

storage used for subevents.

Definition at line 60 of file ReaderLHEF.h.


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