/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_AsciiParticles Class Reference

event input/output in ascii format for eye and machine reading More...

#include <IO_AsciiParticles.h>

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

List of all members.

Public Member Functions

 IO_AsciiParticles (const char *filename="IO_AsciiParticles.dat", std::ios::openmode mode=std::ios::out)
 constructor requiring a file name and std::ios mode
virtual ~IO_AsciiParticles ()
void write_event (const GenEvent *evt)
 write this event
bool fill_next_event (GenEvent *evt)
 get the next event
void write_particle_data_table (const ParticleDataTable *)
 write this ParticleDataTable
bool fill_particle_data_table (ParticleDataTable *)
 fill this ParticleDataTable
void 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.
void setPrecision (int iprec)
 set output precision
int rdstate () const
 check the state of the IO stream
void clear ()
 clear the IO stream
void print (std::ostream &ostr=std::cout) const
 write to ostr
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 write_end_listing ()
 write end tag

Private Member Functions

 IO_AsciiParticles (const IO_AsciiParticles &)

Private Attributes

int m_precision
std::ios::openmode m_mode
std::fstream * m_file
std::ostream * m_outstream
bool m_finished_first_event_io

Detailed Description

event input/output in ascii format for eye and machine reading

Strategy for reading or writing events/particleData as machine readable ascii to a file. When instantiating, the mode of file to be created must be specified.

Definition at line 54 of file IO_AsciiParticles.h.


Constructor & Destructor Documentation

HepMC::IO_AsciiParticles::IO_AsciiParticles ( const char *  filename = "IO_AsciiParticles.dat",
std::ios::openmode  mode = std::ios::out 
)

constructor requiring a file name and std::ios mode

virtual HepMC::IO_AsciiParticles::~IO_AsciiParticles ( ) [virtual]
HepMC::IO_AsciiParticles::IO_AsciiParticles ( const IO_AsciiParticles ) [inline, private]

Definition at line 85 of file IO_AsciiParticles.h.

: IO_BaseClass() {}

Member Function Documentation

void HepMC::IO_AsciiParticles::write_event ( const GenEvent evt) [virtual]

write this event

Implements HepMC::IO_BaseClass.

bool HepMC::IO_AsciiParticles::fill_next_event ( GenEvent evt) [virtual]

get the next event

Implements HepMC::IO_BaseClass.

void HepMC::IO_AsciiParticles::write_particle_data_table ( const ParticleDataTable ) [inline, virtual]

write this ParticleDataTable

Implements HepMC::IO_BaseClass.

Definition at line 106 of file IO_AsciiParticles.h.

{;}
bool HepMC::IO_AsciiParticles::fill_particle_data_table ( ParticleDataTable ) [inline, virtual]

fill this ParticleDataTable

Implements HepMC::IO_BaseClass.

Definition at line 107 of file IO_AsciiParticles.h.

{return false;}
void HepMC::IO_AsciiParticles::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_AsciiParticles-COMMENT\n"

void HepMC::IO_AsciiParticles::setPrecision ( int  iprec) [inline]

set output precision

Definition at line 100 of file IO_AsciiParticles.h.

{ m_precision=iprec; }
int HepMC::IO_AsciiParticles::rdstate ( ) const [inline]

check the state of the IO stream

Definition at line 98 of file IO_AsciiParticles.h.

{ return (int)m_file->rdstate(); }
void HepMC::IO_AsciiParticles::clear ( ) [inline]

clear the IO stream

Definition at line 99 of file IO_AsciiParticles.h.

{ m_file->clear(); }
void HepMC::IO_AsciiParticles::print ( std::ostream &  ostr = std::cout) const [virtual]

write to ostr

Reimplemented from HepMC::IO_BaseClass.

bool HepMC::IO_AsciiParticles::write_end_listing ( ) [protected]

write end tag

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 87 of file IO_AsciiParticles.h.

std::ios::openmode HepMC::IO_AsciiParticles::m_mode [private]

Definition at line 88 of file IO_AsciiParticles.h.

std::fstream* HepMC::IO_AsciiParticles::m_file [private]

Definition at line 89 of file IO_AsciiParticles.h.

std::ostream* HepMC::IO_AsciiParticles::m_outstream [private]

Definition at line 90 of file IO_AsciiParticles.h.

Definition at line 91 of file IO_AsciiParticles.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