6 #ifndef HEPMC_GENPARTICLE_H 7 #define HEPMC_GENPARTICLE_H 16 #include "HepMC/Data/SmartPointer.h" 17 #include "HepMC/Data/GenParticleData.h" 18 #include "HepMC/FourVector.h" 19 #include "HepMC/Common.h" 51 bool in_event()
const {
return (
bool)(m_event); }
59 int id()
const {
return m_id; }
71 vector<GenParticlePtr> parents()
const;
75 vector<GenParticlePtr> children()
const;
78 vector<GenParticlePtr> ancestors()
const;
81 vector<GenParticlePtr> descendants()
const;
84 int pid()
const {
return m_data.pid; }
85 int status()
const {
return m_data.status; }
93 double generated_mass()
const;
96 void set_pid(
int pid);
97 void set_status(
int status);
99 void set_generated_mass(
double m);
100 void unset_generated_mass();
109 bool add_attribute(
string name, shared_ptr<Attribute> att);
112 vector<string> attribute_names()
const;
115 void remove_attribute(
string name);
119 shared_ptr<T> attribute(
string name)
const;
122 string attribute_as_string(
string name)
const;
128 #ifndef HEPMC_NO_DEPRECATED 133 int pdg_id()
const {
return m_data.pid; }
158 #include "HepMC/GenEvent.h" 163 return parent_event()?
164 parent_event()->attribute<T>(name, id()): HepMC::shared_ptr<T>();
Stores serializable particle information.
GenEvent * parent_event() const
Get parent event.
GenEvent * m_event
Parent event.
GenParticleData m_data
Particle data.
int id() const
Get particle id.
void set_pdg_id(int pidin)
Set PDG ID.
bool in_event() const
Check if this particle belongs to an event.
static const FourVector & ZERO_VECTOR()
Static null FourVector = (0,0,0,0)
Smart pointer for HepMC objects.
int status() const
Get status code.
Stores vertex-related information.
const FourVector & momentum() const
Get momentum.
Stores event-related information.
shared_ptr< T > attribute(string name) const
Get attribute of type T.
int pdg_id() const
Get PDG ID.
weak_ptr< GenParticle > m_this
Pointer to shared pointer managing this particle.
weak_ptr< GenVertex > m_production_vertex
Production vertex.
Definition of template class SmartPointer.
weak_ptr< GenVertex > m_end_vertex
End vertex.
const GenParticleData & data() const
Get particle data.
int pid() const
Get PDG ID.
Stores particle-related information.
bool is_generated_mass_set() const
Check if generated mass is set.