42 G4cout <<
"WARNING: model G4LEPionMinusInelastic is being deprecated and will\n"
43 <<
"disappear in Geant4 version 10.0" <<
G4endl;
49 outFile <<
"G4LEPionMinusInelastic is one of the Low Energy Parameterized\n"
50 <<
"(LEP) models used to implement inelastic pi- scattering\n"
51 <<
"from nuclei. It is a re-engineered version of the GHEISHA\n"
52 <<
"code of H. Fesefeldt. It divides the initial collision\n"
53 <<
"products into backward- and forward-going clusters which are\n"
54 <<
"then decayed into final state hadrons. The model does not\n"
55 <<
"conserve energy on an event-by-event basis. It may be\n"
56 <<
"applied to pions with initial energies between 0 and 25\n"
79 G4cout <<
"G4PionMinusInelastic::ApplyYourself called" <<
G4endl;
81 G4cout <<
"target material = " << targetMaterial->
GetName() <<
", ";
86 const_cast<G4ParticleDefinition *>(originalIncident->
GetDefinition() ) );
99 G4double p = std::sqrt( std::abs((et-amas)*(et+amas)) );
111 p = std::sqrt( std::abs((et-amas)*(et+amas)) );
121 targetParticle.SetSide( -1 );
122 G4bool incidentHasChanged =
false;
123 G4bool targetHasChanged =
false;
124 G4bool quasiElastic =
false;
131 Cascade(vec, vecLen, originalIncident, currentParticle, targetParticle,
132 incidentHasChanged, targetHasChanged, quasiElastic);
135 modifiedOriginal, targetNucleus, currentParticle,
136 targetParticle, incidentHasChanged, targetHasChanged,
139 SetUpChange(vec, vecLen, currentParticle, targetParticle, incidentHasChanged);
143 delete originalTarget;
149 G4LEPionMinusInelastic::Cascade(
155 G4bool& incidentHasChanged,
174 G4double centerofmassEnergy = std::sqrt(mOriginal*mOriginal +
175 targetMass*targetMass +
176 2.0*targetMass*etOriginal);
177 G4double availableEnergy = centerofmassEnergy-(targetMass+mOriginal);
178 static G4bool first =
true;
179 const G4int numMul = 1200;
180 const G4int numSec = 60;
181 static G4double protmul[numMul], protnorm[numSec];
182 static G4double neutmul[numMul], neutnorm[numSec];
185 G4int counter,
nt=0, npos=0, nneg=0, nzero=0;
192 for( i=0; i<numMul; ++i )protmul[i] = 0.0;
193 for( i=0; i<numSec; ++i )protnorm[i] = 0.0;
195 for( npos=0; npos<(numSec/3); ++npos )
197 for( nneg=std::max(0,npos-1); nneg<=(npos+1); ++nneg )
199 for( nzero=0; nzero<numSec/3; ++nzero )
201 if( ++counter < numMul )
203 nt = npos+nneg+nzero;
206 protmul[counter] =
Pmltpc(npos,nneg,nzero,nt,b[0],c);
207 protnorm[nt-1] += protmul[counter];
213 for( i=0; i<numMul; ++i )neutmul[i] = 0.0;
214 for( i=0; i<numSec; ++i )neutnorm[i] = 0.0;
216 for( npos=0; npos<numSec/3; ++npos )
218 for( nneg=npos; nneg<=(npos+2); ++nneg )
220 for( nzero=0; nzero<numSec/3; ++nzero )
222 if( ++counter < numMul )
224 nt = npos+nneg+nzero;
225 if( (nt>0) && (nt<=numSec) )
227 neutmul[counter] =
Pmltpc(npos,nneg,nzero,nt,b[1],c);
228 neutnorm[nt-1] += neutmul[counter];
234 for( i=0; i<numSec; ++i )
236 if( protnorm[i] > 0.0 )protnorm[i] = 1.0/protnorm[i];
237 if( neutnorm[i] > 0.0 )neutnorm[i] = 1.0/neutnorm[i];
247 const G4double supp[] = {0.,0.4,0.55,0.65,0.75,0.82,0.86,0.90,0.94,0.98};
256 const G4double cech[] = {1.,0.95,0.79,0.32,0.19,0.16,0.14,0.12,0.10,0.08};
264 incidentHasChanged =
true;
265 targetHasChanged =
true;
275 nneg = npos = nzero = 0;
278 test = std::exp( std::min( expxu, std::max( expxl, -(1.0+b[0])*(1.0+b[0])/(2.0*c*c) ) ) );
281 test = std::exp( std::min( expxu, std::max( expxl, -(-1.0+b[0])*(-1.0+b[0])/(2.0*c*c) ) ) );
288 else if( ran < wp/wt )
295 test = std::exp( std::min( expxu, std::max( expxl, -(1.0+b[1])*(1.0+b[1])/(2.0*c*c) ) ) );
297 test = std::exp( std::min( expxu, std::max( expxl, -(-1.0+b[1])*(-1.0+b[1])/(2.0*c*c) ) ) );
300 if( ran < w0/(w0+wm) )
320 for( npos=0; (npos<numSec/3) && (ran>=excs); ++npos )
322 for( nneg=std::max(0,npos-1); (nneg<=(npos+1)) && (ran>=excs); ++nneg )
324 for( nzero=0; (nzero<numSec/3) && (ran>=excs); ++nzero )
326 if( ++counter < numMul )
328 nt = npos+nneg+nzero;
331 test = std::exp( std::min( expxu, std::max( expxl, -(
pi/4.0)*(nt*nt)/(n*n) ) ) );
332 dum = (
pi/anpn)*nt*protmul[counter]*protnorm[nt-1]/(2.0*n*n);
333 if( std::fabs(dum) < 1.0 )
335 if( test >= 1.0
e-10 )excs += dum*
test;
349 npos--; nneg--; nzero--;
354 for( npos=0; (npos<numSec/3) && (ran>=excs); ++npos )
356 for( nneg=npos; (nneg<=(npos+2)) && (ran>=excs); ++nneg )
358 for( nzero=0; (nzero<numSec/3) && (ran>=excs); ++nzero )
360 if( ++counter < numMul )
362 nt = npos+nneg+nzero;
363 if( (nt>=1) && (nt<=numSec) )
365 test = std::exp( std::min( expxu, std::max( expxl, -(
pi/4.0)*(nt*nt)/(n*n) ) ) );
366 dum = (
pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
367 if( std::fabs(dum) < 1.0 )
369 if( test >= 1.0
e-10 )excs += dum*
test;
383 npos--; nneg--; nzero--;
395 incidentHasChanged =
true;
396 targetHasChanged =
true;
401 targetHasChanged =
true;
405 incidentHasChanged =
true;
417 targetHasChanged =
true;
420 incidentHasChanged =
true;
427 incidentHasChanged =
true;