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

In This Package:

HepMC::IO_ExtendedAscii Class Reference

event input/output in ascii format for machine reading extended format contains HeavyIon and PdfInfo classes More...

#include <IO_ExtendedAscii.h>

Inheritance diagram for HepMC::IO_ExtendedAscii:

[legend]
Collaboration diagram for HepMC::IO_ExtendedAscii:
[legend]
List of all members.

Public Member Functions

 IO_ExtendedAscii (const char *filename="IO_ExtendedAscii.dat", std::ios::openmode mode=std::ios::out)
 constructor requiring a file name and std::ios mode
virtual ~IO_ExtendedAscii ()
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.
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

void write_vertex (GenVertex *)
 write vertex information
void write_beam_particles (std::pair< HepMC::GenParticle *, HepMC::GenParticle * >)
 write beam particle information
void write_heavy_ion (HeavyIon const *)
 write heavy ion information
void write_pdf_info (PdfInfo const *)
 write PDF information
void write_particle (GenParticle *p)
 write particle information
void write_particle_data (const ParticleData *d)
 write particle data information
bool write_end_listing ()
 write end tag
void output (const double &)
 write double
void output (const float &)
 write float
void output (const int &)
 write int
void output (const long int &)
 write long int
void output (const char &)
 write a single character

Private Member Functions

 IO_ExtendedAscii (const IO_ExtendedAscii &)

Private Attributes

std::ios::openmode m_mode
std::fstream m_file
bool m_finished_first_event_io
CommonIO m_common_io

Detailed Description

event input/output in ascii format for machine reading extended format contains HeavyIon and PdfInfo classes

Definition at line 65 of file IO_ExtendedAscii.h.


Constructor & Destructor Documentation

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

constructor requiring a file name and std::ios mode

virtual HepMC::IO_ExtendedAscii::~IO_ExtendedAscii (  )  [virtual]

HepMC::IO_ExtendedAscii::IO_ExtendedAscii ( const IO_ExtendedAscii  )  [inline, private]

Definition at line 111 of file IO_ExtendedAscii.h.

00111 : IO_BaseClass() {}


Member Function Documentation

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

write this event

Implements HepMC::IO_BaseClass.

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

get the next event

Implements HepMC::IO_BaseClass.

void HepMC::IO_ExtendedAscii::write_particle_data_table ( const ParticleDataTable  )  [virtual]

write this ParticleDataTable

Implements HepMC::IO_BaseClass.

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

fill this ParticleDataTable

Implements HepMC::IO_BaseClass.

void HepMC::IO_ExtendedAscii::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_ExtendedAscii-COMMENT\n"

int HepMC::IO_ExtendedAscii::rdstate (  )  const [inline]

check the state of the IO stream

Definition at line 140 of file IO_ExtendedAscii.h.

00140 { return (int)m_file.rdstate(); }

void HepMC::IO_ExtendedAscii::clear (  )  [inline]

clear the IO stream

Definition at line 141 of file IO_ExtendedAscii.h.

00141 { m_file.clear(); }

void HepMC::IO_ExtendedAscii::print ( std::ostream &  ostr = std::cout  )  const [virtual]

write to ostr

Reimplemented from HepMC::IO_BaseClass.

void HepMC::IO_ExtendedAscii::write_vertex ( GenVertex  )  [protected]

write vertex information

void HepMC::IO_ExtendedAscii::write_beam_particles ( std::pair< HepMC::GenParticle *, HepMC::GenParticle * >   )  [protected]

write beam particle information

void HepMC::IO_ExtendedAscii::write_heavy_ion ( HeavyIon const *   )  [protected]

write heavy ion information

void HepMC::IO_ExtendedAscii::write_pdf_info ( PdfInfo const *   )  [protected]

write PDF information

void HepMC::IO_ExtendedAscii::write_particle ( GenParticle p  )  [protected]

write particle information

void HepMC::IO_ExtendedAscii::write_particle_data ( const ParticleData d  )  [protected]

write particle data information

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

write end tag

void HepMC::IO_ExtendedAscii::output ( const double &   )  [inline, protected]

write double

Definition at line 123 of file IO_ExtendedAscii.h.

00123                                                           {
00124         if ( d == 0. ) {
00125             m_file << ' ' << (int)0;
00126         } else {
00127             m_file << ' ' << d;
00128         }
00129     }

void HepMC::IO_ExtendedAscii::output ( const float &   )  [inline, protected]

write float

Definition at line 130 of file IO_ExtendedAscii.h.

00130                                                          {
00131         if ( d == 0. ) {
00132             m_file << ' ' << (int)0;
00133         } else {
00134             m_file << ' ' << d;
00135         }
00136     }

void HepMC::IO_ExtendedAscii::output ( const int &   )  [inline, protected]

write int

Definition at line 137 of file IO_ExtendedAscii.h.

00137 { m_file << ' ' << i; }

void HepMC::IO_ExtendedAscii::output ( const long int &   )  [inline, protected]

write long int

Definition at line 138 of file IO_ExtendedAscii.h.

00138 { m_file << ' ' << i; }

void HepMC::IO_ExtendedAscii::output ( const char &   )  [inline, protected]

write a single character

Definition at line 139 of file IO_ExtendedAscii.h.

00139 { m_file << c; }

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::ios::openmode HepMC::IO_ExtendedAscii::m_mode [private]

Definition at line 113 of file IO_ExtendedAscii.h.

std::fstream HepMC::IO_ExtendedAscii::m_file [private]

Definition at line 114 of file IO_ExtendedAscii.h.

bool HepMC::IO_ExtendedAscii::m_finished_first_event_io [private]

Definition at line 115 of file IO_ExtendedAscii.h.

CommonIO HepMC::IO_ExtendedAscii::m_common_io [private]

Definition at line 116 of file IO_ExtendedAscii.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:44 2011 for HepMC by doxygen 1.4.7