Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ChargeExchangeXS Class Referencefinal

#include <G4ChargeExchangeXS.hh>

+ Inheritance diagram for G4ChargeExchangeXS:

Public Member Functions

 G4ChargeExchangeXS ()
 
 ~G4ChargeExchangeXS () override=default
 
G4bool IsIsoApplicable (const G4DynamicParticle *, G4int Z, G4int A, const G4Element *, const G4Material *) override
 
G4double GetIsoCrossSection (const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso, const G4Element *elm, const G4Material *mat) override
 
void CrossSectionDescription (std::ostream &) const override
 
const G4ParticleDefinitionSampleSecondaryType (const G4ParticleDefinition *, const G4int Z, const G4int A)
 
void SetEnergyLimit (G4double val)
 
void SetCrossSectionFactor (G4double val)
 
G4ChargeExchangeXSoperator= (const G4ChargeExchangeXS &right)=delete
 
 G4ChargeExchangeXS (const G4ChargeExchangeXS &)=delete
 
- Public Member Functions inherited from G4VCrossSectionDataSet
 G4VCrossSectionDataSet (const G4String &nam="")
 
virtual ~G4VCrossSectionDataSet ()
 
virtual G4bool IsElementApplicable (const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr)
 
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)
 
G4double ComputeCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)
 
virtual G4double ComputeCrossSectionPerElement (G4double kinEnergy, G4double loge, const G4ParticleDefinition *, const G4Element *, const G4Material *mat=nullptr)
 
virtual G4double GetElementCrossSection (const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr)
 
virtual G4double ComputeIsoCrossSection (G4double kinEnergy, G4double loge, const G4ParticleDefinition *, G4int Z, G4int A, const G4Isotope *iso=nullptr, const G4Element *elm=nullptr, const G4Material *mat=nullptr)
 
virtual const G4IsotopeSelectIsotope (const G4Element *, G4double kinEnergy, G4double logE)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
 
virtual void SetVerboseLevel (G4int value)
 
G4double GetMinKinEnergy () const
 
void SetMinKinEnergy (G4double value)
 
G4double GetMaxKinEnergy () const
 
void SetMaxKinEnergy (G4double value)
 
bool ForAllAtomsAndEnergies () const
 
void SetForAllAtomsAndEnergies (G4bool val)
 
const G4StringGetName () const
 
void SetName (const G4String &nam)
 
G4VCrossSectionDataSetoperator= (const G4VCrossSectionDataSet &right)=delete
 
 G4VCrossSectionDataSet (const G4VCrossSectionDataSet &)=delete
 

Additional Inherited Members

- Protected Attributes inherited from G4VCrossSectionDataSet
G4int verboseLevel
 
G4String name
 

Detailed Description

Definition at line 65 of file G4ChargeExchangeXS.hh.

Constructor & Destructor Documentation

◆ G4ChargeExchangeXS() [1/2]

G4ChargeExchangeXS::G4ChargeExchangeXS ( )

Definition at line 70 of file G4ChargeExchangeXS.cc.

71{
72 if (verboseLevel > 1) {
73 G4cout << "G4ChargeExchangeXS::G4ChargeExchangeXS" << G4endl;
74 }
75 g4calc = G4Pow::GetInstance();
77 const G4String nam[5] = {"pi0", "eta", "eta_prime", "omega", "f2(1270)"};
78 for (G4int i=0; i<5; ++i) {
79 fPionSecPD[i] = table->FindParticle(nam[i]);
80 if (nullptr == fPionSecPD[i]) {
82 ed << "### meson " << nam[i] << " is not found out in the particle table";
83 G4Exception("G4ChargeExchangeXS::G4ChargeExchangeXS()","had044",
84 FatalException, ed,"");
85 }
86 }
87}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
int G4int
Definition G4Types.hh:85
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
static G4ParticleTable * GetParticleTable()
static G4Pow * GetInstance()
Definition G4Pow.cc:41

◆ ~G4ChargeExchangeXS()

G4ChargeExchangeXS::~G4ChargeExchangeXS ( )
overridedefault

◆ G4ChargeExchangeXS() [2/2]

G4ChargeExchangeXS::G4ChargeExchangeXS ( const G4ChargeExchangeXS & )
delete

Member Function Documentation

◆ CrossSectionDescription()

void G4ChargeExchangeXS::CrossSectionDescription ( std::ostream & outFile) const
overridevirtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 90 of file G4ChargeExchangeXS.cc.

91{
92 outFile << "G4ChargeExchangeXS calculates charge exchange cross section for "
93 << "pi+, pi-, K+, K-, KL\n";
94}

◆ GetIsoCrossSection()

G4double G4ChargeExchangeXS::GetIsoCrossSection ( const G4DynamicParticle * aParticle,
G4int Z,
G4int A,
const G4Isotope * iso,
const G4Element * elm,
const G4Material * mat )
overridevirtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 104 of file G4ChargeExchangeXS.cc.

108{
109 G4double result = 0.0;
110 const G4double pE = aParticle->GetTotalEnergy();
111 if (pE <= fEnergyLimit) { return result; }
112 auto part = aParticle->GetDefinition();
113 G4int pdg = part->GetPDGEncoding();
114
115 // Get or calculate the nucleus mass, particle mass,particle kinetic energy
116 // and particle total energy
118 G4double pM = part->GetPDGMass();
119
120 // Calculate s(lorentz invariant)
121 G4double lorentz_s = tM*tM + 2*tM*pE + pM*pM;
122 if (lorentz_s <= (tM + pM)*(tM + pM)) { return result; }
123
124 // For unit conversion
125 const G4double inv1e7 = 1e-7;
126 const G4double fact = 1e-30*CLHEP::cm2;
127 const G4double pfact = 0.1/CLHEP::GeV;
128 const G4double kfact = 56.3*fact;
129
130 G4double logA = g4calc->logZ(A);
131
132 // The approximation of Glauber-Gribov formula -> extend it from interaction with
133 // proton to nuclei Z^(2/3). The factor g4calc->powA(A,-beta_prime_pi*G4Log(A))
134 // takes into account absorption of pi0 and eta
135 // pi- + p -> sum of (pi0 + eta) + n
136 if (pdg == -211) {
137 const G4double z23 = g4calc->Z23(Z);
138 const G4int z = A/2;
139 const G4double a23 = g4calc->Z23(z);
140 const G4double x = lorentz_s*inv1e7;
141 G4double sum = 122.*z23*g4calc->powA(x, -1.23)*g4calc->powZ(A,-beta_prime_pi*logA);
142 fXSecPion[0] = sum;
143 sum += 31.*z23*g4calc->powA(x, -1.53)*g4calc->powZ(A,-beta_prime_eta*logA);
144 fXSecPion[1] = sum;
145 const G4double logX = G4Log(x);
146 for (G4int i=2; i<5; ++i) {
147 sum += piA[i]*z23*g4calc->powA(x, -pAP[i])*(1.0 + pG0[i] + pG1[i]*logX)
148 *g4calc->powA(z23, -0.15*a23)/(pC0[i] + pC1[i]*logX);
149 fXSecPion[i] = sum;
150 }
151 result = sum*fact;
152 }
153
154 // pi+ + n -> sum of (pi0 + eta) + p
155 else if (pdg == 211) {
156 const G4double n23 = g4calc->Z23(A - Z);
157 const G4int z = A/2;
158 const G4double a23 = g4calc->Z23(z);
159 const G4double x = lorentz_s*inv1e7;
160 G4double sum = 122.*n23*g4calc->powA(x, -1.23)*g4calc->powZ(A,-beta_prime_pi*logA);
161 fXSecPion[0] = sum;
162 sum += 31.*n23*g4calc->powA(x, -1.53)*g4calc->powZ(A,-beta_prime_eta*logA);
163 fXSecPion[1] = sum;
164 const G4double logX = G4Log(x);
165 for (G4int i=2; i<5; ++i) {
166 sum += piA[i]*n23*g4calc->powA(x, -pAP[i])*(1.0 + pG0[i] + pG1[i]*logX)
167 *g4calc->powA(n23, -0.15*a23)/(pC0[i] + pC1[i]*logX);
168 fXSecPion[i] = sum;
169 }
170 result = sum*fact;
171 }
172
173 // K- + p -> Kbar + n
174 else if (pdg == -321){
175 // Calculate the momentum of the bombarding particles and convert
176 // it to GeV/c^2 unit
177 const G4double p_momentum = std::sqrt(pE*pE - pM*pM)*pfact;
178 result = g4calc->Z23(Z)*g4calc->powA(p_momentum, -1.60)*kfact;
179 }
180
181 // K+ + n -> Kbar + p
182 else if (pdg == 321) {
183 const G4double p_momentum = std::sqrt(pE*pE - pM*pM)*pfact;
184 result = g4calc->Z23(A-Z)*g4calc->powA(p_momentum, -1.60)*kfact;
185 }
186
187 // KL
188 else if (pdg == 130) {
189 // Cross section of K-long = 0.5*(Cross section of K+ + Cross section of K-)
190 const G4double p_momentum = std::sqrt(pE*pE - pM*pM)*pfact;
191 result = 0.5*(g4calc->Z23(Z) + g4calc->Z23(A-Z))*
192 g4calc->powA(p_momentum, -1.60)*kfact;
193 }
194
195 return result*fFactor;
196}
G4double G4Log(G4double x)
Definition G4Log.hh:227
double G4double
Definition G4Types.hh:83
const G4double A[17]
G4ParticleDefinition * GetDefinition() const
G4double GetTotalEnergy() const
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4double logZ(G4int Z) const
Definition G4Pow.hh:137
G4double powZ(G4int Z, G4double y) const
Definition G4Pow.hh:225
G4double powA(G4double A, G4double y) const
Definition G4Pow.hh:230
G4double Z23(G4int Z) const
Definition G4Pow.hh:125

◆ IsIsoApplicable()

G4bool G4ChargeExchangeXS::IsIsoApplicable ( const G4DynamicParticle * ,
G4int Z,
G4int A,
const G4Element * ,
const G4Material *  )
overridevirtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 96 of file G4ChargeExchangeXS.cc.

99{
100 return true;
101}

◆ operator=()

G4ChargeExchangeXS & G4ChargeExchangeXS::operator= ( const G4ChargeExchangeXS & right)
delete

◆ SampleSecondaryType()

const G4ParticleDefinition * G4ChargeExchangeXS::SampleSecondaryType ( const G4ParticleDefinition * part,
const G4int Z,
const G4int A )

Definition at line 199 of file G4ChargeExchangeXS.cc.

201{
202 const G4ParticleDefinition* pd = nullptr;
203 G4int pdg = part->GetPDGEncoding();
204
205 // pi- + p / pi+ + n
206 if (std::abs(pdg) == 211) {
207 const G4double x = fXSecPion[4]*G4UniformRand();
208 for (G4int i=0; i<5; ++i) {
209 if (x <= fXSecPion[i]) {
210 return fPionSecPD[i];
211 }
212 }
213 }
214
215 // K- + p / K+ + n
216 // Equal opportunity of producing k-short and k-long
217 else if (std::abs(pdg) == 321) {
218 if (G4UniformRand() > 0.5) {
220 }
221 else {
223 }
224 }
225
226 // KL + atom
227 else if (std::abs(pdg) == 130) {
228 G4double prob = (G4double)Z/(G4double)A;
229 if (G4UniformRand() > prob) {
231 }
232 else {
234 }
235 }
236
237 return pd;
238}
#define G4UniformRand()
Definition Randomize.hh:52
static G4KaonMinus * KaonMinus()
static G4KaonPlus * KaonPlus()
static G4KaonZeroLong * KaonZeroLong()
static G4KaonZeroShort * KaonZeroShort()

Referenced by G4ChargeExchange::ApplyYourself().

◆ SetCrossSectionFactor()

void G4ChargeExchangeXS::SetCrossSectionFactor ( G4double val)
inline

Definition at line 89 of file G4ChargeExchangeXS.hh.

89{ fFactor = val; };

◆ SetEnergyLimit()

void G4ChargeExchangeXS::SetEnergyLimit ( G4double val)
inline

Definition at line 87 of file G4ChargeExchangeXS.hh.

87{ fEnergyLimit = val; };

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