Geant4 11.1.1
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)
 
 ParticleSpecies (const G4int A, const G4int Z, const G4int S)
 
G4int getPDGCode () const
 Set a PDG Code (MONTE CARLO PARTICLE NUMBERING)
 

Public Attributes

ParticleType theType
 
G4int theA
 
G4int theZ
 
G4int theS
 

Detailed Description

Definition at line 53 of file G4INCLParticleSpecies.hh.

Constructor & Destructor Documentation

◆ ParticleSpecies() [1/5]

G4INCL::ParticleSpecies::ParticleSpecies ( )
inline

Convert a string to a particle species.

Definition at line 56 of file G4INCLParticleSpecies.hh.

◆ ParticleSpecies() [2/5]

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;
59 theS = 0;
61 } else if(pS=="n" || pS=="neutron") {
62 theA = 1;
63 theZ = 0;
64 theS = 0;
66 } else if(pS=="delta++" || pS=="deltaplusplus") {
67 theA = 1;
68 theZ = 2;
69 theS = 0;
71 } else if(pS=="delta+" || pS=="deltaplus") {
72 theA = 1;
73 theZ = 1;
74 theS = 0;
76 } else if(pS=="delta0" || pS=="deltazero") {
77 theA = 1;
78 theZ = 0;
79 theS = 0;
81 } else if(pS=="delta-" || pS=="deltaminus") {
82 theA = 1;
83 theZ = -1;
84 theS = 0;
86 } else if(pS=="pi+" || pS=="pion+" || pS=="piplus" || pS=="pionplus") {
87 theA = 0;
88 theZ = 1;
89 theS = 0;
91 } else if(pS=="pi0" || pS=="pion0" || pS=="pizero" || pS=="pionzero") {
92 theA = 0;
93 theZ = 0;
94 theS = 0;
96 } else if(pS=="pi-" || pS=="pion-" || pS=="piminus" || pS=="pionminus") {
97 theA = 0;
98 theZ = -1;
99 theS = 0;
101 } else if(pS=="lambda" || pS=="l" || pS=="l0") {
102 theA = 1;
103 theZ = 0;
104 theS = -1;
106 } else if(pS=="s+" || pS=="sigma+" || pS=="sigmaplus") {
107 theA = 1;
108 theZ = 1;
109 theS = -1;
111 } else if(pS=="s0" || pS=="sigma0" || pS=="sigmazero") {
112 theA = 1;
113 theZ = 0;
114 theS = -1;
116 } else if(pS=="s-" || pS=="sigma-" || pS=="sigmaminus") { //Sm = Samarium
117 theA = 1;
118 theZ = -1;
119 theS = -1;
121 } else if(pS=="k+" || pS=="kaon+" || pS=="kplus" || pS=="kaonplus") {
122 theA = 0;
123 theZ = 1;
124 theS = 1;
126 } else if(pS=="k0" || pS=="kaon0" || pS=="kzero" || pS=="kaonzero") {
127 theA = 0;
128 theZ = 0;
129 theS = 1;
131 } else if(pS=="k0b" || pS=="kzb" || pS=="kaon0bar" || pS=="kzerobar" || pS=="kaonzerobar") {
132 theA = 0;
133 theZ = 0;
134 theS = -1;
136 } else if(pS=="k-" || pS=="kaon-" || pS=="kminus" || pS=="kaonminus") {
137 theA = 0;
138 theZ = -1;
139 theS = -1;
141 } else if(pS=="k0s" || pS=="kshort" || pS=="ks" || pS=="kaonshort") {
142 theA = 0;
143 theZ = 0;
144// theS not defined
146 } else if(pS=="k0l" || pS=="klong" || pS=="kl" || pS=="kaonlong") {
147 theA = 0;
148 theZ = 0;
149// theS not defined
151 } else if(pS=="d" || pS=="deuteron") {
152 theA = 2;
153 theZ = 1;
154 theS = 0;
156 } else if(pS=="t" || pS=="triton") {
157 theA = 3;
158 theZ = 1;
159 theS = 0;
161 } else if(pS=="a" || pS=="alpha") {
162 theA = 4;
163 theZ = 2;
164 theS = 0;
166 } else if(pS=="eta") {
167 theA = 0;
168 theZ = 0;
169 theS = 0;
171 } else if(pS=="omega") {
172 theA = 0;
173 theZ = 0;
174 theS = 0;
176 } else if(pS=="etaprime" || pS=="etap") {
177 theA = 0;
178 theZ = 0;
179 theS = 0;
181 } else if(pS=="photon") {
182 theA = 0;
183 theZ = 0;
184 theS = 0;
186 } else
187 parseNuclide(pS);
188 }

◆ ParticleSpecies() [3/5]

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

Definition at line 190 of file G4INCLParticleSpecies.cc.

190 :
191 theType(t),
195 {}
G4int getMassNumber(const ParticleType t)
Get mass number from particle type.
G4int getStrangenessNumber(const ParticleType t)
Get strangeness number from particle type.
G4int getChargeNumber(const ParticleType t)
Get charge number from particle type.

◆ ParticleSpecies() [4/5]

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

Definition at line 197 of file G4INCLParticleSpecies.cc.

197 :
199 theA(A),
200 theZ(Z),
201 theS(0)
202 {}
const G4int Z[17]
const G4double A[17]

◆ ParticleSpecies() [5/5]

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

Definition at line 204 of file G4INCLParticleSpecies.cc.

204 :
206 theA(A),
207 theZ(Z),
208 theS(S)
209 {}
G4double S(G4double temp)

Member Function Documentation

◆ getPDGCode()

G4int G4INCL::ParticleSpecies::getPDGCode ( ) const

Set a PDG Code (MONTE CARLO PARTICLE NUMBERING)

Parameters

return integer (identifying number for each particle)

Definition at line 365 of file G4INCLParticleSpecies.cc.

365 {
366 switch (theType) {
367 case Proton:
368 return 2212;
369 break;
370 case Neutron:
371 return 2112;
372 break;
373 case DeltaPlusPlus:
374 return 2224;
375 break;
376 case DeltaPlus:
377 return 2214;
378 break;
379 case DeltaZero:
380 return 2114;
381 break;
382 case DeltaMinus:
383 return 1114;
384 break;
385 case PiPlus:
386 return 211;
387 break;
388 case PiZero:
389 return 111;
390 break;
391 case PiMinus:
392 return -211;
393 break;
394 case Eta:
395 return 221;
396 break;
397 case Omega:
398 return 223;
399 break;
400 case EtaPrime:
401 return 331;
402 break;
403 case Photon:
404 return 22;
405 break;
406 case Lambda:
407 return 3122;
408 break;
409 case SigmaPlus:
410 return 3222;
411 break;
412 case SigmaZero:
413 return 3212;
414 break;
415 case SigmaMinus:
416 return 3112;
417 break;
418 case KPlus:
419 return 321;
420 break;
421 case KZero:
422 return 311;
423 break;
424 case KZeroBar:
425 return -311;
426 break;
427 case KShort:
428 return 310;
429 break;
430 case KLong:
431 return 130;
432 break;
433 case KMinus:
434 return -321;
435 break;
436 case Composite:
437 if(theA == 1 && theZ == 1 && theS == 0) return 2212;
438 else if(theA == 1 && theZ == 0 && theS == 0) return 2112;
439 else if(theA == 1 && theZ == 0 && theS == -1) return 3122;
440 else return theA+theZ*1000-theS*1e6; // Here -theS because hyper-nucleus -> theS < 0
441 break;
442 default:
443 INCL_ERROR("ParticleSpecies::getPDGCode: Unknown particle type." << '\n');
444 return 0;
445 break;
446 }
447 }
#define INCL_ERROR(x)

Referenced by G4INCL::Nucleus::fillEventInfo(), and G4INCL::EventInfo::remnantToParticle().

Member Data Documentation

◆ theA

◆ theS

◆ theType

◆ theZ


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