6#ifndef HEPMC3_GENPARTICLE_H
7#define HEPMC3_GENPARTICLE_H
20#include "HepMC3/GenParticle_fwd.h"
21#include "HepMC3/GenVertex_fwd.h"
31class GenParticle :
public std::enable_shared_from_this<GenParticle> {
72 std::vector<GenParticlePtr>
parents();
76 std::vector<ConstGenParticlePtr>
parents()
const;
80 std::vector<GenParticlePtr>
children();
84 std::vector<ConstGenParticlePtr>
children()
const;
111 bool add_attribute(
const std::string& name, std::shared_ptr<Attribute> att);
121 std::shared_ptr<T>
attribute(
const std::string& name)
const;
Definition of class FourVector.
Definition of class GenEvent.
Definition of class GenParticleData.
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.
Stores particle-related information.
void set_pid(int pid)
Set PDG ID.
ConstGenVertexPtr end_vertex() const
Get end vertex (const version)
void unset_generated_mass()
Declare that generated mass is not set.
std::shared_ptr< T > attribute(const std::string &name) const
Get attribute of type T.
GenEvent * m_event
Parent event.
void remove_attribute(const std::string &name)
Remove attribute.
std::weak_ptr< GenVertex > m_production_vertex
Production vertex.
std::vector< GenParticlePtr > children()
Convenience access to immediate outgoing particles via end vertex.
bool add_attribute(const std::string &name, std::shared_ptr< Attribute > att)
Add an attribute to this particle.
int id() const
Get particle id.
void set_pdg_id(const int &pidin)
Set PDG ID.
std::vector< std::string > attribute_names() const
Get list of names of attributes assigned to this particle.
int pid() const
Get PDG ID.
std::weak_ptr< GenVertex > m_end_vertex
End vertex.
const GenParticleData & data() const
Get particle data.
std::vector< GenParticlePtr > parents()
Convenience access to immediate incoming particles via production vertex.
ConstGenVertexPtr production_vertex() const
Get production vertex (const version)
int status() const
Get status code.
void set_momentum(const FourVector &momentum)
Set momentum.
void set_status(int status)
Set status code.
GenEvent * parent_event()
Get parent event.
void set_generated_mass(double m)
Set generated mass.
double generated_mass() const
Get generated mass.
bool in_event() const
Check if this particle belongs to an event.
int pdg_id() const
Get PDG ID.
bool is_generated_mass_set() const
Check if generated mass is set.
int abs_pid() const
Get absolute value of PDG ID.
const GenEvent * parent_event() const
Get parent event.
GenParticleData m_data
Particle data.
std::string attribute_as_string(const std::string &name) const
Get attribute of any type as string.
const FourVector & momentum() const
Get momentum.
Stores vertex-related information.
Stores serializable particle information.
FourVector momentum
Momentum.
bool is_mass_set
Check if generated mass is set.