51 G4cout <<
"G4RPGXiZeroInelastic::ApplyYourself called" <<
G4endl;
53 G4cout <<
"target material = " << targetMaterial->
GetName() <<
", ";
63 modifiedOriginal = *originalIncident;
83 p = std::sqrt(
std::abs((et-amas)*(et+amas)) );
92 targetParticle = *originalTarget;
95 G4bool incidentHasChanged =
false;
96 G4bool targetHasChanged =
false;
97 G4bool quasiElastic =
false;
104 Cascade(vec, vecLen, originalIncident, currentParticle, targetParticle,
105 incidentHasChanged, targetHasChanged, quasiElastic);
108 modifiedOriginal, targetNucleus, currentParticle,
109 targetParticle, incidentHasChanged, targetHasChanged,
112 SetUpChange(vec, vecLen, currentParticle, targetParticle, incidentHasChanged);
114 delete originalTarget;
125 G4bool& incidentHasChanged,
142 G4double centerofmassEnergy = std::sqrt(mOriginal*mOriginal +
143 targetMass*targetMass +
144 2.0*targetMass*etOriginal);
145 G4double availableEnergy = centerofmassEnergy-(targetMass+mOriginal);
151 const G4int numMul = 1200;
152 const G4int numSec = 60;
157 G4int counter, nt=0, np=0, nneg=0, nz=0;
164 for (i = 0; i < numMul; ++i) protmul[i] = 0.0;
165 for (i = 0; i < numSec; ++i) protnorm[i] = 0.0;
167 for( np=0; np<(numSec/3); ++np )
169 for( nneg=
std::max(0,np-2); nneg<=(np+1); ++nneg )
171 for( nz=0; nz<numSec/3; ++nz )
173 if( ++counter < numMul )
176 if( nt>0 && nt<=numSec )
178 protmul[counter] =
Pmltpc(np,nneg,nz,nt,b[0],c);
179 protnorm[nt-1] += protmul[counter];
185 for( i=0; i<numMul; ++i )neutmul[i] = 0.0;
186 for( i=0; i<numSec; ++i )neutnorm[i] = 0.0;
188 for( np=0; np<numSec/3; ++np )
190 for( nneg=
std::max(0,np-1); nneg<=(np+2); ++nneg )
192 for( nz=0; nz<numSec/3; ++nz )
194 if( ++counter < numMul )
197 if( nt>0 && nt<=numSec )
199 neutmul[counter] =
Pmltpc(np,nneg,nz,nt,b[1],c);
200 neutnorm[nt-1] += neutmul[counter];
206 for( i=0; i<numSec; ++i )
208 if( protnorm[i] > 0.0 )protnorm[i] = 1.0/protnorm[i];
209 if( neutnorm[i] > 0.0 )neutnorm[i] = 1.0/neutnorm[i];
230 for( np=0; np<numSec/3 && ran>=excs; ++np )
232 for( nneg=
std::max(0,np-2); nneg<=(np+1) && ran>=excs; ++nneg )
234 for( nz=0; nz<numSec/3 && ran>=excs; ++nz )
236 if( ++counter < numMul )
239 if( nt>0 && nt<=numSec )
242 dum = (
pi/anpn)*nt*protmul[counter]*protnorm[nt-1]/(2.0*n*n);
243 if( std::fabs(dum) < 1.0 )
245 if( test >= 1.0
e-10 )excs += dum*
test;
271 incidentHasChanged =
true;
283 else if( np == nneg+1 )
288 targetHasChanged =
true;
293 incidentHasChanged =
true;
299 incidentHasChanged =
true;
301 targetHasChanged =
true;
307 for( np=0; np<numSec/3 && ran>=excs; ++np )
309 for( nneg=
std::max(0,np-1); nneg<=(np+2) && ran>=excs; ++nneg )
311 for( nz=0; nz<numSec/3 && ran>=excs; ++nz )
313 if( ++counter < numMul )
316 if( nt>0 && nt<=numSec )
319 dum = (
pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
320 if( std::fabs(dum) < 1.0 )
322 if( test >= 1.0
e-10 )excs += dum*
test;
342 targetHasChanged =
true;
347 incidentHasChanged =
true;
349 targetHasChanged =
true;
361 else if( np == nneg )
366 incidentHasChanged =
true;
368 targetHasChanged =
true;
374 incidentHasChanged =
true;