Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Data Fields
G4INCL::ParticleSpecies Class Reference

#include <G4INCLParticleSpecies.hh>

Public Member Functions

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

Data Fields

ParticleType theType
 
G4int theA
 
G4int theZ
 

Detailed Description

Definition at line 52 of file G4INCLParticleSpecies.hh.

Constructor & Destructor Documentation

G4INCL::ParticleSpecies::ParticleSpecies ( )
inline

Convert a string to a particle species.

Definition at line 55 of file G4INCLParticleSpecies.hh.

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

Definition at line 53 of file G4INCLParticleSpecies.cc.

References G4INCL::Composite, G4INCL::DeltaMinus, G4INCL::DeltaPlus, G4INCL::DeltaPlusPlus, G4INCL::DeltaZero, G4INCL::Neutron, G4INCL::PiMinus, G4INCL::PiPlus, G4INCL::PiZero, G4INCL::Proton, theA, theType, and theZ.

53  {
54  // Normalise the string to lower case
55  std::string pSNorm = pS;
56  std::transform(pSNorm.begin(), pSNorm.end(), pSNorm.begin(), ::tolower);
57  if(pSNorm=="p" || pSNorm=="proton") {
58  theA = 1;
59  theZ = 1;
61  } else if(pSNorm=="n" || pSNorm=="neutron") {
62  theA = 1;
63  theZ = 0;
65  } else if(pSNorm=="delta++" || pSNorm=="deltaplusplus") {
66  theA = 1;
67  theZ = 2;
69  } else if(pSNorm=="delta+" || pSNorm=="deltaplus") {
70  theA = 1;
71  theZ = 1;
73  } else if(pSNorm=="delta0" || pSNorm=="deltazero") {
74  theA = 1;
75  theZ = 0;
77  } else if(pSNorm=="delta-" || pSNorm=="deltaminus") {
78  theA = 1;
79  theZ = -1;
81  } else if(pSNorm=="pi+" || pSNorm=="pion+" || pSNorm=="piplus" || pSNorm=="pionplus") {
82  theA = 0;
83  theZ = 1;
85  } else if(pSNorm=="pi0" || pSNorm=="pion0" || pSNorm=="pizero" || pSNorm=="pionzero") {
86  theA = 0;
87  theZ = 0;
89  } else if(pSNorm=="pi-" || pSNorm=="pion-" || pSNorm=="piminus" || pSNorm=="pionminus") {
90  theA = 0;
91  theZ = -1;
93  } else if(pSNorm=="d" || pSNorm=="deuteron") {
94  theA = 2;
95  theZ = 1;
97  } else if(pSNorm=="t" || pSNorm=="triton") {
98  theA = 3;
99  theZ = 1;
101  } else if(pSNorm=="a" || pSNorm=="alpha") {
102  theA = 4;
103  theZ = 2;
105  } else
106  parseNuclide(pSNorm);
107  }
G4INCL::ParticleSpecies::ParticleSpecies ( ParticleType const  t)

Definition at line 109 of file G4INCLParticleSpecies.cc.

109  :
110  theType(t),
113  {}
G4int getChargeNumber(const ParticleType t)
Get charge number from particle type.
G4int getMassNumber(const ParticleType t)
Get mass number from particle type.
G4INCL::ParticleSpecies::ParticleSpecies ( const G4int  A,
const G4int  Z 
)

Field Documentation

G4int G4INCL::ParticleSpecies::theA
ParticleType G4INCL::ParticleSpecies::theType
G4int G4INCL::ParticleSpecies::theZ

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