|
MARLEY (Model of Argon Reaction Low Energy Yields) v2.0.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
|
Stores particle-related information. More...
#include <GenParticle.h>
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. | |
| int | abs_pid () const |
| Get absolute value of PDG ID. | |
| bool | add_attribute (const std::string &name, std::shared_ptr< Attribute > att) |
| Add an attribute to this particle. | |
| 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. | |
| std::vector< std::string > | attribute_names () const |
| Get list of names of attributes assigned to this particle. | |
| 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. | |
| const GenParticleData & | data () const |
| Get particle data. | |
| GenVertexPtr | end_vertex () |
| Get end vertex. | |
| ConstGenVertexPtr | end_vertex () const |
| Get end vertex (const version) | |
| double | generated_mass () const |
| Get generated mass. | |
| int | id () const |
| Get the particle ID number (not PDG ID) | |
| bool | in_event () const |
| Check if this particle belongs to an event. | |
| bool | is_generated_mass_set () const |
| Check if generated mass is set. | |
| const FourVector & | momentum () const |
| Get momentum. | |
| GenEvent * | parent_event () |
| Get the parent event. | |
| const GenEvent * | parent_event () const |
| Get the parent event (const) | |
| 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) | |
| int | pid () const |
| Get PDG ID. | |
| GenVertexPtr | production_vertex () |
| Get production vertex. | |
| ConstGenVertexPtr | production_vertex () const |
| Get production vertex (const version) | |
| void | remove_attribute (const std::string &name) |
| Remove attribute. | |
| void | set_generated_mass (double m) |
| Set generated mass. | |
| void | set_momentum (const FourVector &momentum) |
| Set momentum. | |
| void | set_pid (int pid) |
| Set PDG ID. | |
| void | set_status (int status) |
| Set status code. | |
| int | status () const |
| Get status code. | |
| void | unset_generated_mass () |
| Declare that generated mass is not set. | |
Deprecated functionality | |
| int | pdg_id () const |
| Get PDG ID. | |
| void | set_pdg_id (const int &pidin) |
| Set PDG ID. | |
Friends | |
| class | GenEvent |
| class | GenVertex |
Stores particle-related information.
Definition at line 34 of file GenParticle.h.
| HepMC3::GenParticle::GenParticle | ( | const FourVector & | momentum = FourVector::ZERO_VECTOR(), |
| int | pid = 0, | ||
| int | status = 0 ) |
Default constructor.
Definition at line 231 of file marley_hepmc3.cc.
| HepMC3::GenParticle::GenParticle | ( | const GenParticleData & | data | ) |
Constructor based on particle data.
Definition at line 241 of file marley_hepmc3.cc.
|
inline |
| bool HepMC3::GenParticle::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 305 of file marley_hepmc3.cc.
References HepMC3::GenEvent::add_attribute(), and parent_event().
Referenced by marley::NuclearReaction::set_nuclear_residue_attributes().
| std::shared_ptr< T > HepMC3::GenParticle::attribute | ( | const std::string & | name | ) | const |
Get attribute of type T.
Definition at line 165 of file GenParticle.h.
References HepMC3::GenEvent::attribute(), id(), and parent_event().
| std::string HepMC3::GenParticle::attribute_as_string | ( | const std::string & | name | ) | const |
Get attribute of any type as string.
Definition at line 320 of file marley_hepmc3.cc.
References HepMC3::GenEvent::attribute_as_string(), and parent_event().
| std::vector< std::string > HepMC3::GenParticle::attribute_names | ( | ) | const |
Get list of names of attributes assigned to this particle.
Definition at line 311 of file marley_hepmc3.cc.
References HepMC3::GenEvent::attribute_names(), and parent_event().
| std::vector< GenParticlePtr > HepMC3::GenParticle::children | ( | ) |
Convenience access to immediate outgoing particles via end vertex.
Definition at line 297 of file marley_hepmc3.cc.
References end_vertex().
| std::vector< ConstGenParticlePtr > HepMC3::GenParticle::children | ( | ) | const |
Convenience access to immediate outgoing particles via end vertex.
Definition at line 301 of file marley_hepmc3.cc.
References end_vertex().
|
inline |
Get particle data.
Definition at line 70 of file GenParticle.h.
| GenVertexPtr HepMC3::GenParticle::end_vertex | ( | ) |
Get end vertex.
Definition at line 281 of file marley_hepmc3.cc.
| ConstGenVertexPtr HepMC3::GenParticle::end_vertex | ( | ) | const |
Get end vertex (const version)
Definition at line 285 of file marley_hepmc3.cc.
Referenced by children(), and children().
| double HepMC3::GenParticle::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 247 of file marley_hepmc3.cc.
|
inline |
Get the particle ID number (not PDG ID)
Definition at line 68 of file GenParticle.h.
Referenced by attribute().
|
inline |
Check if this particle belongs to an event.
Definition at line 60 of file GenParticle.h.
|
inline |
Check if generated mass is set.
Definition at line 98 of file GenParticle.h.
|
inline |
Get momentum.
Definition at line 97 of file GenParticle.h.
Referenced by marley::RotationMatrix::rotate_particle_inplace().
|
inline |
Get the parent event.
Definition at line 63 of file GenParticle.h.
Referenced by add_attribute(), attribute(), attribute_as_string(), attribute_names(), and remove_attribute().
|
inline |
| std::vector< GenParticlePtr > HepMC3::GenParticle::parents | ( | ) |
Convenience access to immediate incoming particles via production vertex.
Definition at line 289 of file marley_hepmc3.cc.
References production_vertex().
| std::vector< ConstGenParticlePtr > HepMC3::GenParticle::parents | ( | ) | const |
Convenience access to immediate incoming particles via production vertex (const version)
Definition at line 293 of file marley_hepmc3.cc.
References production_vertex().
|
inline |
Get PDG ID.
Definition at line 139 of file GenParticle.h.
References pid().
|
inline |
| GenVertexPtr HepMC3::GenParticle::production_vertex | ( | ) |
Get production vertex.
Definition at line 273 of file marley_hepmc3.cc.
| ConstGenVertexPtr HepMC3::GenParticle::production_vertex | ( | ) | const |
Get production vertex (const version)
Definition at line 277 of file marley_hepmc3.cc.
| void HepMC3::GenParticle::remove_attribute | ( | const std::string & | name | ) |
Remove attribute.
Definition at line 316 of file marley_hepmc3.cc.
References parent_event(), and HepMC3::GenEvent::remove_attribute().
| void HepMC3::GenParticle::set_generated_mass | ( | double | m | ) |
Set generated mass.
Definition at line 263 of file marley_hepmc3.cc.
| void HepMC3::GenParticle::set_momentum | ( | const FourVector & | momentum | ) |
Set momentum.
Definition at line 259 of file marley_hepmc3.cc.
Referenced by marley::RotationMatrix::rotate_particle_inplace().
|
inline |
Set PDG ID.
Definition at line 143 of file GenParticle.h.
References set_pid().
| void HepMC3::GenParticle::set_pid | ( | int | pid | ) |
Set PDG ID.
Definition at line 251 of file marley_hepmc3.cc.
Referenced by set_pdg_id().
| void HepMC3::GenParticle::set_status | ( | int | status | ) |
Set status code.
Definition at line 255 of file marley_hepmc3.cc.
Referenced by marley::DecayScheme::do_cascade().
|
inline |
Get status code.
Definition at line 96 of file GenParticle.h.
| void HepMC3::GenParticle::unset_generated_mass | ( | ) |
Declare that generated mass is not set.
Definition at line 268 of file marley_hepmc3.cc.
|
friend |
Definition at line 37 of file GenParticle.h.
|
friend |
Definition at line 36 of file GenParticle.h.