source: trunk/source/processes/hadronic/models/high_energy/src/G4HEKaonPlusInelastic.cc @ 962

Last change on this file since 962 was 962, checked in by garnier, 15 years ago

update processes

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