Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4HEKaonMinusInelastic Class Reference

#include <G4HEKaonMinusInelastic.hh>

+ Inheritance diagram for G4HEKaonMinusInelastic:

Public Member Functions

 G4HEKaonMinusInelastic ()
 
 ~G4HEKaonMinusInelastic ()
 
virtual void ModelDescription (std::ostream &) const
 
G4HadFinalStateApplyYourself (const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
 
G4int GetNumberOfSecondaries ()
 
void FirstIntInCasKaonMinus (G4bool &inElastic, const G4double availableEnergy, G4HEVector pv[], G4int &vecLen, const G4HEVector &incidentParticle, const G4HEVector &targetParticle)
 
- Public Member Functions inherited from G4HEInelastic
 G4HEInelastic (const G4String &modelName="HEInelastic")
 
 ~G4HEInelastic ()
 
void SetMaxNumberOfSecondaries (const G4int maxnumber)
 
void SetVerboseLevel (const G4int level)
 
void ForceEnergyConservation (G4bool energyConservation)
 
G4bool EnergyConservation (void)
 
virtual const std::pair< G4double, G4doubleGetFatalEnergyCheckLevels () const
 
G4double Amin (G4double a, G4double b)
 
G4double Amax (G4double a, G4double b)
 
G4int Imin (G4int a, G4int b)
 
G4int Imax (G4int a, G4int b)
 
void FillParticleChange (G4HEVector pv[], G4int aVecLength)
 
G4double pmltpc (G4int np, G4int nm, G4int nz, G4int n, G4double b, G4double c)
 
G4int Factorial (G4int n)
 
G4double NuclearInelasticity (G4double incidentKineticEnergy, G4double atomicWeight, G4double atomicNumber)
 
G4double NuclearExcitation (G4double incidentKineticEnergy, G4double atomicWeight, G4double atomicNumber, G4double &excitationEnergyCascade, G4double &excitationEnergyEvaporation)
 
void HighEnergyCascading (G4bool &successful, G4HEVector pv[], G4int &vecLen, G4double &excitationEnergyGNP, G4double &excitationEnergyDTA, const G4HEVector &incidentParticle, const G4HEVector &targetParticle, G4double atomicWeight, G4double atomicNumber)
 
void HighEnergyClusterProduction (G4bool &successful, G4HEVector pv[], G4int &vecLen, G4double &excitationEnergyGNP, G4double &excitationEnergyDTA, const G4HEVector &incidentParticle, const G4HEVector &targetParticle, G4double atomicWeight, G4double atomicNumber)
 
void TuningOfHighEnergyCascading (G4HEVector pv[], G4int &vecLen, const G4HEVector &incidentParticle, const G4HEVector &targetParticle, G4double atomicWeight, G4double atomicNumber)
 
void MediumEnergyCascading (G4bool &successful, G4HEVector pv[], G4int &vecLen, G4double &excitationEnergyGNP, G4double &excitationEnergyDTA, const G4HEVector &incidentParticle, const G4HEVector &targetParticle, G4double atomicWeight, G4double atomicNumber)
 
void MediumEnergyClusterProduction (G4bool &successful, G4HEVector pv[], G4int &vecLen, G4double &excitationEnergyGNP, G4double &excitationEnergyDTA, const G4HEVector &incidentParticle, const G4HEVector &targetParticle, G4double atomicWeight, G4double atomicNumber)
 
void QuasiElasticScattering (G4bool &successful, G4HEVector pv[], G4int &vecLen, G4double &excitationEnergyGNP, G4double &excitationEnergyDTA, const G4HEVector &incidentParticle, const G4HEVector &targetParticle, G4double atomicWeight, G4double atomicNumber)
 
void ElasticScattering (G4bool &successful, G4HEVector pv[], G4int &vecLen, const G4HEVector &incidentParticle, G4double atomicWeight, G4double atomicNumber)
 
G4int rtmi (G4double *x, G4double xli, G4double xri, G4double eps, G4int iend, G4double aa, G4double bb, G4double cc, G4double dd, G4double rr)
 
G4double fctcos (G4double t, G4double aa, G4double bb, G4double cc, G4double dd, G4double rr)
 
void StrangeParticlePairProduction (const G4double availableEnergy, const G4double centerOfMassEnergy, G4HEVector pv[], G4int &vecLen, const G4HEVector &incidentParticle, const G4HEVector &targetParticle)
 
G4double NBodyPhaseSpace (const G4double totalEnergy, const G4bool constantCrossSection, G4HEVector pv[], G4int &vecLen)
 
G4double NBodyPhaseSpace (G4int npart, G4HEVector pv[], G4double wmax, G4double wfcn, G4int maxtrial, G4int ntrial)
 
G4double gpdk (G4double a, G4double b, G4double c)
 
void QuickSort (G4double arr[], const G4int lidx, const G4int ridx)
 
G4double Alam (G4double a, G4double b, G4double c)
 
G4double CalculatePhaseSpaceWeight (G4int npart)
 
G4double normal (void)
 
G4double GammaRand (G4double avalue)
 
G4double Erlang (G4int mvalue)
 
G4int Poisson (G4double x)
 
void SetParticles (void)
 
- Public Member Functions inherited from G4HadronicInteraction
 G4HadronicInteraction (const G4String &modelName="HadronicModel")
 
virtual ~G4HadronicInteraction ()
 
virtual G4HadFinalStateApplyYourself (const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)=0
 
virtual G4double SampleInvariantT (const G4ParticleDefinition *p, G4double plab, G4int Z, G4int A)
 
virtual G4bool IsApplicable (const G4HadProjectile &, G4Nucleus &)
 
G4double GetMinEnergy () const
 
G4double GetMinEnergy (const G4Material *aMaterial, const G4Element *anElement) const
 
void SetMinEnergy (G4double anEnergy)
 
void SetMinEnergy (G4double anEnergy, const G4Element *anElement)
 
void SetMinEnergy (G4double anEnergy, const G4Material *aMaterial)
 
G4double GetMaxEnergy () const
 
G4double GetMaxEnergy (const G4Material *aMaterial, const G4Element *anElement) const
 
void SetMaxEnergy (const G4double anEnergy)
 
void SetMaxEnergy (G4double anEnergy, const G4Element *anElement)
 
void SetMaxEnergy (G4double anEnergy, const G4Material *aMaterial)
 
const G4HadronicInteractionGetMyPointer () const
 
G4int GetVerboseLevel () const
 
void SetVerboseLevel (G4int value)
 
const G4StringGetModelName () const
 
void DeActivateFor (const G4Material *aMaterial)
 
void ActivateFor (const G4Material *aMaterial)
 
void DeActivateFor (const G4Element *anElement)
 
void ActivateFor (const G4Element *anElement)
 
G4bool IsBlocked (const G4Material *aMaterial) const
 
G4bool IsBlocked (const G4Element *anElement) const
 
void SetRecoilEnergyThreshold (G4double val)
 
G4double GetRecoilEnergyThreshold () const
 
G4bool operator== (const G4HadronicInteraction &right) const
 
G4bool operator!= (const G4HadronicInteraction &right) const
 
virtual const std::pair< G4double, G4doubleGetFatalEnergyCheckLevels () const
 
virtual std::pair< G4double, G4doubleGetEnergyMomentumCheckLevels () const
 
void SetEnergyMomentumCheckLevels (G4double relativeLevel, G4double absoluteLevel)
 
virtual void ModelDescription (std::ostream &outFile) const
 

Public Attributes

G4int vecLength
 
- Public Attributes inherited from G4HEInelastic
G4int verboseLevel
 
G4int MAXPART
 
G4bool conserveEnergy
 
G4HEVector PionPlus
 
G4HEVector PionZero
 
G4HEVector PionMinus
 
G4HEVector KaonPlus
 
G4HEVector KaonZero
 
G4HEVector AntiKaonZero
 
G4HEVector KaonMinus
 
G4HEVector KaonZeroShort
 
G4HEVector KaonZeroLong
 
G4HEVector Proton
 
G4HEVector AntiProton
 
G4HEVector Neutron
 
G4HEVector AntiNeutron
 
G4HEVector Lambda
 
G4HEVector AntiLambda
 
G4HEVector SigmaPlus
 
G4HEVector SigmaZero
 
G4HEVector SigmaMinus
 
G4HEVector AntiSigmaPlus
 
G4HEVector AntiSigmaZero
 
G4HEVector AntiSigmaMinus
 
G4HEVector XiZero
 
G4HEVector XiMinus
 
G4HEVector AntiXiZero
 
G4HEVector AntiXiMinus
 
G4HEVector OmegaMinus
 
G4HEVector AntiOmegaMinus
 
G4HEVector Deuteron
 
G4HEVector Triton
 
G4HEVector Alpha
 
G4HEVector Gamma
 

Additional Inherited Members

- Protected Member Functions inherited from G4HadronicInteraction
void SetModelName (const G4String &nam)
 
G4bool IsBlocked () const
 
void Block ()
 
- Protected Attributes inherited from G4HadronicInteraction
G4HadFinalState theParticleChange
 
G4int verboseLevel
 
G4double theMinEnergy
 
G4double theMaxEnergy
 
G4bool isBlocked
 

Detailed Description

Definition at line 52 of file G4HEKaonMinusInelastic.hh.

Constructor & Destructor Documentation

◆ G4HEKaonMinusInelastic()

G4HEKaonMinusInelastic::G4HEKaonMinusInelastic ( )
inline

Definition at line 55 of file G4HEKaonMinusInelastic.hh.

55 : G4HEInelastic("G4HEKaonMinusInelastic")
56 {
57 vecLength = 0;
58 theMinEnergy = 20*CLHEP::GeV;
59 theMaxEnergy = 10*CLHEP::TeV;
60 MAXPART = 2048;
61 verboseLevel = 0;
62 G4cout << "WARNING: model G4HEKaonMinusInelastic is being deprecated and will\n"
63 << "disappear in Geant4 version 10.0" << G4endl;
64 }
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout

◆ ~G4HEKaonMinusInelastic()

G4HEKaonMinusInelastic::~G4HEKaonMinusInelastic ( )
inline

Definition at line 66 of file G4HEKaonMinusInelastic.hh.

66{};

Member Function Documentation

◆ ApplyYourself()

G4HadFinalState * G4HEKaonMinusInelastic::ApplyYourself ( const G4HadProjectile aTrack,
G4Nucleus targetNucleus 
)
virtual

Implements G4HadronicInteraction.

Definition at line 58 of file G4HEKaonMinusInelastic.cc.

60{
61 G4HEVector* pv = new G4HEVector[MAXPART];
62 const G4HadProjectile* aParticle = &aTrack;
63 const G4double A = targetNucleus.GetA_asInt();
64 const G4double Z = targetNucleus.GetZ_asInt();
65 G4HEVector incidentParticle(aParticle);
66
67 G4double atomicNumber = Z;
68 G4double atomicWeight = A;
69
70 G4int incidentCode = incidentParticle.getCode();
71 G4double incidentMass = incidentParticle.getMass();
72 G4double incidentTotalEnergy = incidentParticle.getEnergy();
73
74 // G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
75 // DHW 19 May 2011: variable set but not used
76
77 G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
78
79 if (incidentKineticEnergy < 1.)
80 G4cout << "GHEKaonMinusInelastic: incident energy < 1 GeV" << G4endl;
81
82 if (verboseLevel > 1) {
83 G4cout << "G4HEKaonMinusInelastic::ApplyYourself" << G4endl;
84 G4cout << "incident particle " << incidentParticle.getName()
85 << "mass " << incidentMass
86 << "kinetic energy " << incidentKineticEnergy
87 << G4endl;
88 G4cout << "target material with (A,Z) = ("
89 << atomicWeight << "," << atomicNumber << ")" << G4endl;
90 }
91
92 G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
93 atomicWeight, atomicNumber);
94 if (verboseLevel > 1)
95 G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
96
97 incidentKineticEnergy -= inelasticity;
98
99 G4double excitationEnergyGNP = 0.;
100 G4double excitationEnergyDTA = 0.;
101
102 G4double excitation = NuclearExcitation(incidentKineticEnergy,
103 atomicWeight, atomicNumber,
104 excitationEnergyGNP,
105 excitationEnergyDTA);
106 if (verboseLevel > 1)
107 G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
108 << excitationEnergyDTA << G4endl;
109
110 incidentKineticEnergy -= excitation;
111 incidentTotalEnergy = incidentKineticEnergy + incidentMass;
112 // incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
113 // *(incidentTotalEnergy+incidentMass));
114 // DHW 19 May 2011: variable set but not used
115
116 G4HEVector targetParticle;
117 if (G4UniformRand() < atomicNumber/atomicWeight) {
118 targetParticle.setDefinition("Proton");
119 } else {
120 targetParticle.setDefinition("Neutron");
121 }
122
123 G4double targetMass = targetParticle.getMass();
124 G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
125 + targetMass*targetMass
126 + 2.0*targetMass*incidentTotalEnergy);
127 G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
128
129 G4bool inElastic = true;
130
131 vecLength = 0;
132
133 if (verboseLevel > 1)
134 G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
135 << incidentCode << G4endl;
136
137 G4bool successful = false;
138
139 FirstIntInCasKaonMinus(inElastic, availableEnergy, pv, vecLength,
140 incidentParticle, targetParticle);
141
142 if (verboseLevel > 1)
143 G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
144
145 if ((vecLength > 0) && (availableEnergy > 1.))
146 StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
147 pv, vecLength,
148 incidentParticle, targetParticle);
149
150 HighEnergyCascading(successful, pv, vecLength,
151 excitationEnergyGNP, excitationEnergyDTA,
152 incidentParticle, targetParticle,
153 atomicWeight, atomicNumber);
154 if (!successful)
156 excitationEnergyGNP, excitationEnergyDTA,
157 incidentParticle, targetParticle,
158 atomicWeight, atomicNumber);
159 if (!successful)
160 MediumEnergyCascading(successful, pv, vecLength,
161 excitationEnergyGNP, excitationEnergyDTA,
162 incidentParticle, targetParticle,
163 atomicWeight, atomicNumber);
164
165 if (!successful)
167 excitationEnergyGNP, excitationEnergyDTA,
168 incidentParticle, targetParticle,
169 atomicWeight, atomicNumber);
170 if (!successful)
171 QuasiElasticScattering(successful, pv, vecLength,
172 excitationEnergyGNP, excitationEnergyDTA,
173 incidentParticle, targetParticle,
174 atomicWeight, atomicNumber);
175 if (!successful)
176 ElasticScattering(successful, pv, vecLength,
177 incidentParticle,
178 atomicWeight, atomicNumber);
179 if (!successful)
180 G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
181 << G4endl;
182
184 delete [] pv;
186 return &theParticleChange;
187}
@ stopAndKill
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
#define G4UniformRand()
Definition: Randomize.hh:53
void MediumEnergyClusterProduction(G4bool &successful, G4HEVector pv[], G4int &vecLen, G4double &excitationEnergyGNP, G4double &excitationEnergyDTA, const G4HEVector &incidentParticle, const G4HEVector &targetParticle, G4double atomicWeight, G4double atomicNumber)
void ElasticScattering(G4bool &successful, G4HEVector pv[], G4int &vecLen, const G4HEVector &incidentParticle, G4double atomicWeight, G4double atomicNumber)
void QuasiElasticScattering(G4bool &successful, G4HEVector pv[], G4int &vecLen, G4double &excitationEnergyGNP, G4double &excitationEnergyDTA, const G4HEVector &incidentParticle, const G4HEVector &targetParticle, G4double atomicWeight, G4double atomicNumber)
void FillParticleChange(G4HEVector pv[], G4int aVecLength)
void HighEnergyClusterProduction(G4bool &successful, G4HEVector pv[], G4int &vecLen, G4double &excitationEnergyGNP, G4double &excitationEnergyDTA, const G4HEVector &incidentParticle, const G4HEVector &targetParticle, G4double atomicWeight, G4double atomicNumber)
G4double NuclearExcitation(G4double incidentKineticEnergy, G4double atomicWeight, G4double atomicNumber, G4double &excitationEnergyCascade, G4double &excitationEnergyEvaporation)
void MediumEnergyCascading(G4bool &successful, G4HEVector pv[], G4int &vecLen, G4double &excitationEnergyGNP, G4double &excitationEnergyDTA, const G4HEVector &incidentParticle, const G4HEVector &targetParticle, G4double atomicWeight, G4double atomicNumber)
G4double NuclearInelasticity(G4double incidentKineticEnergy, G4double atomicWeight, G4double atomicNumber)
void StrangeParticlePairProduction(const G4double availableEnergy, const G4double centerOfMassEnergy, G4HEVector pv[], G4int &vecLen, const G4HEVector &incidentParticle, const G4HEVector &targetParticle)
void HighEnergyCascading(G4bool &successful, G4HEVector pv[], G4int &vecLen, G4double &excitationEnergyGNP, G4double &excitationEnergyDTA, const G4HEVector &incidentParticle, const G4HEVector &targetParticle, G4double atomicWeight, G4double atomicNumber)
void FirstIntInCasKaonMinus(G4bool &inElastic, const G4double availableEnergy, G4HEVector pv[], G4int &vecLen, const G4HEVector &incidentParticle, const G4HEVector &targetParticle)
G4double getMass() const
Definition: G4HEVector.cc:361
void setDefinition(G4String name)
Definition: G4HEVector.cc:812
void SetStatusChange(G4HadFinalStateStatus aS)
G4int GetA_asInt() const
Definition: G4Nucleus.hh:109
G4int GetZ_asInt() const
Definition: G4Nucleus.hh:115

◆ FirstIntInCasKaonMinus()

void G4HEKaonMinusInelastic::FirstIntInCasKaonMinus ( G4bool inElastic,
const G4double  availableEnergy,
G4HEVector  pv[],
G4int vecLen,
const G4HEVector incidentParticle,
const G4HEVector targetParticle 
)

Definition at line 191 of file G4HEKaonMinusInelastic.cc.

205{
206 static const G4double expxu = 82.; // upper bound for arg. of exp
207 static const G4double expxl = -expxu; // lower bound for arg. of exp
208
209 static const G4double protb = 0.7;
210 static const G4double neutb = 0.7;
211 static const G4double c = 1.25;
212
213 static const G4int numMul = 1200;
214 static const G4int numSec = 60;
215
217 G4int protonCode = Proton.getCode();
218 G4int kaonMinusCode = KaonMinus.getCode();
219 G4int kaonZeroCode = KaonZero.getCode();
220 G4int antiKaonZeroCode = AntiKaonZero.getCode();
221
222 G4int targetCode = targetParticle.getCode();
223 G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
224
225 static G4bool first = true;
226 static G4double protmul[numMul], protnorm[numSec]; // proton constants
227 static G4double neutmul[numMul], neutnorm[numSec]; // neutron constants
228
229 // misc. local variables
230 // npos = number of pi+, nneg = number of pi-, nzero = number of pi0
231
232 G4int i, counter, nt, npos, nneg, nzero;
233
234 if (first) {
235 // compute normalization constants, this will only be done once
236 first = false;
237 for (i = 0; i < numMul; i++) protmul[i] = 0.0;
238 for (i = 0; i < numSec; i++) protnorm[i] = 0.0;
239 counter = -1;
240 for (npos = 0; npos < (numSec/3); npos++) {
241 for( nneg=Imax(0,npos-1); nneg<=npos+1; nneg++ )
242 {
243 for( nzero=0; nzero<numSec/3; nzero++ )
244 {
245 if( ++counter < numMul )
246 {
247 nt = npos+nneg+nzero;
248 if( (nt>0) && (nt<=numSec) )
249 {
250 protmul[counter] =
251 pmltpc(npos,nneg,nzero,nt,protb,c) ;
252 protnorm[nt-1] += protmul[counter];
253 }
254 }
255 }
256 }
257 }
258 for( i=0; i<numMul; i++ )neutmul[i] = 0.0;
259 for( i=0; i<numSec; i++ )neutnorm[i] = 0.0;
260 counter = -1;
261 for (npos = 0; npos < numSec/3; npos++) {
262 for (nneg = npos; nneg <= (npos+2); nneg++) {
263 for( nzero=0; nzero<numSec/3; nzero++ )
264 {
265 if( ++counter < numMul )
266 {
267 nt = npos+nneg+nzero;
268 if( (nt>0) && (nt<=numSec) )
269 {
270 neutmul[counter] =
271 pmltpc(npos,nneg,nzero,nt,neutb,c);
272 neutnorm[nt-1] += neutmul[counter];
273 }
274 }
275 }
276 }
277 }
278
279 for (i = 0; i < numSec; i++) {
280 if (protnorm[i] > 0.0) protnorm[i] = 1.0/protnorm[i];
281 if (neutnorm[i] > 0.0) neutnorm[i] = 1.0/neutnorm[i];
282 }
283 } // end of initialization
284
285 pv[0] = incidentParticle; // initialize the first two places
286 pv[1] = targetParticle; // the same as beam and target
287 vecLen = 2;
288
289 if (!inElastic || (availableEnergy <= PionPlus.getMass())) return;
290
291 // inelastic scattering
292 npos = 0, nneg = 0, nzero = 0;
293 G4double cech[] = { 1., 1., 1., 0.70, 0.60, 0.55, 0.35, 0.25, 0.18, 0.15};
294 G4int iplab = G4int( incidentTotalMomentum*5.);
295 if ( (iplab < 10) && (G4UniformRand() < cech[iplab])) {
296 G4int ipl = Imin(19, G4int( incidentTotalMomentum*5.));
297 G4double cnk0[] = {0.17, 0.18, 0.17, 0.24, 0.26, 0.20, 0.22, 0.21, 0.34, 0.45,
298 0.58, 0.55, 0.36, 0.29, 0.29, 0.32, 0.32, 0.33, 0.33, 0.33};
299 if (G4UniformRand() < cnk0[ipl]) {
300 if (targetCode == protonCode) {
301 pv[0] = AntiKaonZero;
302 pv[1] = Neutron;
303 return;
304 } else {
305 return;
306 }
307 }
308 G4double ran = G4UniformRand();
309 if (targetCode == protonCode) { // target is a proton
310 if( ran < 0.25 )
311 {
312 pv[0] = PionMinus;
313 pv[1] = SigmaPlus;
314 }
315 else if (ran < 0.50)
316 {
317 pv[0] = PionZero;
318 pv[1] = SigmaZero;
319 }
320 else if (ran < 0.75)
321 {
322 pv[0] = PionPlus;
323 pv[1] = SigmaMinus;
324 }
325 else
326 {
327 pv[0] = PionZero;
328 pv[1] = Lambda;
329 }
330 } else { // target is a neutron
331 if( ran < 0.25 )
332 {
333 }
334 else if (ran < 0.50)
335 {
336 pv[0] = PionMinus;
337 pv[1] = SigmaZero;
338 }
339 else if (ran < 0.75)
340 {
341 pv[0] = PionZero;
342 pv[1] = SigmaMinus;
343 }
344 else
345 {
346 pv[0] = PionMinus;
347 pv[1] = Lambda;
348 }
349 }
350 return;
351 } else {
352 // number of total particles vs. centre of mass Energy - 2*proton mass
353 G4double aleab = std::log(availableEnergy);
354 G4double n = 3.62567+aleab*(0.665843+aleab*(0.336514
355 + aleab*(0.117712+0.0136912*aleab))) - 2.0;
356
357 // normalization constant for kno-distribution.
358 // calculate first the sum of all constants, check for numerical problems.
359 G4double test, dum, anpn = 0.0;
360
361 for (nt=1; nt<=numSec; nt++) {
362 test = std::exp( Amin( expxu, Amax( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
363 dum = pi*nt/(2.0*n*n);
364 if (std::fabs(dum) < 1.0) {
365 if( test >= 1.0e-10 )anpn += dum*test;
366 } else {
367 anpn += dum*test;
368 }
369 }
370
371 G4double ran = G4UniformRand();
372 G4double excs = 0.0;
373 if( targetCode == protonCode )
374 {
375 counter = -1;
376 for( npos=0; npos<numSec/3; npos++ )
377 {
378 for( nneg=Imax(0,npos-1); nneg<=npos+1; nneg++ )
379 {
380 for (nzero=0; nzero<numSec/3; nzero++) {
381 if (++counter < numMul) {
382 nt = npos+nneg+nzero;
383 if ( (nt>0) && (nt<=numSec) ) {
384 test = std::exp( Amin( expxu, Amax( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
385 dum = (pi/anpn)*nt*protmul[counter]*protnorm[nt-1]/(2.0*n*n);
386 if (std::fabs(dum) < 1.0) {
387 if( test >= 1.0e-10 )excs += dum*test;
388 } else {
389 excs += dum*test;
390 }
391
392 if (ran < excs) goto outOfLoop; //----------------------->
393 }
394 }
395 }
396 }
397 }
398
399 // 3 previous loops continued to the end
400 inElastic = false; // quasi-elastic scattering
401 return;
402 }
403 else
404 { // target must be a neutron
405 counter = -1;
406 for( npos=0; npos<numSec/3; npos++ )
407 {
408 for( nneg=npos; nneg<=(npos+2); nneg++ )
409 {
410 for (nzero=0; nzero<numSec/3; nzero++) {
411 if (++counter < numMul) {
412 nt = npos+nneg+nzero;
413 if ( (nt>=1) && (nt<=numSec) ) {
414 test = std::exp( Amin( expxu, Amax( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
415 dum = (pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
416 if (std::fabs(dum) < 1.0) {
417 if( test >= 1.0e-10 )excs += dum*test;
418 } else {
419 excs += dum*test;
420 }
421 if (ran < excs) goto outOfLoop; // -------------------------->
422 }
423 }
424 }
425 }
426 }
427 // 3 previous loops continued to the end
428 inElastic = false; // quasi-elastic scattering.
429 return;
430 }
431 }
432 outOfLoop: // <---------------------------------------------
433
434 if( targetCode == protonCode)
435 {
436 if( npos == (1+nneg))
437 {
438 pv[1] = Neutron;
439 }
440 else if (npos == nneg)
441 {
442 if( G4UniformRand() < 0.75)
443 {
444 }
445 else
446 {
447 pv[0] = AntiKaonZero;
448 pv[1] = Neutron;
449 }
450 }
451 else
452 {
453 pv[0] = AntiKaonZero;
454 }
455 }
456 else
457 {
458 if( npos == (nneg-1))
459 {
460 if( G4UniformRand() < 0.5)
461 {
462 pv[1] = Proton;
463 }
464 else
465 {
466 pv[0] = AntiKaonZero;
467 }
468 }
469 else if ( npos == nneg)
470 {
471 }
472 else
473 {
474 pv[0] = AntiKaonZero;
475 pv[1] = Proton;
476 }
477 }
478
479 if( G4UniformRand() < 0.5 )
480 {
481 if( ( (pv[0].getCode() == kaonMinusCode)
482 && (pv[1].getCode() == neutronCode) )
483 || ( (pv[0].getCode() == kaonZeroCode)
484 && (pv[1].getCode() == protonCode) )
485 || ( (pv[0].getCode() == antiKaonZeroCode)
486 && (pv[1].getCode() == protonCode) ) )
487 {
488 G4double ran = G4UniformRand();
489 if( pv[1].getCode() == protonCode)
490 {
491 if(ran < 0.68)
492 {
493 pv[0] = PionPlus;
494 pv[1] = Lambda;
495 }
496 else if (ran < 0.84)
497 {
498 pv[0] = PionZero;
499 pv[1] = SigmaPlus;
500 }
501 else
502 {
503 pv[0] = PionPlus;
504 pv[1] = SigmaZero;
505 }
506 }
507 else
508 {
509 if(ran < 0.68)
510 {
511 pv[0] = PionMinus;
512 pv[1] = Lambda;
513 }
514 else if (ran < 0.84)
515 {
516 pv[0] = PionMinus;
517 pv[1] = SigmaZero;
518 }
519 else
520 {
521 pv[0] = PionZero;
522 pv[1] = SigmaMinus;
523 }
524 }
525 }
526 else
527 {
528 G4double ran = G4UniformRand();
529 if (ran < 0.67)
530 {
531 pv[0] = PionZero;
532 pv[1] = Lambda;
533 }
534 else if (ran < 0.78)
535 {
536 pv[0] = PionMinus;
537 pv[1] = SigmaPlus;
538 }
539 else if (ran < 0.89)
540 {
541 pv[0] = PionZero;
542 pv[1] = SigmaZero;
543 }
544 else
545 {
546 pv[0] = PionPlus;
547 pv[1] = SigmaMinus;
548 }
549 }
550 }
551
552
553 nt = npos + nneg + nzero;
554 while ( nt > 0)
555 {
556 G4double ran = G4UniformRand();
557 if ( ran < (G4double)npos/nt)
558 {
559 if( npos > 0 )
560 { pv[vecLen++] = PionPlus;
561 npos--;
562 }
563 }
564 else if ( ran < (G4double)(npos+nneg)/nt)
565 {
566 if( nneg > 0 )
567 {
568 pv[vecLen++] = PionMinus;
569 nneg--;
570 }
571 }
572 else
573 {
574 if( nzero > 0 )
575 {
576 pv[vecLen++] = PionZero;
577 nzero--;
578 }
579 }
580 nt = npos + nneg + nzero;
581 }
582 if (verboseLevel > 1)
583 {
584 G4cout << "Particles produced: " ;
585 G4cout << pv[0].getName() << " " ;
586 G4cout << pv[1].getName() << " " ;
587 for (i=2; i < vecLen; i++)
588 {
589 G4cout << pv[i].getName() << " " ;
590 }
591 G4cout << G4endl;
592 }
593 return;
594 }
@ neutronCode
G4HEVector PionPlus
G4HEVector SigmaZero
G4HEVector KaonZero
G4double pmltpc(G4int np, G4int nm, G4int nz, G4int n, G4double b, G4double c)
G4HEVector Lambda
G4HEVector SigmaPlus
G4double Amin(G4double a, G4double b)
G4HEVector SigmaMinus
G4HEVector Neutron
G4int Imin(G4int a, G4int b)
G4HEVector PionMinus
G4double Amax(G4double a, G4double b)
G4HEVector PionZero
G4HEVector KaonMinus
G4HEVector Proton
G4HEVector AntiKaonZero
G4int Imax(G4int a, G4int b)
G4int getCode() const
Definition: G4HEVector.cc:426
G4double getTotalMomentum() const
Definition: G4HEVector.cc:166
G4String getName() const
Definition: G4HEVector.cc:431
const G4double pi

Referenced by ApplyYourself().

◆ GetNumberOfSecondaries()

G4int G4HEKaonMinusInelastic::GetNumberOfSecondaries ( )
inline

Definition at line 75 of file G4HEKaonMinusInelastic.hh.

75{return vecLength;}

◆ ModelDescription()

void G4HEKaonMinusInelastic::ModelDescription ( std::ostream &  outFile) const
virtual

Reimplemented from G4HadronicInteraction.

Definition at line 43 of file G4HEKaonMinusInelastic.cc.

44{
45 outFile << "G4HEKaonMinusInelastic is one of the High Energy\n"
46 << "Parameterized (HEP) models used to implement inelastic\n"
47 << "K- scattering from nuclei. It is a re-engineered\n"
48 << "version of the GHEISHA code of H. Fesefeldt. It divides the\n"
49 << "initial collision products into backward- and forward-going\n"
50 << "clusters which are then decayed into final state hadrons.\n"
51 << "The model does not conserve energy on an event-by-event\n"
52 << "basis. It may be applied to K- with initial energies\n"
53 << "above 20 GeV.\n";
54}

Member Data Documentation

◆ vecLength

G4int G4HEKaonMinusInelastic::vecLength

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