HepMC Reference Documentation

HepMC

HepMC::GenVertex Class Reference

GenVertex contains information about decay vertices. More...

#include <GenVertex.h>

List of all members.

Public Types

typedef std::vector< HepMC::GenParticle
* >::const_iterator 
particles_in_const_iterator
 const iterator for incoming particles
typedef std::vector< HepMC::GenParticle
* >::const_iterator 
particles_out_const_iterator
 const iterator for outgoing particles

Public Member Functions

 GenVertex (const FourVector &position=FourVector(0, 0, 0, 0), int id=0, const WeightContainer &weights=std::vector< double >())
 default constructor
 GenVertex (const GenVertex &invertex)
 shallow copy
virtual ~GenVertex ()
void swap (GenVertex &other)
 swap
GenVertexoperator= (const GenVertex &invertex)
 shallow
bool operator== (const GenVertex &a) const
 equality
bool operator!= (const GenVertex &a) const
 inequality
void print (std::ostream &ostr=std::cout) const
 print vertex information
double check_momentum_conservation () const
 |Sum (mom_in-mom_out)|
void add_particle_in (GenParticle *inparticle)
 add incoming particle
void add_particle_out (GenParticle *outparticle)
 add outgoing particle
GenParticleremove_particle (GenParticle *particle)
 remove a particle
 operator HepMC::FourVector () const
 conversion operator
 operator HepMC::ThreeVector () const
 conversion operator
GenEventparent_event () const
 pointer to the event that owns this vertex
ThreeVector point3d () const
 vertex position
FourVector position () const
 vertex position and time
void set_position (const FourVector &position=FourVector(0, 0, 0, 0))
 set vertex position and time
int id () const
 vertex ID
void set_id (int id)
 set vertex ID
int barcode () const
 unique identifier
bool suggest_barcode (int the_bar_code)
 In general there is no reason to "suggest_barcode".
WeightContainerweights ()
 direct access to the weights container is allowed.
const WeightContainerweights () const
 const direct access to the weights container
particles_in_const_iterator particles_in_const_begin () const
 begin iteration of incoming particles
particles_in_const_iterator particles_in_const_end () const
 end iteration of incoming particles
particles_out_const_iterator particles_out_const_begin () const
 begin iteration of outgoing particles
particles_out_const_iterator particles_out_const_end () const
 end iteration of outgoing particles
int particles_in_size () const
 number of incoming particles
int particles_out_size () const
 number of outgoing particles
vertex_iterator vertices_begin (IteratorRange range=relatives)
 begin vertex range
vertex_iterator vertices_end (IteratorRange)
 end vertex range
particle_iterator particles_begin (IteratorRange range=relatives)
 begin particle range
particle_iterator particles_end (IteratorRange)
 end particle range

Protected Member Functions

void set_parent_event_ (GenEvent *evt)
 set parent event
void set_barcode_ (int the_bar_code)
 set identifier
int edges_size (IteratorRange range=family) const
 size
edge_iterator edges_begin (IteratorRange range=family) const
 begin range
edge_iterator edges_end (IteratorRange) const
 end range
void delete_adopted_particles ()
 for internal use only
void remove_particle_in (GenParticle *)
 for internal use only - remove particle from incoming list
void remove_particle_out (GenParticle *)
 for internal use only - remove particle from outgoing list

Static Protected Member Functions

static unsigned int counter ()
 temporary for debugging

Friends

class GenEvent
class edge_iterator
class vertex_iterator
class particle_iterator
std::ostream & operator<< (std::ostream &, const GenVertex &)
 print vertex information

Classes

class  edge_iterator
 edge iterator More...
class  particle_iterator
 particle iterator More...
class  vertex_iterator
 vertex iterator More...


Detailed Description

GenVertex contains information about decay vertices.

HepMC::GenVertex contains the position in space and time of a decay. It also contains lists of incoming and outgoing particles.

Examples:

example_BuildEventFromScratch.cc.

Definition at line 47 of file GenVertex.h.


Member Typedef Documentation

typedef std::vector<HepMC::GenParticle*>::const_iterator HepMC::GenVertex::particles_in_const_iterator

const iterator for incoming particles

Definition at line 130 of file GenVertex.h.

typedef std::vector<HepMC::GenParticle*>::const_iterator HepMC::GenVertex::particles_out_const_iterator

const iterator for outgoing particles

Definition at line 133 of file GenVertex.h.


Constructor & Destructor Documentation

HepMC::GenVertex::GenVertex ( const FourVector position = FourVector(0, 0, 0, 0),
int  id = 0,
const WeightContainer weights = std::vector< double >() 
)

default constructor

Definition at line 14 of file GenVertex.cc.

HepMC::GenVertex::GenVertex ( const GenVertex invertex  ) 

shallow copy

Shallow copy: does not copy the FULL list of particle pointers. Creates a copy of - invertex

Definition at line 22 of file GenVertex.cc.

References add_particle_in(), add_particle_out(), barcode(), particles_in_const_begin(), particles_in_const_end(), particles_out_const_begin(), particles_out_const_end(), and suggest_barcode().

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

Definition at line 62 of file GenVertex.cc.

References delete_adopted_particles(), parent_event(), and HepMC::GenEvent::remove_barcode().


Member Function Documentation

void HepMC::GenVertex::swap ( GenVertex other  ) 

swap

Definition at line 70 of file GenVertex.cc.

References m_barcode, m_event, m_id, m_particles_in, m_particles_out, m_position, m_weights, HepMC::WeightContainer::swap(), and HepMC::FourVector::swap().

Referenced by operator=().

GenVertex & HepMC::GenVertex::operator= ( const GenVertex invertex  ) 

shallow

Shallow: does not copy the FULL list of particle pointers. Creates a copy of - invertex

Definition at line 81 of file GenVertex.cc.

References swap().

bool HepMC::GenVertex::operator== ( const GenVertex a  )  const

equality

Returns true if the positions and the particles in the lists of a and this are identical. Does not compare barcodes. Note that it is impossible for two vertices to point to the same particle's address, so we need to do more than just compare the particle pointers

Definition at line 102 of file GenVertex.cc.

References particles_in_const_begin(), particles_in_const_end(), particles_in_size(), particles_out_const_begin(), particles_out_const_end(), particles_out_size(), and position().

bool HepMC::GenVertex::operator!= ( const GenVertex a  )  const

inequality

Definition at line 139 of file GenVertex.cc.

void HepMC::GenVertex::print ( std::ostream &  ostr = std::cout  )  const

print vertex information

Definition at line 144 of file GenVertex.cc.

References barcode(), HepMC::WeightContainer::end(), id(), particles_in_const_begin(), particles_in_const_end(), particles_out_const_begin(), particles_out_const_end(), position(), HepMC::WeightContainer::size(), HepMC::FourVector::t(), weights(), HepMC::FourVector::x(), HepMC::FourVector::y(), and HepMC::FourVector::z().

Referenced by HepMC::IO_HERWIG::build_production_vertex().

double HepMC::GenVertex::check_momentum_conservation (  )  const

|Sum (mom_in-mom_out)|

finds the difference between the total momentum out and the total momentum in vectors, and returns the magnitude of this vector i.e. returns | vec{p_in} - vec{p_out} |

Definition at line 252 of file GenVertex.cc.

References particles_in_const_begin(), particles_in_const_end(), particles_out_const_begin(), and particles_out_const_end().

void HepMC::GenVertex::add_particle_in ( GenParticle inparticle  ) 

add incoming particle

Examples:
example_BuildEventFromScratch.cc.

Definition at line 272 of file GenVertex.cc.

References HepMC::GenParticle::end_vertex(), remove_particle_in(), and HepMC::GenParticle::set_end_vertex_().

Referenced by HepMC::IO_HERWIG::build_end_vertex(), HepMC::IO_HERWIG::build_production_vertex(), HepMC::IO_HERWIG::fill_next_event(), HepMC::IO_ExtendedAscii::fill_next_event(), HepMC::IO_Ascii::fill_next_event(), GenVertex(), and main().

void HepMC::GenVertex::add_particle_out ( GenParticle outparticle  ) 

add outgoing particle

Examples:
example_BuildEventFromScratch.cc.

Definition at line 283 of file GenVertex.cc.

References HepMC::GenParticle::production_vertex(), remove_particle_out(), and HepMC::GenParticle::set_production_vertex_().

Referenced by HepMC::IO_HERWIG::build_end_vertex(), HepMC::IO_HERWIG::build_production_vertex(), HepMC::IO_HERWIG::fill_next_event(), HepMC::IO_HEPEVT::fill_next_event(), GenVertex(), and main().

GenParticle * HepMC::GenVertex::remove_particle ( GenParticle particle  ) 

remove a particle

remove_particle finds *particle in the in and/or out list and removes it from these lists ... it DOES NOT DELETE THE PARTICLE or its relations. You could delete the particle too as follows: delete vtx->remove_particle( particle );

this finds *particle in the in and/or out list and removes it from these lists ... it DOES NOT DELETE THE PARTICLE or its relations. you could delete the particle too as follows: delete vtx->remove_particle( particle ); or if the particle has an end vertex, you could: delete vtx->remove_particle( particle )->end_vertex(); which would delete the particle's end vertex, and thus would also delete the particle, since the particle would be owned by the end vertex.

Definition at line 294 of file GenVertex.cc.

References HepMC::GenParticle::end_vertex(), HepMC::GenParticle::production_vertex(), remove_particle_in(), remove_particle_out(), HepMC::GenParticle::set_end_vertex_(), and HepMC::GenParticle::set_production_vertex_().

HepMC::GenVertex::operator HepMC::FourVector (  )  const [inline]

conversion operator

Definition at line 365 of file GenVertex.h.

References position().

HepMC::GenVertex::operator HepMC::ThreeVector (  )  const [inline]

conversion operator

Definition at line 367 of file GenVertex.h.

References point3d().

GenEvent * HepMC::GenVertex::parent_event (  )  const [inline]

pointer to the event that owns this vertex

Definition at line 371 of file GenVertex.h.

Referenced by HepMC::GenEvent::add_vertex(), HepMC::GenParticle::parent_event(), HepMC::GenEvent::remove_vertex(), suggest_barcode(), and ~GenVertex().

ThreeVector HepMC::GenVertex::point3d (  )  const [inline]

vertex position

Definition at line 373 of file GenVertex.h.

References HepMC::FourVector::x(), HepMC::FourVector::y(), and HepMC::FourVector::z().

Referenced by operator HepMC::ThreeVector().

FourVector HepMC::GenVertex::position (  )  const [inline]

vertex position and time

Definition at line 369 of file GenVertex.h.

Referenced by HepMC::IO_HERWIG::build_end_vertex(), HepMC::IO_HERWIG::build_production_vertex(), operator HepMC::FourVector(), HepMC::operator<<(), operator==(), print(), and set_position().

void HepMC::GenVertex::set_position ( const FourVector position = FourVector(0, 0, 0, 0)  )  [inline]

set vertex position and time

Definition at line 387 of file GenVertex.h.

References position().

Referenced by HepMC::IO_HERWIG::build_end_vertex(), and HepMC::IO_HERWIG::build_production_vertex().

int HepMC::GenVertex::id (  )  const [inline]

vertex ID

we don't define what you use the id for -- but we imagine, for example it might code the meaning of the weights()

Definition at line 377 of file GenVertex.h.

Referenced by print().

void HepMC::GenVertex::set_id ( int  id  )  [inline]

set vertex ID

Definition at line 391 of file GenVertex.h.

int HepMC::GenVertex::barcode (  )  const [inline]

unique identifier

The barcode is the vertex's reference number, every vertex in the event has a unique barcode. Vertex barcodes are negative numbers, particle barcodes are positive numbers.

Definition at line 379 of file GenVertex.h.

Referenced by HepMC::GenEvent::add_vertex(), GenVertex(), HepMC::operator<<(), print(), HepMC::GenParticle::print(), HepMC::GenEvent::print(), HepMC::GenEvent::remove_vertex(), set_parent_event_(), HepMC::IO_ExtendedAscii::write_event(), HepMC::IO_AsciiParticles::write_event(), and HepMC::IO_Ascii::write_event().

bool HepMC::GenVertex::suggest_barcode ( int  the_bar_code  ) 

In general there is no reason to "suggest_barcode".

allows a barcode to be suggested for this vertex. In general it is better to let the event pick the barcode for you, which is automatic. Returns TRUE if the suggested barcode has been accepted (i.e. the suggested barcode has not already been used in the event, and so it was used). Returns FALSE if the suggested barcode was rejected, or if the vertex is not yet part of an event, such that it is not yet possible to know if the suggested barcode will be accepted).

Definition at line 362 of file GenVertex.cc.

References parent_event(), HepMC::GenEvent::set_barcode(), and set_barcode_().

Referenced by GenVertex().

WeightContainer & HepMC::GenVertex::weights (  )  [inline]

direct access to the weights container is allowed.

Definition at line 382 of file GenVertex.h.

Referenced by print().

const WeightContainer & HepMC::GenVertex::weights (  )  const [inline]

const direct access to the weights container

Definition at line 384 of file GenVertex.h.

GenVertex::particles_in_const_iterator HepMC::GenVertex::particles_in_const_begin (  )  const [inline]

begin iteration of incoming particles

Definition at line 398 of file GenVertex.h.

Referenced by check_momentum_conservation(), GenVertex(), operator==(), print(), and set_parent_event_().

GenVertex::particles_in_const_iterator HepMC::GenVertex::particles_in_const_end (  )  const [inline]

end iteration of incoming particles

Definition at line 403 of file GenVertex.h.

Referenced by check_momentum_conservation(), GenVertex(), operator==(), print(), and set_parent_event_().

GenVertex::particles_out_const_iterator HepMC::GenVertex::particles_out_const_begin (  )  const [inline]

begin iteration of outgoing particles

Definition at line 408 of file GenVertex.h.

Referenced by check_momentum_conservation(), GenVertex(), operator==(), print(), and set_parent_event_().

GenVertex::particles_out_const_iterator HepMC::GenVertex::particles_out_const_end (  )  const [inline]

end iteration of outgoing particles

Definition at line 413 of file GenVertex.h.

Referenced by check_momentum_conservation(), GenVertex(), operator==(), print(), and set_parent_event_().

int HepMC::GenVertex::particles_in_size (  )  const [inline]

number of incoming particles

Definition at line 417 of file GenVertex.h.

Referenced by operator==().

int HepMC::GenVertex::particles_out_size (  )  const [inline]

number of outgoing particles

Definition at line 421 of file GenVertex.h.

Referenced by operator==().

unsigned int HepMC::GenVertex::counter (  )  [static, protected]

temporary for debugging

Definition at line 421 of file GenVertex.cc.

Referenced by HepMC::GenEvent::clear(), HepMC::GenEvent::delete_all_vertices(), and HepMC::GenEvent::print().

void HepMC::GenVertex::set_parent_event_ ( GenEvent evt  )  [protected]

set parent event

only the GenEvent (friend) is allowed to set the parent_event, and barcode. It is done automatically anytime you add a vertex to an event

Definition at line 387 of file GenVertex.cc.

References barcode(), particles_in_const_begin(), particles_in_const_end(), particles_out_const_begin(), particles_out_const_end(), HepMC::GenEvent::remove_barcode(), and HepMC::GenEvent::set_barcode().

Referenced by HepMC::GenEvent::add_vertex(), and HepMC::GenEvent::remove_vertex().

void HepMC::GenVertex::set_barcode_ ( int  the_bar_code  )  [inline, protected]

set identifier

Definition at line 380 of file GenVertex.h.

Referenced by suggest_barcode().

int HepMC::GenVertex::edges_size ( IteratorRange  range = family  )  const [protected]

size

Definition at line 572 of file GenVertex.cc.

References HepMC::children, HepMC::family, and HepMC::parents.

GenVertex::edge_iterator HepMC::GenVertex::edges_begin ( IteratorRange  range = family  )  const [inline, protected]

begin range

Definition at line 439 of file GenVertex.h.

Referenced by HepMC::GenVertex::vertex_iterator::vertex_iterator().

GenVertex::edge_iterator HepMC::GenVertex::edges_end ( IteratorRange   )  const [inline, protected]

end range

Definition at line 444 of file GenVertex.h.

Referenced by HepMC::GenVertex::vertex_iterator::operator++(), and HepMC::GenVertex::vertex_iterator::vertex_iterator().

GenVertex::vertex_iterator HepMC::GenVertex::vertices_begin ( IteratorRange  range = relatives  )  [inline]

begin vertex range

Definition at line 467 of file GenVertex.h.

References vertex_iterator.

GenVertex::vertex_iterator HepMC::GenVertex::vertices_end ( IteratorRange   )  [inline]

end vertex range

Definition at line 473 of file GenVertex.h.

References vertex_iterator.

GenVertex::particle_iterator HepMC::GenVertex::particles_begin ( IteratorRange  range = relatives  )  [inline]

begin particle range

Definition at line 488 of file GenVertex.h.

References particle_iterator.

Referenced by HepMC::Flow::connected_partners(), and HepMC::Flow::dangling_connected_partners().

GenVertex::particle_iterator HepMC::GenVertex::particles_end ( IteratorRange   )  [inline]

end particle range

Definition at line 493 of file GenVertex.h.

References particle_iterator.

Referenced by HepMC::Flow::connected_partners(), and HepMC::Flow::dangling_connected_partners().

void HepMC::GenVertex::delete_adopted_particles (  )  [protected]

for internal use only

deletes all particles which this vertex owns to be used by the vertex destructor and operator=

Definition at line 328 of file GenVertex.cc.

Referenced by ~GenVertex().

void HepMC::GenVertex::remove_particle_in ( GenParticle  )  [protected]

for internal use only - remove particle from incoming list

this finds *particle in m_particles_in and removes it from that list

Definition at line 316 of file GenVertex.cc.

References HepMC::already_in_vector().

Referenced by add_particle_in(), and remove_particle().

void HepMC::GenVertex::remove_particle_out ( GenParticle  )  [protected]

for internal use only - remove particle from outgoing list

this finds *particle in m_particles_out and removes it from that list

Definition at line 322 of file GenVertex.cc.

References HepMC::already_in_vector().

Referenced by add_particle_out(), and remove_particle().


Friends And Related Function Documentation

friend class GenEvent [friend]

Definition at line 51 of file GenVertex.h.

friend class edge_iterator [friend]

Definition at line 205 of file GenVertex.h.

friend class vertex_iterator [friend]

Definition at line 284 of file GenVertex.h.

Referenced by vertices_begin(), and vertices_end().

friend class particle_iterator [friend]

Definition at line 332 of file GenVertex.h.

Referenced by particles_begin(), and particles_end().

std::ostream& operator<< ( std::ostream &  ostr,
const GenVertex vtx 
) [friend]

print vertex information

Definition at line 429 of file GenVertex.cc.


The documentation for this class was generated from the following files:
Generated on Tue Feb 5 13:25:46 2008 for HepMC by  doxygen 1.5.1-3