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

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

geant4 tag 9.4

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// $Id: G4HEAntiKaonZeroInelastic.cc,v 1.18 2010/11/27 00:06:50 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 is the low energy stuff like
36// nuclear reactions, nuclear fission without any cascading and all processes for
37// 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 "G4HEAntiKaonZeroInelastic.hh"
43
44G4HadFinalState*
45G4HEAntiKaonZeroInelastic::ApplyYourself(const G4HadProjectile& aTrack,
46                                         G4Nucleus& targetNucleus)
47{
48  G4HEVector* pv = new G4HEVector[MAXPART];
49  const G4HadProjectile* aParticle = &aTrack;
50  const G4double atomicWeight = targetNucleus.GetN();
51  const G4double atomicNumber = targetNucleus.GetZ();
52  G4HEVector incidentParticle(aParticle);
53
54  G4int incidentCode = incidentParticle.getCode();
55  G4double incidentMass = incidentParticle.getMass();
56  G4double incidentTotalEnergy = incidentParticle.getEnergy();
57  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
58  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
59
60  if (incidentKineticEnergy < 1.)
61    G4cout << "GHEAntiKaonZeroInelastic: incident energy < 1 GeV" << G4endl;
62
63  if (verboseLevel > 1) {
64    G4cout << "G4HEAntiKaonZeroInelastic::ApplyYourself" << G4endl;
65    G4cout << "incident particle " << incidentParticle.getName()
66           << "mass "              << incidentMass
67           << "kinetic energy "    << incidentKineticEnergy
68           << G4endl;
69    G4cout << "target material with (A,Z) = (" 
70           << atomicWeight << "," << atomicNumber << ")" << G4endl;
71  }
72   
73  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy, 
74                                              atomicWeight, atomicNumber);
75  if (verboseLevel > 1)
76    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
77   
78  incidentKineticEnergy -= inelasticity;
79   
80  G4double excitationEnergyGNP = 0.;
81  G4double excitationEnergyDTA = 0.; 
82
83  G4double excitation = NuclearExcitation(incidentKineticEnergy,
84                                          atomicWeight, atomicNumber,
85                                          excitationEnergyGNP,
86                                          excitationEnergyDTA);
87  if (verboseLevel > 1)
88    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
89           << excitationEnergyDTA << G4endl;             
90
91
92  incidentKineticEnergy -= excitation;
93  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
94  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
95                                    *(incidentTotalEnergy+incidentMass));
96
97  G4HEVector targetParticle;
98  if (G4UniformRand() < atomicNumber/atomicWeight) { 
99    targetParticle.setDefinition("Proton");
100  } else { 
101    targetParticle.setDefinition("Neutron");
102  }
103
104  G4double targetMass = targetParticle.getMass();
105  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
106                                         + targetMass*targetMass
107                                         + 2.0*targetMass*incidentTotalEnergy);
108  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
109
110  vecLength = 0;           
111       
112  if (verboseLevel > 1)
113    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
114           << incidentCode << G4endl;
115
116  G4bool successful = false; 
117
118  G4bool inElastic = true; 
119  FirstIntInCasAntiKaonZero(inElastic, availableEnergy, pv, vecLength,
120                            incidentParticle, targetParticle );
121
122  if (verboseLevel > 1)
123    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
124
125  if ((vecLength > 0) && (availableEnergy > 1.)) 
126    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
127                                  pv, vecLength,
128                                  incidentParticle, targetParticle);
129  HighEnergyCascading(successful, pv, vecLength,
130                      excitationEnergyGNP, excitationEnergyDTA,
131                      incidentParticle, targetParticle,
132                      atomicWeight, atomicNumber);
133  if (!successful)
134    HighEnergyClusterProduction(successful, pv, vecLength,
135                                excitationEnergyGNP, excitationEnergyDTA,
136                                incidentParticle, targetParticle,
137                                atomicWeight, atomicNumber);
138  if (!successful) 
139    MediumEnergyCascading(successful, pv, vecLength, 
140                          excitationEnergyGNP, excitationEnergyDTA, 
141                          incidentParticle, targetParticle,
142                          atomicWeight, atomicNumber);
143  if (!successful)
144    MediumEnergyClusterProduction(successful, pv, vecLength,
145                                  excitationEnergyGNP, excitationEnergyDTA,       
146                                  incidentParticle, targetParticle,
147                                  atomicWeight, atomicNumber);
148  if (!successful)
149    QuasiElasticScattering(successful, pv, vecLength,
150                           excitationEnergyGNP, excitationEnergyDTA,
151                           incidentParticle, targetParticle, 
152                           atomicWeight, atomicNumber);
153  if (!successful)
154    ElasticScattering(successful, pv, vecLength,
155                      incidentParticle,   
156                      atomicWeight, atomicNumber);
157
158  if (!successful) 
159    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
160           << G4endl;
161
162  FillParticleChange(pv,  vecLength);
163  delete [] pv;
164  theParticleChange.SetStatusChange(stopAndKill);
165  return &theParticleChange;
166}
167
168
169void
170G4HEAntiKaonZeroInelastic::FirstIntInCasAntiKaonZero(G4bool& inElastic,
171                                                     const G4double availableEnergy,
172                                                     G4HEVector pv[],
173                                                     G4int &vecLen,
174                                                     const G4HEVector& incidentParticle,
175                                                     const G4HEVector& targetParticle)
176
177// AntiKaon0 undergoes interaction with nucleon within a nucleus.  Check if it
178// is energetically possible to produce pions/kaons.  In not, assume nuclear
179// excitation occurs and input particle is degraded in energy.  No other
180// particles are produced.
181// If reaction is possible, find the correct number of pions/protons/neutrons
182// produced using an interpolation to multiplicity data.  Replace some pions or
183// protons/neutrons by kaons or strange baryons according to the average
184// multiplicity per inelastic reaction.
185{
186  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
187  static const G4double expxl = -expxu;             // lower bound for arg. of exp
188
189  static const G4double protb = 0.7;
190  static const G4double neutb = 0.7;
191  static const G4double     c = 1.25;
192
193  static const G4int numMul = 1200;
194  static const G4int numSec = 60;
195
196  G4int neutronCode = Neutron.getCode();
197  G4int protonCode = Proton.getCode();
198  G4int kaonMinusCode = KaonMinus.getCode();
199  G4int kaonZeroCode = KaonZero.getCode();
200  G4int antiKaonZeroCode = AntiKaonZero.getCode(); 
201
202  G4int targetCode = targetParticle.getCode();
203  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
204
205  static G4bool first = true;
206  static G4double protmul[numMul], protnorm[numSec];  // proton constants
207  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
208
209  // misc. local variables
210  // np = number of pi+,  nm = number of pi-,  nz = number of pi0
211
212  G4int i, counter, nt, np, nm, nz;
213
214   if( first ) 
215     {                   // compute normalization constants, this will only be done once
216       first = false;
217       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
218       for( i=0; i<numSec; i++ )protnorm[i] = 0.0;
219       counter = -1;
220       for( np=0; np<(numSec/3); np++ ) 
221          {
222            for( nm=std::max(0,np-2); nm<=np; nm++ ) 
223               {
224                 for( nz=0; nz<numSec/3; nz++ ) 
225                    {
226                      if( ++counter < numMul ) 
227                        {
228                          nt = np+nm+nz;
229                          if( (nt>0) && (nt<=numSec) ) 
230                            {
231                              protmul[counter] =
232                                    pmltpc(np,nm,nz,nt,protb,c) ;
233                              protnorm[nt-1] += protmul[counter];
234                            }
235                        }
236                    }
237               }
238          }
239       for( i=0; i<numMul; i++ )neutmul[i]  = 0.0;
240       for( i=0; i<numSec; i++ )neutnorm[i] = 0.0;
241       counter = -1;
242       for( np=0; np<numSec/3; np++ ) 
243          {
244            for( nm=std::max(0,np-1); nm<=(np+1); nm++ ) 
245               {
246                 for( nz=0; nz<numSec/3; nz++ ) 
247                    {
248                      if( ++counter < numMul ) 
249                        {
250                          nt = np+nm+nz;
251                          if( (nt>0) && (nt<=numSec) ) 
252                            {
253                               neutmul[counter] =
254                                      pmltpc(np,nm,nz,nt,neutb,c);
255                               neutnorm[nt-1] += neutmul[counter];
256                            }
257                        }
258                    }
259               }
260          }
261       for( i=0; i<numSec; i++ ) 
262          {
263            if( protnorm[i] > 0.0 )protnorm[i] = 1.0/protnorm[i];
264            if( neutnorm[i] > 0.0 )neutnorm[i] = 1.0/neutnorm[i];
265          }
266     }                                          // end of initialization
267
268         
269                                              // initialize the first two places
270                                              // the same as beam and target                                   
271   pv[0] = incidentParticle;
272   pv[1] = targetParticle;
273   vecLen = 2;
274
275   if (!inElastic || (availableEnergy <= PionPlus.getMass())) 
276      return;
277
278                                       
279//                                            inelastic scattering
280
281   np = 0, nm = 0, nz = 0;
282   G4double cech[] = { 1., 1., 1., 0.70, 0.60, 0.55, 0.35, 0.25, 0.18, 0.15};
283   G4int iplab = G4int( incidentTotalMomentum*5.);
284   if( (iplab < 10) && (G4UniformRand() < cech[iplab]) ) 
285     {
286       G4int     iplab = std::min(19, G4int( incidentTotalMomentum*5.));
287       G4double cnk0[] = {0.17, 0.18, 0.17, 0.24, 0.26, 0.20, 0.22, 0.21, 0.34, 0.45,
288                          0.58, 0.55, 0.36, 0.29, 0.29, 0.32, 0.32, 0.33, 0.33, 0.33};
289       if( G4UniformRand() < cnk0[iplab] )
290         {
291           if( targetCode == protonCode )
292             {
293               return;
294             }
295           else
296             {
297               pv[0] = KaonMinus;
298               pv[1] = Proton;
299               return;
300             }
301         }
302       G4double ran = G4UniformRand();
303       if( targetCode == protonCode )                    // target is a proton
304         {
305           if( ran < 0.25 )
306             { 
307             } 
308           else if (ran < 0.50)
309             {
310               pv[0] = PionPlus;
311               pv[1] = SigmaZero;
312             }
313           else if (ran < 0.75)
314             {
315             }
316           else
317             {
318               pv[0] = PionPlus;
319               pv[1] = Lambda;
320             }
321         } 
322       else 
323         {                                               // target is a neutron
324           if( ran < 0.25 )
325             { 
326               pv[0] = PionMinus;
327               pv[1] = SigmaPlus;
328             } 
329           else if (ran < 0.50)
330             {
331               pv[0] = PionZero;
332               pv[1] = SigmaZero;
333             }
334           else if (ran < 0.75)
335             { 
336               pv[0] = PionPlus;
337               pv[1] = SigmaMinus;
338             }
339           else
340             {
341               pv[0] = PionZero;
342               pv[1] = Lambda;
343             }
344         }
345       return;
346     }
347   else
348     {
349//                    number of total particles vs. centre of mass Energy - 2*proton mass
350   
351       G4double aleab = std::log(availableEnergy);
352       G4double n     = 3.62567+aleab*(0.665843+aleab*(0.336514
353                    + aleab*(0.117712+0.0136912*aleab))) - 2.0;
354   
355//                    normalization constant for kno-distribution.
356//                    calculate first the sum of all constants, check for numerical problems.   
357       G4double test, dum, anpn = 0.0;
358
359       for (nt=1; nt<=numSec; nt++) {
360         test = std::exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
361         dum = pi*nt/(2.0*n*n);
362         if (std::fabs(dum) < 1.0) { 
363           if( test >= 1.0e-10 )anpn += dum*test;
364         } else { 
365           anpn += dum*test;
366         }
367       }
368   
369       G4double ran = G4UniformRand();
370       G4double excs = 0.0;
371       if (targetCode == protonCode) {
372         counter = -1;
373         for (np=0; np<numSec/3; np++) {
374           for (nm=std::max(0,np-2); nm<=np; nm++) {
375             for (nz=0; nz<numSec/3; nz++) {
376               if (++counter < numMul) {
377                 nt = np+nm+nz;
378                 if( (nt>0) && (nt<=numSec) ) {
379                   test = std::exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
380                   dum = (pi/anpn)*nt*protmul[counter]*protnorm[nt-1]/(2.0*n*n);
381
382                   if (std::fabs(dum) < 1.0) { 
383                     if( test >= 1.0e-10 )excs += dum*test;
384                   } else { 
385                     excs += dum*test;
386                   }
387
388                   if (ran < excs) goto outOfLoop;      //----------------------->
389                 }
390               }
391             }
392           }
393         }
394                                            // 3 previous loops continued to the end
395         inElastic = false;                 // quasi-elastic scattering   
396         return;
397
398       } else {         // target must be a neutron
399         counter = -1;
400         for (np=0; np<numSec/3; np++) {
401           for (nm=std::max(0,np-1); nm<=(np+1); nm++) {
402             for (nz=0; nz<numSec/3; nz++) {
403               if (++counter < numMul) {
404                 nt = np+nm+nz;
405                 if( (nt>=1) && (nt<=numSec) ) {
406                   test = std::exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
407                   dum = (pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
408
409                   if (std::fabs(dum) < 1.0) { 
410                     if( test >= 1.0e-10 )excs += dum*test;
411                   } else { 
412                     excs += dum*test;
413                   }
414
415                   if (ran < excs) goto outOfLoop;       // -------------------------->
416                 }
417               }
418             }
419           }
420         }
421                                                  // 3 previous loops continued to the end
422         inElastic = false;                     // quasi-elastic scattering.
423         return;
424       }
425     } 
426   outOfLoop:           //  <------------------------------------------------------------------------   
427   
428   if( targetCode == protonCode)
429     {
430       if( np == nm)
431         {
432         }
433       else if (np == (1+nm))
434         {
435           if( G4UniformRand() < 0.5)
436             {
437               pv[0] = KaonMinus;
438             }
439           else
440             {
441               pv[1] = Neutron;
442             }
443         }
444       else     
445         {
446           pv[0] = KaonMinus;
447           pv[1] = Neutron;
448         } 
449     } 
450   else
451     {
452       if( np == nm)
453         {
454           if( G4UniformRand() < 0.75)
455             {
456             }
457           else
458             {
459               pv[0] = KaonMinus;
460               pv[1] = Proton;
461             }
462         } 
463       else if ( np == (1+nm))
464         {
465           pv[0] = KaonMinus;
466         }
467       else
468         {
469           pv[1] = Proton;
470         }
471     }     
472
473
474   if( G4UniformRand() < 0.5 )   
475     {
476       if(    (    (pv[0].getCode() == kaonMinusCode)
477                && (pv[1].getCode() == neutronCode)  )
478           || (    (pv[0].getCode() == kaonZeroCode)
479                && (pv[1].getCode() == protonCode)   )
480           || (    (pv[0].getCode() == antiKaonZeroCode)
481                && (pv[1].getCode() == protonCode)   )   )
482         {
483           G4double ran = G4UniformRand();
484           if( pv[1].getCode() == protonCode)
485             { 
486               if(ran < 0.68)
487                 {
488                   pv[0] = PionPlus;
489                   pv[1] = Lambda;
490                 }
491               else if (ran < 0.84)
492                 {
493                   pv[0] = PionZero;
494                   pv[1] = SigmaPlus;
495                 }
496               else
497                 {
498                   pv[0] = PionPlus;
499                   pv[1] = SigmaZero;
500                 }
501             }
502           else
503             {
504               if(ran < 0.68)
505                 {
506                   pv[0] = PionMinus;
507                   pv[1] = Lambda;
508                 }
509               else if (ran < 0.84)
510                 {
511                   pv[0] = PionMinus;
512                   pv[1] = SigmaZero;
513                 }
514               else
515                 {
516                   pv[0] = PionZero;
517                   pv[1] = SigmaMinus;
518                 }
519             }
520         } 
521       else
522         {
523           G4double ran = G4UniformRand();
524           if (ran < 0.67)
525              {
526                pv[0] = PionZero;
527                pv[1] = Lambda;
528              }
529           else if (ran < 0.78)
530              {
531                pv[0] = PionMinus;
532                pv[1] = SigmaPlus;
533              }
534           else if (ran < 0.89)
535              {
536                pv[0] = PionZero;
537                pv[1] = SigmaZero;
538              }
539           else
540              {
541                pv[0] = PionPlus;
542                pv[1] = SigmaMinus;
543              }
544         }
545     }
546               
547
548   nt = np + nm + nz;
549   while ( nt > 0)
550       {
551         G4double ran = G4UniformRand();
552         if ( ran < (G4double)np/nt)
553            { 
554              if( np > 0 ) 
555                { pv[vecLen++] = PionPlus;
556                  np--;
557                }
558            }
559         else if ( ran < (G4double)(np+nm)/nt)
560            {   
561              if( nm > 0 )
562                { 
563                  pv[vecLen++] = PionMinus;
564                  nm--;
565                }
566            }
567         else
568            {
569              if( nz > 0 )
570                { 
571                  pv[vecLen++] = PionZero;
572                  nz--;
573                }
574            }
575         nt = np + nm + nz;
576       } 
577   if (verboseLevel > 1)
578      {
579        G4cout << "Particles produced: " ;
580        G4cout << pv[0].getName() << " " ;
581        G4cout << pv[1].getName() << " " ;
582        for (i=2; i < vecLen; i++)   
583            { 
584              G4cout << pv[i].getName() << " " ;
585            }
586         G4cout << G4endl;
587      }
588   return;
589 }
590
591
592
593
594
595
596
Note: See TracBrowser for help on using the repository browser.