39 outFile <<
"G4LENeutronInelastic is one of the Low Energy Parameterized\n"
40 <<
"(LEP) models used to implement inelastic neutron scattering\n"
41 <<
"from nuclei. It is a re-engineered version of the GHEISHA\n"
42 <<
"code of H. Fesefeldt. It divides the initial collision\n"
43 <<
"products into backward- and forward-going clusters which are\n"
44 <<
"then decayed into final state hadrons. The model does not\n"
45 <<
"conserve energy on an event-by-event basis. It may be\n"
46 <<
"applied to neutrons with initial energies between 0 and 25\n"
63 G4cout <<
"G4LENeutronInelastic::ApplyYourself called" <<
G4endl;
65 G4cout <<
"target material = " << targetMaterial->
GetName() <<
", ";
71 modifiedOriginal = *originalIncident;
73 targetParticle = *originalTarget;
75 SlowNeutron(originalIncident, modifiedOriginal, targetParticle, targetNucleus);
77 delete originalTarget;
90 G4double p = std::sqrt( std::abs((et-amas)*(et+amas)) );
102 p = std::sqrt( std::abs((et-amas)*(et+amas)) );
110 SlowNeutron(originalIncident, modifiedOriginal, targetParticle, targetNucleus);
112 delete originalTarget;
119 G4bool incidentHasChanged =
false;
120 G4bool targetHasChanged =
false;
121 G4bool quasiElastic =
false;
126 Cascade(vec, vecLen, originalIncident, currentParticle, targetParticle,
127 incidentHasChanged, targetHasChanged, quasiElastic);
130 modifiedOriginal, targetNucleus, currentParticle,
131 targetParticle, incidentHasChanged, targetHasChanged,
134 SetUpChange(vec, vecLen, currentParticle, targetParticle, incidentHasChanged);
137 delete originalTarget;
142 void G4LENeutronInelastic::SlowNeutron(
const G4HadProjectile* originalIncident,
163 eka = 1.0 + 2.0*cost1*A + A*A;
165 G4double cost = std::min( 1.0, std::max( -1.0, (A*cost1+1.0)/std::sqrt(eka) ) );
166 eka /= (1.0+A)*(1.0+A);
171 G4double p = std::sqrt(std::abs(en*en-amas*amas));
172 G4double sint = std::sqrt(std::abs(1.0-cost*cost));
184 G4double pO = std::sqrt(pxO*pxO+pyO*pyO+pzO*pzO);
186 sint = 0.5*(std::sqrt(std::abs((1.0-cost)*(1.0+cost)))+std::sqrt(ptO)/pO);
188 if( pyO < 0.0 )ph = ph*1.5;
189 if( std::abs(pxO) > 0.000001 )ph = std::atan2(pyO,pxO);
192 px = cost*cosp*px - sinp*py+sint*cosp*pz;
193 py = cost*sinp*px + cosp*py+sint*sinp*pz;
194 pz = -sint*px + cost*pz;
198 if( pz < 0.0 )pz *= -1.0;
200 G4double pu = std::sqrt(px*px+py*py+pz*pz);
208 targetParticle.
SetTotalEnergy( std::sqrt( pp*pp + tarmas*tarmas ) );
223 massVec[0] = targetNucleus.
AtomicMass( A+1.0, Z );
224 massVec[1] = theAtomicMass;
227 massVec[2] = targetNucleus.
AtomicMass( A , Z-1.0 );
229 if (Z > 1.0 && A > 1.0)
230 massVec[3] = targetNucleus.
AtomicMass( A-1.0, Z-1.0 );
232 if (Z > 1.0 && A > 2.0 && A-2.0 > Z-1.0)
233 massVec[4] = targetNucleus.
AtomicMass( A-2.0, Z-1.0 );
235 if (Z > 2.0 && A > 3.0 && A-3.0 > Z-2.0)
236 massVec[5] = targetNucleus.
AtomicMass( A-3.0, Z-2.0 );
238 if (A > 1.0 && A-1.0 > Z)
239 massVec[6] = targetNucleus.
AtomicMass( A-1.0, Z );
240 massVec[7] = massVec[3];
242 if (Z > 2.0 && A > 1.0)
243 massVec[8] = targetNucleus.
AtomicMass( A-1.0, Z-2.0 );
246 targetNucleus, theAtomicMass, massVec );
252 for(
G4int i=0; i<vecLen; ++i )
263 void G4LENeutronInelastic::Cascade(
269 G4bool &incidentHasChanged,
286 G4double centerofmassEnergy = std::sqrt( mOriginal*mOriginal +
287 targetMass*targetMass +
288 2.0*targetMass*etOriginal );
289 G4double availableEnergy = centerofmassEnergy-(targetMass+mOriginal);
295 static G4bool first =
true;
296 const G4int numMul = 1200;
297 const G4int numSec = 60;
298 static G4double protmul[numMul], protnorm[numSec];
299 static G4double neutmul[numMul], neutnorm[numSec];
301 G4int counter,
nt=0, npos=0, nneg=0, nzero=0;
308 for( i=0; i<numMul; ++i )protmul[i] = 0.0;
309 for( i=0; i<numSec; ++i )protnorm[i] = 0.0;
311 for( npos=0; npos<numSec/3; ++npos )
313 for( nneg=std::max(0,npos-1); nneg<=(npos+1); ++nneg )
315 for( nzero=0; nzero<numSec/3; ++nzero )
317 if( ++counter < numMul )
319 nt = npos+nneg+nzero;
322 protmul[counter] =
Pmltpc(npos,nneg,nzero,nt,b[0],c) /
325 protnorm[nt-1] += protmul[counter];
331 for( i=0; i<numMul; ++i )neutmul[i] = 0.0;
332 for( i=0; i<numSec; ++i )neutnorm[i] = 0.0;
334 for( npos=0; npos<(numSec/3); ++npos )
336 for( nneg=npos; nneg<=(npos+2); ++nneg )
338 for( nzero=0; nzero<numSec/3; ++nzero )
340 if( ++counter < numMul )
342 nt = npos+nneg+nzero;
343 if( (nt>0) && (nt<=numSec) )
345 neutmul[counter] =
Pmltpc(npos,nneg,nzero,nt,b[1],c) /
348 neutnorm[nt-1] += neutmul[counter];
354 for( i=0; i<numSec; ++i )
356 if( protnorm[i] > 0.0 )protnorm[i] = 1.0/protnorm[i];
357 if( neutnorm[i] > 0.0 )neutnorm[i] = 1.0/neutnorm[i];
366 const G4double supp[] = {0.,0.4,0.55,0.65,0.75,0.82,0.86,0.90,0.94,0.98};
368 if( (availableEnergy < 2.0*GeV) && (
G4UniformRand() >= supp[ieab]) )
373 nneg = npos = nzero = 0;
376 test = std::exp( std::min( expxu, std::max( expxl, -(1.0+b[1])*(1.0+b[1])/(2.0*c*c) ) ) );
384 test = std::exp( std::min( expxu, std::max( expxl, -(1.0+b[0])*(1.0+b[0])/(2.0*c*c) ) ) );
387 test = std::exp( std::min( expxu, std::max( expxl, -(-1.0+b[0])*(-1.0+b[0])/(2.0*c*c) ) ) );
394 else if( ran < wp/wt )
407 for( npos=0; npos<numSec/3 && ran>=excs; ++npos )
409 for( nneg=std::max(0,npos-1); nneg<=(npos+1) && ran>=excs; ++nneg )
411 for( nzero=0; nzero<numSec/3 && ran>=excs; ++nzero )
413 if( ++counter < numMul )
415 nt = npos+nneg+nzero;
418 test = std::exp( std::min( expxu, std::max( expxl, -(
pi/4.0)*(nt*nt)/(n*n) ) ) );
419 dum = (
pi/anpn)*nt*protmul[counter]*protnorm[nt-1]/(2.0*n*n);
420 if( std::fabs(dum) < 1.0 ) {
421 if( test >= 1.0
e-10 )excs += dum*
test;
435 npos--; nneg--; nzero--;
438 for( npos=0; npos<numSec/3 && ran>=excs; ++npos )
440 for( nneg=npos; nneg<=(npos+2) && ran>=excs; ++nneg )
442 for( nzero=0; nzero<numSec/3 && ran>=excs; ++nzero )
444 if( ++counter < numMul )
446 nt = npos+nneg+nzero;
447 if( (nt>=1) && (nt<=numSec) )
449 test = std::exp( std::min( expxu, std::max( expxl, -(
pi/4.0)*(nt*nt)/(n*n) ) ) );
450 dum = (
pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
451 if( std::fabs(dum) < 1.0 ) {
452 if( test >= 1.0
e-10 )excs += dum*
test;
466 npos--; nneg--; nzero--;
478 incidentHasChanged =
true;
479 targetHasChanged =
true;
484 targetHasChanged =
true;
488 incidentHasChanged =
true;
498 incidentHasChanged =
true;
501 targetHasChanged =
true;
509 incidentHasChanged =
true;
510 targetHasChanged =
true;