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

In This Package:

HepMC::IO_HEPEVT Class Reference

IO class for reading the standard HEPEVT common block. More...

#include <IO_HEPEVT.h>

Inheritance diagram for HepMC::IO_HEPEVT:

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

Public Member Functions

 IO_HEPEVT ()
virtual ~IO_HEPEVT ()
bool fill_next_event (GenEvent *)
 fill this GenEvent
void write_event (const GenEvent *)
 write this GenEvent
void print (std::ostream &ostr=std::cout) const
 write output to ostr
bool trust_both_mothers_and_daughters () const
 default is false
bool trust_mothers_before_daughters () const
 default is true
bool print_inconsistency_errors () const
 default is true
bool trust_beam_particles () const
 default is true
void set_trust_mothers_before_daughters (bool b=1)
 define mother daughter trust rules
void set_trust_both_mothers_and_daughters (bool b=0)
 define mother daughter trust rules
void set_print_inconsistency_errors (bool b=1)
 Since HEPEVT has bi-directional pointers, it is possible that the mother/daughter pointers are inconsistent (though physically speaking this should never happen).
void set_trust_beam_particles (bool b=true)
 declare whether or not beam particles exist
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

GenParticlebuild_particle (int index)
 create a GenParticle
void build_production_vertex (int i, std::vector< HepMC::GenParticle * > &hepevt_particle, GenEvent *evt)
 create a production vertex
void build_end_vertex (int i, std::vector< HepMC::GenParticle * > &hepevt_particle, GenEvent *evt)
 create an end vertex
int find_in_map (const std::map< HepMC::GenParticle *, int > &m, GenParticle *p) const
 find this particle in the particle map

Private Member Functions

virtual void write_particle_data_table (const ParticleDataTable *)
 write this ParticleDataTable
virtual bool fill_particle_data_table (ParticleDataTable *)
 fill this ParticleDataTable
 IO_HEPEVT (const IO_HEPEVT &)

Private Attributes

bool m_trust_mothers_before_daughters
bool m_trust_both_mothers_and_daughters
bool m_print_inconsistency_errors
bool m_trust_beam_particles

Detailed Description

IO class for reading the standard HEPEVT common block.

Definition at line 40 of file IO_HEPEVT.h.


Constructor & Destructor Documentation

HepMC::IO_HEPEVT::IO_HEPEVT (  ) 

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

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

Definition at line 107 of file IO_HEPEVT.h.

00107 : IO_BaseClass() {}


Member Function Documentation

bool HepMC::IO_HEPEVT::fill_next_event ( GenEvent  )  [virtual]

fill this GenEvent

Implements HepMC::IO_BaseClass.

void HepMC::IO_HEPEVT::write_event ( const GenEvent  )  [virtual]

write this GenEvent

Implements HepMC::IO_BaseClass.

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

write output to ostr

Reimplemented from HepMC::IO_BaseClass.

bool HepMC::IO_HEPEVT::trust_both_mothers_and_daughters (  )  const [inline]

default is false

Definition at line 120 of file IO_HEPEVT.h.

bool HepMC::IO_HEPEVT::trust_mothers_before_daughters (  )  const [inline]

default is true

Definition at line 123 of file IO_HEPEVT.h.

bool HepMC::IO_HEPEVT::print_inconsistency_errors (  )  const [inline]

default is true

Definition at line 126 of file IO_HEPEVT.h.

00127     { return m_print_inconsistency_errors; }

bool HepMC::IO_HEPEVT::trust_beam_particles (  )  const [inline]

default is true

Definition at line 138 of file IO_HEPEVT.h.

00139     { return m_trust_beam_particles; }

void HepMC::IO_HEPEVT::set_trust_mothers_before_daughters ( bool  b = 1  )  [inline]

define mother daughter trust rules

Definition at line 132 of file IO_HEPEVT.h.

void HepMC::IO_HEPEVT::set_trust_both_mothers_and_daughters ( bool  b = 0  )  [inline]

define mother daughter trust rules

Definition at line 129 of file IO_HEPEVT.h.

void HepMC::IO_HEPEVT::set_print_inconsistency_errors ( bool  b = 1  )  [inline]

Since HEPEVT has bi-directional pointers, it is possible that the mother/daughter pointers are inconsistent (though physically speaking this should never happen).

In practise it happens often. When a conflict occurs (i.e. when mother/daughter pointers are in disagreement, where an empty (0) pointer is not considered a disagreement) an error is printed. These errors can be turned off with: myio_hepevt.set_print_inconsistency_errors(0); but it is STRONGLY recommended that you print the HEPEVT common and understand the inconsistency BEFORE you turn off the errors. The messages are there for a reason [remember, there is no message printed when the information is missing, ... only when is it inconsistent. User beware.] You can inspect the HEPEVT common block for inconsistencies with HEPEVT_Wrapper::check_hepevt_consistency()

There is a switch controlling whether the mother pointers or the daughters are to be trusted. For example, in Pythia the mother information is always correctly included, but the daughter information is often left unfilled: in this case we want to trust the mother pointers and not necessarily the daughters. [THIS IS THE DEFAULT]. Unfortunately the reverse happens for the stdhep(2001) translation of Isajet, so we need an option to toggle the choices.

Definition at line 135 of file IO_HEPEVT.h.

void HepMC::IO_HEPEVT::set_trust_beam_particles ( bool  b = true  )  [inline]

declare whether or not beam particles exist

Definition at line 141 of file IO_HEPEVT.h.

00142     { m_trust_beam_particles = b; }

GenParticle* HepMC::IO_HEPEVT::build_particle ( int  index  )  [protected]

create a GenParticle

void HepMC::IO_HEPEVT::build_production_vertex ( int  i,
std::vector< HepMC::GenParticle * > &  hepevt_particle,
GenEvent evt 
) [protected]

create a production vertex

void HepMC::IO_HEPEVT::build_end_vertex ( int  i,
std::vector< HepMC::GenParticle * > &  hepevt_particle,
GenEvent evt 
) [protected]

create an end vertex

int HepMC::IO_HEPEVT::find_in_map ( const std::map< HepMC::GenParticle *, int > &  m,
GenParticle p 
) const [protected]

find this particle in the particle map

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

write this ParticleDataTable

Implements HepMC::IO_BaseClass.

Definition at line 102 of file IO_HEPEVT.h.

00102 {}

virtual bool HepMC::IO_HEPEVT::fill_particle_data_table ( ParticleDataTable  )  [inline, private, virtual]

fill this ParticleDataTable

Implements HepMC::IO_BaseClass.

Definition at line 103 of file IO_HEPEVT.h.

00104             { return 0; }

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

bool HepMC::IO_HEPEVT::m_trust_mothers_before_daughters [private]

Definition at line 111 of file IO_HEPEVT.h.

bool HepMC::IO_HEPEVT::m_trust_both_mothers_and_daughters [private]

Definition at line 112 of file IO_HEPEVT.h.

bool HepMC::IO_HEPEVT::m_print_inconsistency_errors [private]

Definition at line 113 of file IO_HEPEVT.h.

bool HepMC::IO_HEPEVT::m_trust_beam_particles [private]

Definition at line 114 of file IO_HEPEVT.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