HepMC Reference DocumentationHepMC
Inheritance diagram for HepMC::IO_GenEvent:
Public Member Functions
|IO_GenEvent (const std::string &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 |
|void||write_event (const GenEvent *evt)|
|write this event |
|bool||fill_next_event (GenEvent *evt)|
|get the next event |
|void||write_comment (const std::string comment)|
|int||rdstate () const|
|check the state of the IO stream |
|clear the IO stream |
|void||print (std::ostream &ostr=std::cout) const|
|write to ostr |
|void||use_input_units (Units::MomentumUnit, Units::LengthUnit)|
|int||error_type () const|
|integer (enum) associated with read error |
|const std::string &||error_message () const|
|the read error message string |
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. Comments may appear anywhere in the file -- so long as they do not contain any of the start/stop keys.
example_EventSelection.cc, example_UsingIterators.cc, fio/example_MyHerwig.cc, fio/example_MyPythia.cc, testFlow.cc, testHepMC.cc.in, testHepMCIteration.cc.in, testMass.cc.in, testMultipleCopies.cc.in, and testStreamIO.cc.in.
Definition at line 63 of file IO_GenEvent.h.
|HepMC::IO_GenEvent::IO_GenEvent||(||const std::string &|| filename =
|std::ios::openmode|| mode = |
|const std::string & HepMC::IO_GenEvent::error_message||(||)|| const
|int HepMC::IO_GenEvent::error_type||(||)|| const
|bool HepMC::IO_GenEvent::fill_next_event||(||GenEvent *||evt||)||
|void HepMC::IO_GenEvent::print||(||std::ostream &|| ostr =
|int HepMC::IO_GenEvent::rdstate||(||)|| const
needed when reading a file without units if those units are different than the declared default units (e.g., the default units are MeV, but the file was written with GeV) This method is not necessary if the units are written in the file
|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"
|void HepMC::IO_GenEvent::write_event||(||const GenEvent *||evt||)||