44 outFile <<
"G4HEKaonPlusInelastic is one of the High Energy\n"
45 <<
"Parameterized (HEP) models used to implement inelastic\n"
46 <<
"K+ scattering from nuclei. It is a re-engineered\n"
47 <<
"version of the GHEISHA code of H. Fesefeldt. It divides the\n"
48 <<
"initial collision products into backward- and forward-going\n"
49 <<
"clusters which are then decayed into final state hadrons.\n"
50 <<
"The model does not conserve energy on an event-by-event\n"
51 <<
"basis. It may be applied to K+ with initial energies\n"
76 G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
78 if (incidentKineticEnergy < 1.)
79 G4cout <<
"GHEKaonPlusInelastic: incident energy < 1 GeV" <<
G4endl;
82 G4cout <<
"G4HEKaonPlusInelastic::ApplyYourself" <<
G4endl;
84 <<
"mass " << incidentMass
85 <<
"kinetic energy " << incidentKineticEnergy
87 G4cout <<
"target material with (A,Z) = ("
88 << atomicWeight <<
"," << atomicNumber <<
")" <<
G4endl;
92 atomicWeight, atomicNumber);
94 G4cout <<
"nuclear inelasticity = " << inelasticity <<
G4endl;
96 incidentKineticEnergy -= inelasticity;
102 atomicWeight, atomicNumber,
104 excitationEnergyDTA);
106 G4cout <<
"nuclear excitation = " << excitation << excitationEnergyGNP
107 << excitationEnergyDTA <<
G4endl;
109 incidentKineticEnergy -= excitation;
110 incidentTotalEnergy = incidentKineticEnergy + incidentMass;
124 G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
125 + targetMass*targetMass
126 + 2.0*targetMass*incidentTotalEnergy);
127 G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
133 G4cout <<
"ApplyYourself: CallFirstIntInCascade for particle "
134 << incidentCode <<
G4endl;
136 G4bool successful =
false;
139 incidentParticle, targetParticle, atomicWeight);
142 G4cout <<
"ApplyYourself::StrangeParticlePairProduction" <<
G4endl;
144 if ((
vecLength > 0) && (availableEnergy > 1.))
147 incidentParticle, targetParticle);
150 excitationEnergyGNP, excitationEnergyDTA,
151 incidentParticle, targetParticle,
152 atomicWeight, atomicNumber);
155 excitationEnergyGNP, excitationEnergyDTA,
156 incidentParticle, targetParticle,
157 atomicWeight, atomicNumber);
160 excitationEnergyGNP, excitationEnergyDTA,
161 incidentParticle, targetParticle,
162 atomicWeight, atomicNumber);
166 excitationEnergyGNP, excitationEnergyDTA,
167 incidentParticle, targetParticle,
168 atomicWeight, atomicNumber);
171 excitationEnergyGNP, excitationEnergyDTA,
172 incidentParticle, targetParticle,
173 atomicWeight, atomicNumber);
177 atomicWeight, atomicNumber);
180 G4cout <<
"GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
208 static const G4double expxl = -expxu;
214 static const G4int numMul = 1200;
215 static const G4int numSec = 60;
223 static G4bool first =
true;
224 static G4double protmul[numMul], protnorm[numSec];
225 static G4double neutmul[numMul], neutnorm[numSec];
230 G4int i, counter, nt, npos, nneg, nzero;
235 for( i=0; i<numMul; i++ )protmul[i] = 0.0;
236 for( i=0; i<numSec; i++ )protnorm[i] = 0.0;
238 for( npos=0; npos<(numSec/3); npos++ )
240 for( nneg=
Imax(0,npos-2); nneg<=npos; nneg++ )
242 for( nzero=0; nzero<numSec/3; nzero++ )
244 if( ++counter < numMul )
246 nt = npos+nneg+nzero;
247 if( (nt>0) && (nt<=numSec) )
250 pmltpc(npos,nneg,nzero,nt,protb,c) ;
251 protnorm[nt-1] += protmul[counter];
257 for( i=0; i<numMul; i++ )neutmul[i] = 0.0;
258 for( i=0; i<numSec; i++ )neutnorm[i] = 0.0;
260 for( npos=0; npos<numSec/3; npos++ )
262 for( nneg=
Imax(0,npos-1); nneg<=(npos+1); nneg++ )
264 for( nzero=0; nzero<numSec/3; nzero++ )
266 if( ++counter < numMul )
268 nt = npos+nneg+nzero;
269 if( (nt>0) && (nt<=numSec) )
272 pmltpc(npos,nneg,nzero,nt,neutb,c);
273 neutnorm[nt-1] += neutmul[counter];
279 for( i=0; i<numSec; i++ )
281 if( protnorm[i] > 0.0 )protnorm[i] = 1.0/protnorm[i];
282 if( neutnorm[i] > 0.0 )neutnorm[i] = 1.0/neutnorm[i];
289 pv[0] = incidentParticle;
290 pv[1] = targetParticle;
297 G4double cech[] = {0.33,0.27,0.29,0.31,0.27,0.18,0.13,0.10,0.09,0.07};
299 if(
G4UniformRand() < cech[iplab]/std::pow(atomicWeight,0.42) )
312 npos = 0, nneg = 0, nzero = 0;
316 G4double supp[] = {0., 0.4, 0.55, 0.65, 0.75, 0.82, 0.86, 0.90, 0.94, 0.98};
322 if( targetCode == protonCode )
324 w0 = -
sqr(1.+protb)/(2.*c*c);
325 wp = w0 = std::exp(w0);
328 { npos = 0; nneg = 0; nzero = 1; }
330 { npos = 1; nneg = 0; nzero = 0; }
334 w0 = -
sqr(1.+neutb)/(2.*c*c);
335 wp = w0 = std::exp(w0);
336 wm = -
sqr(-1.+neutb)/(2.*c*c);
342 { npos = 0; nneg = 0; nzero = 1; }
343 else if( ran < wp/wt)
344 { npos = 1; nneg = 0; nzero = 0; }
346 { npos = 0; nneg = 1; nzero = 0; }
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;
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;
373 if( targetCode == protonCode )
376 for( npos=0; npos<numSec/3; npos++ )
378 for( nneg=
Imax(0,npos-2); nneg<=npos; nneg++ )
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;
391 if (ran < excs)
goto outOfLoop;
405 for( npos=0; npos<numSec/3; npos++ )
407 for( nneg=
Imax(0,npos-1); nneg<=(npos+1); nneg++ )
409 for (nzero=0; nzero<numSec/3; nzero++) {
410 if (++counter < numMul) {
411 nt = npos+nneg+nzero;
412 if ( (nt>=1) && (nt<=numSec) ) {
413 test = std::exp(
Amin( expxu,
Amax( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
414 dum = (pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
415 if (std::fabs(dum) < 1.0) {
416 if( test >= 1.0e-10 )excs += dum*test;
420 if (ran < excs)
goto outOfLoop;
433 if( targetCode == protonCode)
438 else if (npos == (1+nneg))
468 else if ( npos == (1+nneg))
479 nt = npos + nneg + nzero;
490 else if ( ran < (
G4double)(npos+nneg)/nt)
506 nt = npos + nneg + nzero;
510 G4cout <<
"Particles produced: " ;
513 for (i=2; i < vecLen; i++)
G4DLLIMPORT std::ostream G4cout
G4double pmltpc(G4int np, G4int nm, G4int nz, G4int n, G4double b, G4double c)
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)
G4double Amin(G4double a, G4double b)
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)
G4double Amax(G4double a, G4double b)
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)
G4int Imax(G4int a, G4int b)
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)
virtual void ModelDescription(std::ostream &) const
void FirstIntInCasKaonPlus(G4bool &inElastic, const G4double availableEnergy, G4HEVector pv[], G4int &vecLen, const G4HEVector &incidentParticle, const G4HEVector &targetParticle, const G4double atomicWeight)
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
G4double getEnergy() const
G4double getTotalMomentum() const
void setDefinition(G4String name)
void SetStatusChange(G4HadFinalStateStatus aS)
G4HadFinalState theParticleChange