Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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)
 
G4int getPDGCode () const
 Set a PDG Code (MONTE CARLO PARTICLE NUMBERING) More...
 

Public Attributes

ParticleType theType
 
G4int theA
 
G4int theZ
 

Detailed Description

Definition at line 53 of file G4INCLParticleSpecies.hh.

Constructor & Destructor Documentation

G4INCL::ParticleSpecies::ParticleSpecies ( )
inline

Convert a string to a particle species.

Definition at line 56 of file G4INCLParticleSpecies.hh.

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

Definition at line 54 of file G4INCLParticleSpecies.cc.

54  {
55  // Normalise the string to lower case
56  if(pS=="p" || pS=="proton") {
57  theA = 1;
58  theZ = 1;
60  } else if(pS=="n" || pS=="neutron") {
61  theA = 1;
62  theZ = 0;
64  } else if(pS=="delta++" || pS=="deltaplusplus") {
65  theA = 1;
66  theZ = 2;
68  } else if(pS=="delta+" || pS=="deltaplus") {
69  theA = 1;
70  theZ = 1;
72  } else if(pS=="delta0" || pS=="deltazero") {
73  theA = 1;
74  theZ = 0;
76  } else if(pS=="delta-" || pS=="deltaminus") {
77  theA = 1;
78  theZ = -1;
80  } else if(pS=="pi+" || pS=="pion+" || pS=="piplus" || pS=="pionplus") {
81  theA = 0;
82  theZ = 1;
84  } else if(pS=="pi0" || pS=="pion0" || pS=="pizero" || pS=="pionzero") {
85  theA = 0;
86  theZ = 0;
88  } else if(pS=="pi-" || pS=="pion-" || pS=="piminus" || pS=="pionminus") {
89  theA = 0;
90  theZ = -1;
92  } else if(pS=="d" || pS=="deuteron") {
93  theA = 2;
94  theZ = 1;
96  } else if(pS=="t" || pS=="triton") {
97  theA = 3;
98  theZ = 1;
100  } else if(pS=="a" || pS=="alpha") {
101  theA = 4;
102  theZ = 2;
104  } else if(pS=="eta") {
105  theA = 0;
106  theZ = 0;
108  } else if(pS=="omega") {
109  theA = 0;
110  theZ = 0;
112  } else if(pS=="etaprime" || pS=="etap") {
113  theA = 0;
114  theZ = 0;
116  } else if(pS=="photon") {
117  theA = 0;
118  theZ = 0;
120  } else
121  parseNuclide(pS);
122  }
G4INCL::ParticleSpecies::ParticleSpecies ( ParticleType const  t)

Definition at line 124 of file G4INCLParticleSpecies.cc.

124  :
125  theType(t),
128  {}
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 
)

Definition at line 130 of file G4INCLParticleSpecies.cc.

Member Function Documentation

G4int G4INCL::ParticleSpecies::getPDGCode ( ) const

Set a PDG Code (MONTE CARLO PARTICLE NUMBERING)

Parameters
\returninteger (identifying number for each particle)

Definition at line 273 of file G4INCLParticleSpecies.cc.

273  {
274  switch (theType) {
275  case Proton:
276  return 2212;
277  break;
278  case Neutron:
279  return 2112;
280  break;
281  case DeltaPlusPlus:
282  return 2224;
283  break;
284  case DeltaPlus:
285  return 2214;
286  break;
287  case DeltaZero:
288  return 2114;
289  break;
290  case DeltaMinus:
291  return 1114;
292  break;
293  case PiPlus:
294  return 211;
295  break;
296  case PiZero:
297  return 111;
298  break;
299  case PiMinus:
300  return -211;
301  break;
302  case Eta:
303  return 221;
304  break;
305  case Omega:
306  return 223;
307  break;
308  case EtaPrime:
309  return 331;
310  break;
311  case Photon:
312  return 22;
313  break;
314  case Composite:
315  return theA+theZ*1000;
316  break;
317  default:
318  INCL_ERROR("ParticleSpecies::getPDGCode: Unknown particle type." << '\n');
319  return 0;
320  break;
321  }
322  }
#define INCL_ERROR(x)

Member Data Documentation

G4int G4INCL::ParticleSpecies::theA

Definition at line 66 of file G4INCLParticleSpecies.hh.

ParticleType G4INCL::ParticleSpecies::theType

Definition at line 65 of file G4INCLParticleSpecies.hh.

G4int G4INCL::ParticleSpecies::theZ

Definition at line 66 of file G4INCLParticleSpecies.hh.


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