![]() |
HepMC Reference DocumentationHepMC |
#include <IO_GenEvent.h>
Inheritance diagram for HepMC::IO_GenEvent:
Public Member Functions | |
IO_GenEvent (const char *filename="IO_GenEvent.dat", std::ios::openmode mode=std::ios::out) | |
constructor requiring a file name and std::ios mode | |
IO_GenEvent (std::istream &) | |
constructor requiring an input stream | |
IO_GenEvent (std::ostream &) | |
constructor requiring an output stream | |
virtual | ~IO_GenEvent () |
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_beam_particles (std::pair< HepMC::GenParticle *, HepMC::GenParticle * >) |
write beam particle information | |
void | write_heavy_ion (HeavyIon *) |
write heavy ion information | |
void | write_pdf_info (PdfInfo *) |
write PDF information | |
void | write_particle (GenParticle *p) |
write particle information | |
void | write_particle_data (const ParticleData *d) |
write particle data information | |
GenVertex * | read_vertex (TempParticleMap &particle_to_end_vertex) |
read vertex information | |
GenParticle * | read_particle (TempParticleMap &particle_to_end_vertex) |
read GenParticle information | |
ParticleData * | read_particle_data (ParticleDataTable *) |
read particle data table information | |
HeavyIon * | read_heavy_ion () |
read heavy ion information | |
PdfInfo * | read_pdf_info () |
read PDF information | |
bool | write_end_listing () |
write end tag | |
void | output (const double &) |
write double | |
void | output (const float &) |
write float | |
void | output (const int &) |
write int | |
void | output (const long &) |
write long | |
void | output (const char &) |
write a single character |
event input/output in ascii format for machine reading extended format contains HeavyIon and PdfInfo classes
Strategy for reading or writing events using iostreams When instantiating with a file name, the mode of file to be created must be specified. Options are: std::ios::in open file for input std::ios::out open file for output std::ios::trunc erase old file when opening (i.e. ios::out|iostrunc removes oldfile, and creates a new one for output ) std::ios::app append output to end of file for the purposes of this class, simultaneous input and output mode ( std::ios::in | std::ios::out ) is not allowed.
Event listings are preceded by the key: "HepMC::IO_GenEvent-START_EVENT_LISTING\n" and terminated by the key: "HepMC::IO_GenEvent-END_EVENT_LISTING\n" GenParticle Data tables are preceded by the key: "HepMC::IO_GenEvent-START_PARTICLE_DATA\n" and terminated by the key: "HepMC::IO_GenEvent-END_PARTICLE_DATA\n" Comments are allowed. They need not be preceded by anything, though if a comment is written using write_comment( const string ) then it will be preceded by "HepMC::IO_GenEvent-COMMENT\n" Each event, vertex, particle, particle data, heavy ion, or pdf info line is preceded by "E ","V ","P ","D ","H ","F " respectively. ExtendedAscii ignores particle data blocks Comments may appear anywhere in the file -- so long as they do not contain any of the start/stop keys.
example_EventSelection.cc, example_MyPythia.cc, example_MyPythiaRead.cc, and example_UsingIterators.cc.
Definition at line 65 of file IO_GenEvent.h.
HepMC::IO_GenEvent::IO_GenEvent | ( | const char * | filename = "IO_GenEvent.dat" , |
|
std::ios::openmode | mode = std::ios::out | |||
) |
HepMC::IO_GenEvent::IO_GenEvent | ( | std::istream & | ) |
HepMC::IO_GenEvent::IO_GenEvent | ( | std::ostream & | ) |
HepMC::IO_GenEvent::~IO_GenEvent | ( | ) | [virtual] |
void HepMC::IO_GenEvent::write_event | ( | const GenEvent * | evt | ) | [virtual] |
write this event
Writes evt to output stream. It does NOT delete the event after writing.
Implements HepMC::IO_BaseClass.
Definition at line 96 of file IO_GenEvent.cc.
References HepMC::GenEvent::alphaQCD(), HepMC::GenEvent::alphaQED(), HepMC::GenVertex::barcode(), HepMC::GenEvent::beam_particles(), HepMC::WeightContainer::begin(), HepMC::WeightContainer::end(), HepMC::GenEvent::event_number(), HepMC::GenEvent::event_scale(), HepMC::GenEvent::heavy_ion(), HepMC::GenEvent::mpi(), output(), HepMC::GenEvent::pdf_info(), 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(), write_beam_particles(), write_heavy_ion(), HepMC::CommonIO::write_IO_GenEvent_Key(), write_pdf_info(), and write_vertex().
bool HepMC::IO_GenEvent::fill_next_event | ( | GenEvent * | evt | ) | [virtual] |
get the next event
Implements HepMC::IO_BaseClass.
Definition at line 150 of file IO_GenEvent.cc.
References HepMC::ascii, HepMC::ascii_pdt, HepMC::extascii, HepMC::extascii_pdt, HepMC::CommonIO::find_end_key(), HepMC::CommonIO::find_file_type(), HepMC::gen, HepMC::CommonIO::io_type(), HepMC::CommonIO::read_io_ascii(), HepMC::CommonIO::read_io_extendedascii(), and HepMC::CommonIO::read_io_genevent().
void HepMC::IO_GenEvent::write_particle_data_table | ( | const ParticleDataTable * | ) | [inline, virtual] |
write this ParticleDataTable
Implements HepMC::IO_BaseClass.
Definition at line 203 of file IO_GenEvent.h.
bool HepMC::IO_GenEvent::fill_particle_data_table | ( | ParticleDataTable * | ) | [inline, virtual] |
fill this ParticleDataTable
Implements HepMC::IO_BaseClass.
Definition at line 204 of file IO_GenEvent.h.
void HepMC::IO_GenEvent::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_GenEvent-COMMENT\n"
Definition at line 228 of file IO_GenEvent.cc.
References write_end_listing().
int HepMC::IO_GenEvent::rdstate | ( | ) | const [inline] |
check the state of the IO stream
Definition at line 186 of file IO_GenEvent.h.
Referenced by main().
void HepMC::IO_GenEvent::clear | ( | ) | [inline] |
void HepMC::IO_GenEvent::print | ( | std::ostream & | ostr = std::cout |
) | const [virtual] |
void HepMC::IO_GenEvent::write_vertex | ( | GenVertex * | ) | [protected] |
write vertex information
Definition at line 243 of file IO_GenEvent.cc.
References output(), v, and write_particle().
Referenced by write_event().
void HepMC::IO_GenEvent::write_beam_particles | ( | std::pair< HepMC::GenParticle *, HepMC::GenParticle * > | ) | [protected] |
write beam particle information
Definition at line 289 of file IO_GenEvent.cc.
Referenced by write_event().
void HepMC::IO_GenEvent::write_heavy_ion | ( | HeavyIon * | ) | [protected] |
write heavy ion information
Definition at line 306 of file IO_GenEvent.cc.
References HepMC::HeavyIon::eccentricity(), HepMC::HeavyIon::event_plane_angle(), HepMC::HeavyIon::impact_parameter(), HepMC::HeavyIon::N_Nwounded_collisions(), HepMC::HeavyIon::Ncoll(), HepMC::HeavyIon::Ncoll_hard(), HepMC::HeavyIon::Npart_proj(), HepMC::HeavyIon::Npart_targ(), HepMC::HeavyIon::Nwounded_N_collisions(), HepMC::HeavyIon::Nwounded_Nwounded_collisions(), output(), HepMC::HeavyIon::sigma_inel_NN(), HepMC::HeavyIon::spectator_neutrons(), and HepMC::HeavyIon::spectator_protons().
Referenced by write_event().
void HepMC::IO_GenEvent::write_pdf_info | ( | PdfInfo * | ) | [protected] |
write PDF information
Definition at line 350 of file IO_GenEvent.cc.
References HepMC::PdfInfo::id1(), HepMC::PdfInfo::id2(), output(), HepMC::PdfInfo::pdf1(), HepMC::PdfInfo::pdf2(), HepMC::PdfInfo::scalePDF(), HepMC::PdfInfo::x1(), and HepMC::PdfInfo::x2().
Referenced by write_event().
void HepMC::IO_GenEvent::write_particle | ( | GenParticle * | p | ) | [protected] |
write particle information
Definition at line 382 of file IO_GenEvent.cc.
Referenced by write_vertex().
void HepMC::IO_GenEvent::write_particle_data | ( | const ParticleData * | d | ) | [protected] |
write particle data information
Definition at line 407 of file IO_GenEvent.cc.
References HepMC::ParticleData::charge(), HepMC::ParticleData::clifetime(), HepMC::ParticleData::mass(), HepMC::ParticleData::name(), output(), HepMC::ParticleData::pdg_id(), and HepMC::ParticleData::spin().
GenVertex* HepMC::IO_GenEvent::read_vertex | ( | TempParticleMap & | particle_to_end_vertex | ) | [protected] |
read vertex information
GenParticle * HepMC::IO_GenEvent::read_particle | ( | TempParticleMap & | particle_to_end_vertex | ) | [protected] |
read GenParticle information
Definition at line 473 of file IO_GenEvent.cc.
References HepMC::TempParticleMap::addEndParticle(), p, and HepMC::Flow::set_icode().
ParticleData * HepMC::IO_GenEvent::read_particle_data | ( | ParticleDataTable * | ) | [protected] |
read particle data table information
Definition at line 515 of file IO_GenEvent.cc.
References HepMC::ParticleDataTable::insert().
HeavyIon * HepMC::IO_GenEvent::read_heavy_ion | ( | ) | [protected] |
PdfInfo * HepMC::IO_GenEvent::read_pdf_info | ( | ) | [protected] |
bool HepMC::IO_GenEvent::write_end_listing | ( | ) | [protected] |
write end tag
Definition at line 537 of file IO_GenEvent.cc.
References HepMC::CommonIO::write_IO_GenEvent_End().
Referenced by write_comment(), and ~IO_GenEvent().
void HepMC::IO_GenEvent::output | ( | const double & | ) | [inline, protected] |
write double
Definition at line 141 of file IO_GenEvent.h.
Referenced by write_beam_particles(), write_event(), write_heavy_ion(), write_particle(), write_particle_data(), write_pdf_info(), and write_vertex().
void HepMC::IO_GenEvent::output | ( | const float & | ) | [inline, protected] |
void HepMC::IO_GenEvent::output | ( | const int & | ) | [inline, protected] |
void HepMC::IO_GenEvent::output | ( | const long & | ) | [inline, protected] |
void HepMC::IO_GenEvent::output | ( | const char & | ) | [inline, protected] |