HepMC event record
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
ReaderAsciiHepMC2 Class Reference

Detailed Description

Parser for HepMC2 I/O files.

Examples:
HepMC2_reader_example.cc.

Definition at line 32 of file build/outputs/include/HepMC/ReaderAsciiHepMC2.h.

#include <ReaderAsciiHepMC2.h>

+ Inheritance diagram for ReaderAsciiHepMC2:
+ Collaboration diagram for ReaderAsciiHepMC2:

Public Member Functions

 ReaderAsciiHepMC2 (const std::string &filename)
 Default constructor. More...
 
bool read_event (GenEvent &evt)
 Implementation of Reader::read_event. More...
 
bool failed ()
 Return status of the stream. More...
 
void close ()
 Close file stream. More...
 
 ReaderAsciiHepMC2 (const std::string &filename)
 Default constructor. More...
 
bool read_event (GenEvent &evt)
 Implementation of Reader::read_event. More...
 
bool failed ()
 Return status of the stream. More...
 
void close ()
 Close file stream. More...
 
shared_ptr< GenRunInforun_info () const
 Get the global GenRunInfo object. More...
 
shared_ptr< GenRunInforun_info () const
 Get the global GenRunInfo object. More...
 

Protected Member Functions

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

Private Member Functions

int parse_event_information (GenEvent &evt, const char *buf)
 Parse event. More...
 
bool parse_units (GenEvent &evt, const char *buf)
 Parse units. More...
 
int parse_vertex_information (const char *buf)
 Parse vertex. More...
 
int parse_particle_information (const char *buf)
 Parse particle. More...
 
bool parse_weight_names (const char *buf)
 Parse weight names. More...
 
bool parse_heavy_ion (GenEvent &evt, const char *buf)
 Parse heavy ion information. More...
 
bool parse_pdf_info (GenEvent &evt, const char *buf)
 Parse pdf information. More...
 
bool parse_xs_info (GenEvent &evt, const char *buf)
 Parse pdf information. More...
 
int parse_event_information (GenEvent &evt, const char *buf)
 Parse event. More...
 
bool parse_units (GenEvent &evt, const char *buf)
 Parse units. More...
 
int parse_vertex_information (const char *buf)
 Parse vertex. More...
 
int parse_particle_information (const char *buf)
 Parse particle. More...
 
bool parse_weight_names (const char *buf)
 Parse weight names. More...
 
bool parse_heavy_ion (GenEvent &evt, const char *buf)
 Parse heavy ion information. More...
 
bool parse_pdf_info (GenEvent &evt, const char *buf)
 Parse pdf information. More...
 
bool parse_xs_info (GenEvent &evt, const char *buf)
 Parse pdf information. More...
 

Private Attributes

ifstream m_file
 Input file. More...
 
vector< GenVertexPtrm_vertex_cache
 Vertex cache. More...
 
vector< int > m_vertex_barcodes
 Old vertex barcodes. More...
 
vector< GenParticlePtrm_particle_cache
 Particle cache. More...
 
vector< int > m_end_vertex_barcodes
 Old end vertex barcodes. More...
 

Constructor & Destructor Documentation

◆ ReaderAsciiHepMC2() [1/2]

ReaderAsciiHepMC2 ( const std::string &  filename)

Default constructor.

Definition at line 25 of file ReaderAsciiHepMC2.cc.

References ReaderAsciiHepMC2::m_file, and Reader::set_run_info().

◆ ReaderAsciiHepMC2() [2/2]

ReaderAsciiHepMC2 ( const std::string &  filename)

Default constructor.

Member Function Documentation

◆ close() [1/2]

void close ( )
virtual

Close file stream.

Implements Reader.

Examples:
HepMC2_reader_example.cc.

Definition at line 546 of file ReaderAsciiHepMC2.cc.

References ReaderAsciiHepMC2::m_file.

◆ close() [2/2]

void close ( )
virtual

Close file stream.

Implements Reader.

◆ failed() [1/2]

bool failed ( )
inlinevirtual

Return status of the stream.

Implements Reader.

Definition at line 47 of file include/HepMC/ReaderAsciiHepMC2.h.

References ReaderAsciiHepMC2::m_file.

◆ failed() [2/2]

bool failed ( )
inlinevirtual

Return status of the stream.

Implements Reader.

Examples:
HepMC2_reader_example.cc.

Definition at line 47 of file build/outputs/include/HepMC/ReaderAsciiHepMC2.h.

References ReaderAsciiHepMC2::m_file.

◆ parse_event_information() [1/2]

int parse_event_information ( GenEvent evt,
const char *  buf 
)
private

Parse event.

Helper routine for parsing event information

Parameters
[out]evtEvent that will be filled with new data
[in]bufLine of text that needs to be parsed

Definition at line 204 of file ReaderAsciiHepMC2.cc.

References GenEvent::set_event_number(), and GenEvent::weights().

◆ parse_event_information() [2/2]

int parse_event_information ( GenEvent evt,
const char *  buf 
)
private

Parse event.

Helper routine for parsing event information

Parameters
[out]evtEvent that will be filled with new data
[in]bufLine of text that needs to be parsed

◆ parse_heavy_ion() [1/2]

bool parse_heavy_ion ( GenEvent evt,
const char *  buf 
)
private

Parse heavy ion information.

Helper routine for parsing heavy ion information

Parameters
[out]evtEvent that will be filled with new data
[in]bufLine of text that needs to be parsed

Definition at line 459 of file ReaderAsciiHepMC2.cc.

References GenEvent::add_attribute().

◆ parse_heavy_ion() [2/2]

bool parse_heavy_ion ( GenEvent evt,
const char *  buf 
)
private

Parse heavy ion information.

Helper routine for parsing heavy ion information

Parameters
[out]evtEvent that will be filled with new data
[in]bufLine of text that needs to be parsed

◆ parse_particle_information() [1/2]

int parse_particle_information ( const char *  buf)
private

Parse particle.

Helper routine for parsing single particle information

Parameters
[in]bufLine of text that needs to be parsed

◆ parse_particle_information() [2/2]

int parse_particle_information ( const char *  buf)
private

Parse particle.

Helper routine for parsing single particle information

Parameters
[in]bufLine of text that needs to be parsed
Todo:
barcode ignored but maybe should be put as an attribute?...

Definition at line 342 of file ReaderAsciiHepMC2.cc.

References ReaderAsciiHepMC2::m_end_vertex_barcodes, ReaderAsciiHepMC2::m_particle_cache, ReaderAsciiHepMC2::m_vertex_barcodes, and ReaderAsciiHepMC2::m_vertex_cache.

◆ parse_pdf_info() [1/2]

bool parse_pdf_info ( GenEvent evt,
const char *  buf 
)
private

Parse pdf information.

Helper routine for parsing pdf information

Parameters
[out]evtEvent that will be filled with new data
[in]bufLine of text that needs to be parsed

◆ parse_pdf_info() [2/2]

bool parse_pdf_info ( GenEvent evt,
const char *  buf 
)
private

Parse pdf information.

Helper routine for parsing pdf information

Parameters
[out]evtEvent that will be filled with new data
[in]bufLine of text that needs to be parsed

Definition at line 510 of file ReaderAsciiHepMC2.cc.

References GenEvent::add_attribute().

◆ parse_units() [1/2]

bool parse_units ( GenEvent evt,
const char *  buf 
)
private

Parse units.

Helper routine for parsing unit information

Parameters
[out]evtEvent that will be filled with unit information
[in]bufLine of text that needs to be parsed

Definition at line 273 of file ReaderAsciiHepMC2.cc.

References Units::length_unit(), GenEvent::length_unit(), Units::momentum_unit(), GenEvent::momentum_unit(), Units::name(), and GenEvent::set_units().

◆ parse_units() [2/2]

bool parse_units ( GenEvent evt,
const char *  buf 
)
private

Parse units.

Helper routine for parsing unit information

Parameters
[out]evtEvent that will be filled with unit information
[in]bufLine of text that needs to be parsed

◆ parse_vertex_information() [1/2]

int parse_vertex_information ( const char *  buf)
private

Parse vertex.

Helper routine for parsing single event information

Parameters
[in]bufLine of text that needs to be parsed

◆ parse_vertex_information() [2/2]

int parse_vertex_information ( const char *  buf)
private

Parse vertex.

Helper routine for parsing single event information

Parameters
[in]bufLine of text that needs to be parsed

Definition at line 293 of file ReaderAsciiHepMC2.cc.

References ReaderAsciiHepMC2::m_vertex_barcodes, and ReaderAsciiHepMC2::m_vertex_cache.

◆ parse_weight_names() [1/2]

bool parse_weight_names ( const char *  buf)
private

Parse weight names.

Helper routine for parsing weight names

Parameters
[in]bufLine of text that needs to be parsed

Definition at line 425 of file ReaderAsciiHepMC2.cc.

References Reader::run_info().

◆ parse_weight_names() [2/2]

bool parse_weight_names ( const char *  buf)
private

Parse weight names.

Helper routine for parsing weight names

Parameters
[in]bufLine of text that needs to be parsed

◆ parse_xs_info() [1/2]

bool parse_xs_info ( GenEvent evt,
const char *  buf 
)
private

Parse pdf information.

Helper routine for parsing cross-section information

Parameters
[out]evtEvent that will be filled with new data
[in]bufLine of text that needs to be parsed

Definition at line 409 of file ReaderAsciiHepMC2.cc.

References GenEvent::add_attribute().

◆ parse_xs_info() [2/2]

bool parse_xs_info ( GenEvent evt,
const char *  buf 
)
private

Parse pdf information.

Helper routine for parsing cross-section information

Parameters
[out]evtEvent that will be filled with new data
[in]bufLine of text that needs to be parsed

◆ read_event() [1/2]

bool read_event ( GenEvent evt)
virtual

◆ read_event() [2/2]

bool read_event ( GenEvent evt)
virtual

Implementation of Reader::read_event.

Implements Reader.

◆ run_info() [1/2]

shared_ptr<GenRunInfo> run_info ( ) const
inlineinherited

Get the global GenRunInfo object.

Definition at line 37 of file include/HepMC/Reader.h.

References Reader::m_run_info.

◆ run_info() [2/2]

shared_ptr<GenRunInfo> run_info ( ) const
inlineinherited

Get the global GenRunInfo object.

Examples:
LHEF_example_cat.cc.

Definition at line 37 of file build/outputs/include/HepMC/Reader.h.

References Reader::m_run_info.

◆ set_run_info() [1/2]

void set_run_info ( shared_ptr< GenRunInfo run)
inlineprotectedinherited

Set the global GenRunInfo object.

Definition at line 44 of file include/HepMC/Reader.h.

References Reader::m_run_info.

◆ set_run_info() [2/2]

void set_run_info ( shared_ptr< GenRunInfo run)
inlineprotectedinherited

Set the global GenRunInfo object.

Definition at line 44 of file build/outputs/include/HepMC/Reader.h.

References Reader::m_run_info.

Field Documentation

◆ m_end_vertex_barcodes

vector< int > m_end_vertex_barcodes
private

Old end vertex barcodes.

Definition at line 127 of file build/outputs/include/HepMC/ReaderAsciiHepMC2.h.

◆ m_file

ifstream m_file
private

Input file.

Definition at line 121 of file build/outputs/include/HepMC/ReaderAsciiHepMC2.h.

◆ m_particle_cache

vector< GenParticlePtr > m_particle_cache
private

Particle cache.

Definition at line 126 of file build/outputs/include/HepMC/ReaderAsciiHepMC2.h.

◆ m_vertex_barcodes

vector< int > m_vertex_barcodes
private

Old vertex barcodes.

Definition at line 124 of file build/outputs/include/HepMC/ReaderAsciiHepMC2.h.

◆ m_vertex_cache

vector< GenVertexPtr > m_vertex_cache
private

Vertex cache.

Definition at line 123 of file build/outputs/include/HepMC/ReaderAsciiHepMC2.h.


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