Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
PoPI::Particle Class Reference

#include <PoPI.hpp>

Inheritance diagram for PoPI::Particle:

Public Member Functions

 Particle (HAPI::Node const &a_node, Particle_class a_class, std::string const &a_family, int a_hasNucleus=0)
virtual ~Particle ()
std::string const & baseId (void) const
std::string const & family (void) const
bool isAnti () const
int hasNucleus (void) const
virtual PQ_suite const & mass (void) const
virtual double massValue (char const *a_unit) const
double massValue (std::string const &a_unit) const
PQ_suite const & spin () const
PQ_suite const & parity () const
PQ_suite const & charge () const
PQ_suite const & halflife () const
DecayData const & decayData () const
void toXMLList (std::vector< std::string > &a_XMLList, std::string const &a_indent1) const
virtual std::string toXMLListExtraAttributes (void) const
virtual void toXMLListExtraElements (std::vector< std::string > &a_XMLList, std::string const &a_indent1) const
Public Member Functions inherited from PoPI::IDBase
 IDBase (std::string const &a_id, Particle_class a_class)
 IDBase (HAPI::Node const &a_node, Particle_class a_class)
virtual ~IDBase ()
std::size_t addToDatabase (Database *a_DB)
double massValue2 (Database const &a_DB, std::string const &a_unit) const
Public Member Functions inherited from PoPI::Base
 Base (std::string const &a_id, Particle_class a_class)
 Base (HAPI::Node const &a_node, std::string const &a_label, Particle_class a_class)
virtual ~Base ()
std::string const & ID (void) const
std::size_t index (void) const
void setIndex (std::size_t a_index)
int intid () const
Particle_class Class (void) const
virtual bool isParticle () const
bool isAlias (void) const
bool isMetaStableAlias (void) const
bool isGaugeBoson () const
bool isLepton () const
bool isBaryon () const
bool isUnorthodox () const
bool isNucleus () const
bool isNuclide () const
bool isIsotope () const
bool isChemicalElement () const

Friends

class Unorthodox

Additional Inherited Members

Public Attributes inherited from PoPI::Base
friend MetaStable
friend Alias
friend Baryon
friend GaugeBoson
friend Lepton
friend Nucleus
friend Nuclide
friend Unorthodox

Detailed Description

The base class representing a particle.

Definition at line 853 of file PoPI.hpp.

Constructor & Destructor Documentation

◆ Particle()

PoPI::Particle::Particle ( HAPI::Node const & a_node,
Particle_class a_class,
std::string const & a_family,
int a_hasNucleus = 0 )
Parameters
a_node[in] The HAPI::Node node to be parsed.
a_class[in] The class of the particle.
a_family[in] The family of the particle.
a_hasNucleus[in] Indicates if the particle is or contains a nucleus. 0 = no, -1 = yes and 1 = is nucleus.

Definition at line 25 of file PoPI_particle.cc.

25 :
26 IDBase( a_node, a_class ),
27 m_baseId( "" ),
28 m_family( a_family ),
29 m_anti( "" ),
30 m_hasNucleus( a_hasNucleus ),
31 m_mass( a_node.child( PoPI_massChars ) ),
32 m_spin( a_node.child( PoPI_spinChars ) ),
33 m_parity( a_node.child( PoPI_parityChars ) ),
34 m_charge( a_node.child( PoPI_chargeChars ) ),
35 m_halflife( a_node.child( PoPI_halflifeChars ) ),
36 m_decayData( a_node.child( PoPI_decayDataChars ) ) {
37
38 m_baseId = baseAntiQualifierFromID( ID( ), m_anti );
39}
#define PoPI_chargeChars
Definition PoPI.hpp:76
#define PoPI_halflifeChars
Definition PoPI.hpp:77
#define PoPI_parityChars
Definition PoPI.hpp:75
#define PoPI_massChars
Definition PoPI.hpp:73
#define PoPI_spinChars
Definition PoPI.hpp:74
#define PoPI_decayDataChars
Definition PoPI.hpp:84
std::string const & ID(void) const
Definition PoPI.hpp:652
IDBase(std::string const &a_id, Particle_class a_class)
Definition PoPI_base.cc:63
std::string baseAntiQualifierFromID(std::string const &a_id, std::string &a_anti, std::string *a_qualifier=nullptr)
Definition PoPI_misc.cc:458

Referenced by PoPI::Baryon::Baryon(), PoPI::GaugeBoson::GaugeBoson(), PoPI::Lepton::Lepton(), PoPI::Nucleus::Nucleus(), PoPI::Nuclide::Nuclide(), and PoPI::Unorthodox::Unorthodox().

◆ ~Particle()

PoPI::Particle::~Particle ( )
virtual

Definition at line 44 of file PoPI_particle.cc.

44 {
45
46}

Member Function Documentation

◆ baseId()

std::string const & PoPI::Particle::baseId ( void ) const
inline

Returns a const reference to the m_baseId member.

Definition at line 873 of file PoPI.hpp.

Referenced by PoPI::Baryon::Baryon().

◆ charge()

PQ_suite const & PoPI::Particle::charge ( ) const
inline

Returns a const reference to the m_charge member.

Definition at line 885 of file PoPI.hpp.

◆ decayData()

DecayData const & PoPI::Particle::decayData ( ) const
inline

Returns a const reference to the m_decayData member.

Definition at line 887 of file PoPI.hpp.

Referenced by PoPI::Nuclide::calculateNuclideGammaBranchStateInfos().

◆ family()

std::string const & PoPI::Particle::family ( void ) const
inline

Returns a const reference to the m_family member.

Definition at line 874 of file PoPI.hpp.

Referenced by toXMLList().

◆ halflife()

PQ_suite const & PoPI::Particle::halflife ( ) const
inline

Returns a const reference to the m_halflife member.

Definition at line 886 of file PoPI.hpp.

◆ hasNucleus()

int PoPI::Particle::hasNucleus ( void ) const
inline

Returns the value of the m_hasNucleus member.

Definition at line 876 of file PoPI.hpp.

Referenced by GIDI::Map::Map::replacementTarget().

◆ isAnti()

bool PoPI::Particle::isAnti ( ) const
inline

◆ mass()

virtual PQ_suite const & PoPI::Particle::mass ( void ) const
inlinevirtual

Returns a const reference to the m_mass member.

Definition at line 878 of file PoPI.hpp.

Referenced by PoPI::Nucleus::massValue(), PoPI::Nuclide::massValue(), and massValue().

◆ massValue() [1/2]

double PoPI::Particle::massValue ( char const * a_unit) const
virtual

Returns the mass of the particle in units of a_unit. Currently not fully implement and does not support a_unit.

Parameters
a_unit[in] The unit to return the mass in.
Returns
The mass in unit of a_unit.

Reimplemented in PoPI::Nucleus, and PoPI::Nuclide.

Definition at line 56 of file PoPI_particle.cc.

56 {
57
58 if( m_mass.size( ) == 0 ) throw Exception( "Particle '" + ID( ) + "' does not have any mass data." );
59
60 PQ_double const *pq_mass = dynamic_cast<PQ_double const *>( mass( )[0] );
61
62 if( pq_mass == nullptr ) throw Exception( "Particle '" + ID( ) + "' does not have a PoPI::PQ_double mass." );
63 return( pq_mass->value( a_unit ) );
64}
virtual PQ_suite const & mass(void) const
Definition PoPI.hpp:878

Referenced by PoPI::DecayMode::calculateNuclideGammaBranchStateInfo(), PoPI::GammaDecayData::calculateNuclideGammaBranchStateInfo(), PoPI::Database::massValue(), and GIDI::ParticleInfo::ParticleInfo().

◆ massValue() [2/2]

double PoPI::Particle::massValue ( std::string const & a_unit) const
inline

Returns the value of massValue( a_unit.c_str( ) ).

Definition at line 880 of file PoPI.hpp.

Referenced by massValue().

◆ parity()

PQ_suite const & PoPI::Particle::parity ( ) const
inline

Returns a const reference to the m_parity member.

Definition at line 884 of file PoPI.hpp.

◆ spin()

PQ_suite const & PoPI::Particle::spin ( ) const
inline

Returns a const reference to the m_spin member.

Definition at line 883 of file PoPI.hpp.

◆ toXMLList()

void PoPI::Particle::toXMLList ( std::vector< std::string > & a_XMLList,
std::string const & a_indent1 ) const

Adds the contents of this to a_XMLList where each item in a_XMLList is one line (without linefeeds) to output as an XML representation of this.

Parameters
a_XMLList[in] The list to add an XML output representation of this to.
a_indent1[in] The amount of indentation to added to each line added to a_XMLList.

Definition at line 73 of file PoPI_particle.cc.

73 {
74
75 std::string indent2 = a_indent1 + " ";
76
77 std::string header = a_indent1 + "<" + family( ) + " id=\"" + ID( ) + "\"" + toXMLListExtraAttributes( ) + ">";
78 a_XMLList.push_back( std::move( header ) );
79
80 m_mass.toXMLList( a_XMLList, indent2 );
81 m_spin.toXMLList( a_XMLList, indent2 );
82 m_parity.toXMLList( a_XMLList, indent2 );
83 m_charge.toXMLList( a_XMLList, indent2 );
84 m_halflife.toXMLList( a_XMLList, indent2 );
85 toXMLListExtraElements( a_XMLList, indent2 );
86 m_decayData.toXMLList( a_XMLList, indent2 );
87
88 appendXMLEnd( a_XMLList, family( ) );
89}
virtual std::string toXMLListExtraAttributes(void) const
virtual void toXMLListExtraElements(std::vector< std::string > &a_XMLList, std::string const &a_indent1) const
std::string const & family(void) const
Definition PoPI.hpp:874
void appendXMLEnd(std::vector< std::string > &a_XMLList, std::string const &a_label)
Definition PoPI_misc.cc:53

◆ toXMLListExtraAttributes()

std::string PoPI::Particle::toXMLListExtraAttributes ( void ) const
virtual

Currently there are no extra attributes to add. Ergo, returns an empty string.

Reimplemented in PoPI::Lepton, and PoPI::Nucleus.

Definition at line 95 of file PoPI_particle.cc.

95 {
96
97 return( "" );
98}

Referenced by toXMLList().

◆ toXMLListExtraElements()

void PoPI::Particle::toXMLListExtraElements ( std::vector< std::string > & a_XMLList,
std::string const & a_indent1 ) const
virtual

Currently there are no extra child nodes to add.

Parameters
a_XMLList[in] The list to add an XML output representation of this to.
a_indent1[in] The amount of indentation to added to each line added to a_XMLList.

Reimplemented in PoPI::Nucleus, and PoPI::Nuclide.

Definition at line 107 of file PoPI_particle.cc.

107 {
108
109 return;
110}

Referenced by toXMLList().

◆ Unorthodox

friend class Unorthodox
friend

Definition at line 893 of file PoPI.hpp.

Referenced by Unorthodox.


The documentation for this class was generated from the following files: