![]() |
HepMC Reference DocumentationHepMC |
#include <IO_Ascii.h>
Inheritance diagram for HepMC::IO_Ascii:
Public Member Functions | |
IO_Ascii (const char *filename="IO_Ascii.dat", std::ios::openmode mode=std::ios::out) | |
constructor requiring a file name and std::ios mode | |
virtual | ~IO_Ascii () |
void | write_event (const GenEvent *evt) |
write this event | |
bool | fill_next_event (GenEvent *evt) |
get the next event | |
void | write_particle_data_table (const ParticleDataTable *) |
write this ParticleDataTable | |
bool | fill_particle_data_table (ParticleDataTable *) |
fill this ParticleDataTable | |
void | write_comment (const std::string comment) |
int | rdstate () const |
check the state of the IO stream | |
void | clear () |
clear the IO stream | |
void | print (std::ostream &ostr=std::cout) const |
write to ostr | |
Protected Member Functions | |
void | write_vertex (GenVertex *) |
write vertex information | |
void | write_particle (GenParticle *p) |
write particle information | |
void | write_particle_data (const ParticleData *d) |
write ParticleDataTable information | |
bool | write_end_listing () |
write end tag | |
void | output (const double &) |
write double | |
void | output (const int &) |
write int | |
void | output (const long int &) |
write long int | |
void | output (const char &) |
write a single character |
Strategy for reading or writing events/particleData as machine readable ascii to a file. When instantiating, the mode of file to be created must be specified.
Definition at line 64 of file IO_Ascii.h.
HepMC::IO_Ascii::IO_Ascii | ( | const char * | filename = "IO_Ascii.dat" , |
|
std::ios::openmode | mode = std::ios::out | |||
) |
HepMC::IO_Ascii::~IO_Ascii | ( | ) | [virtual] |
void HepMC::IO_Ascii::write_event | ( | const GenEvent * | evt | ) | [virtual] |
write this event
Writes evt to m_file. It does NOT delete the event after writing.
Implements HepMC::IO_BaseClass.
Definition at line 54 of file IO_Ascii.cc.
References HepMC::GenEvent::alphaQCD(), HepMC::GenEvent::alphaQED(), HepMC::GenVertex::barcode(), HepMC::WeightContainer::begin(), HepMC::WeightContainer::end(), HepMC::GenEvent::event_number(), HepMC::GenEvent::event_scale(), output(), HepMC::GenEvent::random_states(), HepMC::GenEvent::signal_process_id(), HepMC::GenEvent::signal_process_vertex(), HepMC::WeightContainer::size(), v, HepMC::versionName(), HepMC::GenEvent::vertices_begin(), HepMC::GenEvent::vertices_end(), HepMC::GenEvent::vertices_size(), HepMC::GenEvent::weights(), and write_vertex().
bool HepMC::IO_Ascii::fill_next_event | ( | GenEvent * | evt | ) | [virtual] |
get the next event
Implements HepMC::IO_BaseClass.
Definition at line 103 of file IO_Ascii.cc.
References HepMC::ascii, HepMC::CommonIO::find_end_key(), HepMC::CommonIO::find_file_type(), and HepMC::CommonIO::read_io_ascii().
void HepMC::IO_Ascii::write_particle_data_table | ( | const ParticleDataTable * | ) | [virtual] |
write this ParticleDataTable
Implements HepMC::IO_BaseClass.
Definition at line 181 of file IO_Ascii.cc.
References HepMC::ParticleDataTable::begin(), HepMC::ParticleDataTable::end(), write_end_listing(), and write_particle_data().
bool HepMC::IO_Ascii::fill_particle_data_table | ( | ParticleDataTable * | ) | [virtual] |
fill this ParticleDataTable
Implements HepMC::IO_BaseClass.
Definition at line 201 of file IO_Ascii.cc.
References HepMC::ascii_pdt, HepMC::CommonIO::find_end_key(), HepMC::CommonIO::find_file_type(), HepMC::CommonIO::read_io_particle_data_table(), and HepMC::ParticleDataTable::set_description().
void HepMC::IO_Ascii::write_comment | ( | const std::string | comment | ) |
insert a comment directly into the output file --- normally you only want to do this at the beginning or end of the file. All comments are preceded with "HepMC::IO_Ascii-COMMENT\n"
Definition at line 166 of file IO_Ascii.cc.
References write_end_listing().
int HepMC::IO_Ascii::rdstate | ( | ) | const [inline] |
void HepMC::IO_Ascii::clear | ( | ) | [inline] |
void HepMC::IO_Ascii::print | ( | std::ostream & | ostr = std::cout |
) | const [virtual] |
void HepMC::IO_Ascii::write_vertex | ( | GenVertex * | ) | [protected] |
write vertex information
Definition at line 249 of file IO_Ascii.cc.
References output(), v, and write_particle().
Referenced by write_event().
void HepMC::IO_Ascii::write_particle | ( | GenParticle * | p | ) | [protected] |
write particle information
Definition at line 295 of file IO_Ascii.cc.
Referenced by write_vertex().
void HepMC::IO_Ascii::write_particle_data | ( | const ParticleData * | d | ) | [protected] |
write ParticleDataTable information
Definition at line 319 of file IO_Ascii.cc.
References HepMC::ParticleData::charge(), HepMC::ParticleData::clifetime(), HepMC::ParticleData::mass(), HepMC::ParticleData::name(), output(), HepMC::ParticleData::pdg_id(), and HepMC::ParticleData::spin().
Referenced by write_particle_data_table().
bool HepMC::IO_Ascii::write_end_listing | ( | ) | [protected] |
write end tag
Definition at line 337 of file IO_Ascii.cc.
References HepMC::CommonIO::write_IO_Ascii_End().
Referenced by write_comment(), write_particle_data_table(), and ~IO_Ascii().
void HepMC::IO_Ascii::output | ( | const double & | ) | [inline, protected] |
write double
Definition at line 115 of file IO_Ascii.h.
Referenced by write_event(), write_particle(), write_particle_data(), and write_vertex().
void HepMC::IO_Ascii::output | ( | const int & | ) | [inline, protected] |
void HepMC::IO_Ascii::output | ( | const long int & | ) | [inline, protected] |
void HepMC::IO_Ascii::output | ( | const char & | ) | [inline, protected] |