/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
HepMC::IO_PDG_ParticleDataTable Class Reference

an example ParticleDataTable IO method More...

#include <IO_PDG_ParticleDataTable.h>

Inheritance diagram for HepMC::IO_PDG_ParticleDataTable:
Inheritance graph
[legend]
Collaboration diagram for HepMC::IO_PDG_ParticleDataTable:
Collaboration graph
[legend]

List of all members.

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
GenEventread_next_event ()
 do not over-ride
ParticleDataTableread_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

Detailed Description

an example ParticleDataTable IO method

Example of reading from file PDG98_ParticleDataTable.txt

Definition at line 49 of file IO_PDG_ParticleDataTable.h.


Constructor & Destructor Documentation

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]

Definition at line 74 of file IO_PDG_ParticleDataTable.h.

                                                                    : 
            IO_BaseClass() {}

Member Function Documentation

bool HepMC::IO_PDG_ParticleDataTable::fill_particle_data_table ( ParticleDataTable ) [virtual]

read the input and fill the table

Implements HepMC::IO_BaseClass.

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.

                                                                        { 
        ostr << "IO_PDG_ParticleDataTable: for computer readable PDG tables.\n"
             << " file state: " << m_file.rdstate()
             << " bad:" << (m_file.rdstate()&std::ios::badbit)
             << " eof:" << (m_file.rdstate()&std::ios::eofbit)
             << " fail:" << (m_file.rdstate()&std::ios::failbit)
             << " good:" << (m_file.rdstate()&std::ios::goodbit) << std::endl;
    }
int HepMC::IO_PDG_ParticleDataTable::rdstate ( ) const [inline]

check the IO state

Definition at line 63 of file IO_PDG_ParticleDataTable.h.

{ 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.

{ return 0; }
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.

                                                   {
        // 
        // 1. create an empty event container
        GenEvent* evt = new GenEvent();
        // 2. fill the evt container - if the read is successful, return the
        //    pointer, otherwise return null and delete the evt
        if ( fill_next_event( evt ) ) return evt;
        // note: the below delete is only reached if read fails
        //       ... thus there is not much overhead in new then delete 
        //       since this statement is rarely reached
        delete evt;
        return 0;
    }
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.

                                                                     {
        //
        // 1. create an empty pdt
        ParticleDataTable* pdt = new ParticleDataTable();
        // 2. fill the pdt container - if the read is successful, return the
        //    pointer, otherwise return null and delete the evt
        if ( fill_particle_data_table( pdt ) ) return pdt;
        // next statement is only reached if read fails
        delete pdt;
        return 0;
    }
GenEvent *& HepMC::IO_BaseClass::operator>> ( GenEvent *&  evt) [inline, virtual, inherited]

the same as read_next_event

Definition at line 121 of file IO_BaseClass.h.

                                                              {
        evt = read_next_event();
        return evt;
    }
ParticleDataTable *& HepMC::IO_BaseClass::operator>> ( ParticleDataTable *&  pdt) [inline, virtual, inherited]

the same as read_particle_data_table

Definition at line 137 of file IO_BaseClass.h.

                                                                    {
        pdt = read_particle_data_table();
        return pdt;
    }
const GenEvent *& HepMC::IO_BaseClass::operator<< ( const GenEvent *&  evt) [inline, virtual, inherited]

the same as write_event

Definition at line 126 of file IO_BaseClass.h.

                                                                     {
        write_event( evt );
        return evt;
    }
GenEvent *& HepMC::IO_BaseClass::operator<< ( GenEvent *&  evt) [inline, virtual, inherited]

the same as write_event

Definition at line 132 of file IO_BaseClass.h.

                                                               {
        write_event( evt );
        return evt;
    }
const ParticleDataTable *& HepMC::IO_BaseClass::operator<< ( const ParticleDataTable *&  pdt) [inline, virtual, inherited]

the same as write_particle_data_table

Definition at line 143 of file IO_BaseClass.h.

                                                                             {
        write_particle_data_table( pdt );
        return pdt;
    }
ParticleDataTable *& HepMC::IO_BaseClass::operator<< ( ParticleDataTable *&  pdt) [inline, virtual, inherited]

the same as write_particle_data_table

Definition at line 149 of file IO_BaseClass.h.

                                                                              {
        write_particle_data_table( pdt );
        return pdt;
    }

Member Data Documentation

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.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:49:37 for HepMC by doxygen 1.7.4