41 G4cout <<
"WARNING: model G4LEProtonInelastic is being deprecated and will\n"
42 <<
"disappear in Geant4 version 10.0" <<
G4endl;
48 outFile <<
"G4LEProtonInelastic is one of the Low Energy Parameterized\n"
49 <<
"(LEP) models used to implement inelastic proton scattering\n"
50 <<
"from nuclei. It is a re-engineered version of the GHEISHA\n"
51 <<
"code of H. Fesefeldt. It divides the initial collision\n"
52 <<
"products into backward- and forward-going clusters which are\n"
53 <<
"then decayed into final state hadrons. The model does not\n"
54 <<
"conserve energy on an event-by-event basis. It may be\n"
55 <<
"applied to protons with initial energies between 0 and 25\n"
78 G4cout <<
"G4LEProtonInelastic::ApplyYourself called" <<
G4endl;
80 G4cout <<
"target material = " << targetMaterial->
GetName() <<
", ";
86 SlowProton(originalIncident, targetNucleus);
88 delete originalTarget;
98 modifiedOriginal = *originalIncident;
104 G4double p = std::sqrt( std::abs((et-amas)*(et+amas)) );
117 p = std::sqrt( std::abs((et-amas)*(et+amas)) );
125 SlowProton( originalIncident, targetNucleus);
127 delete originalTarget;
132 targetParticle = *originalTarget;
135 G4bool incidentHasChanged =
false;
136 G4bool targetHasChanged =
false;
137 G4bool quasiElastic =
false;
143 originalIncident, currentParticle, targetParticle,
144 incidentHasChanged, targetHasChanged, quasiElastic);
147 originalIncident, originalTarget, modifiedOriginal,
148 targetNucleus, currentParticle, targetParticle,
149 incidentHasChanged, targetHasChanged, quasiElastic);
152 currentParticle, targetParticle,
156 delete originalTarget;
162 G4LEProtonInelastic::SlowProton(
const G4HadProjectile* originalIncident,
172 massVec[0] = targetNucleus.
AtomicMass( A+1.0, Z+1.0 );
175 massVec[1] = targetNucleus.
AtomicMass( A , Z+1.0 );
176 massVec[2] = theAtomicMass;
178 if (A > 1.0 && A-1.0 > Z)
179 massVec[3] = targetNucleus.
AtomicMass( A-1.0, Z );
181 if (A > 2.0 && A-2.0 > Z)
182 massVec[4] = targetNucleus.
AtomicMass( A-2.0, Z );
184 if (A > 3.0 && Z > 1.0 && A-3.0 > Z-1.0)
185 massVec[5] = targetNucleus.
AtomicMass( A-3.0, Z-1.0 );
187 if (A > 1.0 && A-1.0 > Z+1.0)
188 massVec[6] = targetNucleus.
AtomicMass( A-1.0, Z+1.0 );
189 massVec[7] = massVec[3];
191 if (A > 1.0 && Z > 1.0)
192 massVec[8] = targetNucleus.
AtomicMass( A-1.0, Z-1.0 );
199 targetNucleus, theAtomicMass, massVec );
205 for(
G4int i=0; i<vecLen; ++i )
216 G4LEProtonInelastic::Cascade(
222 G4bool &incidentHasChanged,
242 G4double centerofmassEnergy = std::sqrt( mOriginal*mOriginal +
243 targetMass*targetMass +
244 2.0*targetMass*etOriginal );
245 G4double availableEnergy = centerofmassEnergy-(targetMass+mOriginal);
251 static G4bool first =
true;
252 const G4int numMul = 1200;
253 const G4int numSec = 60;
254 static G4double protmul[numMul], protnorm[numSec];
255 static G4double neutmul[numMul], neutnorm[numSec];
257 G4int counter,
nt=0, npos=0, nneg=0, nzero=0;
264 for( i=0; i<numMul; ++i )protmul[i] = 0.0;
265 for( i=0; i<numSec; ++i )protnorm[i] = 0.0;
267 for( npos=0; npos<(numSec/3); ++npos )
269 for( nneg=std::max(0,npos-2); nneg<=npos; ++nneg )
271 for( nzero=0; nzero<numSec/3; ++nzero )
273 if( ++counter < numMul )
275 nt = npos+nneg+nzero;
276 if( nt>0 && nt<=numSec )
278 protmul[counter] =
Pmltpc(npos,nneg,nzero,nt,b[0],c) /
281 protnorm[nt-1] += protmul[counter];
287 for( i=0; i<numMul; ++i )neutmul[i] = 0.0;
288 for( i=0; i<numSec; ++i )neutnorm[i] = 0.0;
290 for( npos=0; npos<numSec/3; ++npos )
292 for( nneg=std::max(0,npos-1); nneg<=(npos+1); ++nneg )
294 for( nzero=0; nzero<numSec/3; ++nzero )
296 if( ++counter < numMul )
298 nt = npos+nneg+nzero;
299 if( nt>0 && nt<=numSec )
301 neutmul[counter] =
Pmltpc(npos,nneg,nzero,nt,b[1],c) /
304 neutnorm[nt-1] += neutmul[counter];
310 for( i=0; i<numSec; ++i )
312 if( protnorm[i] > 0.0 )protnorm[i] = 1.0/protnorm[i];
313 if( neutnorm[i] > 0.0 )neutnorm[i] = 1.0/neutnorm[i];
322 const G4double supp[] = {0.,0.4,0.55,0.65,0.75,0.82,0.86,0.90,0.94,0.98};
329 npos = nneg = nzero = 0;
332 test = std::exp( std::min( expxu, std::max(
333 expxl, -(1.0+b[0])*(1.0+b[0])/(2.0*c*c) ) ) );
343 test = std::exp( std::min( expxu, std::max(
344 expxl, -(1.0+b[1])*(1.0+b[1])/(2.0*c*c) ) ) );
347 test = std::exp( std::min( expxu, std::max(
348 expxl, -(-1.0+b[1])*(-1.0+b[1])/(2.0*c*c) ) ) );
355 else if( ran < wp/wt )
370 for( npos=0; npos<numSec/3 && ran>=excs; ++npos )
372 for( nneg=std::max(0,npos-2); nneg<=npos && ran>=excs; ++nneg )
374 for( nzero=0; nzero<numSec/3 && ran>=excs; ++nzero )
376 if( ++counter < numMul )
378 nt = npos+nneg+nzero;
379 if( nt>0 && nt<=numSec )
381 test = std::exp( std::min( expxu, std::max( expxl, -(
pi/4.0)*(nt*nt)/(n*n) ) ) );
382 dum = (
pi/anpn)*nt*protmul[counter]*protnorm[nt-1]/(2.0*n*n);
383 if( std::fabs(dum) < 1.0 )
385 if( test >= 1.0
e-10 )excs += dum*
test;
403 for( npos=0; npos<numSec/3 && ran>=excs; ++npos )
405 for( nneg=std::max(0,npos-1); nneg<=(npos+1) && ran>=excs; ++nneg )
407 for( nzero=0; nzero<numSec/3 && ran>=excs; ++nzero )
409 if( ++counter < numMul )
411 nt = npos+nneg+nzero;
412 if( nt>0 && nt<=numSec )
414 test = std::exp( std::min( expxu, std::max( expxl, -(
pi/4.0)*(nt*nt)/(n*n) ) ) );
415 dum = (
pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
416 if( std::fabs(dum) < 1.0 )
418 if( test >= 1.0
e-10 )excs += dum*
test;
433 npos--; nneg--; nzero--;
443 targetHasChanged =
true;
446 incidentHasChanged =
true;
452 incidentHasChanged =
true;
453 targetHasChanged =
true;
468 incidentHasChanged =
true;
469 targetHasChanged =
true;
474 incidentHasChanged =
true;
478 targetHasChanged =
true;