39 outFile <<
"G4LESigmaPlusInelastic is one of the Low Energy Parameterized\n"
40 <<
"(LEP) models used to implement inelastic Sigma+ scattering\n"
41 <<
"from nuclei. It is a re-engineered version of the GHEISHA\n"
42 <<
"code of H. Fesefeldt. It divides the initial collision\n"
43 <<
"products into backward- and forward-going clusters which are\n"
44 <<
"then decayed into final state hadrons. The model does not\n"
45 <<
"conserve energy on an event-by-event basis. It may be\n"
46 <<
"applied to Sigma+ with initial energies between 0 and 25\n"
67 G4cout <<
"G4LESigmaPlusInelastic::ApplyYourself called" <<
G4endl;
69 G4cout <<
"target material = " << targetMaterial->
GetName() <<
", ";
79 modifiedOriginal = *originalIncident;
85 G4double p = std::sqrt( std::abs((et-amas)*(et+amas)) );
97 p = std::sqrt( std::abs((et-amas)*(et+amas)) );
105 targetParticle = *originalTarget;
108 G4bool incidentHasChanged =
false;
109 G4bool targetHasChanged =
false;
110 G4bool quasiElastic =
false;
117 Cascade(vec, vecLen, originalIncident, currentParticle, targetParticle,
118 incidentHasChanged, targetHasChanged, quasiElastic);
121 modifiedOriginal, targetNucleus, currentParticle,
122 targetParticle, incidentHasChanged, targetHasChanged,
125 SetUpChange(vec, vecLen, currentParticle, targetParticle, incidentHasChanged);
129 delete originalTarget;
134void G4LESigmaPlusInelastic::Cascade(
140 G4bool &incidentHasChanged,
157 G4double centerofmassEnergy = std::sqrt(mOriginal*mOriginal +
158 targetMass*targetMass +
159 2.0*targetMass*etOriginal);
160 G4double availableEnergy = centerofmassEnergy - (targetMass+mOriginal);
165 static G4bool first =
true;
166 const G4int numMul = 1200;
167 const G4int numSec = 60;
168 static G4double protmul[numMul], protnorm[numSec];
169 static G4double neutmul[numMul], neutnorm[numSec];
172 G4int counter, nt=0, npos=0, nneg=0, nzero=0;
179 for( i=0; i<numMul; ++i )protmul[i] = 0.0;
180 for( i=0; i<numSec; ++i )protnorm[i] = 0.0;
182 for (npos = 0; npos < (numSec/3); ++npos) {
183 for (nneg = npos; nneg <= (npos+2); ++nneg) {
184 for (nzero = 0; nzero < numSec/3; ++nzero) {
185 if (++counter < numMul) {
186 nt = npos+nneg+nzero;
187 if (nt > 0 && nt <= numSec) {
188 protmul[counter] =
Pmltpc(npos,nneg,nzero,nt,b[0],c);
189 protnorm[nt-1] += protmul[counter];
196 for( i=0; i<numMul; ++i )neutmul[i] = 0.0;
197 for( i=0; i<numSec; ++i )neutnorm[i] = 0.0;
199 for( npos=0; npos<numSec/3; ++npos )
201 for( nneg=std::max(0,npos-1); nneg<=(npos+1); ++nneg )
203 for( nzero=0; nzero<numSec/3; ++nzero )
205 if( ++counter < numMul )
207 nt = npos+nneg+nzero;
208 if( nt>0 && nt<=numSec )
210 neutmul[counter] =
Pmltpc(npos,nneg,nzero,nt,b[1],c);
211 neutnorm[nt-1] += neutmul[counter];
217 for (i = 0; i < numSec; ++i) {
218 if (protnorm[i] > 0.0) protnorm[i] = 1.0/protnorm[i];
219 if (neutnorm[i] > 0.0) neutnorm[i] = 1.0/neutnorm[i];
237 for( npos=0; npos<numSec/3 && ran>=excs; ++npos )
239 for( nneg=npos; nneg<=(npos+2) && ran>=excs; ++nneg )
241 for( nzero=0; nzero<numSec/3 && ran>=excs; ++nzero )
243 if( ++counter < numMul )
245 nt = npos+nneg+nzero;
246 if( nt>0 && nt<=numSec )
248 test = std::exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
249 dum = (
pi/anpn)*nt*protmul[counter]*protnorm[nt-1]/(2.0*n*n);
250 if( std::fabs(dum) < 1.0 )
252 if( test >= 1.0e-10 )excs += dum*test;
266 npos--; nneg--; nzero--;
267 switch( std::min( 3, std::max( 1, npos-nneg+3 ) ) )
274 incidentHasChanged =
true;
276 targetHasChanged =
true;
282 targetHasChanged =
true;
290 incidentHasChanged =
true;
300 for( npos=0; npos<numSec/3 && ran>=excs; ++npos )
302 for( nneg=std::max(0,npos-1); nneg<=(npos+1) && ran>=excs; ++nneg )
304 for( nzero=0; nzero<numSec/3 && ran>=excs; ++nzero )
306 if( ++counter < numMul )
308 nt = npos+nneg+nzero;
309 if( nt>0 && nt<=numSec )
311 test = std::exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
312 dum = (
pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
313 if( std::fabs(dum) < 1.0 )
315 if( test >= 1.0e-10 )excs += dum*test;
329 npos--; nneg--; nzero--;
330 switch( std::min( 3, std::max( 1, npos-nneg+2 ) ) )
334 targetHasChanged =
true;
342 incidentHasChanged =
true;
344 targetHasChanged =
true;
349 targetHasChanged =
true;
357 incidentHasChanged =
true;
359 targetHasChanged =
true;
368 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
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4double GetTotalEnergy() const
G4HadFinalState theParticleChange
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)
virtual void ModelDescription(std::ostream &outFile) const
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
static G4Lambda * Lambda()
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 G4PionPlus * PionPlus()
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
static G4SigmaZero * SigmaZero()