Geant4 11.2.2
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=="xi-" || pS=="x-") {
122 theA = 1;
123 theZ = -1;
124 theS = -2;
126 } else if(pS=="xi0" || pS=="x0") {
127 theA = 1;
128 theZ = 0;
129 theS = -2;
131 } else if(pS=="pb" || pS=="antiproton") {
132 theA = -1;
133 theZ = -1;
134 theS = 0;
136 } else if(pS=="nb" || pS=="antineutron") {
137 theA = -1;
138 theZ = 0;
139 theS = 0;
141 } else if(pS=="s+b" || pS=="antisigma+" || pS=="antisigmaplus") {
142 theA = -1;
143 theZ = -1;
144 theS = 1;
146 } else if(pS=="s0b" || pS=="antisigma0" || pS=="antisigmazero") {
147 theA = -1;
148 theZ = 0;
149 theS = 1;
151 } else if(pS=="s-b" || pS=="antisigma-" || pS=="antisigmaminus") { //Sm = Samarium; Whats wrong with the sign?
152 theA = -1;
153 theZ = 1;
154 theS = 1;
156 } else if(pS=="antilambda" || pS=="lb" || pS=="l0b") {
157 theA = -1;
158 theZ = 0;
159 theS = 1;
161 } else if(pS=="antixi-" || pS=="x-b") {
162 theA = -1;
163 theZ = 1;
164 theS = 2;
166 } else if(pS=="antixi0" || pS=="x0b") {
167 theA = -1;
168 theZ = 0;
169 theS = 2;
171 } else if(pS=="k+" || pS=="kaon+" || pS=="kplus" || pS=="kaonplus") {
172 theA = 0;
173 theZ = 1;
174 theS = 1;
176 } else if(pS=="k0" || pS=="kaon0" || pS=="kzero" || pS=="kaonzero") {
177 theA = 0;
178 theZ = 0;
179 theS = 1;
181 } else if(pS=="k0b" || pS=="kzb" || pS=="kaon0bar" || pS=="kzerobar" || pS=="kaonzerobar") {
182 theA = 0;
183 theZ = 0;
184 theS = -1;
186 } else if(pS=="k-" || pS=="kaon-" || pS=="kminus" || pS=="kaonminus") {
187 theA = 0;
188 theZ = -1;
189 theS = -1;
191 } else if(pS=="k0s" || pS=="kshort" || pS=="ks" || pS=="kaonshort") {
192 theA = 0;
193 theZ = 0;
194// theS not defined
196 } else if(pS=="k0l" || pS=="klong" || pS=="kl" || pS=="kaonlong") {
197 theA = 0;
198 theZ = 0;
199// theS not defined
201 } else if(pS=="d" || pS=="deuteron") {
202 theA = 2;
203 theZ = 1;
204 theS = 0;
206 } else if(pS=="t" || pS=="triton") {
207 theA = 3;
208 theZ = 1;
209 theS = 0;
211 } else if(pS=="a" || pS=="alpha") {
212 theA = 4;
213 theZ = 2;
214 theS = 0;
216 } else if(pS=="eta") {
217 theA = 0;
218 theZ = 0;
219 theS = 0;
221 } else if(pS=="omega") {
222 theA = 0;
223 theZ = 0;
224 theS = 0;
226 } else if(pS=="etaprime" || pS=="etap") {
227 theA = 0;
228 theZ = 0;
229 theS = 0;
231 } else if(pS=="photon") {
232 theA = 0;
233 theZ = 0;
234 theS = 0;
236 } else
237 parseNuclide(pS);
238 }

◆ ParticleSpecies() [3/5]

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

Definition at line 240 of file G4INCLParticleSpecies.cc.

240 :
241 theType(t),
245 {}
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 247 of file G4INCLParticleSpecies.cc.

247 :
249 theA(A),
250 theZ(Z),
251 theS(0)
252 {}
const G4double A[17]

◆ ParticleSpecies() [5/5]

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

Definition at line 254 of file G4INCLParticleSpecies.cc.

254 :
256 theA(A),
257 theZ(Z),
258 theS(S)
259 {}
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 415 of file G4INCLParticleSpecies.cc.

415 {
416 switch (theType) {
417 case Proton:
418 return 2212;
419 break;
420 case Neutron:
421 return 2112;
422 break;
423 case DeltaPlusPlus:
424 return 2224;
425 break;
426 case DeltaPlus:
427 return 2214;
428 break;
429 case DeltaZero:
430 return 2114;
431 break;
432 case DeltaMinus:
433 return 1114;
434 break;
435 case PiPlus:
436 return 211;
437 break;
438 case PiZero:
439 return 111;
440 break;
441 case PiMinus:
442 return -211;
443 break;
444 case Eta:
445 return 221;
446 break;
447 case Omega:
448 return 223;
449 break;
450 case EtaPrime:
451 return 331;
452 break;
453 case Photon:
454 return 22;
455 break;
456 case Lambda:
457 return 3122;
458 break;
459 case SigmaPlus:
460 return 3222;
461 break;
462 case SigmaZero:
463 return 3212;
464 break;
465 case SigmaMinus:
466 return 3112;
467 break;
468 case antiProton:
469 return -2212;
470 break;
471 case XiMinus:
472 return 3312;
473 break;
474 case XiZero:
475 return 3322;
476 break;
477 case antiNeutron:
478 return -2112;
479 break;
480 case antiLambda:
481 return -3122;
482 break;
483 case antiSigmaPlus:
484 return -3222;
485 break;
486 case antiSigmaZero:
487 return -3212;
488 break;
489 case antiSigmaMinus:
490 return -3112;
491 break;
492 case antiXiMinus:
493 return -3312;
494 break;
495 case antiXiZero:
496 return -3322;
497 break;
498 case KPlus:
499 return 321;
500 break;
501 case KZero:
502 return 311;
503 break;
504 case KZeroBar:
505 return -311;
506 break;
507 case KShort:
508 return 310;
509 break;
510 case KLong:
511 return 130;
512 break;
513 case KMinus:
514 return -321;
515 break;
516 case Composite:
517 if(theA == 1 && theZ == 1 && theS == 0) return 2212;
518 else if(theA == 1 && theZ == 0 && theS == 0) return 2112;
519 else if(theA == 1 && theZ == 0 && theS == -1) return 3122;
520 else return theA+theZ*1000-theS*1e6; // Here -theS because hyper-nucleus -> theS < 0
521 break;
522 default:
523 INCL_ERROR("ParticleSpecies::getPDGCode: Unknown particle type." << '\n');
524 return 0;
525 break;
526 }
527 }
#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: