HepMC event record
|
GenEvent I/O parsing for structured text files.
Definition at line 26 of file build/outputs/include/HepMC/ReaderAscii.h.
#include <ReaderAscii.h>
Public Member Functions | |
ReaderAscii (const std::string &filename) | |
Constructor. More... | |
ReaderAscii (std::istream &) | |
The ctor to read from stdin. More... | |
~ReaderAscii () | |
Destructor. More... | |
bool | read_event (GenEvent &evt) |
Load event from file. More... | |
bool | failed () |
Return status of the stream. More... | |
void | close () |
Close file stream. More... | |
ReaderAscii (const std::string &filename) | |
Constructor. More... | |
ReaderAscii (std::istream &) | |
The ctor to read from stdin. More... | |
~ReaderAscii () | |
Destructor. More... | |
bool | read_event (GenEvent &evt) |
Load event from file. 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... | |
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... | |
void | set_run_info (shared_ptr< GenRunInfo > run) |
Set the global GenRunInfo object. More... | |
Private Member Functions | |
shared_ptr< Attribute > | get_global (std::string name) |
Get global attribute. More... | |
std::string | unescape (const std::string s) |
Unsecape '\' and ' ' characters in string. More... | |
shared_ptr< Attribute > | get_global (std::string name) |
Get global attribute. More... | |
std::string | unescape (const std::string s) |
Unsecape '\' and ' ' characters in string. More... | |
Read helpers | |
std::pair< int, int > | parse_event_information (GenEvent &evt, const char *buf) |
Parse event. More... | |
bool | parse_weight_values (GenEvent &evt, const char *buf) |
Parse weight value lines. More... | |
bool | parse_units (GenEvent &evt, const char *buf) |
Parse units. More... | |
bool | parse_pdf_info (GenEvent &evt, const char *buf) |
Parse struct GenPdfInfo information. More... | |
bool | parse_heavy_ion (GenEvent &evt, const char *buf) |
Parse struct GenHeavyIon information. More... | |
bool | parse_cross_section (GenEvent &evt, const char *buf) |
Parse struct GenCrossSection information. More... | |
bool | parse_vertex_information (GenEvent &evt, const char *buf) |
Parse vertex. More... | |
bool | parse_particle_information (GenEvent &evt, const char *buf) |
Parse particle. More... | |
bool | parse_attribute (GenEvent &evt, const char *buf) |
Parse attribute. More... | |
bool | parse_run_attribute (const char *buf) |
Parse run-level attribute. More... | |
bool | parse_weight_names (const char *buf) |
Parse run-level weight names. More... | |
bool | parse_tool (const char *buf) |
Parse run-level tool information. More... | |
std::pair< int, int > | parse_event_information (GenEvent &evt, const char *buf) |
Parse event. More... | |
bool | parse_weight_values (GenEvent &evt, const char *buf) |
Parse weight value lines. More... | |
bool | parse_units (GenEvent &evt, const char *buf) |
Parse units. More... | |
bool | parse_pdf_info (GenEvent &evt, const char *buf) |
Parse struct GenPdfInfo information. More... | |
bool | parse_heavy_ion (GenEvent &evt, const char *buf) |
Parse struct GenHeavyIon information. More... | |
bool | parse_cross_section (GenEvent &evt, const char *buf) |
Parse struct GenCrossSection information. More... | |
bool | parse_vertex_information (GenEvent &evt, const char *buf) |
Parse vertex. More... | |
bool | parse_particle_information (GenEvent &evt, const char *buf) |
Parse particle. More... | |
bool | parse_attribute (GenEvent &evt, const char *buf) |
Parse attribute. More... | |
bool | parse_run_attribute (const char *buf) |
Parse run-level attribute. More... | |
bool | parse_weight_names (const char *buf) |
Parse run-level weight names. More... | |
bool | parse_tool (const char *buf) |
Parse run-level tool information. More... | |
Private Attributes | |
std::ifstream | m_file |
Input file. More... | |
std::istream * | m_stream |
bool | m_isstream |
std::map< std::string, shared_ptr< Attribute > > | m_global_attributes |
Store attributes global to the run being written/read. More... | |
ReaderAscii | ( | const std::string & | filename | ) |
Constructor.
Definition at line 22 of file ReaderAscii.cc.
References ReaderAscii::m_file, and Reader::set_run_info().
ReaderAscii | ( | std::istream & | stream | ) |
The ctor to read from stdin.
Definition at line 33 of file ReaderAscii.cc.
References Reader::set_run_info().
~ReaderAscii | ( | ) |
ReaderAscii | ( | const std::string & | filename | ) |
Constructor.
ReaderAscii | ( | std::istream & | ) |
The ctor to read from stdin.
~ReaderAscii | ( | ) |
Destructor.
|
virtual |
Close file stream.
Implements Reader.
Definition at line 484 of file ReaderAscii.cc.
References ReaderAscii::m_file.
|
virtual |
Close file stream.
Implements Reader.
|
inlinevirtual |
Return status of the stream.
Implements Reader.
Definition at line 45 of file include/HepMC/ReaderAscii.h.
References ReaderAscii::m_file.
|
inlinevirtual |
Return status of the stream.
Implements Reader.
Definition at line 45 of file build/outputs/include/HepMC/ReaderAscii.h.
References ReaderAscii::m_file.
|
private |
Get global attribute.
|
private |
Get global attribute.
|
private |
Parse attribute.
Helper routine for parsing single attribute information
[out] | evt | Event that will contain parsed attribute |
[in] | buf | Line of text that needs to be parsed |
Definition at line 381 of file ReaderAscii.cc.
References GenEvent::add_attribute(), and ReaderAscii::unescape().
|
private |
Parse attribute.
Helper routine for parsing single attribute information
[out] | evt | Event that will contain parsed attribute |
[in] | buf | Line of text that needs to be parsed |
|
private |
Parse struct GenCrossSection information.
Helper routine for parsing cross-section information
[out] | evt | Event that will be filled with unit information |
[in] | buf | Line of text that needs to be parsed |
|
private |
Parse struct GenCrossSection information.
Helper routine for parsing cross-section information
[out] | evt | Event that will be filled with unit information |
[in] | buf | Line of text that needs to be parsed |
|
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 |
|
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 151 of file ReaderAscii.cc.
References GenEvent::set_event_number(), FourVector::setT(), FourVector::setX(), FourVector::setY(), FourVector::setZ(), and GenEvent::shift_position_to().
|
private |
Parse struct GenHeavyIon information.
Helper routine for parsing heavy ion information
[out] | evt | Event that will be filled with unit information |
[in] | buf | Line of text that needs to be parsed |
|
private |
Parse struct GenHeavyIon information.
Helper routine for parsing heavy ion information
[out] | evt | Event that will be filled with unit information |
[in] | buf | Line of text that needs to be parsed |
|
private |
Parse particle.
Helper routine for parsing single particle information
[out] | evt | Event that will contain parsed particle |
[in] | buf | Line of text that needs to be parsed |
Definition at line 306 of file ReaderAscii.cc.
References GenEvent::add_particle(), GenEvent::add_vertex(), GenEvent::particles(), and GenEvent::vertices().
|
private |
Parse particle.
Helper routine for parsing single particle information
[out] | evt | Event that will contain parsed particle |
[in] | buf | Line of text that needs to be parsed |
|
private |
Parse struct GenPdfInfo information.
Helper routine for parsing PDF information
[out] | evt | Event that will be filled with unit information |
[in] | buf | Line of text that needs to be parsed |
|
private |
Parse struct GenPdfInfo information.
Helper routine for parsing PDF information
[out] | evt | Event that will be filled with unit information |
[in] | buf | Line of text that needs to be parsed |
|
private |
Parse run-level attribute.
Helper routine for parsing single attribute information
[in] | buf | Line of text that needs to be parsed |
|
private |
Parse run-level attribute.
Helper routine for parsing single attribute information
[in] | buf | Line of text that needs to be parsed |
Definition at line 406 of file ReaderAscii.cc.
References Reader::run_info(), and ReaderAscii::unescape().
|
private |
Parse run-level tool information.
Helper routine for parsing a line with information about tools being used.
[in] | buf | Line of text that needs to be parsed |
Definition at line 446 of file ReaderAscii.cc.
References GenRunInfo::ToolInfo::description, GenRunInfo::ToolInfo::name, Reader::run_info(), ReaderAscii::unescape(), and GenRunInfo::ToolInfo::version.
|
private |
Parse run-level tool information.
Helper routine for parsing a line with information about tools being used.
[in] | buf | Line of text that needs to be parsed |
|
private |
Parse units.
Helper routine for parsing units information
[out] | evt | Event that will be filled with unit information |
[in] | buf | Line of text that needs to be parsed |
Definition at line 215 of file ReaderAscii.cc.
References Units::length_unit(), GenEvent::length_unit(), Units::momentum_unit(), GenEvent::momentum_unit(), Units::name(), and GenEvent::set_units().
|
private |
Parse units.
Helper routine for parsing units information
[out] | evt | Event that will be filled with unit information |
[in] | buf | Line of text that needs to be parsed |
|
private |
Parse vertex.
Helper routine for parsing single event information
[out] | evt | Event that will contain parsed vertex |
[in] | buf | Line of text that needs to be parsed |
|
private |
Parse vertex.
Helper routine for parsing single event information
[out] | evt | Event that will contain parsed vertex |
[in] | buf | Line of text that needs to be parsed |
Definition at line 236 of file ReaderAscii.cc.
References GenEvent::add_vertex(), and GenEvent::particles().
|
private |
Parse run-level weight names.
Helper routine for parsing a line with information about weight names.
[in] | buf | Line of text that needs to be parsed |
|
private |
Parse run-level weight names.
Helper routine for parsing a line with information about weight names.
[in] | buf | Line of text that needs to be parsed |
Definition at line 429 of file ReaderAscii.cc.
References Reader::run_info(), and ReaderAscii::unescape().
|
private |
Parse weight value lines.
Helper routine for parsing weight value information
[out] | evt | Event whose GenWeights will be filled with weight values |
[in] | buf | Line of text that needs to be parsed |
|
private |
Parse weight value lines.
Helper routine for parsing weight value information
[out] | evt | Event whose GenWeights will be filled with weight values |
[in] | buf | Line of text that needs to be parsed |
Definition at line 198 of file ReaderAscii.cc.
References Reader::run_info(), and GenEvent::weights().
|
virtual |
Load event from file.
[out] | evt | Event to be filled |
Implements Reader.
Definition at line 47 of file ReaderAscii.cc.
References GenEvent::clear(), ReaderAscii::failed(), ReaderAscii::m_file, ReaderAscii::parse_attribute(), ReaderAscii::parse_event_information(), ReaderAscii::parse_particle_information(), ReaderAscii::parse_run_attribute(), ReaderAscii::parse_tool(), ReaderAscii::parse_units(), ReaderAscii::parse_vertex_information(), ReaderAscii::parse_weight_names(), ReaderAscii::parse_weight_values(), GenEvent::particles(), Reader::run_info(), GenEvent::set_run_info(), and GenEvent::vertices().
|
virtual |
|
inlineinherited |
Get the global GenRunInfo object.
Definition at line 37 of file include/HepMC/Reader.h.
References Reader::m_run_info.
|
inlineinherited |
Get the global GenRunInfo object.
Definition at line 37 of file build/outputs/include/HepMC/Reader.h.
References Reader::m_run_info.
|
inlineprotectedinherited |
Set the global GenRunInfo object.
Definition at line 44 of file include/HepMC/Reader.h.
References Reader::m_run_info.
|
inlineprotectedinherited |
Set the global GenRunInfo object.
Definition at line 44 of file build/outputs/include/HepMC/Reader.h.
References Reader::m_run_info.
|
private |
Unsecape '\' and '
' characters in string.
Definition at line 466 of file ReaderAscii.cc.
|
private |
Unsecape '\' and '
' characters in string.
|
private |
Input file.
Definition at line 155 of file build/outputs/include/HepMC/ReaderAscii.h.
|
private |
Store attributes global to the run being written/read.
Definition at line 161 of file build/outputs/include/HepMC/ReaderAscii.h.