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

Last change on this file since 1315 was 1315, checked in by garnier, 14 years ago

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

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