00001
00002 #ifndef HEPMC_IO_PDG_PARTICLEDATATABLE_H
00003 #define HEPMC_IO_PDG_PARTICLEDATATABLE_H
00004
00006
00007
00008
00009
00010
00011
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #include "HepMC/IO_BaseClass.h"
00037 #include <fstream>
00038
00039 namespace HepMC {
00040
00041 class GenEvent;
00042
00044
00049 class IO_PDG_ParticleDataTable : public IO_BaseClass {
00050 public:
00052 IO_PDG_ParticleDataTable( const char* filename
00053 ="PDG98_ParticleDataTable.txt" );
00054 virtual ~IO_PDG_ParticleDataTable();
00056 bool fill_particle_data_table( ParticleDataTable* );
00058 void add_quarks_to_table( ParticleDataTable& );
00060 void print( std::ostream& ostr = std::cout ) const;
00061
00063 int rdstate() const { return (int)m_file.rdstate(); }
00064 protected:
00066 bool search_for_key_end( std::istream& in, const char* key );
00068 void read_entry( ParticleDataTable* );
00069 private:
00070 void write_event( const GenEvent* ){}
00071 bool fill_next_event( GenEvent* ){ return 0; }
00072 void write_particle_data_table( const ParticleDataTable* ){}
00073 private:
00074 IO_PDG_ParticleDataTable( const IO_PDG_ParticleDataTable& ) :
00075 IO_BaseClass() {}
00076 private:
00077 std::string m_filename;
00078 std::ifstream m_file;
00079 };
00080
00082
00084
00085 inline void IO_PDG_ParticleDataTable::print( std::ostream& ostr ) const {
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 }
00093
00094 }
00095
00096 #endif // HEPMC_IO_BASECLASS_H
00097
00098
00099
00100
00101
00102
00103
00104