HepMC Reference Documentation

HepMC

HepMC::IO_HERWIG Class Reference

IO_HERWIG is used to get Herwig information. More...

#include <IO_HERWIG.h>

Inheritance diagram for HepMC::IO_HERWIG:

HepMC::IO_BaseClass List of all members.

Public Member Functions

 IO_HERWIG ()
virtual ~IO_HERWIG ()
bool fill_next_event (GenEvent *)
 get the next event
void print (std::ostream &ostr=std::cout) const
 write to ostr
double interfaces_to_version_number () const
 this information is dubious
bool print_inconsistency_errors () const
 default is true
void set_print_inconsistency_errors (bool b=true)
 decide whether or not to print inconsistency errors
bool no_gaps_in_barcodes () const
 ask how to deal with extra non-physical pseudo particles
void set_no_gaps_in_barcodes (bool a)

Protected Member Functions

bool trust_both_mothers_and_daughters () const
 default is true
bool trust_mothers_before_daughters () const
 default is false
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
GenParticlebuild_particle (int index)
 make a particle
void build_production_vertex (int i, std::vector< GenParticle * > &hepevt_particle, GenEvent *evt)
 make a production vertex
void build_end_vertex (int i, std::vector< GenParticle * > &hepevt_particle, GenEvent *evt)
 make a decay vertex
int find_in_map (const std::map< GenParticle *, int > &m, GenParticle *p) const
 find this particle in the map
void repair_hepevt () const
 make the HERWIG HEPEVT common block look like the standard
void remove_gaps_in_hepevt () const
 deal with artifacts of repairing HEPEVT
void zero_hepevt_entry (int i) const
 zero out a HEPEVT pseudo particle
int translate_herwig_to_pdg_id (int i) const
 translate particle ID

Detailed Description

IO_HERWIG is used to get Herwig information.

IO class for reading the HEPEVT common block from the Herwig monte carlo program.

Examples:

example_MyHerwig.cc, and testHerwigCopies.cc.

Definition at line 57 of file IO_HERWIG.h.


Constructor & Destructor Documentation

HepMC::IO_HERWIG::IO_HERWIG (  ) 

Definition at line 12 of file IO_HERWIG.cc.

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

Definition at line 83 of file IO_HERWIG.cc.


Member Function Documentation

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

make a decay vertex

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

Definition at line 304 of file IO_HERWIG.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_HERWIG::build_particle ( int  index  )  [protected]

make a particle

Builds a particle object corresponding to index in HEPEVT

Definition at line 372 of file IO_HERWIG.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_HERWIG::build_production_vertex ( int  i,
std::vector< GenParticle * > &  hepevt_particle,
GenEvent evt 
) [protected]

make 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 231 of file IO_HERWIG.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::print(), 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_HERWIG::fill_next_event ( GenEvent  )  [virtual]

get the next event

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

sufficient to do one or the other.

Implements HepMC::IO_BaseClass.

Definition at line 96 of file IO_HERWIG.cc.

References HepMC::GenVertex::add_particle_in(), 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::first_parent(), HepMC::HEPEVT_Wrapper::number_entries(), repair_hepevt(), HepMC::GenEvent::set_beam_particles(), HepMC::GenEvent::set_event_number(), HepMC::GenEvent::set_signal_process_vertex(), and HepMC::HEPEVT_Wrapper::status().

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

find this particle in the map

Definition at line 387 of file IO_HERWIG.cc.

References p.

double HepMC::IO_HERWIG::interfaces_to_version_number (  )  const [inline]

this information is dubious

Definition at line 66 of file IO_HERWIG.h.

bool HepMC::IO_HERWIG::no_gaps_in_barcodes (  )  const [inline]

ask how to deal with extra non-physical pseudo particles

Definition at line 75 of file IO_HERWIG.h.

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

write to ostr

Reimplemented from HepMC::IO_BaseClass.

Definition at line 85 of file IO_HERWIG.cc.

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

default is true

Definition at line 149 of file IO_HERWIG.h.

void HepMC::IO_HERWIG::remove_gaps_in_hepevt (  )  const [protected]

deal with artifacts of repairing HEPEVT

in this scenario, we do not allow there to be zero-ed entries in the HEPEVT common block, and so be reshuffle the common block, removing the zeero-ed entries as we go and making sure we keep the mother/daughter relationships appropriate

Definition at line 682 of file IO_HERWIG.cc.

References HepMC::HEPEVT_Wrapper::e(), HepMC::HEPEVT_Wrapper::first_child(), HepMC::HEPEVT_Wrapper::first_parent(), HepMC::HEPEVT_Wrapper::id(), HepMC::HEPEVT_Wrapper::last_child(), HepMC::HEPEVT_Wrapper::last_parent(), HepMC::HEPEVT_Wrapper::m(), HepMC::HEPEVT_Wrapper::number_entries(), HepMC::HEPEVT_Wrapper::px(), HepMC::HEPEVT_Wrapper::py(), HepMC::HEPEVT_Wrapper::pz(), HepMC::HEPEVT_Wrapper::set_children(), 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(), HepMC::HEPEVT_Wrapper::status(), HepMC::HEPEVT_Wrapper::t(), HepMC::HEPEVT_Wrapper::x(), HepMC::HEPEVT_Wrapper::y(), and HepMC::HEPEVT_Wrapper::z().

Referenced by repair_hepevt().

void HepMC::IO_HERWIG::repair_hepevt (  )  const [protected]

make the HERWIG HEPEVT common block look like the standard

This routine takes the HEPEVT common block as used in HERWIG, and converts it into the HEPEVT common block in the standard format

This means it:

Special HERWIG status codes 101,102 colliding beam particles 103 beam-beam collision CMS vector 120 hard subprocess CMS vector 121,122 hard subprocess colliding partons 123-129 hard subprocess outgoing particles 141-149 (ID=94) mirror image of hard subrpocess particles 100 (ID=0 cone)

Special HERWIG particle id's 91 clusters 94 jets 0 others with no pdg code

Definition at line 394 of file IO_HERWIG.cc.

References HepMC::HEPEVT_Wrapper::first_child(), HepMC::HEPEVT_Wrapper::first_parent(), HepMC::HEPEVT_Wrapper::id(), HepMC::HEPEVT_Wrapper::last_child(), HepMC::HEPEVT_Wrapper::last_parent(), HepMC::HEPEVT_Wrapper::number_entries(), remove_gaps_in_hepevt(), HepMC::HEPEVT_Wrapper::set_children(), HepMC::HEPEVT_Wrapper::set_id(), HepMC::HEPEVT_Wrapper::set_parents(), HepMC::HEPEVT_Wrapper::status(), translate_herwig_to_pdg_id(), and zero_hepevt_entry().

Referenced by fill_next_event().

void HepMC::IO_HERWIG::set_no_gaps_in_barcodes ( bool  a  )  [inline]

The HERWIG HEPEVT common block has some EXTRA non-physical ENTRIES (such as CMS frame, HARD subprocess, and CONE). These are removed by IO_HERWIG. Thus the HepMC event will APPEAR to have fewer particles in it that herwig did. There is a switch m_no_gaps_in_barcodes. For true - then the extra particles are removed from HEPEVT, with the result that the HepMC barcodes will be sequential, with no gaps. false - the barcodes will correspond directly to the HEPEVT index, but there will be gaps ... ie some barcodes will be unassigned. this switch requested by I Hinchliffe, October 31, 2002

Definition at line 88 of file IO_HERWIG.h.

void HepMC::IO_HERWIG::set_print_inconsistency_errors ( bool  b = true  )  [inline]

decide whether or not to print inconsistency errors

Definition at line 158 of file IO_HERWIG.h.

void HepMC::IO_HERWIG::set_trust_both_mothers_and_daughters ( bool  b = false  )  [inline, protected]

define mother daughter trust rules

Definition at line 152 of file IO_HERWIG.h.

void HepMC::IO_HERWIG::set_trust_mothers_before_daughters ( bool  b = true  )  [inline, protected]

define mother daughter trust rules

Definition at line 155 of file IO_HERWIG.h.

int HepMC::IO_HERWIG::translate_herwig_to_pdg_id ( int  i  )  const [protected]

translate particle ID

This routine is copied from Lynn Garren's stdhep 5.01. see http:///cepa.fnal.gov/psm/stdhep/

Definition at line 753 of file IO_HERWIG.cc.

Referenced by repair_hepevt().

bool HepMC::IO_HERWIG::trust_both_mothers_and_daughters (  )  const [inline, protected]

default is true

Definition at line 143 of file IO_HERWIG.h.

bool HepMC::IO_HERWIG::trust_mothers_before_daughters (  )  const [inline, protected]

default is false

Definition at line 146 of file IO_HERWIG.h.

void HepMC::IO_HERWIG::zero_hepevt_entry ( int  i  )  const [protected]

zero out a HEPEVT pseudo particle

Definition at line 742 of file IO_HERWIG.cc.

References HepMC::HEPEVT_Wrapper::max_number_entries(), HepMC::HEPEVT_Wrapper::set_children(), HepMC::HEPEVT_Wrapper::set_id(), HepMC::HEPEVT_Wrapper::set_mass(), HepMC::HEPEVT_Wrapper::set_momentum(), HepMC::HEPEVT_Wrapper::set_parents(), HepMC::HEPEVT_Wrapper::set_position(), and HepMC::HEPEVT_Wrapper::set_status().

Referenced by repair_hepevt().


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