Geant4 10.7.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=="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 {}

◆ 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 {}
double S(double 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 349 of file G4INCLParticleSpecies.cc.

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