HepMC Reference Documentation

HepMC

HepMC::IO_HEPEVT Class Reference

HEPEVT IO class. More...

#include <IO_HEPEVT.h>

Inheritance diagram for HepMC::IO_HEPEVT:

HepMC::IO_BaseClass 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=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

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

Detailed Description

HEPEVT IO class.

IO class for reading the standard HEPEVT common block.

Examples:

example_MyPythia.cc, example_MyPythiaOnlyToHepMC.cc, example_PythiaStreamIO.cc, and testPythiaCopies.cc.

Definition at line 40 of file IO_HEPEVT.h.


Constructor & Destructor Documentation

HepMC::IO_HEPEVT::IO_HEPEVT (  ) 

Definition at line 12 of file IO_HEPEVT.cc.

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

Definition at line 18 of file IO_HEPEVT.cc.


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::HEPEVT_Wrapper::event_number(), HepMC::HEPEVT_Wrapper::first_child(), HepMC::HEPEVT_Wrapper::last_child(), HepMC::HEPEVT_Wrapper::number_children(), p, HepMC::GenVertex::position(), HepMC::GenVertex::set_position(), HepMC::HEPEVT_Wrapper::t(), HepMC::HEPEVT_Wrapper::x(), HepMC::HEPEVT_Wrapper::y(), and HepMC::HEPEVT_Wrapper::z().

Referenced by fill_next_event().

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::HEPEVT_Wrapper::e(), HepMC::HEPEVT_Wrapper::id(), HepMC::HEPEVT_Wrapper::m(), p, HepMC::HEPEVT_Wrapper::px(), HepMC::HEPEVT_Wrapper::py(), HepMC::HEPEVT_Wrapper::pz(), and HepMC::HEPEVT_Wrapper::status().

Referenced by fill_next_event().

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::HEPEVT_Wrapper::event_number(), HepMC::HEPEVT_Wrapper::first_parent(), HepMC::HEPEVT_Wrapper::last_parent(), HepMC::HEPEVT_Wrapper::number_parents(), p, HepMC::GenVertex::position(), HepMC::GenVertex::set_position(), HepMC::HEPEVT_Wrapper::t(), HepMC::HEPEVT_Wrapper::x(), HepMC::HEPEVT_Wrapper::y(), and HepMC::HEPEVT_Wrapper::z().

Referenced by fill_next_event().

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

fill this GenEvent

Implements HepMC::IO_BaseClass.

Definition at line 31 of file IO_HEPEVT.cc.

References HepMC::GenVertex::add_particle_out(), HepMC::GenEvent::add_vertex(), build_end_vertex(), build_particle(), build_production_vertex(), HepMC::HEPEVT_Wrapper::event_number(), HepMC::HEPEVT_Wrapper::number_entries(), HepMC::GenEvent::set_beam_particles(), HepMC::GenEvent::set_event_number(), and trust_beam_particles().

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

Definition at line 340 of file IO_HEPEVT.cc.

References p.

Referenced by write_event().

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

write output to ostr

Reimplemented from HepMC::IO_BaseClass.

Definition at line 20 of file IO_HEPEVT.cc.

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

default is true

Definition at line 126 of file IO_HEPEVT.h.

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

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

define mother daughter trust rules

Definition at line 129 of file IO_HEPEVT.h.

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

define mother daughter trust rules

Definition at line 132 of file IO_HEPEVT.h.

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

default is true

Definition at line 138 of file IO_HEPEVT.h.

Referenced by fill_next_event().

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.

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

write this GenEvent

Implements HepMC::IO_BaseClass.

Definition at line 110 of file IO_HEPEVT.cc.

References HepMC::FourVector::e(), HepMC::GenEvent::event_number(), find_in_map(), HepMC::HEPEVT_Wrapper::max_number_entries(), p, HepMC::FourVector::px(), HepMC::FourVector::py(), HepMC::FourVector::pz(), HepMC::HEPEVT_Wrapper::set_children(), HepMC::HEPEVT_Wrapper::set_event_number(), HepMC::HEPEVT_Wrapper::set_id(), HepMC::HEPEVT_Wrapper::set_mass(), HepMC::HEPEVT_Wrapper::set_momentum(), HepMC::HEPEVT_Wrapper::set_number_entries(), HepMC::HEPEVT_Wrapper::set_parents(), HepMC::HEPEVT_Wrapper::set_position(), HepMC::HEPEVT_Wrapper::set_status(), v, HepMC::GenEvent::vertices_begin(), and HepMC::GenEvent::vertices_end().


The documentation for this class was generated from the following files:
Generated on Thu Jan 7 13:10:20 2010 for HepMC by  doxygen 1.4.7