HepMC3 event record library
|
Stores vertex-related information. More...
#include <GenVertex.h>
Public Member Functions | |
Constructors | |
GenVertex (const FourVector &position=FourVector::ZERO_VECTOR()) | |
Default constructor. More... | |
GenVertex (const GenVertexData &data) | |
Constructor based on vertex data. More... | |
Accessors | |
GenEvent * | parent_event () |
Get parent event. More... | |
const GenEvent * | parent_event () const |
Get parent event. More... | |
bool | in_event () const |
Check if this vertex belongs to an event. More... | |
int | id () const |
void | set_id (int id) |
set the vertex identifier More... | |
int | status () const |
Get vertex status code. More... | |
void | set_status (int stat) |
Set vertex status code. More... | |
const GenVertexData & | data () const |
Get vertex data. More... | |
void | add_particle_in (GenParticlePtr p) |
Add incoming particle. More... | |
void | add_particle_out (GenParticlePtr p) |
Add outgoing particle. More... | |
void | remove_particle_in (GenParticlePtr p) |
Remove incoming particle. More... | |
void | remove_particle_out (GenParticlePtr p) |
Remove outgoing particle. More... | |
const std::vector < GenParticlePtr > & | particles_in () |
Get list of incoming particles. More... | |
const std::vector < ConstGenParticlePtr > & | particles_in () const |
Get list of incoming particles (for const access) More... | |
const std::vector < GenParticlePtr > & | particles_out () |
Get list of outgoing particles. More... | |
const std::vector < ConstGenParticlePtr > & | particles_out () const |
Get list of outgoing particles (for const access) More... | |
const FourVector & | position () const |
Get vertex position. More... | |
bool | has_set_position () const |
Check if position of this vertex is set. More... | |
void | set_position (const FourVector &new_pos) |
Set vertex position. More... | |
bool | add_attribute (const std::string &name, std::shared_ptr< Attribute > att) |
Add event attribute to this vertex. More... | |
std::vector< std::string > | attribute_names () const |
Get list of names of attributes assigned to this particle. More... | |
void | remove_attribute (const std::string &name) |
Remove attribute. More... | |
template<class T > | |
std::shared_ptr< T > | attribute (const std::string &name) const |
Get attribute of type T. More... | |
std::string | attribute_as_string (const std::string &name) const |
Get attribute of any type as string. More... | |
Deprecated functionality | |
void | add_particle_in (GenParticle *p) |
void | add_particle_out (GenParticle *p) |
Private Attributes | |
Fields | |
GenEvent * | m_event |
Parent event. More... | |
int | m_id |
Vertex id. More... | |
GenVertexData | m_data |
Vertex data. More... | |
std::vector< GenParticlePtr > | m_particles_in |
Incoming particle list. More... | |
std::vector< GenParticlePtr > | m_particles_out |
Outgoing particle list. More... | |
Friends | |
class | GenEvent |
Stores vertex-related information.
Definition at line 26 of file GenVertex.h.
GenVertex | ( | const FourVector & | position = FourVector::ZERO_VECTOR() | ) |
Default constructor.
Definition at line 21 of file GenVertex.cc.
References GenVertex::m_data, GenVertexData::position, and GenVertexData::status.
GenVertex | ( | const GenVertexData & | data | ) |
Constructor based on vertex data.
Definition at line 28 of file GenVertex.cc.
bool add_attribute | ( | const std::string & | name, |
std::shared_ptr< Attribute > | att | ||
) |
Add event attribute to this vertex.
This will overwrite existing attribute if an attribute with the same name is present. The attribute will be stored in the parent_event().
Definition at line 121 of file GenVertex.cc.
References GenEvent::add_attribute(), and GenVertex::parent_event().
void add_particle_in | ( | GenParticlePtr | p | ) |
Add incoming particle.
Definition at line 35 of file GenVertex.cc.
References GenEvent::add_particle(), GenVertex::m_event, GenVertex::m_particles_in, and GenVertex::particles_in().
|
inline |
Add incoming particle by raw pointer
Definition at line 130 of file GenVertex.h.
References GenVertex::add_particle_in().
void add_particle_out | ( | GenParticlePtr | p | ) |
Add outgoing particle.
Definition at line 51 of file GenVertex.cc.
References GenEvent::add_particle(), GenVertex::m_event, GenVertex::m_particles_out, and GenVertex::particles_out().
|
inline |
Add outgoing particle by raw pointer
Definition at line 134 of file GenVertex.h.
References GenVertex::add_particle_out().
std::shared_ptr< T > attribute | ( | const std::string & | name | ) | const |
Get attribute of type T.
Definition at line 161 of file GenVertex.h.
std::string attribute_as_string | ( | const std::string & | name | ) | const |
Get attribute of any type as string.
Definition at line 131 of file GenVertex.cc.
References GenEvent::attribute_as_string(), and GenVertex::parent_event().
std::vector< std::string > attribute_names | ( | ) | const |
Get list of names of attributes assigned to this particle.
Definition at line 135 of file GenVertex.cc.
References GenEvent::attribute_names(), and GenVertex::parent_event().
|
inline |
Get vertex data.
Definition at line 71 of file GenVertex.h.
|
inline |
Check if position of this vertex is set.
Definition at line 99 of file GenVertex.h.
|
inline |
Get the vertex unique identifier
Definition at line 60 of file GenVertex.h.
|
inline |
Check if this vertex belongs to an event.
Definition at line 55 of file GenVertex.h.
|
inline |
Get parent event.
Definition at line 49 of file GenVertex.h.
|
inline |
Get parent event.
Definition at line 52 of file GenVertex.h.
|
inline |
Get list of incoming particles.
Definition at line 83 of file GenVertex.h.
const std::vector< ConstGenParticlePtr > & particles_in | ( | ) | const |
Get list of incoming particles (for const access)
Definition at line 87 of file GenVertex.cc.
References GenVertex::m_particles_in.
|
inline |
Get list of outgoing particles.
Definition at line 87 of file GenVertex.h.
const std::vector< ConstGenParticlePtr > & particles_out | ( | ) | const |
Get list of outgoing particles (for const access)
Definition at line 91 of file GenVertex.cc.
References GenVertex::m_particles_out.
const FourVector & position | ( | ) | const |
Get vertex position.
Returns the position of this vertex. If a position is not set on this vertex, the production vertices of ancestors are searched to find the inherited position. FourVector(0,0,0,0) is returned if no position information is found.
Definition at line 95 of file GenVertex.cc.
References GenEvent::attribute(), GenEvent::event_pos(), GenVertex::has_set_position(), GenVertex::m_data, GenVertex::m_particles_in, GenVertex::parent_event(), GenVertexData::position, and FourVector::ZERO_VECTOR().
void remove_attribute | ( | const std::string & | name | ) |
Remove attribute.
Definition at line 127 of file GenVertex.cc.
References GenVertex::parent_event(), and GenEvent::remove_attribute().
void remove_particle_in | ( | GenParticlePtr | p | ) |
Remove incoming particle.
Definition at line 66 of file GenVertex.cc.
References GenVertex::m_particles_in.
void remove_particle_out | ( | GenParticlePtr | p | ) |
Remove outgoing particle.
Definition at line 74 of file GenVertex.cc.
References GenVertex::m_particles_out.
void set_id | ( | int | id | ) |
set the vertex identifier
Definition at line 81 of file GenVertex.cc.
References GenVertex::id(), and GenVertex::m_id.
void set_position | ( | const FourVector & | new_pos | ) |
Set vertex position.
Definition at line 117 of file GenVertex.cc.
References GenVertex::m_data, and GenVertexData::position.
|
inline |
Set vertex status code.
Definition at line 68 of file GenVertex.h.
|
inline |
Get vertex status code.
Definition at line 66 of file GenVertex.h.
|
private |
Vertex data.
Definition at line 146 of file GenVertex.h.
|
private |
Parent event.
Definition at line 144 of file GenVertex.h.
|
private |
Vertex id.
Definition at line 145 of file GenVertex.h.
|
private |
Incoming particle list.
Definition at line 148 of file GenVertex.h.
|
private |
Outgoing particle list.
Definition at line 150 of file GenVertex.h.