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

Classes

struct  IDs
struct  Intids
class  Exception
class  ParseIntidInfo
class  ParseIdInfo
class  Suite
class  PhysicalQuantity
class  PQ_double
class  PQ_integer
class  PQ_fraction
class  PQ_string
class  PQ_shell
class  PQ_suite
class  NuclideGammaBranchInfo
class  NuclideGammaBranchStateInfo
class  NuclideGammaBranchStateInfos
class  Base
class  IDBase
class  SymbolBase
class  Product
class  Decay
class  DecayMode
class  DecayData
class  GammaDecayData
class  Particle
class  GaugeBoson
class  Lepton
class  Baryon
class  Unorthodox
class  Nucleus
class  Nuclide
class  Isotope
class  ChemicalElement
class  Alias
class  MetaStable
class  Database

Typedefs

typedef std::vector< Base * > ParticleList
typedef std::vector< SymbolBase * > SymbolList

Enumerations

enum class  Particle_class {
  nuclide , nucleus , gaugeBoson , lepton ,
  baryon , nuclideMetaStable , nucleusMetaStable , TNSL ,
  ENDL_fissionProduct , unorthodox , alias , chemicalElement ,
  isotope , unknown
}
enum class  PQ_class {
  Double , integer , fraction , string ,
  shell
}
enum class  SpecialParticleID_mode { familiar , nuclide , nucleus }

Functions

void appendXMLEnd (std::vector< std::string > &a_XMLList, std::string const &a_label)
int particleZ (Base const &a_particle, bool a_isNeutronProtonANucleon=false)
int particleZ (Database const &a_pops, std::size_t a_index, bool a_isNeutronProtonANucleon=false)
int particleZ (Database const &a_pops, std::string const &a_id, bool a_isNeutronProtonANucleon=false)
int particleA (Base const &a_particle, bool a_isNeutronProtonANucleon=false)
int particleA (Database const &a_pops, std::size_t a_index, bool a_isNeutronProtonANucleon=false)
int particleA (Database const &a_pops, std::string const &a_id, bool a_isNeutronProtonANucleon=false)
int particleZA (Base const &a_particle, bool a_isNeutronProtonANucleon=false)
int particleZA (Database const &a_pops, std::size_t a_index, bool a_isNeutronProtonANucleon=false)
int particleZA (Database const &a_pops, std::string const &a_id, bool a_isNeutronProtonANucleon=false)
int particleMetaStableIndex (Base const &a_particle)
int particleMetaStableIndex (Database const &a_pops, std::size_t a_index)
int particleMetaStableIndex (Database const &a_pops, std::string const &a_id)
std::string specialParticleID (SpecialParticleID_mode a_mode, std::string const &a_id)
bool compareSpecialParticleIDs (std::string const &a_id1, std::string const &a_id2)
double getPhysicalQuantityAsDouble (PhysicalQuantity const &a_physicalQuantity)
double getPhysicalQuantityOfSuiteAsDouble (PQ_suite const &a_suite, bool a_allowEmpty=false, double a_emptyValue=0.0)
bool supportedFormat (LUPI::FormatVersion const &a_formatVersion)
std::string baseAntiQualifierFromID (std::string const &a_id, std::string &a_anti, std::string *a_qualifier=nullptr)
int maximumChemicalElementZ ()
std::string chemicalElementInfoFromZ (int a_Z, bool a_wantSymbol, bool a_asNucleus=false)
std::string const & chemicalElementSymbolFromZ (int a_Z)
int Z_FromChemicalElementSymbol (std::string const &a_symbol)
int family2Integer (Particle_class a_family)
int intidHelper (bool a_isAnti, Particle_class a_family, int a_SSSSSSS)

Variables

std::map< std::string, std::string > supportedNucleusAliases { {"d", "h2"}, {"t", "h3"}, {"h", "he3"}, {"a", "he4"} }

Typedef Documentation

◆ ParticleList

typedef std::vector<Base *> PoPI::ParticleList

Definition at line 186 of file PoPI.hpp.

◆ SymbolList

typedef std::vector<SymbolBase *> PoPI::SymbolList

Definition at line 187 of file PoPI.hpp.

Enumeration Type Documentation

◆ Particle_class

enum class PoPI::Particle_class
strong

This enum represents the various type of allowed particle types.

Enumerator
nuclide 

Specifies that the particle is a nuclide.

nucleus 

Specifies that the particle is a nucleus.

gaugeBoson 

Specifies that the particle is a gauge boson.

lepton 

Specifies that the particle is a lepton.

baryon 

Specifies that the particle is a baryon.

nuclideMetaStable 

Specifies that the particle is a nuclide meta-stable alias.

nucleusMetaStable 

Specifies that the particle is a nucleus meta-stable alias.

TNSL 

Specifies that the particle is a TNSL target. Currently not used.

ENDL_fissionProduct 

Specifies that the particle is an ENDL fissiont product (e.g., 99120, 99125).

unorthodox 

Specifies that the particle is an unorthodox.

alias 

Specifies that the particle is a alias.

chemicalElement 

Specifies that the particle is a chemicalElement.

isotope 

Specifies that the particle is a isotope.

unknown 

Specifies that the particle is a unknown.

Definition at line 58 of file PoPI.hpp.

58 { nuclide, /**< Specifies that the particle is a nuclide. */
59 nucleus, /**< Specifies that the particle is a nucleus. */
60 gaugeBoson, /**< Specifies that the particle is a gauge boson. */
61 lepton, /**< Specifies that the particle is a lepton. */
62 baryon, /**< Specifies that the particle is a baryon. */
63 nuclideMetaStable, /**< Specifies that the particle is a nuclide meta-stable alias. */
64 nucleusMetaStable, /**< Specifies that the particle is a nucleus meta-stable alias. */
65 TNSL, /**< Specifies that the particle is a TNSL target. Currently not used. */
66 ENDL_fissionProduct, /**< Specifies that the particle is an ENDL fissiont product (e.g., 99120, 99125). */
67 unorthodox, /**< Specifies that the particle is an unorthodox. */
68 alias, /**< Specifies that the particle is a alias. */
69 chemicalElement, /**< Specifies that the particle is a chemicalElement. */
70 isotope, /**< Specifies that the particle is a isotope. */
71 unknown /**< Specifies that the particle is a unknown. */ };

◆ PQ_class

enum class PoPI::PQ_class
strong

This enum represents the various type of allowed physcial quantity types.

Enumerator
Double 

Specifies that the physcial quantity is a double.

integer 

Specifies that the physcial quantity is an integer.

fraction 

Specifies that the physcial quantity is a fraction.

string 

Specifies that the physcial quantity is a string.

shell 

Specifies that the physcial quantity is a shell.

Definition at line 105 of file PoPI.hpp.

105 { Double, /**< Specifies that the physcial quantity is a double. */
106 integer, /**< Specifies that the physcial quantity is an integer. */
107 fraction, /**< Specifies that the physcial quantity is a fraction. */
108 string, /**< Specifies that the physcial quantity is a string. */
109 shell /**< Specifies that the physcial quantity is a shell. */ };

◆ SpecialParticleID_mode

enum class PoPI::SpecialParticleID_mode
strong

This enum specifies how the light charged particle ids are handled. The light charged particles ids are familiarly known as p, d, t, h and a.

Enumerator
familiar 

Treat ids as the familiar p, d, t, h and a.

nuclide 

Treat ids as the familiar p, d, t, h and a as h1, h2, h3, he3 and he4, respectively.

nucleus 

Treat ids as the familiar p, d, t, h and a as H1, H2, H3, He3 and He4, respectively.

Definition at line 116 of file PoPI.hpp.

116 { familiar, /**< Treat ids as the familiar p, d, t, h and a. */
117 nuclide, /**< Treat ids as the familiar p, d, t, h and a as h1, h2, h3, he3 and he4, respectively. */
118 nucleus /**< Treat ids as the familiar p, d, t, h and a as H1, H2, H3, He3 and He4, respectively. */ };

Function Documentation

◆ appendXMLEnd()

void PoPI::appendXMLEnd ( std::vector< std::string > & a_XMLList,
std::string const & a_label )

Added the XML end tag (e.g., "</tag>") with tag name a_label to the last srd::string in a_XMLList.

Parameters
a_XMLList[in] The list whose last item is emended with an XML end tag.
a_label[in] The name of the end tag.

Definition at line 53 of file PoPI_misc.cc.

53 {
54
55 std::string theEnd = "</" + a_label + ">";
56 std::vector<std::string>::iterator iter = a_XMLList.end( );
57 --iter;
58 *iter += theEnd;
59}

Referenced by PoPI::ChemicalElement::toXMLList(), PoPI::Database::toXMLList(), PoPI::Decay::toXMLList(), PoPI::DecayData::toXMLList(), PoPI::DecayMode::toXMLList(), PoPI::Isotope::toXMLList(), PoPI::Particle::toXMLList(), PoPI::PQ_suite::toXMLList(), and PoPI::Suite< T, T2 >::toXMLList().

◆ baseAntiQualifierFromID()

std::string PoPI::baseAntiQualifierFromID ( std::string const & a_id,
std::string & a_anti,
std::string * a_qualifier )

Breaks th components of a particles name into base, anti and quailier strings. Every id in GNDS PoPs can be of the form base["_anti"][qualifier] where both "_anti" and qualifier are optional. For example, an electron is represented as "e-" and an anti-electron (i.e., positron) "e-_anti". Qualifiers are endings imbedded by "{" and "}". For example, "H{1s1/2}" has the base "H" with quailifier "1s1/2" where the "{" and "}" have been stripped from the quailifier.

Parameters
a_id[in] The base id for a_id.
a_anti[in] A std::string to be filled with "_anti" if particle is an anti-particle and an "" otherwise.
a_qualifier[in] A pointer to a std::string that will be filled with the qualifer characters.
Returns
The base id for the particle.

Definition at line 458 of file PoPI_misc.cc.

458 {
459
460 std::size_t curlyBraketPosition = a_id.find( "{" );
461 std::string base = a_id.substr( 0, curlyBraketPosition );
462
463 a_anti = "";
464 if( a_qualifier != nullptr ) *a_qualifier = "";
465
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 );
471 } }
472 else if( a_id.find( "}" ) != std::string::npos ) {
473 throw Exception( "Invalid quaifier string in id '" + a_id + "'." );
474 }
475
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 + "'." );
481 }
482
483 return( base );
484}
static std::string const anti
Definition PoPI.hpp:173

Referenced by PoPI::ParseIdInfo::ParseIdInfo(), and PoPI::Particle::Particle().

◆ chemicalElementInfoFromZ()

std::string PoPI::chemicalElementInfoFromZ ( int a_Z,
bool a_wantSymbol,
bool a_asNucleus )

Returns the chemical element's symbol (a_wantSymbol = true) or name (a_wantSymbol = false) for the requrest atomic number a_Z. a_wantSymbol is true, the returned symbol is for the nuclide when a_asNucleus is false and for the nucleus otherwise.

Parameters
a_Z[in] The Z (atomic number of the chemical element.
a_wantSymbol[in] If true returns the chemical element's symbol otherwise its name.
a_asNucleus[in] If true returns the symbol for the nucleus, otherwise for the nuclide. As no affect if a_wantSymbol is false.
Returns
The symbol for the nuclide or the nucleus, or the name as a std::string.

Definition at line 129 of file PoPI_chemicalElement.cc.

129 {
130
131 std::string info;
132
133 switch( a_Z ) {
134 case 1:
135 if( a_wantSymbol ) {
136 info = "H"; }
137 else {
138 info = "Hydrogen";
139 }
140 break;
141 case 2:
142 if( a_wantSymbol ) {
143 info = "He"; }
144 else {
145 info = "Helium";
146 }
147 break;
148 case 3:
149 if( a_wantSymbol ) {
150 info = "Li"; }
151 else {
152 info = "Lithium";
153 }
154 break;
155 case 4:
156 if( a_wantSymbol ) {
157 info = "Be"; }
158 else {
159 info = "Beryllium";
160 }
161 break;
162 case 5:
163 if( a_wantSymbol ) {
164 info = "B"; }
165 else {
166 info = "Boron";
167 }
168 break;
169 case 6:
170 if( a_wantSymbol ) {
171 info = "C"; }
172 else {
173 info = "Carbon";
174 }
175 break;
176 case 7:
177 if( a_wantSymbol ) {
178 info = "N"; }
179 else {
180 info = "Nitrogen";
181 }
182 break;
183 case 8:
184 if( a_wantSymbol ) {
185 info = "O"; }
186 else {
187 info = "Oxygen";
188 }
189 break;
190 case 9:
191 if( a_wantSymbol ) {
192 info = "F"; }
193 else {
194 info = "Fluorine";
195 }
196 break;
197 case 10:
198 if( a_wantSymbol ) {
199 info = "Ne"; }
200 else {
201 info = "Neon";
202 }
203 break;
204 case 11:
205 if( a_wantSymbol ) {
206 info = "Na"; }
207 else {
208 info = "Sodium";
209 }
210 break;
211 case 12:
212 if( a_wantSymbol ) {
213 info = "Mg"; }
214 else {
215 info = "Magnesium";
216 }
217 break;
218 case 13:
219 if( a_wantSymbol ) {
220 info = "Al"; }
221 else {
222 info = "Aluminium";
223 }
224 break;
225 case 14:
226 if( a_wantSymbol ) {
227 info = "Si"; }
228 else {
229 info = "Silicon";
230 }
231 break;
232 case 15:
233 if( a_wantSymbol ) {
234 info = "P"; }
235 else {
236 info = "Phosphorus";
237 }
238 break;
239 case 16:
240 if( a_wantSymbol ) {
241 info = "S"; }
242 else {
243 info = "Sulphur";
244 }
245 break;
246 case 17:
247 if( a_wantSymbol ) {
248 info = "Cl"; }
249 else {
250 info = "Chlorine";
251 }
252 break;
253 case 18:
254 if( a_wantSymbol ) {
255 info = "Ar"; }
256 else {
257 info = "Argon";
258 }
259 break;
260 case 19:
261 if( a_wantSymbol ) {
262 info = "K"; }
263 else {
264 info = "Potassium";
265 }
266 break;
267 case 20:
268 if( a_wantSymbol ) {
269 info = "Ca"; }
270 else {
271 info = "Calcium";
272 }
273 break;
274 case 21:
275 if( a_wantSymbol ) {
276 info = "Sc"; }
277 else {
278 info = "Scandium";
279 }
280 break;
281 case 22:
282 if( a_wantSymbol ) {
283 info = "Ti"; }
284 else {
285 info = "Titanium";
286 }
287 break;
288 case 23:
289 if( a_wantSymbol ) {
290 info = "V"; }
291 else {
292 info = "Vanadium";
293 }
294 break;
295 case 24:
296 if( a_wantSymbol ) {
297 info = "Cr"; }
298 else {
299 info = "Chromium";
300 }
301 break;
302 case 25:
303 if( a_wantSymbol ) {
304 info = "Mn"; }
305 else {
306 info = "Manganese";
307 }
308 break;
309 case 26:
310 if( a_wantSymbol ) {
311 info = "Fe"; }
312 else {
313 info = "Iron";
314 }
315 break;
316 case 27:
317 if( a_wantSymbol ) {
318 info = "Co"; }
319 else {
320 info = "Cobalt";
321 }
322 break;
323 case 28:
324 if( a_wantSymbol ) {
325 info = "Ni"; }
326 else {
327 info = "Nickel";
328 }
329 break;
330 case 29:
331 if( a_wantSymbol ) {
332 info = "Cu"; }
333 else {
334 info = "Copper";
335 }
336 break;
337 case 30:
338 if( a_wantSymbol ) {
339 info = "Zn"; }
340 else {
341 info = "Zinc";
342 }
343 break;
344 case 31:
345
346 if( a_wantSymbol ) {
347 info = "Ga"; }
348 else {
349 info = "Gallium";
350 }
351 break;
352 case 32:
353 if( a_wantSymbol ) {
354 info = "Ge"; }
355 else {
356 info = "Germanium";
357 }
358 break;
359 case 33:
360 if( a_wantSymbol ) {
361 info = "As"; }
362 else {
363 info = "Arsenic";
364 }
365 break;
366 case 34:
367 if( a_wantSymbol ) {
368 info = "Se"; }
369 else {
370 info = "Selenium";
371 }
372 break;
373 case 35:
374 if( a_wantSymbol ) {
375 info = "Br"; }
376 else {
377 info = "Bromine";
378 }
379 break;
380 case 36:
381 if( a_wantSymbol ) {
382 info = "Kr"; }
383 else {
384 info = "Krypton";
385 }
386 break;
387 case 37:
388 if( a_wantSymbol ) {
389 info = "Rb"; }
390 else {
391 info = "Rubidium";
392 }
393 break;
394 case 38:
395 if( a_wantSymbol ) {
396 info = "Sr"; }
397 else {
398 info = "Strontium";
399 }
400 break;
401 case 39:
402 if( a_wantSymbol ) {
403 info = "Y"; }
404 else {
405 info = "Yttrium";
406 }
407 break;
408 case 40:
409 if( a_wantSymbol ) {
410 info = "Zr"; }
411 else {
412 info = "Zirconium";
413 }
414 break;
415 case 41:
416 if( a_wantSymbol ) {
417 info = "Nb"; }
418 else {
419 info = "Niobium";
420 }
421 break;
422 case 42:
423 if( a_wantSymbol ) {
424 info = "Mo"; }
425 else {
426 info = "Molybdenum";
427 }
428 break;
429 case 43:
430 if( a_wantSymbol ) {
431 info = "Tc"; }
432 else {
433 info = "Technetium";
434 }
435 break;
436 case 44:
437 if( a_wantSymbol ) {
438 info = "Ru"; }
439 else {
440 info = "Ruthenium";
441 }
442 break;
443 case 45:
444 if( a_wantSymbol ) {
445 info = "Rh"; }
446 else {
447 info = "Rhodium";
448 }
449 break;
450 case 46:
451 if( a_wantSymbol ) {
452 info = "Pd"; }
453 else {
454 info = "Palladium";
455 }
456 break;
457 case 47:
458 if( a_wantSymbol ) {
459 info = "Ag"; }
460 else {
461 info = "Silver";
462 }
463 break;
464 case 48:
465 if( a_wantSymbol ) {
466 info = "Cd"; }
467 else {
468 info = "Cadmium";
469 }
470 break;
471 case 49:
472 if( a_wantSymbol ) {
473 info = "In"; }
474 else {
475 info = "Indium";
476 }
477 break;
478 case 50:
479 if( a_wantSymbol ) {
480 info = "Sn"; }
481 else {
482 info = "Tin";
483 }
484 break;
485 case 51:
486 if( a_wantSymbol ) {
487 info = "Sb"; }
488 else {
489 info = "Antimony";
490 }
491 break;
492 case 52:
493 if( a_wantSymbol ) {
494 info = "Te"; }
495 else {
496 info = "Tellurium";
497 }
498 break;
499 case 53:
500 if( a_wantSymbol ) {
501 info = "I"; }
502 else {
503 info = "Iodine";
504 }
505 break;
506 case 54:
507 if( a_wantSymbol ) {
508 info = "Xe"; }
509 else {
510 info = "Xenon";
511 }
512 break;
513 case 55:
514 if( a_wantSymbol ) {
515 info = "Cs"; }
516 else {
517 info = "Cesium";
518 }
519 break;
520 case 56:
521 if( a_wantSymbol ) {
522 info = "Ba"; }
523 else {
524 info = "Barium";
525 }
526 break;
527 case 57:
528 if( a_wantSymbol ) {
529 info = "La"; }
530 else {
531 info = "Lanthanum";
532 }
533 break;
534 case 58:
535 if( a_wantSymbol ) {
536 info = "Ce"; }
537 else {
538 info = "Cerium";
539 }
540 break;
541 case 59:
542 if( a_wantSymbol ) {
543 info = "Pr"; }
544 else {
545 info = "Praseodymium";
546 }
547 break;
548 case 60:
549 if( a_wantSymbol ) {
550 info = "Nd"; }
551 else {
552 info = "Neodymium";
553 }
554 break;
555 case 61:
556 if( a_wantSymbol ) {
557 info = "Pm"; }
558 else {
559 info = "Promethium";
560 }
561 break;
562 case 62:
563 if( a_wantSymbol ) {
564 info = "Sm"; }
565 else {
566 info = "Samarium";
567 }
568 break;
569 case 63:
570 if( a_wantSymbol ) {
571 info = "Eu"; }
572 else {
573 info = "Europium";
574 }
575 break;
576 case 64:
577 if( a_wantSymbol ) {
578 info = "Gd"; }
579 else {
580 info = "Gadolinium";
581 }
582 break;
583 case 65:
584 if( a_wantSymbol ) {
585 info = "Tb"; }
586 else {
587 info = "Terbium";
588 }
589 break;
590 case 66:
591 if( a_wantSymbol ) {
592 info = "Dy"; }
593 else {
594 info = "Dysprosium";
595 }
596 break;
597 case 67:
598 if( a_wantSymbol ) {
599 info = "Ho"; }
600 else {
601 info = "Holmium";
602 }
603 break;
604 case 68:
605 if( a_wantSymbol ) {
606 info = "Er"; }
607 else {
608 info = "Erbium";
609 }
610 break;
611 case 69:
612 if( a_wantSymbol ) {
613 info = "Tm"; }
614 else {
615 info = "Thulium";
616 }
617 break;
618 case 70:
619 if( a_wantSymbol ) {
620 info = "Yb"; }
621 else {
622 info = "Ytterbium";
623 }
624 break;
625 case 71:
626 if( a_wantSymbol ) {
627 info = "Lu"; }
628 else {
629 info = "Lutetium";
630 }
631 break;
632 case 72:
633 if( a_wantSymbol ) {
634 info = "Hf"; }
635 else {
636 info = "Hafnium";
637 }
638 break;
639 case 73:
640 if( a_wantSymbol ) {
641 info = "Ta"; }
642 else {
643 info = "Tantalum";
644 }
645 break;
646 case 74:
647 if( a_wantSymbol ) {
648 info = "W"; }
649 else {
650 info = "Tungsten";
651 }
652 break;
653 case 75:
654 if( a_wantSymbol ) {
655 info = "Re"; }
656 else {
657 info = "Rhenium";
658 }
659 break;
660 case 76:
661 if( a_wantSymbol ) {
662 info = "Os"; }
663 else {
664 info = "Osmium";
665 }
666 break;
667 case 77:
668 if( a_wantSymbol ) {
669 info = "Ir"; }
670 else {
671 info = "Iridium";
672 }
673 break;
674 case 78:
675 if( a_wantSymbol ) {
676 info = "Pt"; }
677 else {
678 info = "Platinum";
679 }
680 break;
681 case 79:
682 if( a_wantSymbol ) {
683 info = "Au"; }
684 else {
685 info = "Gold";
686 }
687 break;
688 case 80:
689 if( a_wantSymbol ) {
690 info = "Hg"; }
691 else {
692 info = "Mercury";
693 }
694 break;
695 case 81:
696 if( a_wantSymbol ) {
697 info = "Tl"; }
698 else {
699 info = "Thallium";
700 }
701 break;
702 case 82:
703 if( a_wantSymbol ) {
704 info = "Pb"; }
705 else {
706 info = "Lead";
707 }
708 break;
709 case 83:
710 if( a_wantSymbol ) {
711 info = "Bi"; }
712 else {
713 info = "Bismuth";
714 }
715 break;
716 case 84:
717 if( a_wantSymbol ) {
718 info = "Po"; }
719 else {
720 info = "Polonium";
721 }
722 break;
723 case 85:
724 if( a_wantSymbol ) {
725 info = "At"; }
726 else {
727 info = "Astatine";
728 }
729 break;
730 case 86:
731 if( a_wantSymbol ) {
732 info = "Rn"; }
733 else {
734 info = "Radon";
735 }
736 break;
737 case 87:
738 if( a_wantSymbol ) {
739 info = "Fr"; }
740 else {
741 info = "Francium";
742 }
743 break;
744 case 88:
745 if( a_wantSymbol ) {
746 info = "Ra"; }
747 else {
748 info = "Radium";
749 }
750 break;
751 case 89:
752 if( a_wantSymbol ) {
753 info = "Ac"; }
754 else {
755 info = "Actinium";
756 }
757 break;
758 case 90:
759 if( a_wantSymbol ) {
760 info = "Th"; }
761 else {
762 info = "Thorium";
763 }
764 break;
765 case 91:
766 if( a_wantSymbol ) {
767 info = "Pa"; }
768 else {
769 info = "Protactinium";
770 }
771 break;
772 case 92:
773 if( a_wantSymbol ) {
774 info = "U"; }
775 else {
776 info = "Uranium";
777 }
778 break;
779 case 93:
780 if( a_wantSymbol ) {
781 info = "Np"; }
782 else {
783 info = "Neptunium";
784 }
785 break;
786 case 94:
787 if( a_wantSymbol ) {
788 info = "Pu"; }
789 else {
790 info = "Plutonium";
791 }
792 break;
793 case 95:
794 if( a_wantSymbol ) {
795 info = "Am"; }
796 else {
797 info = "Americium";
798 }
799 break;
800 case 96:
801 if( a_wantSymbol ) {
802 info = "Cm"; }
803 else {
804 info = "Curium";
805 }
806 break;
807 case 97:
808 if( a_wantSymbol ) {
809 info = "Bk"; }
810 else {
811 info = "Berkelium";
812 }
813 break;
814 case 98:
815 if( a_wantSymbol ) {
816 info = "Cf"; }
817 else {
818 info = "Californium";
819 }
820 break;
821 case 99:
822 if( a_wantSymbol ) {
823 info = "Es"; }
824 else {
825 info = "Einsteinium";
826 }
827 break;
828 case 100:
829 if( a_wantSymbol ) {
830 info = "Fm"; }
831 else {
832 info = "Fermium";
833 }
834 break;
835 case 101:
836 if( a_wantSymbol ) {
837 info = "Md"; }
838 else {
839 info = "Mendelevium";
840 }
841 break;
842 case 102:
843 if( a_wantSymbol ) {
844 info = "No"; }
845 else {
846 info = "Nobelium";
847 }
848 break;
849 case 103:
850 if( a_wantSymbol ) {
851 info = "Lr"; }
852 else {
853 info = "Lawrencium";
854 }
855 break;
856 case 104:
857 if( a_wantSymbol ) {
858 info = "Rf"; }
859 else {
860 info = "Rutherfordium";
861 }
862 break;
863 case 105:
864 if( a_wantSymbol ) {
865 info = "Db"; }
866 else {
867 info = "Dubnium";
868 }
869 break;
870 case 106:
871 if( a_wantSymbol ) {
872 info = "Sg"; }
873 else {
874 info = "Seaborgium";
875 }
876 break;
877 case 107:
878 if( a_wantSymbol ) {
879 info = "Bh"; }
880 else {
881 info = "Bohrium";
882 }
883 break;
884 case 108:
885 if( a_wantSymbol ) {
886 info = "Hs"; }
887 else {
888 info = "Hassium";
889 }
890 break;
891 case 109:
892 if( a_wantSymbol ) {
893 info = "Mt"; }
894 else {
895 info = "Meitnerium";
896 }
897 break;
898 case 110:
899 if( a_wantSymbol ) {
900 info = "Ds"; }
901 else {
902 info = "Darmstadtium";
903 }
904 break;
905 case 111:
906 if( a_wantSymbol ) {
907 info = "Rg"; }
908 else {
909 info = "Roentgenium";
910 }
911 break;
912 case 112:
913 if( a_wantSymbol ) {
914 info = "Cn"; }
915 else {
916 info = "Copernicium";
917 }
918 break;
919 case 113:
920 if( a_wantSymbol ) {
921 info = "Nh"; }
922 else {
923 info = "Nihonium";
924 }
925 break;
926 case 114:
927 if( a_wantSymbol ) {
928 info = "Fl"; }
929 else {
930 info = "Flerovium";
931 }
932 break;
933 case 115:
934 if( a_wantSymbol ) {
935 info = "Mc"; }
936 else {
937 info = "Moscovium";
938 }
939 break;
940 case 116:
941 if( a_wantSymbol ) {
942 info = "Lv"; }
943 else {
944 info = "Livermorium";
945 }
946 break;
947 case 117:
948 if( a_wantSymbol ) {
949 info = "Ts"; }
950 else {
951 info = "Tennessine";
952 }
953 break;
954 case 118:
955 if( a_wantSymbol ) {
956 info = "Og"; }
957 else {
958 info = "Oganesson";
959 }
960 break;
961 default:
962 break;
963 }
964
965 if( a_wantSymbol && a_asNucleus ) {
966 char c1[3];
967 c1[0] = static_cast<char>( tolower( info.c_str( )[0] ) );
968 c1[1] = 0;
969 c1[2] = 0;
970 if( info.size( ) > 1 ) c1[1] = info.c_str( )[1];
971
972 info = c1;
973 }
974
975 return( info );
976}

Referenced by chemicalElementInfoFromZ(), and PoPI::ParseIntidInfo::id().

◆ chemicalElementSymbolFromZ()

std::string const & PoPI::chemicalElementSymbolFromZ ( int a_Z)

Returns the chemical element symbol for the requested atomic number a_Z.

Parameters
a_Z[in] The atomic number (Z) of the requested chemical element.
Returns
The symbol for the nuclide or an empty string if a_Z is an invalid atomic number.

Definition at line 986 of file PoPI_chemicalElement.cc.

986 {
987
988 if( ZtoChemicalElementSymbols.find( a_Z ) == ZtoChemicalElementSymbols.end( ) ) return( emptyString );
989
990 return( ZtoChemicalElementSymbols[a_Z ] );
991}

Referenced by chemicalElementSymbolFromZ().

◆ compareSpecialParticleIDs()

bool PoPI::compareSpecialParticleIDs ( std::string const & a_id1,
std::string const & a_id2 )

Compares two particle ids and returns if they are the same particle. This methods using the name returned by the function specialParticleID with the same SpecialParticleID_mode for each particle id. Ergo, "H1" is the same as "H1", "p" or "h1".

Returns
true if particles are the same and false otherwise.

Definition at line 133 of file PoPI_misc.cc.

133 {
134
136}
std::string specialParticleID(SpecialParticleID_mode a_mode, std::string const &a_id)
Definition PoPI_misc.cc:79

Referenced by GIDI::Map::ProtareBase::findProtareEntry(), GIDI::Map::ProtareBase::isMatch(), GIDI::Map::MapWalkDirectoryCallback(), GIDI::Product::maximumLegendreOrder(), GIDI::Product::multiGroupAverageEnergy(), GIDI::Product::multiGroupAverageMomentum(), GIDI::Reaction::multiGroupGain(), GIDI::Product::multiGroupMultiplicity(), GIDI::Product::multiGroupProductMatrix(), GIDI::Transporting::Particles::particle(), and GIDI::Product::productMultiplicity().

◆ family2Integer()

int PoPI::family2Integer ( Particle_class a_family)

Returns an integer representing the particle's famuly a_family.

Parameters
a_isAnti[in] If true particle is an anti-particle and otherwise its a particle.

Definition at line 21 of file PoPI_intId.cc.

21 {
22
23 if( a_family == Particle_class::nucleus ) return( -1 );
24 if( a_family == Particle_class::nuclide ) return( -2 );
25 if( a_family == Particle_class::gaugeBoson ) return( 0 );
26 if( a_family == Particle_class::lepton ) return( 1 );
27 if( a_family == Particle_class::baryon ) return( 2 );
28 if( a_family == Particle_class::nuclideMetaStable ) return( 50 );
29 if( a_family == Particle_class::nucleusMetaStable ) return( 60 );
30 if( a_family == Particle_class::ENDL_fissionProduct ) return( 99 );
31
32 return( -3 );
33}

Referenced by intidHelper().

◆ getPhysicalQuantityAsDouble()

double PoPI::getPhysicalQuantityAsDouble ( PhysicalQuantity const & a_physicalQuantity)

A physical quantity can be a double, integer, fraction (e.g, '3/7') or a string. For all but string, this functions returns a double representing the value of the physical quantity a_physicalQuantity. For string, a throw is executed.

Parameters
a_physicalQuantity[in] The physical quantity whose value is returend.
Returns
A double value representing the physical quantity.

Definition at line 403 of file PoPI_misc.cc.

403 {
404
405 double value = 0.0;
406
407 switch( a_physicalQuantity.Class( ) ) {
408 case PQ_class::Double :
409 case PQ_class::shell : {
410 PQ_double const &pq_double = static_cast<PQ_double const &>( a_physicalQuantity );
411 value = pq_double.value( ); }
412 break;
413 case PQ_class::integer : {
414 PQ_integer const &pq_integer = static_cast<PQ_integer const &>( a_physicalQuantity );
415 value = pq_integer.value( ); }
416 break;
417 default :
418 throw Exception( "Cannot convert physical quantitiy to a double." );
419 }
420
421 return( value );
422}
double value(void) const
Definition PoPI.hpp:443

Referenced by getPhysicalQuantityOfSuiteAsDouble().

◆ getPhysicalQuantityOfSuiteAsDouble()

double PoPI::getPhysicalQuantityOfSuiteAsDouble ( PQ_suite const & a_suite,
bool a_allowEmpty,
double a_emptyValue )

If the suite a_suite as data, getPhysicalQuantityAsDouble is called on its first item; otherwise, a throw is executed. If a_suite is empty and a_allowEmpty is true, then a_emptyValue is returned.

Parameters
a_suite[in] The suite whose first item's value is returned as a double.
a_allowEmpty[in] Determines act to follow when a_suite is empty.
a_emptyValue[in] The value to return if a_suite is empty and a_allowEmpty is true.
Returns
A double value representing the physical quantity.

Definition at line 435 of file PoPI_misc.cc.

435 {
436
437 if( a_suite.size( ) == 0 ) {
438 if( a_allowEmpty ) return( a_emptyValue );
439 throw Exception( "No physical quantitiy in Suite." );
440 }
441
442 return( getPhysicalQuantityAsDouble( *a_suite[0] ) );
443}
double getPhysicalQuantityAsDouble(PhysicalQuantity const &a_physicalQuantity)
Definition PoPI_misc.cc:403

Referenced by PoPI::DecayMode::calculateNuclideGammaBranchStateInfo().

◆ intidHelper()

int PoPI::intidHelper ( bool a_isAnti,
Particle_class a_family,
int a_SSSSSSS )

This function is for internal use. Returns the intid for the particle of family a_family with family indentifier a_SSSSSSS. If the return value is -1 the family is not supported by this function.

Parameters
a_isAnti[in] If true particle is an anti-particle and otherwise its a particle.
a_family[in] The particle's family.
a_SSSSSSS[in] The particle's indentifier within its family.
Returns
The intid for the particle.

Definition at line 47 of file PoPI_intId.cc.

47 {
48
49 int sign = a_isAnti ? -1 : 1;
50
51 int intid = family2Integer( a_family );
52 if( intid < 0 ) return( -1 );
53 intid += 100;
54 intid *= 10000000;
55
56 return( sign * ( intid + a_SSSSSSS ) );
57}
int family2Integer(Particle_class a_family)
Definition PoPI_intId.cc:21

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

◆ maximumChemicalElementZ()

int PoPI::maximumChemicalElementZ ( )

Returns the maximum supported Z (atomic number) supported by function chemicalElementInfoFromZ.

Returns
int.

Definition at line 112 of file PoPI_chemicalElement.cc.

112 {
113
114 return( static_cast<int>( ZtoChemicalElementSymbols.size( ) ) );
115}

Referenced by maximumChemicalElementZ().

◆ particleA() [1/3]

int PoPI::particleA ( Base const & a_particle,
bool a_isNeutronProtonANucleon )

Returns the A (i.e., atomic mass number) for a nuclear type particle; otherwise, 0 is returned. Currently, non-0 values are returned if a_particle is an isotope, nuclide or nucleus, or if it is a neutron or a proton and a_isNeutronProtonANucleon is true.

Parameters
a_particle[in] The PoPI::Base instance whose Z is returned.
a_isNeutronProtonANucleon[in] If true a proton is treated as a nucleus.
Returns
The Z of the particle

Definition at line 227 of file PoPI_misc.cc.

227 {
228
229 int A = 0;
230
231 if( a_particle.ID( ) == IDs::neutron ) {
232 if( a_isNeutronProtonANucleon ) A = 1; }
233 else if( a_particle.ID( ) == IDs::proton ) {
234 if( a_isNeutronProtonANucleon ) A = 1; }
235 else if( a_particle.isNuclide( ) ) {
236 Nuclide const &particle = (Nuclide const &) a_particle;
237 A = particle.A( ); }
238 else if( a_particle.isNucleus( ) ) {
239 Nucleus const &particle = (Nucleus const &) a_particle;
240 A = particle.A( ); }
241 else if( a_particle.isIsotope( ) ) {
242 Isotope const &object = (Isotope const &) a_particle;
243 A = object.A( );
244 }
245
246 return( A );
247}
const G4double A[17]
int A(void) const
Definition PoPI.hpp:1047
int A(void) const
Definition PoPI.hpp:976
int A(void) const
static std::string const neutron
Definition PoPI.hpp:164
static std::string const proton
Definition PoPI.hpp:165

Referenced by G4GIDI_target::G4GIDI_target(), particleA(), particleA(), and particleZA().

◆ particleA() [2/3]

int PoPI::particleA ( Database const & a_pops,
std::size_t a_index,
bool a_isNeutronProtonANucleon )

Uses the index a_index to look up the particle in a_pops and calls particleA for that particle.

Parameters
a_pops[in] The PoPs database to look up the particle.
a_index[in] The index of the particle in a_pops whose A value is returned.
a_isNeutronProtonANucleon[in] If true a proton is treated as a nucleus.
Returns
The A returned by particleA( Base const &, bool ).

Definition at line 259 of file PoPI_misc.cc.

259 {
260
261 Base const &particle( a_pops.get<Base>( a_pops.final( a_index ) ) );
262
263 return( particleA( particle, a_isNeutronProtonANucleon ) );
264}
int particleA(Base const &a_particle, bool a_isNeutronProtonANucleon=false)
Definition PoPI_misc.cc:227

◆ particleA() [3/3]

int PoPI::particleA ( Database const & a_pops,
std::string const & a_id,
bool a_isNeutronProtonANucleon )

Uses the id a_id to look up the particle in a_pops and calls particleA for that particle.

Parameters
a_pops[in] The PoPs database to look up the particle.
a_id[in] The id of the particle in a_pops whose A value is returned.
a_isNeutronProtonANucleon[in] If true a proton is treated as a nucleus.
Returns
The A returned by particleA( Base const &, bool ).

Definition at line 276 of file PoPI_misc.cc.

276 {
277
278 Base const &particle( a_pops.get<Base>( a_pops.final( a_id ) ) );
279
280 return( particleA( particle, a_isNeutronProtonANucleon ) );
281}

◆ particleMetaStableIndex() [1/3]

int PoPI::particleMetaStableIndex ( Base const & a_particle)

Returns the meta-stable index if a_particle is a PoPI::MetaStable alias; otherwise, 0 is returned.

Parameters
a_particle[in] The PoPI::Base instance whose meta-stable index is returned.
Returns
The meta-stable index of the particle

Definition at line 349 of file PoPI_misc.cc.

349 {
350
351 int metaStableIndex = 0;
352
353 if( a_particle.isMetaStableAlias( ) ) {
354 MetaStable const &object = (MetaStable const &) a_particle;
355 metaStableIndex = object.metaStableIndex( );
356 }
357
358 return( metaStableIndex );
359}
int metaStableIndex(void) const
Definition PoPI.hpp:1118

Referenced by G4GIDI_target::G4GIDI_target(), particleMetaStableIndex(), and particleMetaStableIndex().

◆ particleMetaStableIndex() [2/3]

int PoPI::particleMetaStableIndex ( Database const & a_pops,
std::size_t a_index )

Returns the meta-stable index if a_index is a PoPI::MetaStable alias; otherwise, 0 is returned.

Parameters
a_pops[in] The PoPs database to look up the particle.
a_index[in] The index of the particle in a_pops whose meta-stable index value is returned.
Returns
The meta-stable index of the particle

Definition at line 370 of file PoPI_misc.cc.

370 {
371
372 Base const &object( a_pops.get<Base>( a_pops.final( a_index ) ) );
373
374 return( particleMetaStableIndex( object ) );
375}
int particleMetaStableIndex(Base const &a_particle)
Definition PoPI_misc.cc:349

◆ particleMetaStableIndex() [3/3]

int PoPI::particleMetaStableIndex ( Database const & a_pops,
std::string const & a_id )

Returns the meta-stable index if a_id is a PoPI::MetaStable alias; otherwise, 0 is returned.

Parameters
a_pops[in] The PoPs database to look up the particle.
a_id[in] The id of the particle in a_pops whose meta-stable index value is returned.
Returns
The meta-stable index of the particle

Definition at line 386 of file PoPI_misc.cc.

386 {
387
388 Base const &object( a_pops.get<Base>( a_pops.final( a_id ) ) );
389
390 return( particleMetaStableIndex( object ) );
391}

◆ particleZ() [1/3]

int PoPI::particleZ ( Base const & a_particle,
bool a_isNeutronProtonANucleon )

Returns the Z (i.e., the atomic number) for a nuclear type particle; otherwise, 0 is returned. Currently, non-0 values are returned if a_particle is an isotope, nuclide or nucleus, or if it is a proton and a_isNeutronProtonANucleon is true. Note, this is not the charge of the particle but its atomic number. For example, the atomic number for an electron is 0 as it is not a nuclear type particle.

Parameters
a_particle[in] The PoPI::Base instance whose Z is returned.
a_isNeutronProtonANucleon[in] If true a proton is treated as a nucleus.
Returns
The Z of the particle

Definition at line 150 of file PoPI_misc.cc.

150 {
151
152 int Z = 0;
153
154 if( a_particle.ID( ) == IDs::proton ) {
155 if( a_isNeutronProtonANucleon ) Z = 1; }
156 else if( a_particle.isNuclide( ) ) {
157 Nuclide const &particle = (Nuclide const &) a_particle;
158 Z = particle.Z( ); }
159 else if( a_particle.isNucleus( ) ) {
160 Nucleus const &particle = (Nucleus const &) a_particle;
161 Z = particle.Z( ); }
162 else if( a_particle.isChemicalElement( ) ) {
163 ChemicalElement const &object = (ChemicalElement const &) a_particle;
164 Z = object.Z( ); }
165 else if( a_particle.isIsotope( ) ) {
166 Isotope const &object = (Isotope const &) a_particle;
167 Z = object.Z( );
168 }
169
170 return( Z );
171}
int Z(void) const
Definition PoPI.hpp:1071
int Z(void) const
Definition PoPI.hpp:1046
int Z(void) const
Definition PoPI.hpp:975

Referenced by G4GIDI_target::G4GIDI_target(), particleZ(), particleZ(), and particleZA().

◆ particleZ() [2/3]

int PoPI::particleZ ( Database const & a_pops,
std::size_t a_index,
bool a_isNeutronProtonANucleon )

Uses the index a_index to look up the particle in a_pops and calls particleZ for that particle.

Parameters
a_pops[in] The PoPs database to look up the particle.
a_index[in] The index of the particle in a_pops whose Z value is returned.
a_isNeutronProtonANucleon[in] If true a proton is treated as a nucleus.
Returns
The Z returned by particleZ( Base const &, bool ).

Definition at line 183 of file PoPI_misc.cc.

183 {
184
185 int Z = 0;
186 Base const &base( a_pops.get<Base>( a_pops.final( a_index ) ) );
187
188 if( base.isChemicalElement( ) ) {
189 SymbolBase const &object2( static_cast<SymbolBase const &>( base ) );
190 Z = particleZ( object2 ); }
191 else {
192 Particle const &particle( static_cast<Particle const &>( base ) );
193 Z = particleZ( particle, a_isNeutronProtonANucleon );
194 }
195
196 return( Z );
197}
int particleZ(Base const &a_particle, bool a_isNeutronProtonANucleon=false)
Definition PoPI_misc.cc:150

◆ particleZ() [3/3]

int PoPI::particleZ ( Database const & a_pops,
std::string const & a_id,
bool a_isNeutronProtonANucleon )

Uses the id a_id to look up the particle in a_pops and calls particleZ for that particle.

Parameters
a_pops[in] The PoPs database to look up the particle.
a_id[in] The id of the particle in a_pops whose Z value is returned.
a_isNeutronProtonANucleon[in] If true a proton is treated as a nucleus.
Returns
The Z returned by particleZ( Base const &, bool ).

Definition at line 209 of file PoPI_misc.cc.

209 {
210
211 Base const &object( a_pops.get<Particle>( a_pops.final( a_id ) ) );
212
213 return( particleZ( object, a_isNeutronProtonANucleon ) );
214}

◆ particleZA() [1/3]

int PoPI::particleZA ( Base const & a_particle,
bool a_isNeutronProtonANucleon )

Returns the ZA (i.e., 1000 * Z + A) for a nuclear type particle; otherwise, 0 is returned. Currently, non-0 values are returned if a_particle is an isotope, nuclide or nucleus, or if it is a neutron or a proton and a_isNeutronProtonANucleon is true.

Parameters
a_particle[in] The PoPI::Base instance whose Z is returned.
a_isNeutronProtonANucleon[in] If true a proton is treated as a nucleus.
Returns
The Z of the particle

Definition at line 294 of file PoPI_misc.cc.

294 {
295
296 int ZA = 0;
297
298 if( a_particle.ID( ) == IDs::neutron ) {
299 if( a_isNeutronProtonANucleon ) ZA = 1; }
300 else {
301 if( !a_particle.isChemicalElement( ) ) ZA = 1000 * particleZ( a_particle, a_isNeutronProtonANucleon ) + particleA( a_particle, a_isNeutronProtonANucleon );
302 }
303
304 return( ZA );
305}

Referenced by particleZA(), and particleZA().

◆ particleZA() [2/3]

int PoPI::particleZA ( Database const & a_pops,
std::size_t a_index,
bool a_isNeutronProtonANucleon )

Uses the index a_index to look up the particle in a_pops and calls particleZA for that particle.

Parameters
a_pops[in] The PoPs database to look up the particle.
a_index[in] The index of the particle in a_pops whose ZA value is returned.
a_isNeutronProtonANucleon[in] If true a proton is treated as a nucleus.
Returns
The ZA returned by particleZA( Base const &, bool ).

Definition at line 317 of file PoPI_misc.cc.

317 {
318
319 Base const &particle( a_pops.get<Base>( a_pops.final( a_index ) ) );
320
321 return( particleZA( particle, a_isNeutronProtonANucleon ) );
322}
int particleZA(Base const &a_particle, bool a_isNeutronProtonANucleon=false)
Definition PoPI_misc.cc:294

◆ particleZA() [3/3]

int PoPI::particleZA ( Database const & a_pops,
std::string const & a_id,
bool a_isNeutronProtonANucleon )

Uses the id a_id to look up the particle in a_pops and calls particleZA for that particle.

Parameters
a_pops[in] The PoPs database to look up the particle.
a_id[in] The id of the particle in a_pops whose ZA value is returned.
a_isNeutronProtonANucleon[in] If true a proton is treated as a nucleus.
Returns
The ZA returned by particleZA( Base const &, bool ).

Definition at line 334 of file PoPI_misc.cc.

334 {
335
336 Base const &particle( a_pops.get<Base>( a_pops.final( a_id ) ) );
337
338 return( particleZA( particle, a_isNeutronProtonANucleon ) );
339}

◆ specialParticleID()

std::string PoPI::specialParticleID ( SpecialParticleID_mode a_mode,
std::string const & a_id )

This function returns the "special particle id" for the specified particle id (a_id). The id returned depends on the a_mode argument. Currently, for all a_id's but for those listed in the following table, * a_id is returned. For an a_id in the following table, find the column that contains the specfied a_id, the id returned will be the id in that column whose row matches the specified a_mode.

a_mode ids ->
familiar p d t h a
nuclide H1 H2 H3 He3 He4
nucleus h1 h2 h3 he3 he4
Parameters
a_mode[in] The mode which determines the returned id.
a_id[in] The specified particle id.
Returns
The special particle id.

Definition at line 79 of file PoPI_misc.cc.

79 {
80
81 static std::string firstChars( "pdthaH" );
82 std::size_t iid = 0;
83
84 if( a_id.size( ) > 3 ) return( a_id );
85
86 std::size_t index = firstChars.find( a_id[0] );
87
88 if( index == std::string::npos ) return( a_id );
89
90 if( a_id == "H" ) return( a_id ); // Special case to avoid test of id1[0] two lines later.
91 std::string id1( a_id );
92 if( id1[0] == 'H' ) id1[0] = 'h';
93
94 if( id1 == IDs::proton || id1 == "h1" ) {
95 iid = 1; }
96 else if( id1 == IDs::familiarDeuteron || id1 == "h2" ) {
97 iid = 2; }
98 else if( id1 == IDs::familiarTriton || id1 == "h3" ) {
99 iid = 3; }
100 else if( id1 == IDs::familiarHelion || id1 == "he3" ) {
101 iid = 4; }
102 else if( id1 == IDs::familiarAlpha || id1 == "he4" ) {
103 iid = 5;
104 }
105 if( iid == 0 ) return( a_id );
106
107 if( a_mode == SpecialParticleID_mode::familiar ) {
108 return( firstChars.substr( iid-1, 1 ) ); }
109 else {
110 if( iid == 1 ) {
111 id1 = "h1"; }
112 else if( iid == 2 ) {
113 id1 = "h2"; }
114 else if( iid == 3 ) {
115 id1 = "h3"; }
116 else if( iid == 4 ) {
117 id1 = "he3"; }
118 else {
119 id1 = "he4";
120 }
121 if( a_mode == SpecialParticleID_mode::nuclide ) id1[0] = 'H';
122 }
123 return( id1 );
124}
static std::string const familiarTriton
Definition PoPI.hpp:168
static std::string const familiarHelion
Definition PoPI.hpp:169
static std::string const familiarAlpha
Definition PoPI.hpp:170
static std::string const familiarDeuteron
Definition PoPI.hpp:167

Referenced by compareSpecialParticleIDs().

◆ supportedFormat()

bool PoPI::supportedFormat ( LUPI::FormatVersion const & a_formatVersion)

Returns true if a_formatVersion is a format supported by PoPI and false otherwise;

Parameters
a_formatVersion[in] The format version to check if it is supported.
Returns
true if format is supported by PoPI and false otherwise.

Definition at line 39 of file PoPI_misc.cc.

39 {
40
41 if( a_formatVersion.format( ) == PoPI_formatVersion_0_1_Chars ) return( true );
42
43 return( a_formatVersion.supported( ) );
44}
#define PoPI_formatVersion_0_1_Chars
Definition PoPI.hpp:33

◆ Z_FromChemicalElementSymbol()

int PoPI::Z_FromChemicalElementSymbol ( std::string const & a_symbol)

Returns the atomic number (Z) for the requested chemical element's symbol.

Parameters
a_symbol[in] The atomic symbol.
Returns
The atomic number or 0 if a_symbol is an invalid symbol.

Definition at line 1001 of file PoPI_chemicalElement.cc.

1001 {
1002
1003 if( chemicalElementSymbolToZs.size( ) == 0 ) {
1004 for( auto iter = ZtoChemicalElementSymbols.begin( ); iter != ZtoChemicalElementSymbols.end( ); ++iter ) {
1005 chemicalElementSymbolToZs[iter->second] = iter->first;
1006 }
1007 }
1008
1009 if( chemicalElementSymbolToZs.find( a_symbol ) == chemicalElementSymbolToZs.end( ) ) return( 0 );
1010
1011 return( chemicalElementSymbolToZs[a_symbol] );
1012}

Referenced by PoPI::ParseIdInfo::ParseIdInfo(), and Z_FromChemicalElementSymbol().

Variable Documentation

◆ supportedNucleusAliases

std::map< std::string, std::string > PoPI::supportedNucleusAliases { {"d", "h2"}, {"t", "h3"}, {"h", "he3"}, {"a", "he4"} }

Definition at line 34 of file PoPI_chemicalElement.cc.

34{ {"d", "h2"}, {"t", "h3"}, {"h", "he3"}, {"a", "he4"} };

Referenced by PoPI::Alias::Alias(), and PoPI::ParseIdInfo::ParseIdInfo().