source: trunk/source/processes/hadronic/models/rpg/src/G4RPGAntiXiMinusInelastic.cc@ 1201

Last change on this file since 1201 was 1196, checked in by garnier, 16 years ago

update CVS release candidate geant4.9.3.01

File size: 14.2 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: G4RPGAntiXiMinusInelastic.cc,v 1.1 2007/07/18 21:04:20 dennis Exp $
27// GEANT4 tag $Name: geant4-09-03-cand-01 $
28//
29//
30// NOTE: The FORTRAN version of the cascade, CASAXM, simply called the
31// routine for the XiMinus particle. Hence, the ApplyYourself function
32// below is just a copy of the ApplyYourself from the XiMinus particle.
33
34#include "G4RPGAntiXiMinusInelastic.hh"
35#include "Randomize.hh"
36
37G4HadFinalState*
38G4RPGAntiXiMinusInelastic::ApplyYourself( const G4HadProjectile &aTrack,
39 G4Nucleus &targetNucleus )
40{
41 const G4HadProjectile *originalIncident = &aTrack;
42 if (originalIncident->GetKineticEnergy()<= 0.1*MeV)
43 {
44 theParticleChange.SetStatusChange(isAlive);
45 theParticleChange.SetEnergyChange(aTrack.GetKineticEnergy());
46 theParticleChange.SetMomentumChange(aTrack.Get4Momentum().vect().unit());
47 return &theParticleChange;
48 }
49
50 // create the target particle
51
52 G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
53
54 if( verboseLevel > 1 )
55 {
56 const G4Material *targetMaterial = aTrack.GetMaterial();
57 G4cout << "G4RPGAntiXiMinusInelastic::ApplyYourself called" << G4endl;
58 G4cout << "kinetic energy = " << originalIncident->GetKineticEnergy()/MeV << "MeV, ";
59 G4cout << "target material = " << targetMaterial->GetName() << ", ";
60 G4cout << "target particle = " << originalTarget->GetDefinition()->GetParticleName()
61 << G4endl;
62 }
63 //
64 // Fermi motion and evaporation
65 // As of Geant3, the Fermi energy calculation had not been Done
66 //
67 G4double ek = originalIncident->GetKineticEnergy()/MeV;
68 G4double amas = originalIncident->GetDefinition()->GetPDGMass()/MeV;
69 G4ReactionProduct modifiedOriginal;
70 modifiedOriginal = *originalIncident;
71
72 G4double tkin = targetNucleus.Cinema( ek );
73 ek += tkin;
74 modifiedOriginal.SetKineticEnergy( ek*MeV );
75 G4double et = ek + amas;
76 G4double p = std::sqrt( std::abs((et-amas)*(et+amas)) );
77 G4double pp = modifiedOriginal.GetMomentum().mag()/MeV;
78 if( pp > 0.0 )
79 {
80 G4ThreeVector momentum = modifiedOriginal.GetMomentum();
81 modifiedOriginal.SetMomentum( momentum * (p/pp) );
82 }
83 //
84 // calculate black track energies
85 //
86 tkin = targetNucleus.EvaporationEffects( ek );
87 ek -= tkin;
88 modifiedOriginal.SetKineticEnergy( ek*MeV );
89 et = ek + amas;
90 p = std::sqrt( std::abs((et-amas)*(et+amas)) );
91 pp = modifiedOriginal.GetMomentum().mag()/MeV;
92 if( pp > 0.0 )
93 {
94 G4ThreeVector momentum = modifiedOriginal.GetMomentum();
95 modifiedOriginal.SetMomentum( momentum * (p/pp) );
96 }
97 G4ReactionProduct currentParticle = modifiedOriginal;
98 G4ReactionProduct targetParticle;
99 targetParticle = *originalTarget;
100 currentParticle.SetSide( 1 ); // incident always goes in forward hemisphere
101 targetParticle.SetSide( -1 ); // target always goes in backward hemisphere
102 G4bool incidentHasChanged = false;
103 G4bool targetHasChanged = false;
104 G4bool quasiElastic = false;
105 G4FastVector<G4ReactionProduct,GHADLISTSIZE> vec; // vec will contain the secondary particles
106 G4int vecLen = 0;
107 vec.Initialize( 0 );
108
109 const G4double cutOff = 0.1;
110 const G4double anni = std::min( 1.3*currentParticle.GetTotalMomentum()/GeV, 0.4 );
111 if( (currentParticle.GetKineticEnergy()/MeV > cutOff) || (G4UniformRand() > anni) )
112 Cascade( vec, vecLen,
113 originalIncident, currentParticle, targetParticle,
114 incidentHasChanged, targetHasChanged, quasiElastic );
115
116 CalculateMomenta( vec, vecLen,
117 originalIncident, originalTarget, modifiedOriginal,
118 targetNucleus, currentParticle, targetParticle,
119 incidentHasChanged, targetHasChanged, quasiElastic );
120
121 SetUpChange( vec, vecLen,
122 currentParticle, targetParticle,
123 incidentHasChanged );
124
125 delete originalTarget;
126 return &theParticleChange;
127}
128
129
130void G4RPGAntiXiMinusInelastic::Cascade(
131 G4FastVector<G4ReactionProduct,GHADLISTSIZE> &vec,
132 G4int& vecLen,
133 const G4HadProjectile *originalIncident,
134 G4ReactionProduct &currentParticle,
135 G4ReactionProduct &targetParticle,
136 G4bool &incidentHasChanged,
137 G4bool &targetHasChanged,
138 G4bool &quasiElastic )
139{
140 // Derived from H. Fesefeldt's original FORTRAN code CASAXM
141 // which is just a copy of casxm (cascade for Xi-).
142 // AntiXiMinus undergoes interaction with nucleon within a nucleus. Check if it is
143 // energetically possible to produce pions/kaons. In not, assume nuclear excitation
144 // occurs and input particle is degraded in energy. No other particles are produced.
145 // If reaction is possible, find the correct number of pions/protons/neutrons
146 // produced using an interpolation to multiplicity data. Replace some pions or
147 // protons/neutrons by kaons or strange baryons according to the average
148 // multiplicity per Inelastic reaction.
149
150 const G4double mOriginal = originalIncident->GetDefinition()->GetPDGMass()/MeV;
151 const G4double etOriginal = originalIncident->GetTotalEnergy()/MeV;
152 const G4double targetMass = targetParticle.GetMass()/MeV;
153 G4double centerofmassEnergy = std::sqrt( mOriginal*mOriginal +
154 targetMass*targetMass +
155 2.0*targetMass*etOriginal );
156 G4double availableEnergy = centerofmassEnergy-(targetMass+mOriginal);
157 if( availableEnergy <= G4PionPlus::PionPlus()->GetPDGMass()/MeV )
158 {
159 quasiElastic = true;
160 return;
161 }
162 static G4bool first = true;
163 const G4int numMul = 1200;
164 const G4int numSec = 60;
165 static G4double protmul[numMul], protnorm[numSec]; // proton constants
166 static G4double neutmul[numMul], neutnorm[numSec]; // neutron constants
167 // np = number of pi+, nm = number of pi-, nz = number of pi0
168 G4int counter, nt=0, np=0, nm=0, nz=0;
169 G4double test;
170 const G4double c = 1.25;
171 const G4double b[] = { 0.7, 0.7 };
172 if( first ) // compute normalization constants, this will only be Done once
173 {
174 first = false;
175 G4int i;
176 for( i=0; i<numMul; ++i )protmul[i] = 0.0;
177 for( i=0; i<numSec; ++i )protnorm[i] = 0.0;
178 counter = -1;
179 for( np=0; np<(numSec/3); ++np )
180 {
181 for( nm=std::max(0,np-1); nm<=(np+1); ++nm )
182 {
183 for( nz=0; nz<numSec/3; ++nz )
184 {
185 if( ++counter < numMul )
186 {
187 nt = np+nm+nz;
188 if( nt>0 && nt<=numSec )
189 {
190 protmul[counter] = Pmltpc(np,nm,nz,nt,b[0],c);
191 protnorm[nt-1] += protmul[counter];
192 }
193 }
194 }
195 }
196 }
197 for( i=0; i<numMul; ++i )neutmul[i] = 0.0;
198 for( i=0; i<numSec; ++i )neutnorm[i] = 0.0;
199 counter = -1;
200 for( np=0; np<numSec/3; ++np )
201 {
202 for( nm=np; nm<=(np+2); ++nm )
203 {
204 for( nz=0; nz<numSec/3; ++nz )
205 {
206 if( ++counter < numMul )
207 {
208 nt = np+nm+nz;
209 if( nt>0 && nt<=numSec )
210 {
211 neutmul[counter] = Pmltpc(np,nm,nz,nt,b[1],c);
212 neutnorm[nt-1] += neutmul[counter];
213 }
214 }
215 }
216 }
217 }
218 for( i=0; i<numSec; ++i )
219 {
220 if( protnorm[i] > 0.0 )protnorm[i] = 1.0/protnorm[i];
221 if( neutnorm[i] > 0.0 )neutnorm[i] = 1.0/neutnorm[i];
222 }
223 } // end of initialization
224
225 const G4double expxu = 82.; // upper bound for arg. of exp
226 const G4double expxl = -expxu; // lower bound for arg. of exp
227 G4ParticleDefinition *aNeutron = G4Neutron::Neutron();
228 G4ParticleDefinition *aProton = G4Proton::Proton();
229 G4ParticleDefinition *aKaonMinus = G4KaonMinus::KaonMinus();
230 G4ParticleDefinition *aSigmaPlus = G4SigmaPlus::SigmaPlus();
231 G4ParticleDefinition *aXiZero = G4XiZero::XiZero();
232 //
233 // energetically possible to produce pion(s) --> inelastic scattering
234 //
235 G4double n, anpn;
236 GetNormalizationConstant( availableEnergy, n, anpn );
237 G4double ran = G4UniformRand();
238 G4double dum, excs = 0.0;
239 if( targetParticle.GetDefinition() == aProton )
240 {
241 counter = -1;
242 for( np=0; np<numSec/3 && ran>=excs; ++np )
243 {
244 for( nm=std::max(0,np-1); nm<=(np+1) && ran>=excs; ++nm )
245 {
246 for( nz=0; nz<numSec/3 && ran>=excs; ++nz )
247 {
248 if( ++counter < numMul )
249 {
250 nt = np+nm+nz;
251 if( nt>0 && nt<=numSec )
252 {
253 test = std::exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
254 dum = (pi/anpn)*nt*protmul[counter]*protnorm[nt-1]/(2.0*n*n);
255 if( std::fabs(dum) < 1.0 )
256 {
257 if( test >= 1.0e-10 )excs += dum*test;
258 }
259 else
260 excs += dum*test;
261 }
262 }
263 }
264 }
265 }
266 if( ran >= excs ) // 3 previous loops continued to the end
267 {
268 quasiElastic = true;
269 return;
270 }
271 np--; nm--; nz--;
272 //
273 // number of secondary mesons determined by kno distribution
274 // check for total charge of final state mesons to determine
275 // the kind of baryons to be produced, taking into account
276 // charge and strangeness conservation
277 //
278 if( np < nm )
279 {
280 if( np+1 == nm )
281 {
282 currentParticle.SetDefinitionAndUpdateE( aXiZero );
283 incidentHasChanged = true;
284 }
285 else // charge mismatch
286 {
287 currentParticle.SetDefinitionAndUpdateE( aSigmaPlus );
288 incidentHasChanged = true;
289 //
290 // correct the strangeness by replacing a pi- by a kaon-
291 //
292 vec.Initialize( 1 );
293 G4ReactionProduct *p = new G4ReactionProduct;
294 p->SetDefinition( aKaonMinus );
295 (G4UniformRand() < 0.5) ? p->SetSide( -1 ) : p->SetSide( 1 );
296 vec.SetElement( vecLen++, p );
297 --nm;
298 }
299 }
300 else if( np == nm )
301 {
302 if( G4UniformRand() >= 0.5 )
303 {
304 currentParticle.SetDefinitionAndUpdateE( aXiZero );
305 incidentHasChanged = true;
306 targetParticle.SetDefinitionAndUpdateE( aNeutron );
307 targetHasChanged = true;
308 }
309 }
310 else
311 {
312 targetParticle.SetDefinitionAndUpdateE( aNeutron );
313 targetHasChanged = true;
314 }
315 }
316 else // target must be a neutron
317 {
318 counter = -1;
319 for( np=0; np<numSec/3 && ran>=excs; ++np )
320 {
321 for( nm=np; nm<=(np+2) && ran>=excs; ++nm )
322 {
323 for( nz=0; nz<numSec/3 && ran>=excs; ++nz )
324 {
325 if( ++counter < numMul )
326 {
327 nt = np+nm+nz;
328 if( nt>0 && nt<=numSec )
329 {
330 test = std::exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
331 dum = (pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
332 if( std::fabs(dum) < 1.0 )
333 {
334 if( test >= 1.0e-10 )excs += dum*test;
335 }
336 else
337 excs += dum*test;
338 }
339 }
340 }
341 }
342 }
343 if( ran >= excs ) // 3 previous loops continued to the end
344 {
345 quasiElastic = true;
346 return;
347 }
348 np--; nm--; nz--;
349 if( np+1 < nm )
350 {
351 if( np+2 == nm )
352 {
353 currentParticle.SetDefinitionAndUpdateE( aXiZero );
354 incidentHasChanged = true;
355 targetParticle.SetDefinitionAndUpdateE( aProton );
356 targetHasChanged = true;
357 }
358 else // charge mismatch
359 {
360 currentParticle.SetDefinitionAndUpdateE( aSigmaPlus );
361 incidentHasChanged = true;
362 targetParticle.SetDefinitionAndUpdateE( aProton );
363 targetHasChanged = true;
364 //
365 // correct the strangeness by replacing a pi- by a kaon-
366 //
367 vec.Initialize( 1 );
368 G4ReactionProduct *p = new G4ReactionProduct;
369 p->SetDefinition( aKaonMinus );
370 (G4UniformRand() < 0.5) ? p->SetSide( -1 ) : p->SetSide( 1 );
371 vec.SetElement( vecLen++, p );
372 --nm;
373 }
374 }
375 else if( np+1 == nm )
376 {
377 if( G4UniformRand() < 0.5 )
378 {
379 currentParticle.SetDefinitionAndUpdateE( aXiZero );
380 incidentHasChanged = true;
381 }
382 else
383 {
384 targetParticle.SetDefinitionAndUpdateE( aProton );
385 targetHasChanged = true;
386 }
387 }
388 }
389
390 SetUpPions( np, nm, nz, vec, vecLen );
391 return;
392}
393
394 /* end of file */
395
Note: See TracBrowser for help on using the repository browser.