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