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

#include <PoPI.hpp>

Inheritance diagram for PoPI::PQ_double:

Public Member Functions

 PQ_double (HAPI::Node const &a_node)
 PQ_double (HAPI::Node const &a_node, PQ_class a_class)
virtual ~PQ_double ()
double value (void) const
double value (char const *a_unit) const
double value (std::string const &a_unit) const
virtual std::string valueToString (void) const
Public Member Functions inherited from PoPI::PhysicalQuantity
 PhysicalQuantity (HAPI::Node const &a_node, PQ_class a_class)
virtual ~PhysicalQuantity ()
PQ_class Class (void) const
std::string const & tag (void) const
std::string const & label (void) const
std::string const & valueString (void) const
std::string const & unit (void) const
void toXMLList (std::vector< std::string > &a_XMLList, std::string const &a_indent1) const

Detailed Description

The physical quantity class representing a double.

Definition at line 432 of file PoPI.hpp.

Constructor & Destructor Documentation

◆ PQ_double() [1/2]

PoPI::PQ_double::PQ_double ( HAPI::Node const & a_node)
Parameters
a_node[in] The HAPI::Node node to be parsed.

Definition at line 71 of file PoPI_physicalQuantity.cc.

71 :
73 m_value( 0.0 ) {
74
75 initialize( );
76}
PhysicalQuantity(HAPI::Node const &a_node, PQ_class a_class)

Referenced by PoPI::PQ_shell::PQ_shell().

◆ PQ_double() [2/2]

PoPI::PQ_double::PQ_double ( HAPI::Node const & a_node,
PQ_class a_class )
Parameters
a_node[in] The HAPI::Node node to be parsed.
a_class[in] The class of the physical quantity.

Definition at line 83 of file PoPI_physicalQuantity.cc.

83 :
84 PhysicalQuantity( a_node, a_class ),
85 m_value( 0.0 ) {
86
87 initialize( );
88}

◆ ~PQ_double()

PoPI::PQ_double::~PQ_double ( )
virtual

Definition at line 104 of file PoPI_physicalQuantity.cc.

104 {
105
106}

Member Function Documentation

◆ value() [1/3]

double PoPI::PQ_double::value ( char const * a_unit) const

◆ value() [2/3]

double PoPI::PQ_double::value ( std::string const & a_unit) const
inline

Returns the value of the m_value member in units of a_unit.

Definition at line 445 of file PoPI.hpp.

Referenced by value().

◆ value() [3/3]

double PoPI::PQ_double::value ( void ) const
inline

Returns the value of the m_value member.

Definition at line 443 of file PoPI.hpp.

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

◆ valueToString()

std::string PoPI::PQ_double::valueToString ( void ) const
virtual

Converts the double value of self to a string.

Returns
The string value of this.

Implements PoPI::PhysicalQuantity.

Definition at line 127 of file PoPI_physicalQuantity.cc.

127 {
128
129 std::string sValue = LUPI::Misc::argumentsToString( "%.12g", m_value );
130 if( fabs( m_value ) < 1e10 ) {
131 if( sValue.find( '.' ) == std::string::npos ) sValue = LUPI::Misc::argumentsToString( "%.1f", m_value );
132 }
133
134 return( sValue );
135}
std::string argumentsToString(char const *a_format,...)
Definition LUPI_misc.cc:305

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