Geant4 11.4.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)
 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=="pbar" || pS=="antiproton") {
132 theA = -1;
133 theZ = -1;
134 theS = 0;
136 } else if(pS=="nb" || pS=="nbar" || 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 if (pS=="db" || pS=="dbar" || pS=="antideuteron"){
237 theA = -2;
238 theZ = -1;
239 theS = 0;
241 } else
242 parseNuclide(pS);
243 }

◆ ParticleSpecies() [3/5]

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

Definition at line 245 of file G4INCLParticleSpecies.cc.

245 :
246 theType(t),
250 {}
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 252 of file G4INCLParticleSpecies.cc.

252 {
253 if (A>=0){
255 theA = A;
256 theZ = Z;
257 theS = 0;
258 } else {
260 theA = A;
261 theZ = Z;
262 theS = 0;
263 }
264 }
const G4double A[17]

◆ ParticleSpecies() [5/5]

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

Definition at line 266 of file G4INCLParticleSpecies.cc.

266 {
267 if (A>=0){
269 theA = A;
270 theZ = Z;
271 theS = S;
272 } else {
274 theA = A;
275 theZ = Z;
276 theS = S;
277 }
278 }
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 434 of file G4INCLParticleSpecies.cc.

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