#include <IO_PDG_ParticleDataTable.h>
Inheritance diagram for HepMC::IO_PDG_ParticleDataTable:
Public Member Functions | |
IO_PDG_ParticleDataTable (const char *filename="PDG98_ParticleDataTable.txt") | |
constructor using filename | |
virtual | ~IO_PDG_ParticleDataTable () |
bool | fill_particle_data_table (ParticleDataTable *) |
read the input and fill the table | |
void | add_quarks_to_table (ParticleDataTable &) |
add u, d, s, c, b, and t | |
void | print (std::ostream &ostr=std::cout) const |
write to ostr | |
int | rdstate () const |
check the IO state | |
GenEvent * | read_next_event () |
do not over-ride | |
ParticleDataTable * | read_particle_data_table () |
do not over-ride | |
virtual GenEvent *& | operator>> (GenEvent *&) |
the same as read_next_event | |
virtual ParticleDataTable *& | operator>> (ParticleDataTable *&) |
the same as read_particle_data_table | |
virtual const GenEvent *& | operator<< (const GenEvent *&) |
the same as write_event | |
virtual GenEvent *& | operator<< (GenEvent *&) |
the same as write_event | |
virtual const ParticleDataTable *& | operator<< (const ParticleDataTable *&) |
the same as write_particle_data_table | |
virtual ParticleDataTable *& | operator<< (ParticleDataTable *&) |
the same as write_particle_data_table | |
Protected Member Functions | |
bool | search_for_key_end (std::istream &in, const char *key) |
for internal use | |
void | read_entry (ParticleDataTable *) |
read a line | |
Private Member Functions | |
void | write_event (const GenEvent *) |
write this GenEvent | |
bool | fill_next_event (GenEvent *) |
fill this GenEvent | |
void | write_particle_data_table (const ParticleDataTable *) |
write this ParticleDataTable | |
IO_PDG_ParticleDataTable (const IO_PDG_ParticleDataTable &) | |
Private Attributes | |
std::string | m_filename |
std::ifstream | m_file |
Definition at line 49 of file IO_PDG_ParticleDataTable.h.
HepMC::IO_PDG_ParticleDataTable::IO_PDG_ParticleDataTable | ( | const char * | filename = "PDG98_ParticleDataTable.txt" |
) |
constructor using filename
virtual HepMC::IO_PDG_ParticleDataTable::~IO_PDG_ParticleDataTable | ( | ) | [virtual] |
HepMC::IO_PDG_ParticleDataTable::IO_PDG_ParticleDataTable | ( | const IO_PDG_ParticleDataTable & | ) | [inline, private] |
bool HepMC::IO_PDG_ParticleDataTable::fill_particle_data_table | ( | ParticleDataTable * | ) | [virtual] |
void HepMC::IO_PDG_ParticleDataTable::add_quarks_to_table | ( | ParticleDataTable & | ) |
add u, d, s, c, b, and t
void HepMC::IO_PDG_ParticleDataTable::print | ( | std::ostream & | ostr = std::cout |
) | const [inline, virtual] |
write to ostr
Reimplemented from HepMC::IO_BaseClass.
Definition at line 85 of file IO_PDG_ParticleDataTable.h.
00085 { 00086 ostr << "IO_PDG_ParticleDataTable: for computer readable PDG tables.\n" 00087 << " file state: " << m_file.rdstate() 00088 << " bad:" << (m_file.rdstate()&std::ios::badbit) 00089 << " eof:" << (m_file.rdstate()&std::ios::eofbit) 00090 << " fail:" << (m_file.rdstate()&std::ios::failbit) 00091 << " good:" << (m_file.rdstate()&std::ios::goodbit) << std::endl; 00092 }
int HepMC::IO_PDG_ParticleDataTable::rdstate | ( | ) | const [inline] |
check the IO state
Definition at line 63 of file IO_PDG_ParticleDataTable.h.
00063 { return (int)m_file.rdstate(); }
bool HepMC::IO_PDG_ParticleDataTable::search_for_key_end | ( | std::istream & | in, | |
const char * | key | |||
) | [protected] |
for internal use
void HepMC::IO_PDG_ParticleDataTable::read_entry | ( | ParticleDataTable * | ) | [protected] |
read a line
void HepMC::IO_PDG_ParticleDataTable::write_event | ( | const GenEvent * | ) | [inline, private, virtual] |
write this GenEvent
Implements HepMC::IO_BaseClass.
Definition at line 70 of file IO_PDG_ParticleDataTable.h.
bool HepMC::IO_PDG_ParticleDataTable::fill_next_event | ( | GenEvent * | ) | [inline, private, virtual] |
fill this GenEvent
Implements HepMC::IO_BaseClass.
Definition at line 71 of file IO_PDG_ParticleDataTable.h.
void HepMC::IO_PDG_ParticleDataTable::write_particle_data_table | ( | const ParticleDataTable * | ) | [inline, private, virtual] |
write this ParticleDataTable
Implements HepMC::IO_BaseClass.
Definition at line 72 of file IO_PDG_ParticleDataTable.h.
GenEvent * HepMC::IO_BaseClass::read_next_event | ( | ) | [inline, inherited] |
do not over-ride
creates a new event and fills it by calling the sister method read_next_event( GenEvent* )
Definition at line 87 of file IO_BaseClass.h.
00087 { 00090 // 00091 // 1. create an empty event container 00092 GenEvent* evt = new GenEvent(); 00093 // 2. fill the evt container - if the read is successful, return the 00094 // pointer, otherwise return null and delete the evt 00095 if ( fill_next_event( evt ) ) return evt; 00096 // note: the below delete is only reached if read fails 00097 // ... thus there is not much overhead in new then delete 00098 // since this statement is rarely reached 00099 delete evt; 00100 return 0; 00101 }
ParticleDataTable * HepMC::IO_BaseClass::read_particle_data_table | ( | ) | [inline, inherited] |
do not over-ride
creates a new particle data table and fills it by calling the sister method read_particle_data_table( ParticleDataTable* )
Definition at line 103 of file IO_BaseClass.h.
00103 { 00106 // 00107 // 1. create an empty pdt 00108 ParticleDataTable* pdt = new ParticleDataTable(); 00109 // 2. fill the pdt container - if the read is successful, return the 00110 // pointer, otherwise return null and delete the evt 00111 if ( fill_particle_data_table( pdt ) ) return pdt; 00112 // next statement is only reached if read fails 00113 delete pdt; 00114 return 0; 00115 }
the same as read_next_event
Definition at line 121 of file IO_BaseClass.h.
00121 { 00122 evt = read_next_event(); 00123 return evt; 00124 }
ParticleDataTable *& HepMC::IO_BaseClass::operator>> | ( | ParticleDataTable *& | ) | [inline, virtual, inherited] |
the same as read_particle_data_table
Definition at line 137 of file IO_BaseClass.h.
00138 { 00139 pdt = read_particle_data_table(); 00140 return pdt; 00141 }
const GenEvent *& HepMC::IO_BaseClass::operator<< | ( | const GenEvent *& | ) | [inline, virtual, inherited] |
the same as write_event
Definition at line 126 of file IO_BaseClass.h.
00127 { 00128 write_event( evt ); 00129 return evt; 00130 }
the same as write_event
Definition at line 132 of file IO_BaseClass.h.
00132 { 00133 write_event( evt ); 00134 return evt; 00135 }
const ParticleDataTable *& HepMC::IO_BaseClass::operator<< | ( | const ParticleDataTable *& | ) | [inline, virtual, inherited] |
the same as write_particle_data_table
Definition at line 143 of file IO_BaseClass.h.
00144 { 00145 write_particle_data_table( pdt ); 00146 return pdt; 00147 }
ParticleDataTable *& HepMC::IO_BaseClass::operator<< | ( | ParticleDataTable *& | ) | [inline, virtual, inherited] |
the same as write_particle_data_table
Definition at line 149 of file IO_BaseClass.h.
00150 { 00151 write_particle_data_table( pdt ); 00152 return pdt; 00153 }
std::string HepMC::IO_PDG_ParticleDataTable::m_filename [private] |
Definition at line 77 of file IO_PDG_ParticleDataTable.h.
std::ifstream HepMC::IO_PDG_ParticleDataTable::m_file [private] |
Definition at line 78 of file IO_PDG_ParticleDataTable.h.