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() <<
", ";
99 G4double p = std::sqrt( std::abs((et-amas)*(et+amas)) );
111 p = std::sqrt( std::abs((et-amas)*(et+amas)) );
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;
149G4LEPionMinusInelastic::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;
187 const G4double b[] = { 0.70, 0.70 };
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};
249 if( (availableEnergy<2.0*GeV) && (
G4UniformRand()>=supp[ieab]) )
256 const G4double cech[] = {1.,0.95,0.79,0.32,0.19,0.16,0.14,0.12,0.10,0.08};
257 G4int iplab =
G4int(std::min( 9.0, pOriginal/GeV*5.0 ));
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.0e-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.0e-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;
G4DLLIMPORT std::ostream G4cout
G4ParticleDefinition * GetDefinition() const
void Initialize(G4int items)
void SetStatusChange(G4HadFinalStateStatus aS)
void SetEnergyChange(G4double anEnergy)
void SetMomentumChange(const G4ThreeVector &aV)
const G4Material * GetMaterial() const
G4double GetTotalMomentum() const
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4double GetTotalEnergy() const
G4HadFinalState theParticleChange
void SetMinEnergy(G4double anEnergy)
void SetMaxEnergy(const G4double anEnergy)
G4double Pmltpc(G4int np, G4int nm, G4int nz, G4int n, G4double b, G4double c)
void GetNormalizationConstant(const G4double availableEnergy, G4double &n, G4double &anpn)
void SetUpPions(const G4int np, const G4int nm, const G4int nz, G4FastVector< G4ReactionProduct, GHADLISTSIZE > &vec, G4int &vecLen)
void CalculateMomenta(G4FastVector< G4ReactionProduct, GHADLISTSIZE > &vec, G4int &vecLen, const G4HadProjectile *originalIncident, const G4DynamicParticle *originalTarget, G4ReactionProduct &modifiedOriginal, G4Nucleus &targetNucleus, G4ReactionProduct ¤tParticle, G4ReactionProduct &targetParticle, G4bool &incidentHasChanged, G4bool &targetHasChanged, G4bool quasiElastic)
void DoIsotopeCounting(const G4HadProjectile *theProjectile, const G4Nucleus &aNucleus)
void SetUpChange(G4FastVector< G4ReactionProduct, GHADLISTSIZE > &vec, G4int &vecLen, G4ReactionProduct ¤tParticle, G4ReactionProduct &targetParticle, G4bool &incidentHasChanged)
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
virtual void ModelDescription(std::ostream &outFile) const
G4LEPionMinusInelastic(const G4String &name="G4LEPionMinusInelastic")
const G4String & GetName() const
static G4Neutron * Neutron()
G4double EvaporationEffects(G4double kineticEnergy)
G4double Cinema(G4double kineticEnergy)
G4DynamicParticle * ReturnTargetParticle() const
G4double GetPDGMass() const
const G4String & GetParticleName() const
static G4PionMinus * PionMinus()
static G4PionZero * PionZero()
static G4Proton * Proton()
void SetMomentum(const G4double x, const G4double y, const G4double z)
G4double GetKineticEnergy() const
G4ThreeVector GetMomentum() const
void SetSide(const G4int sid)
void SetDefinitionAndUpdateE(G4ParticleDefinition *aParticleDefinition)
void SetKineticEnergy(const G4double en)
G4ParticleDefinition * GetDefinition() const