41 G4cout <<
"WARNING: model G4LEProtonInelastic is being deprecated and will\n"
42 <<
"disappear in Geant4 version 10.0" <<
G4endl;
48 outFile <<
"G4LEProtonInelastic is one of the Low Energy Parameterized\n"
49 <<
"(LEP) models used to implement inelastic proton scattering\n"
50 <<
"from nuclei. It is a re-engineered version of the GHEISHA\n"
51 <<
"code of H. Fesefeldt. It divides the initial collision\n"
52 <<
"products into backward- and forward-going clusters which are\n"
53 <<
"then decayed into final state hadrons. The model does not\n"
54 <<
"conserve energy on an event-by-event basis. It may be\n"
55 <<
"applied to protons with initial energies between 0 and 25\n"
78 G4cout <<
"G4LEProtonInelastic::ApplyYourself called" <<
G4endl;
80 G4cout <<
"target material = " << targetMaterial->
GetName() <<
", ";
86 SlowProton(originalIncident, targetNucleus);
88 delete originalTarget;
98 modifiedOriginal = *originalIncident;
104 G4double p = std::sqrt( std::abs((et-amas)*(et+amas)) );
117 p = std::sqrt( std::abs((et-amas)*(et+amas)) );
125 SlowProton( originalIncident, targetNucleus);
127 delete originalTarget;
132 targetParticle = *originalTarget;
135 G4bool incidentHasChanged =
false;
136 G4bool targetHasChanged =
false;
137 G4bool quasiElastic =
false;
143 originalIncident, currentParticle, targetParticle,
144 incidentHasChanged, targetHasChanged, quasiElastic);
147 originalIncident, originalTarget, modifiedOriginal,
148 targetNucleus, currentParticle, targetParticle,
149 incidentHasChanged, targetHasChanged, quasiElastic);
152 currentParticle, targetParticle,
156 delete originalTarget;
162G4LEProtonInelastic::SlowProton(
const G4HadProjectile* originalIncident,
172 massVec[0] = targetNucleus.
AtomicMass( A+1.0, Z+1.0 );
175 massVec[1] = targetNucleus.
AtomicMass( A , Z+1.0 );
176 massVec[2] = theAtomicMass;
178 if (A > 1.0 && A-1.0 > Z)
179 massVec[3] = targetNucleus.
AtomicMass( A-1.0, Z );
181 if (A > 2.0 && A-2.0 > Z)
182 massVec[4] = targetNucleus.
AtomicMass( A-2.0, Z );
184 if (A > 3.0 && Z > 1.0 && A-3.0 > Z-1.0)
185 massVec[5] = targetNucleus.
AtomicMass( A-3.0, Z-1.0 );
187 if (A > 1.0 && A-1.0 > Z+1.0)
188 massVec[6] = targetNucleus.
AtomicMass( A-1.0, Z+1.0 );
189 massVec[7] = massVec[3];
191 if (A > 1.0 && Z > 1.0)
192 massVec[8] = targetNucleus.
AtomicMass( A-1.0, Z-1.0 );
199 targetNucleus, theAtomicMass, massVec );
205 for(
G4int i=0; i<vecLen; ++i )
216 G4LEProtonInelastic::Cascade(
222 G4bool &incidentHasChanged,
242 G4double centerofmassEnergy = std::sqrt( mOriginal*mOriginal +
243 targetMass*targetMass +
244 2.0*targetMass*etOriginal );
245 G4double availableEnergy = centerofmassEnergy-(targetMass+mOriginal);
251 static G4bool first =
true;
252 const G4int numMul = 1200;
253 const G4int numSec = 60;
254 static G4double protmul[numMul], protnorm[numSec];
255 static G4double neutmul[numMul], neutnorm[numSec];
257 G4int counter, nt=0, npos=0, nneg=0, nzero=0;
259 const G4double b[] = { 0.70, 0.35 };
264 for( i=0; i<numMul; ++i )protmul[i] = 0.0;
265 for( i=0; i<numSec; ++i )protnorm[i] = 0.0;
267 for( npos=0; npos<(numSec/3); ++npos )
269 for( nneg=std::max(0,npos-2); nneg<=npos; ++nneg )
271 for( nzero=0; nzero<numSec/3; ++nzero )
273 if( ++counter < numMul )
275 nt = npos+nneg+nzero;
276 if( nt>0 && nt<=numSec )
278 protmul[counter] =
Pmltpc(npos,nneg,nzero,nt,b[0],c) /
281 protnorm[nt-1] += protmul[counter];
287 for( i=0; i<numMul; ++i )neutmul[i] = 0.0;
288 for( i=0; i<numSec; ++i )neutnorm[i] = 0.0;
290 for( npos=0; npos<numSec/3; ++npos )
292 for( nneg=std::max(0,npos-1); nneg<=(npos+1); ++nneg )
294 for( nzero=0; nzero<numSec/3; ++nzero )
296 if( ++counter < numMul )
298 nt = npos+nneg+nzero;
299 if( nt>0 && nt<=numSec )
301 neutmul[counter] =
Pmltpc(npos,nneg,nzero,nt,b[1],c) /
304 neutnorm[nt-1] += neutmul[counter];
310 for( i=0; i<numSec; ++i )
312 if( protnorm[i] > 0.0 )protnorm[i] = 1.0/protnorm[i];
313 if( neutnorm[i] > 0.0 )neutnorm[i] = 1.0/neutnorm[i];
321 G4int ieab =
static_cast<G4int>(availableEnergy*5.0/GeV);
322 const G4double supp[] = {0.,0.4,0.55,0.65,0.75,0.82,0.86,0.90,0.94,0.98};
324 if( (availableEnergy < 2.0*GeV) && (
G4UniformRand() >= supp[ieab]) )
329 npos = nneg = nzero = 0;
332 test = std::exp( std::min( expxu, std::max(
333 expxl, -(1.0+b[0])*(1.0+b[0])/(2.0*c*c) ) ) );
343 test = std::exp( std::min( expxu, std::max(
344 expxl, -(1.0+b[1])*(1.0+b[1])/(2.0*c*c) ) ) );
347 test = std::exp( std::min( expxu, std::max(
348 expxl, -(-1.0+b[1])*(-1.0+b[1])/(2.0*c*c) ) ) );
355 else if( ran < wp/wt )
370 for( npos=0; npos<numSec/3 && ran>=excs; ++npos )
372 for( nneg=std::max(0,npos-2); nneg<=npos && ran>=excs; ++nneg )
374 for( nzero=0; nzero<numSec/3 && ran>=excs; ++nzero )
376 if( ++counter < numMul )
378 nt = npos+nneg+nzero;
379 if( nt>0 && nt<=numSec )
381 test = std::exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
382 dum = (
pi/anpn)*nt*protmul[counter]*protnorm[nt-1]/(2.0*n*n);
383 if( std::fabs(dum) < 1.0 )
385 if( test >= 1.0e-10 )excs += dum*test;
403 for( npos=0; npos<numSec/3 && ran>=excs; ++npos )
405 for( nneg=std::max(0,npos-1); nneg<=(npos+1) && ran>=excs; ++nneg )
407 for( nzero=0; nzero<numSec/3 && ran>=excs; ++nzero )
409 if( ++counter < numMul )
411 nt = npos+nneg+nzero;
412 if( nt>0 && nt<=numSec )
414 test = std::exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
415 dum = (
pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
416 if( std::fabs(dum) < 1.0 )
418 if( test >= 1.0e-10 )excs += dum*test;
433 npos--; nneg--; nzero--;
443 targetHasChanged =
true;
446 incidentHasChanged =
true;
452 incidentHasChanged =
true;
453 targetHasChanged =
true;
468 incidentHasChanged =
true;
469 targetHasChanged =
true;
474 incidentHasChanged =
true;
478 targetHasChanged =
true;
G4DLLIMPORT std::ostream G4cout
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4ParticleDefinition * GetDefinition() const
void SetMomentum(const G4ThreeVector &momentum)
void Initialize(G4int items)
void SetStatusChange(G4HadFinalStateStatus aS)
void AddSecondary(G4DynamicParticle *aP)
void SetEnergyChange(G4double anEnergy)
void SetMomentumChange(const G4ThreeVector &aV)
const G4Material * GetMaterial() 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)
G4ReactionDynamics theReactionDynamics
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)
virtual void ModelDescription(std::ostream &outFile) const
G4LEProtonInelastic(const G4String &name="G4LEProtonInelastic")
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
const G4String & GetName() const
static G4Neutron * Neutron()
G4double EvaporationEffects(G4double kineticEnergy)
G4double Cinema(G4double kineticEnergy)
G4DynamicParticle * ReturnTargetParticle() const
G4double AtomicMass(const G4double A, const G4double Z) const
G4double GetPDGMass() const
const G4String & GetParticleName() const
static G4PionPlus * PionPlus()
static G4Proton * Proton()
void NuclearReaction(G4FastVector< G4ReactionProduct, 4 > &vec, G4int &vecLen, const G4HadProjectile *originalIncident, const G4Nucleus &aNucleus, const G4double theAtomicMass, const G4double *massVec)
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