9#ifndef HEPMC3_GENVERTEX_H
10#define HEPMC3_GENVERTEX_H
12#include "HepMC3/GenParticle_fwd.h"
13#include "HepMC3/GenVertex_fwd.h"
14#include "HepMC3/Data/GenVertexData.h"
15#include "HepMC3/FourVector.h"
17#ifdef HEPMC3_PROTOBUFIO
19class GenEventData_GenVertexData;
29class GenVertex :
public std::enable_shared_from_this<GenVertex> {
31 friend class GenEvent;
44#ifdef HEPMC3_PROTOBUFIO
46 GenVertex( HepMC3_pb::GenEventData_GenVertexData
const &
data );
67 int id()
const {
return m_id; }
70 int status()
const {
return m_data.status; }
93 const std::vector<GenParticlePtr>&
particles_in() {
return m_particles_in; }
95 const std::vector<ConstGenParticlePtr>&
particles_in()
const;
97 const std::vector<GenParticlePtr>&
particles_out() {
return m_particles_out; }
99 const std::vector<ConstGenParticlePtr>&
particles_out()
const;
119 bool add_attribute(
const std::string& name, std::shared_ptr<Attribute> att);
129 std::shared_ptr<T>
attribute(
const std::string& name)
const;
143 std::vector<GenParticlePtr> m_particles_in;
145 std::vector<GenParticlePtr> m_particles_out;
153#include "HepMC3/GenEvent.h"
static const FourVector & ZERO_VECTOR()
Static null FourVector = (0,0,0,0)
Stores event-related information.
std::shared_ptr< T > attribute(const std::string &name, const int &id=0) const
Get attribute of type T.
std::vector< std::string > attribute_names() const
Get list of names of attributes assigned to this particle.
GenEvent * parent_event()
Get parent event.
const GenVertexData & data() const
Get vertex data.
void add_particle_in(GenParticlePtr p)
Add incoming particle.
std::string attribute_as_string(const std::string &name) const
Get attribute of any type as string.
void set_status(int stat)
Set vertex status code.
const GenEvent * parent_event() const
Get parent event.
int particles_in_size() const
Number of incoming particles, HepMC2 compatiility.
int status() const
Get vertex status code.
bool in_event() const
Check if this vertex belongs to an event.
void remove_attribute(const std::string &name)
Remove attribute.
void remove_particle_in(GenParticlePtr p)
Remove incoming particle.
const std::vector< GenParticlePtr > & particles_out()
Get list of outgoing particles.
void set_position(const FourVector &new_pos)
Set vertex position.
bool has_set_position() const
Check if position of this vertex is set.
std::shared_ptr< T > attribute(const std::string &name) const
Get attribute of type T.
bool add_attribute(const std::string &name, std::shared_ptr< Attribute > att)
Add event attribute to this vertex.
const FourVector & position() const
Get vertex position.
int particles_out_size() const
Number of outgoing particles, HepMC2 compatiility.
const std::vector< GenParticlePtr > & particles_in()
Get list of incoming particles.
void add_particle_out(GenParticlePtr p)
Add outgoing particle.
GenVertex(const FourVector &position=FourVector::ZERO_VECTOR())
Default constructor.
void remove_particle_out(GenParticlePtr p)
Remove outgoing particle.
Stores serializable vertex information.