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

#include <PoPI.hpp>

Inheritance diagram for PoPI::Nucleus:

Public Member Functions

 Nucleus (HAPI::Node const &node, Database *a_DB, Nuclide *a_parent)
virtual ~Nucleus ()
Nuclide const * nuclide () const
int Z (void) const
int A (void) const
std::string const & levelName () const
int levelIndex (void) const
std::string const & atomsID (void) const
double massValue (char const *a_unit) const
PQ_suite const & energy (void) const
double energy (std::string const &a_unit) 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::Particle
 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
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
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

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

This class represents PoPs nucleus instance.

Definition at line 960 of file PoPI.hpp.

Constructor & Destructor Documentation

◆ Nucleus()

PoPI::Nucleus::Nucleus ( HAPI::Node const & a_node,
Database * a_DB,
Nuclide * a_nuclide )

Constructor that parses an HAPI instance to create a PoPs nucleus node.

Parameters
a_node[in] The HAPI::Node to be parsed.
a_DB[in] The PoPI::Database:: instance to add the constructed **Nucleus to.
a_nuclide[in] This nuclide instance that will contain this.

Definition at line 31 of file PoPI_nucleus.cc.

31 :
33 m_nuclide( a_nuclide ),
34 m_Z( a_nuclide->Z( ) ),
35 m_A( a_nuclide->A( ) ),
36 m_levelName( a_node.attribute( PoPI_indexChars ).value( ) ), // The string version of m_levelIndex.
37 m_levelIndex( a_node.attribute( PoPI_indexChars ).as_int( ) ), // The int version of m_levelName.
38 m_energy( a_node.child( PoPI_energyChars ) ) {
39
40 if( a_node.empty( ) ) throw Exception( "nuclide is missing nucleus" );
41
42 int sign = ( isAnti( ) ? -1 : 1 );
43 setIntid( sign * ( 1000 * ( 1000 * (levelIndex( ) + 500) + Z( ) ) + A( ) ) );
44
45 addToDatabase( a_DB );
46}
#define PoPI_nucleusChars
Definition PoPI.hpp:50
#define PoPI_indexChars
Definition PoPI.hpp:91
#define PoPI_energyChars
std::size_t addToDatabase(Database *a_DB)
Definition PoPI_base.cc:95
int levelIndex(void) const
Definition PoPI.hpp:978
int A(void) const
Definition PoPI.hpp:976
int Z(void) const
Definition PoPI.hpp:975
Particle(HAPI::Node const &a_node, Particle_class a_class, std::string const &a_family, int a_hasNucleus=0)
bool isAnti() const
Definition PoPI.hpp:875
G4int sign(const T t)

◆ ~Nucleus()

PoPI::Nucleus::~Nucleus ( )
virtual

Definition at line 51 of file PoPI_nucleus.cc.

51 {
52
53}

Member Function Documentation

◆ A()

int PoPI::Nucleus::A ( void ) const
inline

Returns a const reference to the m_A member.

Definition at line 976 of file PoPI.hpp.

Referenced by Nucleus(), and PoPI::particleA().

◆ atomsID()

std::string const & PoPI::Nucleus::atomsID ( void ) const

Returns the atomic ID of the parent nuclide.

Returns
The atomic ID of the parent nuclide.

Definition at line 61 of file PoPI_nucleus.cc.

61 {
62
63 return( m_nuclide->atomsID( ) );
64}

◆ energy() [1/2]

double PoPI::Nucleus::energy ( std::string const & a_unit) const

Returns the excitation energy of the nucleus 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.

Definition at line 102 of file PoPI_nucleus.cc.

102 {
103
104 if( m_energy.size( ) == 0 ) {
105 if( m_levelIndex != 0 )
106 std::cerr << std::endl << "Particle " << ID( ) << " missing energy node, please report to PoPs maintainer. Using 0.0 and continuing." << std::endl;
107 return( 0.0 );
108 }
109 PQ_double *pq = static_cast<PQ_double *>( m_energy[0] );
110 if( pq->unit( ) == "eV" ) return( pq->value( ) * 1e-6 ); // Kludge until units are functional.
111 return( pq->value( a_unit ) );
112}
std::string const & ID(void) const
Definition PoPI.hpp:652

◆ energy() [2/2]

PQ_suite const & PoPI::Nucleus::energy ( void ) const
inline

Returns a const reference to the m_energy member.

Definition at line 982 of file PoPI.hpp.

◆ levelIndex()

int PoPI::Nucleus::levelIndex ( void ) const
inline

Returns a const reference to the m_levelIndex member.

Definition at line 978 of file PoPI.hpp.

Referenced by Nucleus().

◆ levelName()

std::string const & PoPI::Nucleus::levelName ( ) const
inline

Returns a const reference to the m_levelName member of this.

Definition at line 977 of file PoPI.hpp.

◆ massValue()

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

Returns the mass of the nucleus 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 from PoPI::Particle.

Definition at line 74 of file PoPI_nucleus.cc.

74 {
75
76 if( mass( ).size( ) > 0 ) {
77 PQ_double const *pq_mass = dynamic_cast<PQ_double const *>( mass( )[0] );
78
79 if( pq_mass == nullptr ) throw Exception( "Particle does not have a PoPI::PQ_double mass." );
80 return( pq_mass->value( a_unit ) );
81 }
82
83// FIXME: still need to correct for electron masses and binding energy. Currently, an approximation is done.
84 double bindingEnergy = 0.0;
85 if( m_Z == 1 ) {
86 bindingEnergy = 13.5981e-6; }
87 else if( m_Z == 2 ) {
88 bindingEnergy = 79.005e-6;
89 }
90
91 return( m_nuclide->massValue( a_unit ) - ( m_Z * PoPI_electronMass_MeV_c2 - bindingEnergy ) / PoPI_AMU2MeV_c2 );
92}
#define PoPI_AMU2MeV_c2
Definition PoPI.hpp:30
#define PoPI_electronMass_MeV_c2
Definition PoPI.hpp:31
virtual PQ_suite const & mass(void) const
Definition PoPI.hpp:878
G4double bindingEnergy(G4int A, G4int Z)

◆ nuclide()

Nuclide const * PoPI::Nucleus::nuclide ( ) const
inline

Returns a const reference to the m_nuclide member.

Definition at line 974 of file PoPI.hpp.

◆ toXMLListExtraAttributes()

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

Returns the index attribute.

Reimplemented from PoPI::Particle.

Definition at line 118 of file PoPI_nucleus.cc.

118 {
119
120 return( std::string( " index=\"" + m_levelName + "\"" ) );
121}

◆ toXMLListExtraElements()

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

Added the m_energy stuff to a_XMLList.

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 from PoPI::Particle.

Definition at line 130 of file PoPI_nucleus.cc.

130 {
131
132 m_energy.toXMLList( a_XMLList, a_indent1 );
133}

◆ Z()

int PoPI::Nucleus::Z ( void ) const
inline

Returns a const reference to the m_Z member.

Definition at line 975 of file PoPI.hpp.

Referenced by Nucleus(), and PoPI::particleZ().


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