Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4INCL::ParticleSpecies Class Reference

#include <G4INCLParticleSpecies.hh>

Public Member Functions

 ParticleSpecies ()
 Convert a string to a particle species.
 
 ParticleSpecies (std::string const &pS)
 
 ParticleSpecies (ParticleType const t)
 
 ParticleSpecies (const G4int A, const G4int Z)
 

Public Attributes

ParticleType theType
 
G4int theA
 
G4int theZ
 

Detailed Description

Definition at line 54 of file G4INCLParticleSpecies.hh.

Constructor & Destructor Documentation

◆ ParticleSpecies() [1/4]

G4INCL::ParticleSpecies::ParticleSpecies ( )
inline

Convert a string to a particle species.

Definition at line 57 of file G4INCLParticleSpecies.hh.

◆ ParticleSpecies() [2/4]

G4INCL::ParticleSpecies::ParticleSpecies ( std::string const pS)

Definition at line 55 of file G4INCLParticleSpecies.cc.

55 {
56 // Normalise the string to lower case
57 std::string pSNorm = pS;
58 std::transform(pSNorm.begin(), pSNorm.end(), pSNorm.begin(), ::tolower);
59 if(pSNorm=="p" || pSNorm=="proton") {
60 theA = 1;
61 theZ = 1;
63 } else if(pSNorm=="n" || pSNorm=="neutron") {
64 theA = 1;
65 theZ = 0;
67 } else if(pSNorm=="delta++" || pSNorm=="deltaplusplus") {
68 theA = 1;
69 theZ = 2;
71 } else if(pSNorm=="delta+" || pSNorm=="deltaplus") {
72 theA = 1;
73 theZ = 1;
75 } else if(pSNorm=="delta0" || pSNorm=="deltazero") {
76 theA = 1;
77 theZ = 0;
79 } else if(pSNorm=="delta-" || pSNorm=="deltaminus") {
80 theA = 1;
81 theZ = -1;
83 } else if(pSNorm=="pi+" || pSNorm=="pion+" || pSNorm=="piplus" || pSNorm=="pionplus") {
84 theA = 0;
85 theZ = 1;
87 } else if(pSNorm=="pi0" || pSNorm=="pion0" || pSNorm=="pizero" || pSNorm=="pionzero") {
88 theA = 0;
89 theZ = 0;
91 } else if(pSNorm=="pi-" || pSNorm=="pion-" || pSNorm=="piminus" || pSNorm=="pionminus") {
92 theA = 0;
93 theZ = -1;
95 } else if(pSNorm=="d" || pSNorm=="deuteron") {
96 theA = 2;
97 theZ = 1;
99 } else if(pSNorm=="t" || pSNorm=="triton") {
100 theA = 3;
101 theZ = 1;
103 } else if(pSNorm=="a" || pSNorm=="alpha") {
104 theA = 4;
105 theZ = 2;
107 } else
108 parseNuclide(pSNorm);
109 }

◆ ParticleSpecies() [3/4]

G4INCL::ParticleSpecies::ParticleSpecies ( ParticleType const  t)

Definition at line 111 of file G4INCLParticleSpecies.cc.

111 :
112 theType(t),
115 {}
static G4int getMassNumber(const ParticleType t)
Get mass number from particle type.
static G4int getChargeNumber(const ParticleType t)
Get charge number from particle type.

◆ ParticleSpecies() [4/4]

G4INCL::ParticleSpecies::ParticleSpecies ( const G4int  A,
const G4int  Z 
)

Definition at line 117 of file G4INCLParticleSpecies.cc.

117 :
119 theA(A),
120 theZ(Z)
121 {}

Member Data Documentation

◆ theA

◆ theType

◆ theZ


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