6 #ifndef HEPMC3_GENPARTICLE_H
7 #define HEPMC3_GENPARTICLE_H
20 #include "HepMC3/GenParticle_fwd.h"
21 #include "HepMC3/GenVertex_fwd.h"
31 class GenParticle :
public std::enable_shared_from_this<GenParticle> {
51 bool in_event()
const {
return (
bool)(m_event); }
60 int id()
const {
return m_id; }
64 ConstGenVertexPtr production_vertex()
const;
65 ConstGenVertexPtr end_vertex()
const;
67 GenVertexPtr production_vertex();
68 GenVertexPtr end_vertex();
72 std::vector<GenParticlePtr> parents();
76 std::vector<ConstGenParticlePtr> parents()
const;
80 std::vector<GenParticlePtr> children();
84 std::vector<ConstGenParticlePtr> children()
const;
86 int pid()
const {
return m_data.pid; }
88 int status()
const {
return m_data.status; }
96 double generated_mass()
const;
99 void set_pid(
int pid);
100 void set_status(
int status);
101 void set_momentum(
const FourVector& momentum);
102 void set_generated_mass(
double m);
103 void unset_generated_mass();
111 bool add_attribute(
const std::string&
name, std::shared_ptr<Attribute> att);
114 std::vector<std::string> attribute_names()
const;
117 void remove_attribute(
const std::string&
name);
121 std::shared_ptr<T> attribute(
const std::string&
name)
const;
124 std::string attribute_as_string(
const std::string&
name)
const;
159 return parent_event()?
160 parent_event()->attribute<T>(name, id()): std::shared_ptr<T>();
int abs_pid() const
Get absolute value of PDG ID.
int status() const
Get status code.
GenEvent * parent_event()
Get parent event.
Stores vertex-related information.
static const FourVector & ZERO_VECTOR()
Static null FourVector = (0,0,0,0)
std::weak_ptr< GenVertex > m_production_vertex
Production vertex.
Stores particle-related information.
const GenParticleData & data() const
Get particle data.
GenParticleData m_data
Particle data.
const GenEvent * parent_event() const
Get parent event.
const FourVector & momentum() const
Get momentum.
std::shared_ptr< T > attribute(const std::string &name) const
Get attribute of type T.
Stores event-related information.
GenEvent * m_event
Parent event.
Stores serializable particle information.
void set_pdg_id(const int &pidin)
Set PDG ID.
int pid() const
Get PDG ID.
bool in_event() const
Check if this particle belongs to an event.
std::weak_ptr< GenVertex > m_end_vertex
End vertex.
int pdg_id() const
Get PDG ID.
Definition of class GenEvent.
Annotation for function names.
int id() const
Get particle id.
Definition of class GenParticleData.
Definition of class FourVector.
bool is_generated_mass_set() const
Check if generated mass is set.
Feature< Feature_type > abs(const Feature< Feature_type > &input)
Obtain the absolute value of a Feature. This works as you'd expect. If foo is a valid Feature...