StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Protected Member Functions | List of all members
HepMC::IO_HEPEVT Class Reference

HEPEVT IO class. More...

#include <IO_HEPEVT.h>

Inheritance diagram for HepMC::IO_HEPEVT:
HepMC::IO_BaseClass

Public Member Functions

bool fill_next_event (GenEvent *)
 fill this GenEvent More...
 
void write_event (const GenEvent *)
 write this GenEvent More...
 
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=true)
 define mother daughter trust rules
 
void set_trust_both_mothers_and_daughters (bool b=false)
 define mother daughter trust rules
 
void set_print_inconsistency_errors (bool b=true)
 
void set_trust_beam_particles (bool b=true)
 declare whether or not beam particles exist
 
- Public Member Functions inherited from HepMC::IO_BaseClass
GenEventread_next_event ()
 do not over-ride More...
 
virtual GenEvent *& operator>> (GenEvent *&)
 the same as read_next_event
 
virtual const GenEvent *& operator<< (const GenEvent *&)
 the same as write_event
 
virtual GenEvent *& operator<< (GenEvent *&)
 the same as write_event
 

Protected Member Functions

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

Detailed Description

HEPEVT IO class.

IO class for reading the standard HEPEVT common block.

Definition at line 39 of file IO_HEPEVT.h.

Member Function Documentation

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

create an end vertex

for particle in HEPEVT with index i, build an end vertex if appropriate, and add that vertex to the event

Definition at line 257 of file IO_HEPEVT.cc.

References HepMC::GenVertex::add_particle_in(), HepMC::GenVertex::add_particle_out(), HepMC::GenEvent::add_vertex(), HepMC::GenParticle::end_vertex(), HepMC::GenVertex::position(), HepMC::GenParticle::production_vertex(), and HepMC::GenVertex::set_position().

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

create a GenParticle

Builds a particle object corresponding to index in HEPEVT

Definition at line 325 of file IO_HEPEVT.cc.

References HepMC::GenParticle::setGeneratedMass(), and HepMC::GenParticle::suggest_barcode().

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

create a production vertex

for particle in HEPEVT with index i, build a production vertex if appropriate, and add that vertex to the event

Definition at line 191 of file IO_HEPEVT.cc.

References HepMC::GenVertex::add_particle_in(), HepMC::GenVertex::add_particle_out(), HepMC::GenEvent::add_vertex(), HepMC::GenVertex::position(), HepMC::GenParticle::production_vertex(), and HepMC::GenVertex::set_position().

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

fill this GenEvent

read one event from the HEPEVT common block and fill GenEvent return T/F =success/failure

For HEPEVT commons built with the luhepc routine of Pythia 5.7 the children pointers are not always correct (i.e. there is oftentimes an internal inconsistency between the parents and children pointers). The parent pointers always seem to be correct. Thus the switch trust_mothers_before_daughters=1 is appropriate for pythia. NOTE: you should also set the switch MSTP(128) = 2 in pythia (not the default!), so that pythia doesn't store two copies of resonances in the event record. The situation is opposite for the HEPEVT which comes from Isajet via stdhep, so then use the switch trust_mothers_before_daughters=0

sufficient to do one or the other.

Implements HepMC::IO_BaseClass.

Definition at line 31 of file IO_HEPEVT.cc.

References HepMC::GenVertex::add_particle_out(), HepMC::GenEvent::add_vertex(), HepMC::GenEvent::set_beam_particles(), and HepMC::GenEvent::set_event_number().

void HepMC::IO_HEPEVT::set_print_inconsistency_errors ( bool  b = true)
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 129 of file IO_HEPEVT.h.

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

write this GenEvent

This writes an event out to the HEPEVT common block. The daughters field is NOT filled, because it is possible to contruct graphs for which the mothers and daughters cannot both be make sequential. This is consistent with how pythia fills HEPEVT (daughters are not necessarily filled properly) and how IO_HEPEVT reads HEPEVT.

Implements HepMC::IO_BaseClass.

Definition at line 110 of file IO_HEPEVT.cc.

References HepMC::FourVector::e(), HepMC::GenEvent::event_number(), HepMC::FourVector::px(), HepMC::FourVector::py(), HepMC::FourVector::pz(), HepMC::FourVector::t(), HepMC::GenEvent::vertices_begin(), HepMC::GenEvent::vertices_end(), HepMC::FourVector::x(), HepMC::FourVector::y(), and HepMC::FourVector::z().


The documentation for this class was generated from the following files: