6 #ifndef HEPMC3_GENPARTICLE_H 7 #define HEPMC3_GENPARTICLE_H 30 class GenParticle :
public std::enable_shared_from_this<GenParticle>{
50 bool in_event()
const {
return (
bool)(m_event); }
59 int id()
const {
return m_id; }
63 ConstGenVertexPtr production_vertex()
const;
64 ConstGenVertexPtr end_vertex()
const;
66 GenVertexPtr production_vertex();
67 GenVertexPtr end_vertex();
71 vector<GenParticlePtr> parents();
75 vector<ConstGenParticlePtr> parents()
const;
79 vector<GenParticlePtr> children();
83 vector<ConstGenParticlePtr> children()
const;
85 int pid()
const {
return m_data.pid; }
86 int status()
const {
return m_data.status; }
94 double generated_mass()
const;
97 void set_pid(
int pid);
98 void set_status(
int status);
100 void set_generated_mass(
double m);
101 void unset_generated_mass();
109 bool add_attribute(
const string& name, shared_ptr<Attribute> att);
112 vector<string> attribute_names()
const;
115 void remove_attribute(
const string& name);
119 shared_ptr<T> attribute(
const string& name)
const;
122 string attribute_as_string(
const string& name)
const;
157 return parent_event()?
158 parent_event()->attribute<T>(name, id()): shared_ptr<T>();
GenEvent * parent_event()
Get parent event.
Stores vertex-related information.
static const FourVector & ZERO_VECTOR()
Static null FourVector = (0,0,0,0)
const GenEvent * parent_event() const
Get parent event.
Stores particle-related information.
weak_ptr< GenVertex > m_end_vertex
End vertex.
int id() const
Get particle id.
GenParticleData m_data
Particle data.
int pid() const
Get PDG ID.
const GenParticleData & data() const
Get particle data.
Stores event-related information.
GenEvent * m_event
Parent event.
Minimal forward declarations for GenParticle.
Minimal forward declarations for GenVertex.
shared_ptr< T > attribute(const string &name) const
Get attribute of type T.
Stores serializable particle information.
bool in_event() const
Check if this particle belongs to an event.
weak_ptr< GenVertex > m_production_vertex
Production vertex.
void set_pdg_id(const int &pidin)
Set PDG ID.
Definition of class GenEvent.
bool is_generated_mass_set() const
Check if generated mass is set.
const FourVector & momentum() const
Get momentum.
Definition of class GenParticleData.
Definition of class FourVector.
int status() const
Get status code.
int pdg_id() const
Get PDG ID.