53void appendXMLEnd( std::vector<std::string> &a_XMLList, std::string
const &a_label ) {
55 std::string theEnd =
"</" + a_label +
">";
56 std::vector<std::string>::iterator iter = a_XMLList.end( );
81 static std::string firstChars(
"pdthaH" );
84 if( a_id.size( ) > 3 )
return( a_id );
86 std::size_t index = firstChars.find( a_id[0] );
88 if( index == std::string::npos )
return( a_id );
90 if( a_id ==
"H" )
return( a_id );
91 std::string id1( a_id );
92 if( id1[0] ==
'H' ) id1[0] =
'h';
105 if( iid == 0 )
return( a_id );
108 return( firstChars.substr( iid-1, 1 ) ); }
112 else if( iid == 2 ) {
114 else if( iid == 3 ) {
116 else if( iid == 4 ) {
155 if( a_isNeutronProtonANucleon ) Z = 1; }
193 Z =
particleZ( particle, a_isNeutronProtonANucleon );
209int particleZ(
Database const &a_pops, std::string
const &a_id,
bool a_isNeutronProtonANucleon ) {
213 return(
particleZ(
object, a_isNeutronProtonANucleon ) );
232 if( a_isNeutronProtonANucleon )
A = 1; }
234 if( a_isNeutronProtonANucleon )
A = 1; }
263 return(
particleA( particle, a_isNeutronProtonANucleon ) );
276int particleA(
Database const &a_pops, std::string
const &a_id,
bool a_isNeutronProtonANucleon ) {
280 return(
particleA( particle, a_isNeutronProtonANucleon ) );
299 if( a_isNeutronProtonANucleon ) ZA = 1; }
321 return(
particleZA( particle, a_isNeutronProtonANucleon ) );
338 return(
particleZA( particle, a_isNeutronProtonANucleon ) );
351 int metaStableIndex = 0;
355 metaStableIndex =
object.metaStableIndex( );
358 return( metaStableIndex );
407 switch( a_physicalQuantity.
Class( ) ) {
411 value = pq_double.
value( ); }
415 value = pq_integer.
value( ); }
418 throw Exception(
"Cannot convert physical quantitiy to a double." );
437 if( a_suite.size( ) == 0 ) {
438 if( a_allowEmpty )
return( a_emptyValue );
439 throw Exception(
"No physical quantitiy in Suite." );
460 std::size_t curlyBraketPosition = a_id.find(
"{" );
461 std::string base = a_id.substr( 0, curlyBraketPosition );
464 if( a_qualifier !=
nullptr ) *a_qualifier =
"";
466 if( curlyBraketPosition != std::string::npos ) {
467 if( a_id.back( ) !=
'}' )
throw Exception(
"Invalid quaifier string in id '" + a_id +
"'." );
468 base = a_id.substr( 0, curlyBraketPosition );
469 if( a_qualifier !=
nullptr ) {
470 *a_qualifier = a_id.substr( curlyBraketPosition + 1, a_id.size( ) - curlyBraketPosition - 2 );
472 else if( a_id.find(
"}" ) != std::string::npos ) {
473 throw Exception(
"Invalid quaifier string in id '" + a_id +
"'." );
476 std::size_t anti_position = base.find(
IDs::anti );
477 if( anti_position != std::string::npos ) {
478 a_anti = base.substr( anti_position );
479 base = base.substr( 0, anti_position );
480 if( a_anti !=
IDs::anti )
throw Exception(
"Invalid anti string in id '" + a_id +
"'." );
495 std::runtime_error( a_message ) {
#define PoPI_formatVersion_0_1_Chars
bool isChemicalElement() const
std::string const & ID(void) const
bool isMetaStableAlias(void) const
T const & get(std::string const &a_id) const
std::string final(std::string const &a_id, bool a_returnAtMetaStableAlias=false) const
Exception(std::string const &a_message)
PQ_class Class(void) const
double getPhysicalQuantityOfSuiteAsDouble(PQ_suite const &a_suite, bool a_allowEmpty=false, double a_emptyValue=0.0)
int particleA(Base const &a_particle, bool a_isNeutronProtonANucleon=false)
std::string specialParticleID(SpecialParticleID_mode a_mode, std::string const &a_id)
int particleMetaStableIndex(Base const &a_particle)
int particleZ(Base const &a_particle, bool a_isNeutronProtonANucleon=false)
double getPhysicalQuantityAsDouble(PhysicalQuantity const &a_physicalQuantity)
bool supportedFormat(LUPI::FormatVersion const &a_formatVersion)
int particleZA(Base const &a_particle, bool a_isNeutronProtonANucleon=false)
bool compareSpecialParticleIDs(std::string const &a_id1, std::string const &a_id2)
void appendXMLEnd(std::vector< std::string > &a_XMLList, std::string const &a_label)
std::string baseAntiQualifierFromID(std::string const &a_id, std::string &a_anti, std::string *a_qualifier=nullptr)
static std::string const anti
static std::string const photon
static std::string const familiarPhoton
static std::string const neutron
static std::string const FissionProductENDL99125
static std::string const familiarTriton
static std::string const FissionProductENDL99120
static std::string const familiarHelion
static std::string const proton
static std::string const familiarAlpha
static std::string const familiarDeuteron
static std::string const electron