HepMC3 event record library
Friends
GenVertex Class Reference

Detailed Description

Stores vertex-related information.

Definition at line 26 of file GenVertex.h.

#include <GenVertex.h>

+ Inheritance diagram for GenVertex:
+ Collaboration diagram for GenVertex:

Public Member Functions

Constructors
 GenVertex (const FourVector &position=FourVector::ZERO_VECTOR())
 Default constructor.
 
 GenVertex (const GenVertexData &data)
 Constructor based on vertex data.
 
Accessors
GenEventparent_event ()
 Get parent event.
 
const GenEventparent_event () const
 Get parent event.
 
bool in_event () const
 Check if this vertex belongs to an event.
 
int id () const
 
void set_id (int id)
 set the vertex identifier
 
int status () const
 Get vertex status code.
 
void set_status (int stat)
 Set vertex status code.
 
const GenVertexDatadata () const
 Get vertex data.
 
void add_particle_in (GenParticlePtr p)
 Add incoming particle.
 
void add_particle_out (GenParticlePtr p)
 Add outgoing particle.
 
void remove_particle_in (GenParticlePtr p)
 Remove incoming particle.
 
void remove_particle_out (GenParticlePtr p)
 Remove outgoing particle.
 
int particles_in_size () const
 Number of incoming particles, HepMC2 compatiility.
 
int particles_out_size () const
 Number of outgoing particles, HepMC2 compatiility.
 
const std::vector< GenParticlePtr > & particles_in ()
 Get list of incoming particles.
 
const std::vector< ConstGenParticlePtr > & particles_in () const
 Get list of incoming particles (for const access)
 
const std::vector< GenParticlePtr > & particles_out ()
 Get list of outgoing particles.
 
const std::vector< ConstGenParticlePtr > & particles_out () const
 Get list of outgoing particles (for const access)
 
const FourVectorposition () const
 Get vertex position.
 
bool has_set_position () const
 Check if position of this vertex is set.
 
void set_position (const FourVector &new_pos)
 Set vertex position.
 
bool add_attribute (const std::string &name, std::shared_ptr< Attribute > att)
 Add event attribute to this vertex.
 
std::vector< std::string > attribute_names () const
 Get list of names of attributes assigned to this particle.
 
void remove_attribute (const std::string &name)
 Remove attribute.
 
template<class T >
std::shared_ptr< T > attribute (const std::string &name) const
 Get attribute of type T.
 
std::string attribute_as_string (const std::string &name) const
 Get attribute of any type as string.
 
Deprecated functionality
void add_particle_in (GenParticle *p)
 
void add_particle_out (GenParticle *p)
 

Private Attributes

Fields
GenEventm_event
 Parent event.
 
int m_id
 Vertex id.
 
GenVertexData m_data
 Vertex data.
 
std::vector< GenParticlePtr > m_particles_in
 Incoming particle list.
 
std::vector< GenParticlePtr > m_particles_out
 Outgoing particle list.
 

Friends

class GenEvent
 

Constructor & Destructor Documentation

◆ GenVertex() [1/2]

GenVertex ( const FourVector position = FourVector::ZERO_VECTOR())

Default constructor.

Definition at line 22 of file GenVertex.cc.

References GenVertex::m_data, GenVertexData::position, and GenVertexData::status.

◆ GenVertex() [2/2]

GenVertex ( const GenVertexData data)

Constructor based on vertex data.

Definition at line 29 of file GenVertex.cc.

Member Function Documentation

◆ add_attribute()

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().

Returns
false if there is no parent_event();

Definition at line 120 of file GenVertex.cc.

References GenEvent::add_attribute(), and GenVertex::parent_event().

◆ add_particle_in() [1/2]

void add_particle_in ( GenParticle p)
inline

Add incoming particle by raw pointer

Deprecated:
Use GenVertex::add_particle_in( const GenParticlePtr &p ) instead

Definition at line 136 of file GenVertex.h.

References GenVertex::add_particle_in().

◆ add_particle_in() [2/2]

void add_particle_in ( GenParticlePtr  p)

Add incoming particle.

Definition at line 36 of file GenVertex.cc.

References GenEvent::add_particle(), GenVertex::m_event, GenVertex::m_particles_in, and GenVertex::particles_in().

◆ add_particle_out() [1/2]

void add_particle_out ( GenParticle p)
inline

Add outgoing particle by raw pointer

Deprecated:
Use GenVertex::add_particle_out( const GenParticlePtr &p ) instead

Definition at line 140 of file GenVertex.h.

References GenVertex::add_particle_out().

◆ add_particle_out() [2/2]

void add_particle_out ( GenParticlePtr  p)

Add outgoing particle.

Definition at line 52 of file GenVertex.cc.

References GenEvent::add_particle(), GenVertex::m_event, GenVertex::m_particles_out, and GenVertex::particles_out().

◆ attribute()

std::shared_ptr< T > attribute ( const std::string &  name) const

Get attribute of type T.

Definition at line 167 of file GenVertex.h.

References GenEvent::attribute(), GenVertex::id(), and GenVertex::parent_event().

◆ attribute_as_string()

std::string attribute_as_string ( const std::string &  name) const

Get attribute of any type as string.

Definition at line 130 of file GenVertex.cc.

References GenEvent::attribute_as_string(), and GenVertex::parent_event().

◆ attribute_names()

std::vector< std::string > attribute_names ( ) const

Get list of names of attributes assigned to this particle.

Definition at line 134 of file GenVertex.cc.

References GenEvent::attribute_names(), and GenVertex::parent_event().

◆ data()

const GenVertexData & data ( ) const
inline

Get vertex data.

Definition at line 71 of file GenVertex.h.

References GenVertex::m_data.

◆ has_set_position()

bool has_set_position ( ) const
inline

Check if position of this vertex is set.

Definition at line 105 of file GenVertex.h.

References FourVector::is_zero(), GenVertex::m_data, and GenVertexData::position.

◆ id()

int id ( ) const
inline

Get the vertex unique identifier

Note
This is not the same as id() in HepMC v2, which is now status()

Definition at line 60 of file GenVertex.h.

References GenVertex::m_id.

◆ in_event()

bool in_event ( ) const
inline

Check if this vertex belongs to an event.

Definition at line 55 of file GenVertex.h.

References GenVertex::parent_event().

◆ parent_event() [1/2]

GenEvent * parent_event ( )
inline

Get parent event.

Definition at line 49 of file GenVertex.h.

References GenVertex::m_event.

◆ parent_event() [2/2]

const GenEvent * parent_event ( ) const
inline

Get parent event.

Definition at line 52 of file GenVertex.h.

References GenVertex::m_event.

◆ particles_in() [1/2]

const std::vector< GenParticlePtr > & particles_in ( )
inline

Get list of incoming particles.

Definition at line 89 of file GenVertex.h.

References GenVertex::m_particles_in.

◆ particles_in() [2/2]

const std::vector< ConstGenParticlePtr > & particles_in ( ) const

Get list of incoming particles (for const access)

Definition at line 88 of file GenVertex.cc.

References GenVertex::m_particles_in.

◆ particles_in_size()

int particles_in_size ( ) const
inline

Number of incoming particles, HepMC2 compatiility.

Definition at line 83 of file GenVertex.h.

References GenVertex::m_particles_in.

◆ particles_out() [1/2]

const std::vector< GenParticlePtr > & particles_out ( )
inline

Get list of outgoing particles.

Definition at line 93 of file GenVertex.h.

References GenVertex::m_particles_out.

◆ particles_out() [2/2]

const std::vector< ConstGenParticlePtr > & particles_out ( ) const

Get list of outgoing particles (for const access)

Definition at line 92 of file GenVertex.cc.

References GenVertex::m_particles_out.

◆ particles_out_size()

int particles_out_size ( ) const
inline

Number of outgoing particles, HepMC2 compatiility.

Definition at line 85 of file GenVertex.h.

References GenVertex::m_particles_out.

◆ position()

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 96 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().

◆ remove_attribute()

void remove_attribute ( const std::string &  name)

Remove attribute.

Definition at line 126 of file GenVertex.cc.

References GenVertex::parent_event(), and GenEvent::remove_attribute().

◆ remove_particle_in()

void remove_particle_in ( GenParticlePtr  p)

Remove incoming particle.

Definition at line 67 of file GenVertex.cc.

References GenVertex::m_particles_in.

◆ remove_particle_out()

void remove_particle_out ( GenParticlePtr  p)

Remove outgoing particle.

Definition at line 75 of file GenVertex.cc.

References GenVertex::m_particles_out.

◆ set_id()

void set_id ( int  id)

set the vertex identifier

Definition at line 82 of file GenVertex.cc.

References GenVertex::id(), and GenVertex::m_id.

◆ set_position()

void set_position ( const FourVector new_pos)

Set vertex position.

Definition at line 116 of file GenVertex.cc.

References GenVertex::m_data, and GenVertexData::position.

◆ set_status()

void set_status ( int  stat)
inline

Set vertex status code.

Definition at line 68 of file GenVertex.h.

References GenVertex::m_data, and GenVertexData::status.

◆ status()

int status ( ) const
inline

Get vertex status code.

Definition at line 66 of file GenVertex.h.

References GenVertex::m_data, and GenVertexData::status.

Friends And Related Function Documentation

◆ GenEvent

friend class GenEvent
friend

Definition at line 28 of file GenVertex.h.

Field Documentation

◆ m_data

GenVertexData m_data
private

Vertex data.

Definition at line 152 of file GenVertex.h.

◆ m_event

GenEvent* m_event
private

Parent event.

Definition at line 150 of file GenVertex.h.

◆ m_id

int m_id
private

Vertex id.

Definition at line 151 of file GenVertex.h.

◆ m_particles_in

std::vector<GenParticlePtr> m_particles_in
private

Incoming particle list.

Definition at line 154 of file GenVertex.h.

◆ m_particles_out

std::vector<GenParticlePtr> m_particles_out
private

Outgoing particle list.

Definition at line 156 of file GenVertex.h.


The documentation for this class was generated from the following files: