Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4HEKaonZeroInelastic.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// $Id$
27//
28
29// G4 Process: Gheisha High Energy Collision model.
30// This includes the high energy cascading model, the two-body-resonance model
31// and the low energy two-body model. Not included are the low energy stuff
32// like nuclear reactions, nuclear fission without any cascading and all
33// processes for particles at rest.
34// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96.
35// H. Fesefeldt, RWTH-Aachen, 23-October-1996
36
38#include "globals.hh"
39#include "G4ios.hh"
41
42void G4HEKaonZeroInelastic::ModelDescription(std::ostream& outFile) const
43{
44 outFile << "G4HEKaonZeroInelastic is one of the High Energy\n"
45 << "Parameterized (HEP) models used to implement inelastic\n"
46 << "K0 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 K0 with initial energies\n"
52 << "above 20 GeV.\n";
53}
54
55
58 G4Nucleus& targetNucleus)
59{
60 G4HEVector* pv = new G4HEVector[MAXPART];
61 const G4HadProjectile* aParticle = &aTrack;
62 const G4double A = targetNucleus.GetA_asInt();
63 const G4double Z = targetNucleus.GetZ_asInt();
64 G4HEVector incidentParticle(aParticle);
65
66 G4double atomicNumber = Z;
67 G4double atomicWeight = A;
68
69 G4int incidentCode = incidentParticle.getCode();
70 G4double incidentMass = incidentParticle.getMass();
71 G4double incidentTotalEnergy = incidentParticle.getEnergy();
72
73 // G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
74 // DHW 19 May 2011: variable set but not used
75
76 G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
77
78 if (incidentKineticEnergy < 1.)
79 G4cout << "GHEKaonZeroInelastic: incident energy < 1 GeV" << G4endl;;
80
81 if (verboseLevel > 1) {
82 G4cout << "G4HEKaonZeroInelastic::ApplyYourself" << G4endl;
83 G4cout << "incident particle " << incidentParticle.getName()
84 << "mass " << incidentMass
85 << "kinetic energy " << incidentKineticEnergy
86 << G4endl;
87 G4cout << "target material with (A,Z) = ("
88 << atomicWeight << "," << atomicNumber << ")" << G4endl;
89 }
90
91 G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
92 atomicWeight, atomicNumber);
93 if (verboseLevel > 1)
94 G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
95
96 incidentKineticEnergy -= inelasticity;
97
98 G4double excitationEnergyGNP = 0.;
99 G4double excitationEnergyDTA = 0.;
100
101 G4double excitation = NuclearExcitation(incidentKineticEnergy,
102 atomicWeight, atomicNumber,
103 excitationEnergyGNP,
104 excitationEnergyDTA);
105 if (verboseLevel > 1)
106 G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
107 << excitationEnergyDTA << G4endl;
108
109 incidentKineticEnergy -= excitation;
110 incidentTotalEnergy = incidentKineticEnergy + incidentMass;
111 // incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
112 // *(incidentTotalEnergy+incidentMass));
113 // DHW 19 May 2011: variable set but not used
114
115 G4HEVector targetParticle;
116 if (G4UniformRand() < atomicNumber/atomicWeight) {
117 targetParticle.setDefinition("Proton");
118 } else {
119 targetParticle.setDefinition("Neutron");
120 }
121
122 G4double targetMass = targetParticle.getMass();
123 G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
124 + targetMass*targetMass
125 + 2.0*targetMass*incidentTotalEnergy);
126 G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
127
128 G4bool inElastic = true;
129 vecLength = 0;
130
131 if (verboseLevel > 1)
132 G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
133 << incidentCode << G4endl;
134
135 G4bool successful = false;
136
137 FirstIntInCasKaonZero(inElastic, availableEnergy, pv, vecLength,
138 incidentParticle, targetParticle, atomicWeight);
139
140 if (verboseLevel > 1)
141 G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
142
143 if ((vecLength > 0) && (availableEnergy > 1.))
144 StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
145 pv, vecLength,
146 incidentParticle, targetParticle);
147
148 HighEnergyCascading(successful, pv, vecLength,
149 excitationEnergyGNP, excitationEnergyDTA,
150 incidentParticle, targetParticle,
151 atomicWeight, atomicNumber);
152 if (!successful)
154 excitationEnergyGNP, excitationEnergyDTA,
155 incidentParticle, targetParticle,
156 atomicWeight, atomicNumber);
157 if (!successful)
158 MediumEnergyCascading(successful, pv, vecLength,
159 excitationEnergyGNP, excitationEnergyDTA,
160 incidentParticle, targetParticle,
161 atomicWeight, atomicNumber);
162
163 if (!successful)
165 excitationEnergyGNP, excitationEnergyDTA,
166 incidentParticle, targetParticle,
167 atomicWeight, atomicNumber);
168 if (!successful)
169 QuasiElasticScattering(successful, pv, vecLength,
170 excitationEnergyGNP, excitationEnergyDTA,
171 incidentParticle, targetParticle,
172 atomicWeight, atomicNumber);
173 if (!successful)
174 ElasticScattering(successful, pv, vecLength,
175 incidentParticle,
176 atomicWeight, atomicNumber);
177
178 if (!successful)
179 G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
180 << G4endl;
181
183
184 delete [] pv;
186 return &theParticleChange;
187}
188
189
190void
192 const G4double availableEnergy,
193 G4HEVector pv[],
194 G4int& vecLen,
195 const G4HEVector& incidentParticle,
196 const G4HEVector& targetParticle,
197 const G4double atomicWeight)
198
199// Kaon0 undergoes interaction with nucleon within a nucleus. Check if it is
200// energetically possible to produce pions/kaons. In not, assume nuclear excitation
201// occurs and input particle is degraded in energy. No other particles are produced.
202// If reaction is possible, find the correct number of pions/protons/neutrons
203// produced using an interpolation to multiplicity data. Replace some pions or
204// protons/neutrons by kaons or strange baryons according to the average
205// multiplicity per inelastic reaction.
206{
207 static const G4double expxu = 82.; // upper bound for arg. of exp
208 static const G4double expxl = -expxu; // lower bound for arg. of exp
209
210 static const G4double protb = 0.7;
211 static const G4double neutb = 0.7;
212 static const G4double c = 1.25;
213
214 static const G4int numMul = 1200;
215 static const G4int numSec = 60;
216
218 G4int protonCode = Proton.getCode();
219
220 G4int targetCode = targetParticle.getCode();
221 G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
222
223 static G4bool first = true;
224 static G4double protmul[numMul], protnorm[numSec]; // proton constants
225 static G4double neutmul[numMul], neutnorm[numSec]; // neutron constants
226
227 // misc. local variables
228 // npos = number of pi+, nneg = number of pi-, nzero = number of pi0
229
230 G4int i, counter, nt, npos, nneg, nzero;
231
232 if( first )
233 { // compute normalization constants, this will only be done once
234 first = false;
235 for( i=0; i<numMul; i++ )protmul[i] = 0.0;
236 for( i=0; i<numSec; i++ )protnorm[i] = 0.0;
237 counter = -1;
238 for( npos=0; npos<(numSec/3); npos++ )
239 {
240 for( nneg=std::max(0,npos-1); nneg<=(npos+1); nneg++ )
241 {
242 for( nzero=0; nzero<numSec/3; nzero++ )
243 {
244 if( ++counter < numMul )
245 {
246 nt = npos+nneg+nzero;
247 if( (nt>0) && (nt<=numSec) )
248 {
249 protmul[counter] =
250 pmltpc(npos,nneg,nzero,nt,protb,c) ;
251 protnorm[nt-1] += protmul[counter];
252 }
253 }
254 }
255 }
256 }
257 for( i=0; i<numMul; i++ )neutmul[i] = 0.0;
258 for( i=0; i<numSec; i++ )neutnorm[i] = 0.0;
259 counter = -1;
260 for( npos=0; npos<numSec/3; npos++ )
261 {
262 for( nneg=npos; nneg<=(npos+2); nneg++ )
263 {
264 for( nzero=0; nzero<numSec/3; nzero++ )
265 {
266 if( ++counter < numMul )
267 {
268 nt = npos+nneg+nzero;
269 if( (nt>0) && (nt<=numSec) )
270 {
271 neutmul[counter] =
272 pmltpc(npos,nneg,nzero,nt,neutb,c);
273 neutnorm[nt-1] += neutmul[counter];
274 }
275 }
276 }
277 }
278 }
279 for( i=0; i<numSec; i++ )
280 {
281 if( protnorm[i] > 0.0 )protnorm[i] = 1.0/protnorm[i];
282 if( neutnorm[i] > 0.0 )neutnorm[i] = 1.0/neutnorm[i];
283 }
284 } // end of initialization
285
286
287 // initialize the first two places
288 // the same as beam and target
289 pv[0] = incidentParticle;
290 pv[1] = targetParticle;
291 vecLen = 2;
292
293 if( !inElastic )
294 { // quasi-elastic scattering, no pions produced
295 if( targetCode == protonCode )
296 {
297 G4double cech[] = {0.33,0.27,0.29,0.31,0.27,0.18,0.13,0.10,0.09,0.07};
298 G4int iplab = G4int( std::min( 9.0, incidentTotalMomentum*5. ) );
299 if( G4UniformRand() < cech[iplab]/std::pow(atomicWeight,0.42) )
300 { // charge exchange K+ n -> K0 p
301 pv[0] = KaonPlus;
302 pv[1] = Neutron;
303 }
304 }
305 return;
306 }
307 else if (availableEnergy <= PionPlus.getMass())
308 return;
309
310 // inelastic scattering
311
312 npos = 0, nneg = 0, nzero = 0;
313 G4double eab = availableEnergy;
314 G4int ieab = G4int( eab*5.0 );
315
316 G4double supp[] = {0., 0.4, 0.55, 0.65, 0.75, 0.82, 0.86, 0.90, 0.94, 0.98};
317 if( (ieab <= 9) && (G4UniformRand() >= supp[ieab]) )
318 {
319// suppress high multiplicity events at low momentum
320// only one additional pion will be produced
321 G4double w0, wp, wm, wt, ran;
322 if( targetCode == neutronCode ) // target is a neutron
323 {
324 w0 = - sqr(1.+protb)/(2.*c*c);
325 w0 = std::exp(w0);
326 wm = - sqr(-1.+protb)/(2.*c*c);
327 wm = std::exp(wm);
328 w0 = w0/2.;
329 wm = wm*1.5;
330 if( G4UniformRand() < w0/(w0+wm) ) { npos = 0; nneg = 0; nzero = 1; }
331 else
332 { npos = 0; nneg = 1; nzero = 0; }
333 }
334 else
335 { // target is a proton
336 w0 = -sqr(1.+neutb)/(2.*c*c);
337 wp = w0 = std::exp(w0);
338 wm = -sqr(-1.+neutb)/(2.*c*c);
339 wm = std::exp(wm);
340 wt = w0+wp+wm;
341 wp = w0+wp;
342 ran = G4UniformRand();
343 if( ran < w0/wt)
344 { npos = 0; nneg = 0; nzero = 1; }
345 else if( ran < wp/wt)
346 { npos = 1; nneg = 0; nzero = 0; }
347 else
348 { npos = 0; nneg = 1; nzero = 0; }
349 }
350 }
351 else
352 {
353// number of total particles vs. centre of mass Energy - 2*proton mass
354
355 G4double aleab = std::log(availableEnergy);
356 G4double n = 3.62567+aleab*(0.665843+aleab*(0.336514
357 + aleab*(0.117712+0.0136912*aleab))) - 2.0;
358
359// normalization constant for kno-distribution.
360// calculate first the sum of all constants, check for numerical problems.
361 G4double test, dum, anpn = 0.0;
362
363 for (nt=1; nt<=numSec; nt++) {
364 test = std::exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
365 dum = pi*nt/(2.0*n*n);
366 if (std::fabs(dum) < 1.0) {
367 if( test >= 1.0e-10 )anpn += dum*test;
368 } else {
369 anpn += dum*test;
370 }
371 }
372
373 G4double ran = G4UniformRand();
374 G4double excs = 0.0;
375 if( targetCode == protonCode )
376 {
377 counter = -1;
378 for( npos=0; npos<numSec/3; npos++ )
379 {
380 for( nneg=std::max(0,npos-1); nneg<=(npos+1); nneg++ )
381 {
382 for (nzero=0; nzero<numSec/3; nzero++) {
383 if (++counter < numMul) {
384 nt = npos+nneg+nzero;
385 if ( (nt>0) && (nt<=numSec) ) {
386 test = std::exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
387 dum = (pi/anpn)*nt*protmul[counter]*protnorm[nt-1]/(2.0*n*n);
388 if (std::fabs(dum) < 1.0) {
389 if( test >= 1.0e-10 )excs += dum*test;
390 } else {
391 excs += dum*test;
392 }
393 if (ran < excs) goto outOfLoop; //----------------------->
394 }
395 }
396 }
397 }
398 }
399
400 // 3 previous loops continued to the end
401 inElastic = false; // quasi-elastic scattering
402 return;
403 }
404 else
405 { // target must be a neutron
406 counter = -1;
407 for( npos=0; npos<numSec/3; npos++ )
408 {
409 for( nneg=npos; nneg<=(npos+2); nneg++ )
410 {
411 for (nzero=0; nzero<numSec/3; nzero++) {
412 if (++counter < numMul) {
413 nt = npos+nneg+nzero;
414 if ( (nt>=1) && (nt<=numSec) ) {
415 test = std::exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
416 dum = (pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
417 if (std::fabs(dum) < 1.0) {
418 if( test >= 1.0e-10 )excs += dum*test;
419 } else {
420 excs += dum*test;
421 }
422 if (ran < excs) goto outOfLoop; // -------------------------->
423 }
424 }
425 }
426 }
427 }
428 // 3 previous loops continued to the end
429 inElastic = false; // quasi-elastic scattering.
430 return;
431 }
432 }
433 outOfLoop: // <-----------------------------------------------
434
435 if( targetCode == neutronCode)
436 {
437 if( npos == nneg)
438 {
439 }
440 else if (npos == (nneg-1))
441 {
442 if( G4UniformRand() < 0.5)
443 {
444 pv[0] = KaonPlus;
445 }
446 else
447 {
448 pv[1] = Proton;
449 }
450 }
451 else
452 {
453 pv[0] = KaonPlus;
454 pv[1] = Proton;
455 }
456 }
457 else
458 {
459 if( npos == nneg )
460 {
461 if( G4UniformRand() < 0.25)
462 {
463 pv[0] = KaonPlus;
464 pv[1] = Neutron;
465 }
466 else
467 {
468 }
469 }
470 else if ( npos == (nneg+1))
471 {
472 pv[1] = Neutron;
473 }
474 else
475 {
476 pv[0] = KaonPlus;
477 }
478 }
479
480
481 nt = npos + nneg + nzero;
482 while ( nt > 0)
483 {
484 G4double ran = G4UniformRand();
485 if ( ran < (G4double)npos/nt)
486 {
487 if( npos > 0 )
488 { pv[vecLen++] = PionPlus;
489 npos--;
490 }
491 }
492 else if ( ran < (G4double)(npos+nneg)/nt)
493 {
494 if( nneg > 0 )
495 {
496 pv[vecLen++] = PionMinus;
497 nneg--;
498 }
499 }
500 else
501 {
502 if( nzero > 0 )
503 {
504 pv[vecLen++] = PionZero;
505 nzero--;
506 }
507 }
508 nt = npos + nneg + nzero;
509 }
510 if (verboseLevel > 1)
511 {
512 G4cout << "Particles produced: " ;
513 G4cout << pv[0].getName() << " " ;
514 G4cout << pv[1].getName() << " " ;
515 for (i=2; i < vecLen; i++)
516 {
517 G4cout << pv[i].getName() << " " ;
518 }
519 G4cout << G4endl;
520 }
521 return; }
522
523
524
525
526
527
528
529
530
@ stopAndKill
@ neutronCode
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
#define G4UniformRand()
Definition: Randomize.hh:53
G4HEVector PionPlus
G4HEVector KaonPlus
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)
void QuasiElasticScattering(G4bool &successful, G4HEVector pv[], G4int &vecLen, G4double &excitationEnergyGNP, G4double &excitationEnergyDTA, const G4HEVector &incidentParticle, const G4HEVector &targetParticle, G4double atomicWeight, G4double atomicNumber)
G4HEVector Neutron
void FillParticleChange(G4HEVector pv[], G4int aVecLength)
G4HEVector PionMinus
void HighEnergyClusterProduction(G4bool &successful, G4HEVector pv[], G4int &vecLen, G4double &excitationEnergyGNP, G4double &excitationEnergyDTA, const G4HEVector &incidentParticle, const G4HEVector &targetParticle, G4double atomicWeight, G4double atomicNumber)
G4HEVector PionZero
G4double NuclearExcitation(G4double incidentKineticEnergy, G4double atomicWeight, G4double atomicNumber, G4double &excitationEnergyCascade, G4double &excitationEnergyEvaporation)
G4HEVector Proton
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)
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
void FirstIntInCasKaonZero(G4bool &inElastic, const G4double availableEnergy, G4HEVector pv[], G4int &vecLen, const G4HEVector &incidentParticle, const G4HEVector &targetParticle, const G4double atomicWeight)
virtual void ModelDescription(std::ostream &) const
G4double getEnergy() const
Definition: G4HEVector.cc:313
G4double getMass() const
Definition: G4HEVector.cc:361
G4int getCode() const
Definition: G4HEVector.cc:426
G4double getTotalMomentum() const
Definition: G4HEVector.cc:166
G4String getName() const
Definition: G4HEVector.cc:431
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
T sqr(const T &x)
Definition: templates.hh:145