|
HepMC3 event record library
|
Stores particle-related information.
Definition at line 28 of file GenParticle.h.
#include <GenParticle.h>
Inheritance diagram for GenParticle:
Collaboration diagram for GenParticle:Public Member Functions | |
| GenParticle (const FourVector &momentum=FourVector::ZERO_VECTOR(), int pid=0, int status=0) | |
| Default constructor. | |
| GenParticle (const GenParticleData &data) | |
| Constructor based on particle data. | |
| bool | in_event () const |
| Check if this particle belongs to an event. | |
| GenEvent * | parent_event () |
| Get the parent event. | |
| const GenEvent * | parent_event () const |
| Get the parent event (const) | |
| int | id () const |
| Get the particle ID number (not PDG ID) | |
| const GenParticleData & | data () const |
| Get particle data. | |
| ConstGenVertexPtr | production_vertex () const |
| Get production vertex (const version) | |
| ConstGenVertexPtr | end_vertex () const |
| Get end vertex (const version) | |
| GenVertexPtr | production_vertex () |
| Get production vertex. | |
| GenVertexPtr | end_vertex () |
| Get end vertex. | |
| std::vector< GenParticlePtr > | parents () |
| Convenience access to immediate incoming particles via production vertex. | |
| std::vector< ConstGenParticlePtr > | parents () const |
| Convenience access to immediate incoming particles via production vertex (const version) | |
| std::vector< GenParticlePtr > | children () |
| Convenience access to immediate outgoing particles via end vertex. | |
| std::vector< ConstGenParticlePtr > | children () const |
| Convenience access to immediate outgoing particles via end vertex. | |
| int | pid () const |
| Get PDG ID. | |
| int | abs_pid () const |
| Get absolute value of PDG ID. | |
| int | status () const |
| Get status code. | |
| const FourVector & | momentum () const |
| Get momentum. | |
| bool | is_generated_mass_set () const |
| Check if generated mass is set. | |
| double | generated_mass () const |
| Get generated mass. | |
| void | set_pid (int pid) |
| Set PDG ID. | |
| void | set_status (int status) |
| Set status code. | |
| void | set_momentum (const FourVector &momentum) |
| Set momentum. | |
| void | set_generated_mass (double m) |
| Set generated mass. | |
| void | unset_generated_mass () |
| Declare that generated mass is not set. | |
| bool | add_attribute (const std::string &name, std::shared_ptr< Attribute > att) |
| Add an attribute to this particle. | |
| std::vector< std::string > | attribute_names () const |
| Get list of names of attributes assigned to this particle. | |
| void | remove_attribute (const std::string &name) |
| Remove attribute. | |
| template<class T> | |
| std::shared_ptr< T > | attribute (const std::string &name) const |
| Get attribute of type T. | |
| std::string | attribute_as_string (const std::string &name) const |
| Get attribute of any type as string. | |
Deprecated functionality | |
| int | pdg_id () const |
| Get PDG ID. | |
| void | set_pdg_id (const int &pidin) |
| Set PDG ID. | |
Private Attributes | |
| GenEvent * | m_event |
| Parent event. | |
| int | m_id |
| Index. | |
| GenParticleData | m_data |
| Particle data. | |
| std::weak_ptr< GenVertex > | m_production_vertex |
| Production vertex. | |
| std::weak_ptr< GenVertex > | m_end_vertex |
| End vertex. | |
Friends | |
| class | GenVertex |
| class | GenEvent |
| GenParticle | ( | const FourVector & | momentum = FourVector::ZERO_VECTOR(), |
| int | pid = 0, | ||
| int | status = 0 ) |
Default constructor.
Definition at line 20 of file GenParticle.cc.
| GenParticle | ( | const GenParticleData & | data | ) |
Constructor based on particle data.
Definition at line 30 of file GenParticle.cc.
|
inline |
| bool add_attribute | ( | const std::string & | name, |
| std::shared_ptr< Attribute > | att ) |
Add an attribute to this particle.
This will overwrite existing attribute if an attribute with the same name is present. The attribute will be stored in the parent_event().
Definition at line 94 of file GenParticle.cc.
References GenEvent::add_attribute(), and parent_event().
| std::shared_ptr< T > attribute | ( | const std::string & | name | ) | const |
Get attribute of type T.
Definition at line 154 of file GenParticle.h.
References GenEvent::attribute(), id(), and parent_event().
| std::string attribute_as_string | ( | const std::string & | name | ) | const |
Get attribute of any type as string.
Definition at line 109 of file GenParticle.cc.
References GenEvent::attribute_as_string(), and parent_event().
| std::vector< std::string > attribute_names | ( | ) | const |
Get list of names of attributes assigned to this particle.
Definition at line 100 of file GenParticle.cc.
References GenEvent::attribute_names(), and parent_event().
| std::vector< GenParticlePtr > children | ( | ) |
Convenience access to immediate outgoing particles via end vertex.
Definition at line 86 of file GenParticle.cc.
References end_vertex(), and m_end_vertex.
| std::vector< ConstGenParticlePtr > children | ( | ) | const |
Convenience access to immediate outgoing particles via end vertex.
Definition at line 90 of file GenParticle.cc.
References end_vertex(), and m_end_vertex.
|
inline |
| GenVertexPtr end_vertex | ( | ) |
| ConstGenVertexPtr end_vertex | ( | ) | const |
Get end vertex (const version)
Definition at line 74 of file GenParticle.cc.
References m_end_vertex.
| double generated_mass | ( | ) | const |
Get generated mass.
This function will return mass as set by a generator/tool. If not set, it will return momentum().m()
Definition at line 36 of file GenParticle.cc.
References m_data.
|
inline |
Get the particle ID number (not PDG ID)
Definition at line 57 of file GenParticle.h.
References m_id.
|
inline |
Check if this particle belongs to an event.
Definition at line 49 of file GenParticle.h.
References m_event.
|
inline |
|
inline |
|
inline |
|
inline |
| std::vector< GenParticlePtr > parents | ( | ) |
Convenience access to immediate incoming particles via production vertex.
Definition at line 78 of file GenParticle.cc.
References m_production_vertex, and production_vertex().
| std::vector< ConstGenParticlePtr > parents | ( | ) | const |
Convenience access to immediate incoming particles via production vertex (const version)
Definition at line 82 of file GenParticle.cc.
References m_production_vertex, and production_vertex().
|
inline |
Get PDG ID.
Definition at line 128 of file GenParticle.h.
References pid().
|
inline |
| GenVertexPtr production_vertex | ( | ) |
Get production vertex.
Definition at line 62 of file GenParticle.cc.
References m_production_vertex.
| ConstGenVertexPtr production_vertex | ( | ) | const |
Get production vertex (const version)
Definition at line 66 of file GenParticle.cc.
References m_production_vertex.
| void remove_attribute | ( | const std::string & | name | ) |
Remove attribute.
Definition at line 105 of file GenParticle.cc.
References parent_event(), and GenEvent::remove_attribute().
| void set_generated_mass | ( | double | m | ) |
| void set_momentum | ( | const FourVector & | momentum | ) |
|
inline |
Set PDG ID.
Definition at line 132 of file GenParticle.h.
References set_pid().
| void set_pid | ( | int | pid | ) |
| void set_status | ( | int | status | ) |
|
inline |
| void unset_generated_mass | ( | ) |
Declare that generated mass is not set.
Definition at line 57 of file GenParticle.cc.
References m_data.
|
friend |
Definition at line 31 of file GenParticle.h.
|
friend |
Definition at line 30 of file GenParticle.h.
|
private |
Particle data.
Definition at line 141 of file GenParticle.h.
|
private |
End vertex.
Definition at line 144 of file GenParticle.h.
|
private |
Parent event.
Definition at line 139 of file GenParticle.h.
|
private |
Index.
Definition at line 140 of file GenParticle.h.
|
private |
Production vertex.
Definition at line 143 of file GenParticle.h.