47 G4cout <<
"WARNING: model G4LEAntiProtonInelastic is being deprecated and will\n"
48 <<
"disappear in Geant4 version 10.0" <<
G4endl;
54 outFile <<
"G4LEAntiProtonInelastic is one of the Low Energy Parameterized\n"
55 <<
"(LEP) models used to implement inelastic anti-proton scattering\n"
56 <<
"from nuclei. It is a re-engineered version of the GHEISHA\n"
57 <<
"code of H. Fesefeldt. It divides the initial collision\n"
58 <<
"products into backward- and forward-going clusters which are\n"
59 <<
"then decayed into final state hadrons. The model does not\n"
60 <<
"conserve energy on an event-by-event basis. It may be\n"
61 <<
"applied to anti-protons with initial energies between 0 and 25\n"
85 G4cout <<
"G4LEAntiProtonInelastic::ApplyYourself called" <<
G4endl;
87 G4cout <<
"target material = " << targetMaterial->
GetName() <<
", ";
98 modifiedOriginal = *originalIncident;
104 G4double p = std::sqrt( std::abs((et-amas)*(et+amas)) );
116 p = std::sqrt( std::abs((et-amas)*(et+amas)) );
124 targetParticle = *originalTarget;
127 G4bool incidentHasChanged =
false;
128 G4bool targetHasChanged =
false;
129 G4bool quasiElastic =
false;
139 Cascade(vec, vecLen, originalIncident, currentParticle, targetParticle,
140 incidentHasChanged, targetHasChanged, quasiElastic);
145 modifiedOriginal, targetNucleus, currentParticle,
146 targetParticle, incidentHasChanged, targetHasChanged,
149 SetUpChange(vec, vecLen, currentParticle, targetParticle, incidentHasChanged);
153 delete originalTarget;
158 void G4LEAntiProtonInelastic::Cascade(
164 G4bool &incidentHasChanged,
183 G4double centerofmassEnergy = std::sqrt( mOriginal*mOriginal +
184 targetMass*targetMass +
185 2.0*targetMass*etOriginal );
186 G4double availableEnergy = centerofmassEnergy-(targetMass+mOriginal);
188 static G4bool first =
true;
189 const G4int numMul = 1200;
190 const G4int numMulA = 400;
191 const G4int numSec = 60;
192 static G4double protmul[numMul], protnorm[numSec];
193 static G4double neutmul[numMul], neutnorm[numSec];
194 static G4double protmulA[numMulA], protnormA[numSec];
195 static G4double neutmulA[numMulA], neutnormA[numSec];
199 G4int npos=0, nneg = 0, nzero=0;
206 for( i=0; i<numMul; ++i )protmul[i] = 0.0;
207 for( i=0; i<numSec; ++i )protnorm[i] = 0.0;
209 for (npos = 0; npos < (numSec/3); ++npos) {
210 for (nneg = std::max(0,npos-1); nneg <= (npos+1); ++nneg) {
211 for (nzero = 0; nzero<numSec/3; ++nzero) {
212 if ( ++counter < numMul ) {
213 nt = npos+nneg+nzero;
214 if (nt > 0 && nt <= numSec) {
215 protmul[counter] =
Pmltpc(npos,nneg,nzero,nt,b[0],c);
216 protnorm[nt-1] += protmul[counter];
223 for( i=0; i<numMul; ++i )neutmul[i] = 0.0;
224 for( i=0; i<numSec; ++i )neutnorm[i] = 0.0;
226 for (npos = 0; npos < numSec/3; ++npos) {
227 for (nneg = npos; nneg <= (npos+2); ++nneg) {
228 for (nzero = 0; nzero < numSec/3; ++nzero) {
229 if (++counter < numMul) {
230 nt = npos+nneg+nzero;
231 if ((nt > 0) && (nt <= numSec) ) {
232 neutmul[counter] =
Pmltpc(npos,nneg,nzero,nt,b[1],c);
233 neutnorm[nt-1] += neutmul[counter];
239 for (i = 0; i < numSec; ++i) {
240 if( protnorm[i] > 0.0 )protnorm[i] = 1.0/protnorm[i];
241 if( neutnorm[i] > 0.0 )neutnorm[i] = 1.0/neutnorm[i];
245 for (i = 0; i < numMulA; ++i) protmulA[i] = 0.0;
246 for (i = 0; i < numSec; ++i) protnormA[i] = 0.0;
248 for (npos = 0; npos < (numSec/3); ++npos) {
250 for (nzero=0; nzero<numSec/3; ++nzero) {
251 if (++counter < numMulA) {
252 nt = npos+nneg+nzero;
253 if (nt > 1 && nt <= numSec) {
254 protmulA[counter] =
Pmltpc(npos,nneg,nzero,nt,b[0],c);
255 protnormA[nt-1] += protmulA[counter];
260 for (i = 0; i < numMulA; ++i) neutmulA[i] = 0.0;
261 for (i = 0; i < numSec; ++i) neutnormA[i] = 0.0;
263 for (npos=0; npos < numSec/3; ++npos) {
265 for( nzero=0; nzero<numSec/3; ++nzero ) {
266 if( ++counter < numMulA ) {
267 nt = npos+nneg+nzero;
268 if( (nt>1) && (nt<=numSec) ) {
269 neutmulA[counter] =
Pmltpc(npos,nneg,nzero,nt,b[1],c);
270 neutnormA[nt-1] += neutmulA[counter];
275 for (i=0; i<numSec; ++i ) {
276 if( protnormA[i] > 0.0 )protnormA[i] = 1.0/protnormA[i];
277 if( neutnormA[i] > 0.0 )neutnormA[i] = 1.0/neutnormA[i];
289 const G4double anhl[] = {1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.90,
290 0.6,0.52,0.47,0.44,0.41,0.39,0.37,0.35,0.34,0.24,
291 0.19,0.15,0.12,0.10,0.09,0.07,0.06,0.05,0.0};
294 if( iplab > 9 )iplab =
G4int( pOriginal/
GeV ) + 9;
295 if( iplab > 18 )iplab =
G4int( pOriginal/
GeV/10.0 ) + 18;
296 if( iplab > 27 )iplab = 28;
298 if (availableEnergy <= aPiPlus->GetPDGMass()/
MeV) {
303 const G4double supp[] = {0.,0.4,0.55,0.65,0.75,0.82,0.86,0.90,0.94,0.98};
308 npos = nneg = nzero = 0;
310 test = std::exp(std::min(expxu,
311 std::max(expxl, -(1.0+b[1])*(1.0+b[1])/(2.0*c*c) ) ) );
314 test = std::exp(std::min(expxu,
315 std::max(expxl, -(-1.0+b[1])*(-1.0+b[1])/(2.0*c*c) ) ) );
322 else if( ran < wp/wt )
328 test = std::exp(std::min(expxu,
329 std::max(expxl, -(1.0+b[0])*(1.0+b[0])/(2.0*c*c) ) ) );
331 test = std::exp(std::min(expxu,
332 std::max(expxl, -(-1.0+b[0])*(-1.0+b[0])/(2.0*c*c) ) ) );
335 if (ran < w0/(w0+wm) )
348 for( npos=0; npos<numSec/3 && ran>=excs; ++npos ) {
349 for( nneg=std::max(0,npos-1); nneg<=(npos+1) && ran>=excs; ++nneg) {
350 for( nzero=0; nzero<numSec/3 && ran>=excs; ++nzero )
352 if( ++counter < numMul )
354 nt = npos+nneg+nzero;
355 if( (nt>0) && (nt<=numSec) )
357 test = std::exp( std::min( expxu, std::max( expxl, -(
pi/4.0)*(nt*nt)/(n*n) ) ) );
358 dum = (
pi/anpn)*nt*protmul[counter]*protnorm[nt-1]/(2.0*n*n);
359 if( std::fabs(dum) < 1.0 )
361 if( test >= 1.0
e-10 )excs += dum*
test;
379 for( npos=0; npos<numSec/3 && ran>=excs; ++npos )
381 for (nneg = npos; nneg <= (npos+2) && ran >= excs; ++nneg) {
382 for( nzero=0; nzero<numSec/3 && ran>=excs; ++nzero )
384 if( ++counter < numMul )
386 nt = npos+nneg+nzero;
387 if( (nt>0) && (nt<=numSec) )
389 test = std::exp( std::min( expxu, std::max( expxl, -(
pi/4.0)*(nt*nt)/(n*n) ) ) );
390 dum = (
pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
391 if( std::fabs(dum) < 1.0 )
393 if( test >= 1.0
e-10 )excs += dum*
test;
408 npos--; nneg--; nzero--;
419 incidentHasChanged =
true;
420 targetHasChanged =
true;
425 targetHasChanged =
true;
429 incidentHasChanged =
true;
441 targetHasChanged =
true;
446 incidentHasChanged =
true;
454 incidentHasChanged =
true;
455 targetHasChanged =
true;
462 if( centerofmassEnergy <= 2*aPiPlus->GetPDGMass()/
MeV )
477 for( npos=0; (npos<numSec/3) && (ran>=excs); ++npos )
480 for( nzero=0; (nzero<numSec/3) && (ran>=excs); ++nzero )
482 if( ++counter < numMulA )
484 nt = npos+nneg+nzero;
485 if( (nt>1) && (nt<=numSec) )
487 test = std::exp( std::min( expxu, std::max( expxl, -(
pi/4.0)*(nt*nt)/(n*n) ) ) );
488 dum = (
pi/anpn)*nt*protmulA[counter]*protnormA[nt-1]/(2.0*n*n);
489 if( std::abs(dum) < 1.0 )
491 if( test >= 1.0
e-10 )excs += dum*
test;
503 for( npos=0; (npos<numSec/3) && (ran>=excs); ++npos )
506 for( nzero=0; (nzero<numSec/3) && (ran>=excs); ++nzero )
508 if( ++counter < numMulA )
510 nt = npos+nneg+nzero;
511 if( (nt>1) && (nt<=numSec) )
513 test = std::exp( std::min( expxu, std::max( expxl, -(
pi/4.0)*(nt*nt)/(n*n) ) ) );
514 dum = (
pi/anpn)*nt*neutmulA[counter]*neutnormA[nt-1]/(2.0*n*n);
515 if( std::fabs(dum) < 1.0 )
517 if( test >= 1.0
e-10 )excs += dum*
test;
532 currentParticle.
SetMass( 0.0 );
536 while(npos+nneg+nzero<3) nzero++;