HepMC event record
Public Member Functions | Friends
GenVertex Class Reference

Detailed Description

Stores vertex-related information.

Definition at line 34 of file build/outputs/include/HepMC/GenVertex.h.

#include <GenVertex.h>

+ Collaboration diagram for GenVertex:

Public Member Functions

template<class T >
HepMC::shared_ptr< T > attribute (string name) const
 Get attribute of type T. More...
 
Constructors
 GenVertex (const FourVector &position=FourVector::ZERO_VECTOR())
 Default constructor. More...
 
 GenVertex (const GenVertexData &data)
 Constructor based on vertex data. More...
 
 GenVertex (const FourVector &position=FourVector::ZERO_VECTOR())
 Default constructor. More...
 
 GenVertex (const GenVertexData &data)
 Constructor based on vertex data. More...
 
Accessors
GenEventparent_event () const
 
bool in_event () const
 
int id () const
 
int status () const
 Get vertex status code. More...
 
void set_status (int stat)
 Set vertex status code. More...
 
const GenVertexDatadata () 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 vector< GenParticlePtrparticles (Relationship range) const
 
const vector< GenParticlePtr > & particles_in () const
 Get list of incoming particles. More...
 
const vector< GenParticlePtr > & particles_out () const
 Get list of outgoing particles. More...
 
const FourVectorposition () 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 (string name, shared_ptr< Attribute > att)
 Add event attribute to this vertex. More...
 
vector< string > attribute_names () const
 Get list of names of attributes assigned to this particle. More...
 
void remove_attribute (string name)
 Remove attribute. More...
 
template<class T >
shared_ptr< T > attribute (string name) const
 Get attribute of type T. More...
 
string attribute_as_string (string name) const
 Get attribute of any type as string. More...
 
GenEventparent_event () const
 
bool in_event () const
 
int id () const
 
int status () const
 Get vertex status code. More...
 
void set_status (int stat)
 Set vertex status code. More...
 
const GenVertexDatadata () 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 vector< GenParticlePtrparticles (Relationship range) const
 
const vector< GenParticlePtr > & particles_in () const
 Get list of incoming particles. More...
 
const vector< GenParticlePtr > & particles_out () const
 Get list of outgoing particles. More...
 
const FourVectorposition () 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 (string name, shared_ptr< Attribute > att)
 Add event attribute to this vertex. More...
 
vector< string > attribute_names () const
 Get list of names of attributes assigned to this particle. More...
 
void remove_attribute (string name)
 Remove attribute. More...
 
template<class T >
shared_ptr< T > attribute (string name) const
 Get attribute of type T. More...
 
string attribute_as_string (string name) const
 Get attribute of any type as string. More...
 

Private Attributes

Fields
GenEventm_event
 Parent event. More...
 
int m_id
 Vertex id. More...
 
GenVertexData m_data
 Vertex data. More...
 
vector< GenParticlePtrm_particles_in
 Incoming particle list. More...
 
vector< GenParticlePtrm_particles_out
 Outgoing particle list. More...
 
weak_ptr< GenVertexm_this
 Pointer to shared pointer managing this vertex. More...
 

Friends

class GenEvent
 
class SmartPointer< GenVertex >
 

Deprecated functionality

typedef vector< GenParticlePtr >::const_iterator particles_in_const_iterator
 Define iterator by typedef. More...
 
typedef vector< GenParticlePtr >::const_iterator particles_out_const_iterator
 Define iterator by typedef. More...
 
typedef vector< GenParticlePtr >::iterator particle_iterator
 Define iterator by typedef. More...
 
typedef vector< GenParticlePtr >::const_iterator particles_in_const_iterator
 Define iterator by typedef. More...
 
typedef vector< GenParticlePtr >::const_iterator particles_out_const_iterator
 Define iterator by typedef. More...
 
typedef vector< GenParticlePtr >::iterator particle_iterator
 Define iterator by typedef. More...
 
void add_particle_in (GenParticle *p)
 
void add_particle_out (GenParticle *p)
 
particles_in_const_iterator particles_in_const_begin () const
 
particles_in_const_iterator particles_in_const_end () const
 
particles_out_const_iterator particles_out_const_begin () const
 
particles_out_const_iterator particles_out_const_end () const
 
particle_iterator particles_begin (IteratorRange range)
 
particle_iterator particles_end (IteratorRange range)
 
 HEPMC_DEPRECATED ("Use particles_in().size() instead") int particles_in_size() const
 
 HEPMC_DEPRECATED ("Use particles_out().size() instead") int particles_out_size() const
 
void add_particle_in (GenParticle *p)
 
void add_particle_out (GenParticle *p)
 
particles_in_const_iterator particles_in_const_begin () const
 
particles_in_const_iterator particles_in_const_end () const
 
particles_out_const_iterator particles_out_const_begin () const
 
particles_out_const_iterator particles_out_const_end () const
 
particle_iterator particles_begin (IteratorRange range)
 
particle_iterator particles_end (IteratorRange range)
 
 HEPMC_DEPRECATED ("Use particles_in().size() instead") int particles_in_size() const
 
 HEPMC_DEPRECATED ("Use particles_out().size() instead") int particles_out_size() const
 

Member Typedef Documentation

◆ particle_iterator [1/2]

typedef vector<GenParticlePtr>::iterator particle_iterator

Define iterator by typedef.

Definition at line 159 of file build/outputs/include/HepMC/GenVertex.h.

◆ particle_iterator [2/2]

typedef vector<GenParticlePtr>::iterator particle_iterator

Define iterator by typedef.

Definition at line 159 of file include/HepMC/GenVertex.h.

◆ particles_in_const_iterator [1/2]

typedef vector<GenParticlePtr>::const_iterator particles_in_const_iterator

Define iterator by typedef.

Definition at line 155 of file include/HepMC/GenVertex.h.

◆ particles_in_const_iterator [2/2]

typedef vector<GenParticlePtr>::const_iterator particles_in_const_iterator

Define iterator by typedef.

Definition at line 155 of file build/outputs/include/HepMC/GenVertex.h.

◆ particles_out_const_iterator [1/2]

typedef vector<GenParticlePtr>::const_iterator particles_out_const_iterator

Define iterator by typedef.

Definition at line 157 of file build/outputs/include/HepMC/GenVertex.h.

◆ particles_out_const_iterator [2/2]

typedef vector<GenParticlePtr>::const_iterator particles_out_const_iterator

Define iterator by typedef.

Definition at line 157 of file include/HepMC/GenVertex.h.

Constructor & Destructor Documentation

◆ GenVertex() [1/4]

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/4]

GenVertex ( const GenVertexData data)

Constructor based on vertex data.

Definition at line 29 of file GenVertex.cc.

◆ GenVertex() [3/4]

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

Default constructor.

◆ GenVertex() [4/4]

GenVertex ( const GenVertexData data)

Constructor based on vertex data.

Member Function Documentation

◆ add_attribute() [1/2]

bool add_attribute ( std::string  name,
shared_ptr< Attribute att 
)

Add event attribute to this vertex.

Todo:
We need a way to check if there is a position on this vertex, without messing up the interface. Is has_position() too intrusive?

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 108 of file GenVertex.cc.

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

◆ add_attribute() [2/2]

bool add_attribute ( string  name,
shared_ptr< Attribute att 
)

Add event attribute to this vertex.

Todo:
We need a way to check if there is a position on this vertex, without messing up the interface. Is has_position() too intrusive?

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

◆ add_particle_in() [1/4]

void add_particle_in ( GenParticlePtr  p)

◆ add_particle_in() [2/4]

void add_particle_in ( GenParticlePtr  p)

Add incoming particle.

◆ add_particle_in() [3/4]

void add_particle_in ( GenParticle p)
inline

Get barcode

Note
Currently barcode = id Add incoming particle by raw pointer
Deprecated:
Use GenVertex::add_particle_in( const GenParticlePtr &p ) instead

Definition at line 147 of file build/outputs/include/HepMC/GenVertex.h.

References GenVertex::add_particle_in().

◆ add_particle_in() [4/4]

void add_particle_in ( GenParticle p)
inline

Get barcode

Note
Currently barcode = id Add incoming particle by raw pointer
Deprecated:
Use GenVertex::add_particle_in( const GenParticlePtr &p ) instead

Definition at line 147 of file include/HepMC/GenVertex.h.

References GenVertex::add_particle_in().

◆ add_particle_out() [1/4]

void add_particle_out ( GenParticlePtr  p)

◆ add_particle_out() [2/4]

void add_particle_out ( GenParticlePtr  p)

Add outgoing particle.

◆ add_particle_out() [3/4]

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 152 of file build/outputs/include/HepMC/GenVertex.h.

References GenVertex::add_particle_out().

◆ add_particle_out() [4/4]

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 152 of file include/HepMC/GenVertex.h.

References GenVertex::add_particle_out().

◆ attribute() [1/3]

shared_ptr<T> attribute ( string  name) const

Get attribute of type T.

◆ attribute() [2/3]

shared_ptr<T> attribute ( string  name) const

Get attribute of type T.

◆ attribute() [3/3]

HepMC::shared_ptr< T > attribute ( string  name) const

Get attribute of type T.

Definition at line 228 of file build/outputs/include/HepMC/GenVertex.h.

◆ attribute_as_string() [1/2]

string attribute_as_string ( string  name) const

Get attribute of any type as string.

Definition at line 118 of file GenVertex.cc.

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

◆ attribute_as_string() [2/2]

string attribute_as_string ( string  name) const

Get attribute of any type as string.

◆ attribute_names() [1/2]

vector< string > attribute_names ( ) const

Get list of names of attributes assigned to this particle.

Definition at line 122 of file GenVertex.cc.

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

◆ attribute_names() [2/2]

vector<string> attribute_names ( ) const

Get list of names of attributes assigned to this particle.

◆ data() [1/2]

const GenVertexData& data ( ) const
inline

Get vertex data.

Definition at line 78 of file include/HepMC/GenVertex.h.

◆ data() [2/2]

const GenVertexData& data ( ) const
inline

Get vertex data.

Definition at line 78 of file build/outputs/include/HepMC/GenVertex.h.

◆ has_set_position() [1/2]

bool has_set_position ( ) const
inline

Check if position of this vertex is set.

Definition at line 106 of file include/HepMC/GenVertex.h.

◆ has_set_position() [2/2]

bool has_set_position ( ) const
inline

Check if position of this vertex is set.

Definition at line 106 of file build/outputs/include/HepMC/GenVertex.h.

◆ HEPMC_DEPRECATED() [1/4]

HEPMC_DEPRECATED ( "Use particles_in().size() instead"  ) const
inline
Deprecated:
Backward compatibility

Definition at line 194 of file include/HepMC/GenVertex.h.

◆ HEPMC_DEPRECATED() [2/4]

HEPMC_DEPRECATED ( "Use particles_in().size() instead"  ) const
inline
Deprecated:
Backward compatibility

Definition at line 194 of file build/outputs/include/HepMC/GenVertex.h.

◆ HEPMC_DEPRECATED() [3/4]

HEPMC_DEPRECATED ( "Use particles_out().size() instead"  ) const
inline
Deprecated:
Backward compatibility

Definition at line 198 of file include/HepMC/GenVertex.h.

◆ HEPMC_DEPRECATED() [4/4]

HEPMC_DEPRECATED ( "Use particles_out().size() instead"  ) const
inline
Deprecated:
Backward compatibility

Definition at line 198 of file build/outputs/include/HepMC/GenVertex.h.

◆ id() [1/2]

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 70 of file include/HepMC/GenVertex.h.

◆ id() [2/2]

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 70 of file build/outputs/include/HepMC/GenVertex.h.

◆ in_event() [1/2]

bool in_event ( ) const
inline

Check if this vertex belongs to an event

Todo:
Needed? Wouldn't it be good enough to just rely on user testing nullness of parent_event()?

Definition at line 65 of file include/HepMC/GenVertex.h.

◆ in_event() [2/2]

bool in_event ( ) const
inline

Check if this vertex belongs to an event

Todo:
Needed? Wouldn't it be good enough to just rely on user testing nullness of parent_event()?

Definition at line 65 of file build/outputs/include/HepMC/GenVertex.h.

◆ parent_event() [1/2]

GenEvent* parent_event ( ) const
inline

Get parent event

Todo:
Should we be returning a smart ptr?

Definition at line 61 of file build/outputs/include/HepMC/GenVertex.h.

◆ parent_event() [2/2]

GenEvent* parent_event ( ) const
inline

Get parent event

Todo:
Should we be returning a smart ptr?

Definition at line 61 of file include/HepMC/GenVertex.h.

◆ particles() [1/2]

const vector< GenParticlePtr > particles ( Relationship  range) const

Get list of associated particles

Note
Note relatively inefficient return by value

Definition at line 84 of file GenVertex.cc.

References HepMC::findParticles().

◆ particles() [2/2]

const vector<GenParticlePtr> particles ( Relationship  range) const

Get list of associated particles

Note
Note relatively inefficient return by value

◆ particles_begin() [1/2]

particle_iterator particles_begin ( IteratorRange  range)
inline
Deprecated:
Backward compatibility iterators

Definition at line 179 of file build/outputs/include/HepMC/GenVertex.h.

◆ particles_begin() [2/2]

particle_iterator particles_begin ( IteratorRange  range)
inline
Deprecated:
Backward compatibility iterators

Definition at line 179 of file include/HepMC/GenVertex.h.

◆ particles_end() [1/2]

particle_iterator particles_end ( IteratorRange  range)
inline
Deprecated:
Backward compatibility iterators

Definition at line 187 of file include/HepMC/GenVertex.h.

◆ particles_end() [2/2]

particle_iterator particles_end ( IteratorRange  range)
inline
Deprecated:
Backward compatibility iterators

Definition at line 187 of file build/outputs/include/HepMC/GenVertex.h.

◆ particles_in() [1/2]

const vector<GenParticlePtr>& particles_in ( ) const
inline

Get list of incoming particles.

Definition at line 93 of file build/outputs/include/HepMC/GenVertex.h.

◆ particles_in() [2/2]

const vector<GenParticlePtr>& particles_in ( ) const
inline

Get list of incoming particles.

Definition at line 93 of file include/HepMC/GenVertex.h.

◆ particles_in_const_begin() [1/2]

particles_in_const_iterator particles_in_const_begin ( ) const
inline
Deprecated:
Backward compatibility iterators
Deprecated:
Backward compatibility iterators

Definition at line 163 of file build/outputs/include/HepMC/GenVertex.h.

◆ particles_in_const_begin() [2/2]

particles_in_const_iterator particles_in_const_begin ( ) const
inline
Deprecated:
Backward compatibility iterators
Deprecated:
Backward compatibility iterators

Definition at line 163 of file include/HepMC/GenVertex.h.

◆ particles_in_const_end() [1/2]

particles_in_const_iterator particles_in_const_end ( ) const
inline
Deprecated:
Backward compatibility iterators
Deprecated:
Backward compatibility iterators

Definition at line 167 of file build/outputs/include/HepMC/GenVertex.h.

◆ particles_in_const_end() [2/2]

particles_in_const_iterator particles_in_const_end ( ) const
inline
Deprecated:
Backward compatibility iterators
Deprecated:
Backward compatibility iterators

Definition at line 167 of file include/HepMC/GenVertex.h.

◆ particles_out() [1/2]

const vector<GenParticlePtr>& particles_out ( ) const
inline

Get list of outgoing particles.

Definition at line 95 of file include/HepMC/GenVertex.h.

◆ particles_out() [2/2]

const vector<GenParticlePtr>& particles_out ( ) const
inline

Get list of outgoing particles.

Definition at line 95 of file build/outputs/include/HepMC/GenVertex.h.

◆ particles_out_const_begin() [1/2]

particles_out_const_iterator particles_out_const_begin ( ) const
inline
Deprecated:
Backward compatibility iterators
Deprecated:
Backward compatibility iterators

Definition at line 171 of file build/outputs/include/HepMC/GenVertex.h.

◆ particles_out_const_begin() [2/2]

particles_out_const_iterator particles_out_const_begin ( ) const
inline
Deprecated:
Backward compatibility iterators
Deprecated:
Backward compatibility iterators

Definition at line 171 of file include/HepMC/GenVertex.h.

◆ particles_out_const_end() [1/2]

particles_out_const_iterator particles_out_const_end ( ) const
inline
Deprecated:
Backward compatibility iterators

Definition at line 175 of file include/HepMC/GenVertex.h.

◆ particles_out_const_end() [2/2]

particles_out_const_iterator particles_out_const_end ( ) const
inline
Deprecated:
Backward compatibility iterators

Definition at line 175 of file build/outputs/include/HepMC/GenVertex.h.

◆ position() [1/2]

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.

Todo:
We need a way to check if there is a position on this vertex, without messing up the interface. Is has_position() too intrusive?

◆ position() [2/2]

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.

Todo:
We need a way to check if there is a position on this vertex, without messing up the interface. Is has_position() too intrusive?

Definition at line 89 of file GenVertex.cc.

References GenEvent::event_pos(), GenVertex::has_set_position(), GenVertex::m_data, GenVertex::parent_event(), GenVertex::particles_in(), GenVertexData::position, and FourVector::ZERO_VECTOR().

◆ remove_attribute() [1/2]

void remove_attribute ( std::string  name)

Remove attribute.

Definition at line 114 of file GenVertex.cc.

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

◆ remove_attribute() [2/2]

void remove_attribute ( string  name)

Remove attribute.

◆ remove_particle_in() [1/2]

void remove_particle_in ( GenParticlePtr  p)

Remove incoming particle.

Definition at line 72 of file GenVertex.cc.

References GenVertex::m_particles_in.

◆ remove_particle_in() [2/2]

void remove_particle_in ( GenParticlePtr  p)

Remove incoming particle.

◆ remove_particle_out() [1/2]

void remove_particle_out ( GenParticlePtr  p)

Remove outgoing particle.

◆ remove_particle_out() [2/2]

void remove_particle_out ( GenParticlePtr  p)

Remove outgoing particle.

Definition at line 78 of file GenVertex.cc.

References GenVertex::m_particles_out.

◆ set_position() [1/2]

void set_position ( const FourVector new_pos)

Set vertex position.

Definition at line 104 of file GenVertex.cc.

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

◆ set_position() [2/2]

void set_position ( const FourVector new_pos)

Set vertex position.

◆ set_status() [1/2]

void set_status ( int  stat)
inline

Set vertex status code.

Definition at line 75 of file include/HepMC/GenVertex.h.

◆ set_status() [2/2]

void set_status ( int  stat)
inline

Set vertex status code.

Definition at line 75 of file build/outputs/include/HepMC/GenVertex.h.

◆ status() [1/2]

int status ( ) const
inline

Get vertex status code.

Definition at line 73 of file include/HepMC/GenVertex.h.

◆ status() [2/2]

int status ( ) const
inline

Get vertex status code.

Definition at line 73 of file build/outputs/include/HepMC/GenVertex.h.

Friends And Related Function Documentation

◆ GenEvent

GenEvent
friend
Todo:
Are these really needed? Friends usually indicate a problem...
Todo:
Are these really needed? Friends usually indicate a problem...

Definition at line 37 of file build/outputs/include/HepMC/GenVertex.h.

Field Documentation

◆ m_data

GenVertexData m_data
private

Vertex data.

Definition at line 212 of file build/outputs/include/HepMC/GenVertex.h.

◆ m_event

GenEvent * m_event
private

Parent event.

Definition at line 210 of file build/outputs/include/HepMC/GenVertex.h.

◆ m_id

int m_id
private

Vertex id.

Definition at line 211 of file build/outputs/include/HepMC/GenVertex.h.

◆ m_particles_in

vector< GenParticlePtr > m_particles_in
private

Incoming particle list.

Definition at line 214 of file build/outputs/include/HepMC/GenVertex.h.

◆ m_particles_out

vector< GenParticlePtr > m_particles_out
private

Outgoing particle list.

Definition at line 215 of file build/outputs/include/HepMC/GenVertex.h.

◆ m_this

weak_ptr< GenVertex > m_this
private

Pointer to shared pointer managing this vertex.

Definition at line 216 of file build/outputs/include/HepMC/GenVertex.h.


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