![]() |
HepMC Reference DocumentationHepMC |
#include <GenVertex.h>
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 | |
GenVertex & | operator= (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 | |
GenParticle * | remove_particle (GenParticle *particle) |
remove a particle | |
operator HepMC::FourVector () const | |
conversion operator | |
operator HepMC::ThreeVector () const | |
conversion operator | |
GenEvent * | parent_event () const |
pointer to the event that owns this vertex | |
ThreeVector | point3d () const |
vertex position | |
const 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". | |
WeightContainer & | weights () |
direct access to the weights container is allowed. | |
const WeightContainer & | weights () 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 | |
void | change_parent_event_ (GenEvent *evt) |
for use with swap | |
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 | |
void | convert_position (const double &) |
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... |
HepMC::GenVertex contains the position in space and time of a decay. It also contains lists of incoming and outgoing particles.
example_BuildEventFromScratch.cc, testFlow.cc, and testPrintBug.cc.
Definition at line 47 of file GenVertex.h.
typedef std::vector<HepMC::GenParticle*>::const_iterator HepMC::GenVertex::particles_in_const_iterator |
typedef std::vector<HepMC::GenParticle*>::const_iterator HepMC::GenVertex::particles_out_const_iterator |
HepMC::GenVertex::GenVertex | ( | const FourVector & | position = FourVector(0, 0, 0, 0) , |
|
int | id = 0 , |
|||
const WeightContainer & | weights = std::vector< double >() | |||
) |
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 23 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 63 of file GenVertex.cc.
References delete_adopted_particles(), parent_event(), and HepMC::GenEvent::remove_barcode().
void HepMC::GenVertex::add_particle_in | ( | GenParticle * | inparticle | ) |
add incoming particle
Definition at line 273 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_HEPEVT::build_end_vertex(), HepMC::IO_HERWIG::build_production_vertex(), HepMC::IO_HEPEVT::build_production_vertex(), HepMC::IO_HERWIG::fill_next_event(), GenVertex(), main(), and HepMC::GenEvent::read().
void HepMC::GenVertex::add_particle_out | ( | GenParticle * | outparticle | ) |
add outgoing particle
Definition at line 284 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_HEPEVT::build_end_vertex(), HepMC::IO_HERWIG::build_production_vertex(), HepMC::IO_HEPEVT::build_production_vertex(), HepMC::IO_HERWIG::fill_next_event(), HepMC::IO_HEPEVT::fill_next_event(), GenVertex(), and main().
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.
Please note that the barcodes are intended for internal use within HepMC as a unique identifier for the particles and vertices. Using the barcode to encode extra information is an abuse of the barcode data member and causes confusion among users.
Definition at line 400 of file GenVertex.h.
Referenced by HepMC::GenEvent::add_vertex(), HepMC::compareVertex(), GenVertex(), HepMC::operator<<(), print(), HepMC::GenParticle::print(), HepMC::GenEvent::print(), HepMC::GenEvent::remove_vertex(), set_parent_event_(), and HepMC::IO_AsciiParticles::write_event().
void HepMC::GenVertex::change_parent_event_ | ( | GenEvent * | evt | ) | [protected] |
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 253 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::convert_position | ( | const double & | ) | [protected] |
scale the position vector this method is only for use by GenEvent
Definition at line 918 of file GenVertex.cc.
References HepMC::FourVector::t(), HepMC::FourVector::x(), HepMC::FourVector::y(), and HepMC::FourVector::z().
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 329 of file GenVertex.cc.
Referenced by ~GenVertex().
GenVertex::edge_iterator HepMC::GenVertex::edges_begin | ( | IteratorRange | range = family |
) | const [inline, protected] |
begin range
Definition at line 460 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 465 of file GenVertex.h.
Referenced by HepMC::GenVertex::vertex_iterator::operator++(), and HepMC::GenVertex::vertex_iterator::vertex_iterator().
int HepMC::GenVertex::edges_size | ( | IteratorRange | range = family |
) | const [protected] |
size
Definition at line 595 of file GenVertex.cc.
References HepMC::children, HepMC::family, and HepMC::parents.
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 398 of file GenVertex.h.
Referenced by print().
HepMC::GenVertex::operator HepMC::FourVector | ( | ) | const [inline] |
HepMC::GenVertex::operator HepMC::ThreeVector | ( | ) | const [inline] |
bool HepMC::GenVertex::operator!= | ( | const GenVertex & | a | ) | const |
shallow
Shallow: does not copy the FULL list of particle pointers. Creates a copy of - invertex
Definition at line 82 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 103 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().
GenEvent * HepMC::GenVertex::parent_event | ( | ) | const [inline] |
pointer to the event that owns this vertex
Definition at line 392 of file GenVertex.h.
Referenced by HepMC::GenEvent::add_vertex(), HepMC::GenParticle::parent_event(), HepMC::GenEvent::remove_vertex(), suggest_barcode(), and ~GenVertex().
GenVertex::particle_iterator HepMC::GenVertex::particles_begin | ( | IteratorRange | range = relatives |
) | [inline] |
begin particle range
Definition at line 509 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 514 of file GenVertex.h.
References particle_iterator.
Referenced by HepMC::Flow::connected_partners(), and HepMC::Flow::dangling_connected_partners().
GenVertex::particles_in_const_iterator HepMC::GenVertex::particles_in_const_begin | ( | ) | const [inline] |
begin iteration of incoming particles
Definition at line 419 of file GenVertex.h.
Referenced by check_momentum_conservation(), HepMC::compareVertex(), 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 424 of file GenVertex.h.
Referenced by check_momentum_conservation(), HepMC::compareVertex(), GenVertex(), operator==(), print(), and set_parent_event_().
int HepMC::GenVertex::particles_in_size | ( | ) | const [inline] |
number of incoming particles
Definition at line 438 of file GenVertex.h.
Referenced by HepMC::compareVertex(), and operator==().
GenVertex::particles_out_const_iterator HepMC::GenVertex::particles_out_const_begin | ( | ) | const [inline] |
begin iteration of outgoing particles
Definition at line 429 of file GenVertex.h.
Referenced by check_momentum_conservation(), HepMC::compareVertex(), 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 434 of file GenVertex.h.
Referenced by check_momentum_conservation(), HepMC::compareVertex(), GenVertex(), operator==(), print(), and set_parent_event_().
int HepMC::GenVertex::particles_out_size | ( | ) | const [inline] |
number of outgoing particles
Definition at line 442 of file GenVertex.h.
Referenced by HepMC::compareVertex(), and operator==().
ThreeVector HepMC::GenVertex::point3d | ( | ) | const [inline] |
vertex position
Definition at line 394 of file GenVertex.h.
References HepMC::FourVector::x(), HepMC::FourVector::y(), and HepMC::FourVector::z().
Referenced by operator HepMC::ThreeVector().
const FourVector & HepMC::GenVertex::position | ( | ) | const [inline] |
vertex position and time
Definition at line 390 of file GenVertex.h.
Referenced by HepMC::IO_HERWIG::build_end_vertex(), HepMC::IO_HEPEVT::build_end_vertex(), HepMC::IO_HERWIG::build_production_vertex(), HepMC::IO_HEPEVT::build_production_vertex(), HepMC::compareVertex(), operator HepMC::FourVector(), HepMC::operator<<(), operator==(), print(), and set_position().
void HepMC::GenVertex::print | ( | std::ostream & | ostr = std::cout |
) | const |
print vertex information
Definition at line 145 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().
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 295 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_().
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 317 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 323 of file GenVertex.cc.
References HepMC::already_in_vector().
Referenced by add_particle_out(), and remove_particle().
void HepMC::GenVertex::set_barcode_ | ( | int | the_bar_code | ) | [inline, protected] |
void HepMC::GenVertex::set_id | ( | int | id | ) | [inline] |
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 388 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_position | ( | const FourVector & | position = FourVector(0, 0, 0, 0) |
) | [inline] |
set vertex position and time
Definition at line 408 of file GenVertex.h.
References position().
Referenced by HepMC::IO_HERWIG::build_end_vertex(), HepMC::IO_HEPEVT::build_end_vertex(), HepMC::IO_HERWIG::build_production_vertex(), and HepMC::IO_HEPEVT::build_production_vertex().
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 363 of file GenVertex.cc.
References parent_event(), HepMC::GenEvent::set_barcode(), and set_barcode_().
Referenced by GenVertex().
void HepMC::GenVertex::swap | ( | GenVertex & | other | ) |
swap
Definition at line 71 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::vertex_iterator HepMC::GenVertex::vertices_begin | ( | IteratorRange | range = relatives |
) | [inline] |
GenVertex::vertex_iterator HepMC::GenVertex::vertices_end | ( | IteratorRange | ) | [inline] |
const WeightContainer & HepMC::GenVertex::weights | ( | ) | const [inline] |
WeightContainer & HepMC::GenVertex::weights | ( | ) | [inline] |
direct access to the weights container is allowed.
Definition at line 403 of file GenVertex.h.
Referenced by print().
friend class edge_iterator [friend] |
Definition at line 217 of file GenVertex.h.
friend class GenEvent [friend] |
Definition at line 51 of file GenVertex.h.
std::ostream& operator<< | ( | std::ostream & | ostr, | |
const GenVertex & | vtx | |||
) | [friend] |
friend class particle_iterator [friend] |
friend class vertex_iterator [friend] |