|
HepMC3 event record library
|
Parser for HepMC2 I/O files.
Definition at line 30 of file ReaderAsciiHepMC2.h.
#include <ReaderAsciiHepMC2.h>
Inheritance diagram for ReaderAsciiHepMC2:
Collaboration diagram for ReaderAsciiHepMC2:Public Member Functions | |
| ReaderAsciiHepMC2 (const std::string &filename) | |
| Default constructor. More... | |
| ReaderAsciiHepMC2 (std::istream &) | |
| The ctor to read from stdin. More... | |
| ~ReaderAsciiHepMC2 () | |
| Destructor. 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< GenRunInfo > | run_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... | |
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... | |
Private Attributes | |
| std::ifstream | m_file |
| Input file. More... | |
| std::istream * | m_stream |
| For ctor when reading from stdin. More... | |
| bool | m_isstream |
| toggles usage of m_file or m_stream More... | |
| vector< GenVertexPtr > | m_vertex_cache |
| Vertex cache. More... | |
| vector< int > | m_vertex_barcodes |
| Old vertex barcodes. More... | |
| vector< GenParticlePtr > | m_particle_cache |
| Particle cache. More... | |
| vector< int > | m_end_vertex_barcodes |
| Old end vertex barcodes. More... | |
| GenEvent * | m_event_ghost |
| To save particle and verstex attributes. More... | |
| vector< GenParticlePtr > | m_particle_cache_ghost |
| Particle cache for attributes. More... | |
| vector< GenVertexPtr > | m_vertex_cache_ghost |
| Vertex cache for attributes. More... | |
| shared_ptr< GenRunInfo > | m_run_info |
| The global GenRunInfo object. More... | |
| ReaderAsciiHepMC2 | ( | const std::string & | filename | ) |
Default constructor.
Definition at line 25 of file ReaderAsciiHepMC2.cc.
References ERROR, ReaderAsciiHepMC2::m_event_ghost, ReaderAsciiHepMC2::m_file, and Reader::set_run_info().
| ReaderAsciiHepMC2 | ( | std::istream & | stream | ) |
The ctor to read from stdin.
Definition at line 34 of file ReaderAsciiHepMC2.cc.
References ERROR, ReaderAsciiHepMC2::m_event_ghost, ReaderAsciiHepMC2::m_stream, and Reader::set_run_info().
| ~ReaderAsciiHepMC2 | ( | ) |
Destructor.
Definition at line 44 of file ReaderAsciiHepMC2.cc.
References GenEvent::clear(), ReaderAsciiHepMC2::close(), ReaderAsciiHepMC2::m_event_ghost, and ReaderAsciiHepMC2::m_isstream.
|
virtual |
Close file stream.
Implements Reader.
Definition at line 649 of file ReaderAsciiHepMC2.cc.
References GenEvent::clear(), ReaderAsciiHepMC2::m_event_ghost, and ReaderAsciiHepMC2::m_file.
|
virtual |
Return status of the stream.
Implements Reader.
Definition at line 647 of file ReaderAsciiHepMC2.cc.
References ReaderAsciiHepMC2::m_file, ReaderAsciiHepMC2::m_isstream, and ReaderAsciiHepMC2::m_stream.
|
private |
Parse event.
Helper routine for parsing event information
| [out] | evt | Event that will be filled with new data |
| [in] | buf | Line of text that needs to be parsed |
Definition at line 250 of file ReaderAsciiHepMC2.cc.
References GenEvent::add_attribute(), DEBUG, GenEvent::set_event_number(), and GenEvent::weights().
|
private |
Parse heavy ion information.
Helper routine for parsing heavy ion information
| [out] | evt | Event that will be filled with new data |
| [in] | buf | Line of text that needs to be parsed |
Definition at line 557 of file ReaderAsciiHepMC2.cc.
References GenEvent::add_attribute().
|
private |
Parse particle.
Helper routine for parsing single particle information
| [in] | buf | Line of text that needs to be parsed |
Definition at line 422 of file ReaderAsciiHepMC2.cc.
References GenEvent::add_particle(), DEBUG, ReaderAsciiHepMC2::m_end_vertex_barcodes, ReaderAsciiHepMC2::m_event_ghost, ReaderAsciiHepMC2::m_particle_cache, ReaderAsciiHepMC2::m_particle_cache_ghost, ReaderAsciiHepMC2::m_vertex_barcodes, ReaderAsciiHepMC2::m_vertex_cache, FourVector::setE(), FourVector::setPx(), FourVector::setPy(), and FourVector::setPz().
|
private |
Parse pdf information.
Helper routine for parsing pdf information
| [out] | evt | Event that will be filled with new data |
| [in] | buf | Line of text that needs to be parsed |
Definition at line 608 of file ReaderAsciiHepMC2.cc.
References GenEvent::add_attribute().
|
private |
Parse units.
Helper routine for parsing unit information
| [out] | evt | Event that will be filled with unit information |
| [in] | buf | Line of text that needs to be parsed |
Definition at line 334 of file ReaderAsciiHepMC2.cc.
References DEBUG, Units::length_unit(), GenEvent::length_unit(), Units::momentum_unit(), GenEvent::momentum_unit(), Units::name(), and GenEvent::set_units().
|
private |
Parse vertex.
Helper routine for parsing single event information
| [in] | buf | Line of text that needs to be parsed |
Definition at line 354 of file ReaderAsciiHepMC2.cc.
References GenEvent::add_vertex(), DEBUG, ReaderAsciiHepMC2::m_event_ghost, ReaderAsciiHepMC2::m_vertex_barcodes, ReaderAsciiHepMC2::m_vertex_cache, ReaderAsciiHepMC2::m_vertex_cache_ghost, FourVector::setT(), FourVector::setX(), FourVector::setY(), and FourVector::setZ().
|
private |
Parse weight names.
Helper routine for parsing weight names
| [in] | buf | Line of text that needs to be parsed |
Definition at line 523 of file ReaderAsciiHepMC2.cc.
References Reader::run_info().
|
private |
Parse pdf information.
Helper routine for parsing cross-section information
| [out] | evt | Event that will be filled with new data |
| [in] | buf | Line of text that needs to be parsed |
Definition at line 507 of file ReaderAsciiHepMC2.cc.
References GenEvent::add_attribute().
|
virtual |
Implementation of Reader::read_event.
Implements Reader.
Definition at line 47 of file ReaderAsciiHepMC2.cc.
References GenEvent::add_tree(), GenEvent::clear(), DEBUG, ERROR, ReaderAsciiHepMC2::failed(), ReaderAsciiHepMC2::m_end_vertex_barcodes, ReaderAsciiHepMC2::m_event_ghost, ReaderAsciiHepMC2::m_file, ReaderAsciiHepMC2::m_isstream, ReaderAsciiHepMC2::m_particle_cache, ReaderAsciiHepMC2::m_particle_cache_ghost, ReaderAsciiHepMC2::m_stream, ReaderAsciiHepMC2::m_vertex_barcodes, ReaderAsciiHepMC2::m_vertex_cache, ReaderAsciiHepMC2::m_vertex_cache_ghost, ReaderAsciiHepMC2::parse_event_information(), ReaderAsciiHepMC2::parse_heavy_ion(), ReaderAsciiHepMC2::parse_particle_information(), ReaderAsciiHepMC2::parse_pdf_info(), ReaderAsciiHepMC2::parse_units(), ReaderAsciiHepMC2::parse_vertex_information(), ReaderAsciiHepMC2::parse_weight_names(), ReaderAsciiHepMC2::parse_xs_info(), GenEvent::reserve(), Reader::run_info(), GenEvent::set_run_info(), and WARNING.
|
inlineinherited |
Get the global GenRunInfo object.
Definition at line 39 of file Reader.h.
References Reader::m_run_info.
|
inlineprotectedinherited |
Set the global GenRunInfo object.
Definition at line 46 of file Reader.h.
References Reader::m_run_info.
|
private |
Old end vertex barcodes.
Definition at line 133 of file ReaderAsciiHepMC2.h.
|
private |
To save particle and verstex attributes.
Definition at line 135 of file ReaderAsciiHepMC2.h.
|
private |
Input file.
Definition at line 125 of file ReaderAsciiHepMC2.h.
|
private |
toggles usage of m_file or m_stream
Definition at line 127 of file ReaderAsciiHepMC2.h.
|
private |
Particle cache.
Definition at line 132 of file ReaderAsciiHepMC2.h.
|
private |
Particle cache for attributes.
Definition at line 136 of file ReaderAsciiHepMC2.h.
|
privateinherited |
The global GenRunInfo object.
|
private |
For ctor when reading from stdin.
Definition at line 126 of file ReaderAsciiHepMC2.h.
|
private |
Old vertex barcodes.
Definition at line 130 of file ReaderAsciiHepMC2.h.
|
private |
Vertex cache.
Definition at line 129 of file ReaderAsciiHepMC2.h.
|
private |
Vertex cache for attributes.
Definition at line 137 of file ReaderAsciiHepMC2.h.
1.8.17