source: trunk/source/processes/hadronic/models/high_energy/src/G4HEKaonZeroInelastic.cc @ 1347

Last change on this file since 1347 was 1347, checked in by garnier, 13 years ago

geant4 tag 9.4

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