6#ifndef HEPMC3_GENPARTICLE_H 
    7#define HEPMC3_GENPARTICLE_H 
   20#include "HepMC3/GenParticle_fwd.h" 
   21#include "HepMC3/GenVertex_fwd.h" 
   28class GenParticle : 
public std::enable_shared_from_this<GenParticle> {
 
   30    friend class GenVertex;
 
   31    friend class GenEvent;
 
   69    std::vector<GenParticlePtr> 
parents();
 
   73    std::vector<ConstGenParticlePtr> 
parents() 
const;
 
   77    std::vector<GenParticlePtr> 
children();
 
   81    std::vector<ConstGenParticlePtr> 
children() 
const;
 
  107    bool add_attribute(
const std::string& name, std::shared_ptr<Attribute> att);
 
  117    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.
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.
GenParticle(const FourVector &momentum=FourVector::ZERO_VECTOR(), int pid=0, int status=0)
Default constructor.
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 the particle ID number (not PDG 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 the 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 the parent event (const)
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 serializable particle information.