StRoot
1
|
GenVertex contains information about decay vertices. More...
#include <GenVertex.h>
Classes | |
class | edge_iterator |
edge iterator More... | |
class | particle_iterator |
particle iterator More... | |
class | vertex_iterator |
vertex iterator More... | |
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 More... | |
void | swap (GenVertex &other) |
swap | |
GenVertex & | operator= (const GenVertex &invertex) |
shallow More... | |
bool | operator== (const GenVertex &a) const |
equality More... | |
bool | operator!= (const GenVertex &a) const |
inequality | |
void | print (std::ostream &ostr=std::cout) const |
print vertex information | |
double | check_momentum_conservation () const |
|Sum (three_mom_in-three_mom_out)| More... | |
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 More... | |
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 More... | |
void | set_id (int id) |
set vertex ID | |
int | barcode () const |
unique identifier More... | |
bool | suggest_barcode (int the_bar_code) |
In general there is no reason to "suggest_barcode". More... | |
WeightContainer & | weights () |
direct access to the weights container is allowed. | |
const WeightContainer & | weights () const |
const direct access to the weights container | |
GenVertexParticleRange | particles (IteratorRange range=relatives) |
particle range | |
GenParticleProductionRange | particles_in (GenParticle &, IteratorRange range=relatives) |
incoming particle range | |
ConstGenParticleProductionRange | particles_in (GenParticle const &, IteratorRange range=relatives) const |
incoming particle range | |
GenParticleEndRange | particles_out (GenParticle &, IteratorRange range=relatives) |
outgoing particle range | |
ConstGenParticleEndRange | particles_out (GenParticle const &, IteratorRange range=relatives) const |
outgoing particle range | |
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 More... | |
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 More... | |
void | remove_particle_in (GenParticle *) |
for internal use only - remove particle from incoming list More... | |
void | remove_particle_out (GenParticle *) |
for internal use only - remove particle from outgoing list More... | |
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 | |
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.
Definition at line 52 of file GenVertex.h.
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().
|
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 416 of file GenVertex.h.
Referenced by HepMC::GenEvent::add_vertex(), GenVertex(), HepMC::operator<<(), print(), HepMC::GenParticle::print(), HepMC::GenEvent::print(), HepMC::GenEvent::remove_barcode(), HepMC::GenEvent::remove_vertex(), HepMC::GenEvent::set_barcode(), set_parent_event_(), and HepMC::IO_AsciiParticles::write_event().
double HepMC::GenVertex::check_momentum_conservation | ( | ) | const |
|Sum (three_mom_in-three_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().
|
protected |
scale the position vector this method is only for use by GenEvent
scale the position vector this method is only for use by GenEvent convert_position assumes that 4th component of the position vector is ctau rather than time and has units of length-time
Definition at line 918 of file GenVertex.cc.
References HepMC::FourVector::t(), HepMC::FourVector::x(), HepMC::FourVector::y(), and HepMC::FourVector::z().
|
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.
|
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 414 of file GenVertex.h.
Referenced by print().
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().
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_().
Referenced by Tauolapp::TauolaHepMCParticle::undecay().
|
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().
|
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().
|
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().
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 HepMC::GenEvent::GenEvent(), and GenVertex().