| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

HepMC::IO_PDG_ParticleDataTable Class Reference

Example of reading from file PDG98_ParticleDataTable.txt. More...

#include <IO_PDG_ParticleDataTable.h>

Inheritance diagram for HepMC::IO_PDG_ParticleDataTable:

[legend]
Collaboration diagram for HepMC::IO_PDG_ParticleDataTable:
[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

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.

00074                                                                     : 
00075             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.

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.

00070 {}

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.

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

00072 {}

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     }

GenEvent *& HepMC::IO_BaseClass::operator>> ( GenEvent *&   )  [inline, virtual, inherited]

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     }

GenEvent *& HepMC::IO_BaseClass::operator<< ( GenEvent *&   )  [inline, virtual, inherited]

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     }


Member Data Documentation

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.


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

Generated on Mon Apr 11 19:56:45 2011 for HepMC by doxygen 1.4.7