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

#include <PoPI.hpp>

Inheritance diagram for PoPI::Alias:

Public Member Functions

 Alias (HAPI::Node const &a_node, Database *a_DB, Particle_class a_class=Particle_class::alias)
virtual ~Alias ()
std::string const & pid (void) const
std::size_t pidIndex (void) const
void setPidIndex (std::size_t a_index)
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 a PoPs alias instance.

Definition at line 1086 of file PoPI.hpp.

Constructor & Destructor Documentation

◆ Alias()

PoPI::Alias::Alias ( HAPI::Node const & a_node,
Database * a_DB,
Particle_class a_class = Particle_class::alias )

Constructor that parses an HAPI instance to create a GNDS alias node.

Parameters
a_node[in] The HAPI::Node to be parsed.
a_DB[in] The PoPI::Database:: instance to add the constructed **Alias to.
a_class[in] The particle class for Alias.

Definition at line 28 of file PoPI_alias.cc.

28 :
29 IDBase( a_node, a_class ),
30 m_pid( a_node.attribute( PoPI_pidChars ).value( ) ),
31 m_pidIndex( SIZE_MAX ) {
32
33 if( supportedNucleusAliases.find( ID( ) ) != supportedNucleusAliases.end( ) ) {
34 ParseIdInfo idInfo( supportedNucleusAliases[ID( )] );
35
36 setIntid( 1000 * ( 1000 * (idInfo.index( ) + 500) + idInfo.Z( ) ) + idInfo.A( ) ); // Anti is currently not supported.
37 }
38 if( a_class == Particle_class::alias ) addToDatabase( a_DB );
39}
#define PoPI_pidChars
Definition PoPI.hpp:92
std::string const & ID(void) const
Definition PoPI.hpp:652
std::size_t addToDatabase(Database *a_DB)
Definition PoPI_base.cc:95
IDBase(std::string const &a_id, Particle_class a_class)
Definition PoPI_base.cc:63
std::map< std::string, std::string > supportedNucleusAliases

Referenced by PoPI::MetaStable::MetaStable().

◆ ~Alias()

PoPI::Alias::~Alias ( )
virtual

Definition at line 44 of file PoPI_alias.cc.

44 {
45
46}

Member Function Documentation

◆ pid()

std::string const & PoPI::Alias::pid ( void ) const
inline

Returns a const reference to the m_pid member of this.

Definition at line 1096 of file PoPI.hpp.

Referenced by PoPI::MetaStable::toXMLList().

◆ pidIndex()

std::size_t PoPI::Alias::pidIndex ( void ) const
inline

Returns a const reference to the m_pidIndex member of this.

Definition at line 1097 of file PoPI.hpp.

◆ setPidIndex()

void PoPI::Alias::setPidIndex ( std::size_t a_index)
inline

Set the member m_pidIndex to a_index.

Definition at line 1098 of file PoPI.hpp.

◆ toXMLList()

void PoPI::Alias::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 55 of file PoPI_alias.cc.

55 {
56
57 std::string header = a_indent1 + "<particle id=\"" + ID( ) + "\" pid=\"" + m_pid + "\"/>";
58 a_XMLList.push_back( std::move( header ) );
59}

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