56 G4cout <<
"G4RPGKPlusInelastic::ApplyYourself called" <<
G4endl;
58 G4cout <<
"target material = " << targetMaterial->
GetName() <<
", ";
75 currentParticle.SetKineticEnergy( ek );
78 G4double pp = currentParticle.GetMomentum().mag();
82 currentParticle.SetMomentum( momentum * (p/pp) );
89 currentParticle.SetKineticEnergy( ek );
91 p = std::sqrt(
std::abs((et-amas)*(et+amas)) );
92 pp = currentParticle.GetMomentum().mag();
96 currentParticle.SetMomentum( momentum * (p/pp) );
102 targetParticle.SetSide( -1 );
103 G4bool incidentHasChanged =
false;
104 G4bool targetHasChanged =
false;
105 G4bool quasiElastic =
false;
111 if( currentParticle.GetKineticEnergy() > cutOff )
113 originalIncident, currentParticle, targetParticle,
114 incidentHasChanged, targetHasChanged, quasiElastic );
117 originalIncident, originalTarget, modifiedOriginal,
118 targetNucleus, currentParticle, targetParticle,
119 incidentHasChanged, targetHasChanged, quasiElastic );
122 currentParticle, targetParticle,
123 incidentHasChanged );
125 delete originalTarget;
137 G4bool &incidentHasChanged,
154 G4double centerofmassEnergy = std::sqrt( mOriginal*mOriginal +
155 targetMass*targetMass +
156 2.0*targetMass*etOriginal );
157 G4double availableEnergy = centerofmassEnergy-(targetMass+mOriginal);
164 const G4int numMul = 1200;
165 const G4int numSec = 60;
171 G4int nt=0, np=0, nneg=0, nz=0;
178 for( i=0; i<numMul; ++i )protmul[i] = 0.0;
179 for( i=0; i<numSec; ++i )protnorm[i] = 0.0;
181 for( np=0; np<(numSec/3); ++np )
183 for( nneg=
std::max(0,np-2); nneg<=np; ++nneg )
185 for( nz=0; nz<numSec/3; ++nz )
187 if( ++counter < numMul )
192 protmul[counter] =
Pmltpc(np,nneg,nz,nt,b[0],c);
193 protnorm[nt-1] += protmul[counter];
199 for( i=0; i<numMul; ++i )neutmul[i] = 0.0;
200 for( i=0; i<numSec; ++i )neutnorm[i] = 0.0;
202 for( np=0; np<numSec/3; ++np )
204 for( nneg=
std::max(0,np-1); nneg<=(np+1); ++nneg )
206 for( nz=0; nz<numSec/3; ++nz )
208 if( ++counter < numMul )
211 if( (nt>0) && (nt<=numSec) )
213 neutmul[counter] =
Pmltpc(np,nneg,nz,nt,b[1],c);
214 neutnorm[nt-1] += neutmul[counter];
220 for( i=0; i<numSec; ++i )
222 if( protnorm[i] > 0.0 )protnorm[i] = 1.0/protnorm[i];
223 if( neutnorm[i] > 0.0 )neutnorm[i] = 1.0/neutnorm[i];
234 const G4double supp[] = {0.,0.4,0.55,0.65,0.75,0.82,0.86,0.90,0.94,0.98};
264 else if( ran < wp/wt )
279 for( np=0; (np<numSec/3) && (ran>=excs); ++np )
281 for( nneg=
std::max(0,np-2); (nneg<=np) && (ran>=excs); ++nneg )
283 for( nz=0; (nz<numSec/3) && (ran>=excs); ++nz )
285 if( ++counter < numMul )
291 dum = (
pi/anpn)*nt*protmul[counter]*protnorm[nt-1]/(2.0*n*n);
292 if( std::fabs(dum) < 1.0 )
294 if( test >= 1.0
e-10 )excs += dum*
test;
303 if( ran >= excs )
return;
309 for( np=0; (np<numSec/3) && (ran>=excs); ++np )
311 for( nneg=
std::max(0,np-1); (nneg<=(np+1)) && (ran>=excs); ++nneg )
313 for( nz=0; (nz<numSec/3) && (ran>=excs); ++nz )
315 if( ++counter < numMul )
318 if( (nt>=1) && (nt<=numSec) )
321 dum = (
pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
322 if( std::fabs(dum) < 1.0 )
324 if( test >= 1.0
e-10 )excs += dum*
test;
333 if( ran >= excs )
return;
349 incidentHasChanged =
true;
354 targetHasChanged =
true;
362 incidentHasChanged =
true;
364 incidentHasChanged =
true;
365 targetHasChanged =
true;
383 incidentHasChanged =
true;
384 targetHasChanged =
true;
392 incidentHasChanged =
true;
396 targetHasChanged =
true;