47 G4cout <<
"WARNING: model G4LEAntiNeutronInelastic is being deprecated and will\n"
48 <<
"disappear in Geant4 version 10.0" <<
G4endl;
54 outFile <<
"G4LEAntiNeutronInelastic is one of the Low Energy\n"
55 <<
"Parameterized (LEP) models used to implement inelastic\n"
56 <<
"anti-neutron scattering from nuclei. It is a re-engineered\n"
57 <<
"version of the GHEISHA code of H. Fesefeldt. It divides the\n"
58 <<
"initial collision products into backward- and forward-going\n"
59 <<
"clusters which are then decayed into final state hadrons.\n"
60 <<
"The model does not conserve energy on an event-by-event\n"
61 <<
"basis. It may be applied to anti-neutrons with initial\n"
62 <<
"energies between 0 and 25 GeV.\n";
77 G4cout <<
"G4LEAntiNeutronInelastic::ApplyYourself called" <<
G4endl;
79 G4cout <<
"target material = " << targetMaterial->
GetName() <<
", ";
89 modifiedOriginal = *originalIncident;
95 G4double p = std::sqrt( std::abs((et-amas)*(et+amas)) );
107 p = std::sqrt( std::abs((et-amas)*(et+amas)) );
116 targetParticle = *originalTarget;
119 G4bool incidentHasChanged =
false;
120 G4bool targetHasChanged =
false;
121 G4bool quasiElastic =
false;
131 Cascade(vec, vecLen, originalIncident, currentParticle, targetParticle,
132 incidentHasChanged, targetHasChanged, quasiElastic);
137 modifiedOriginal, targetNucleus, currentParticle,
138 targetParticle, incidentHasChanged, targetHasChanged,
141 SetUpChange(vec, vecLen, currentParticle, targetParticle, incidentHasChanged);
145 delete originalTarget;
150void G4LEAntiNeutronInelastic::Cascade(
156 G4bool &incidentHasChanged,
175 G4double centerofmassEnergy = std::sqrt( mOriginal*mOriginal +
176 targetMass*targetMass +
177 2.0*targetMass*etOriginal );
178 G4double availableEnergy = centerofmassEnergy-(targetMass+mOriginal);
180 static G4bool first =
true;
181 const G4int numMul = 1200;
182 const G4int numMulA = 400;
183 const G4int numSec = 60;
184 static G4double protmul[numMul], protnorm[numSec];
185 static G4double neutmul[numMul], neutnorm[numSec];
186 static G4double protmulA[numMulA], protnormA[numSec];
187 static G4double neutmulA[numMulA], neutnormA[numSec];
192 G4int npos = 0, nneg = 0, nzero = 0;
195 const G4double b[] = { 0.70, 0.70 };
200 for( i=0; i<numMul; ++i )protmul[i] = 0.0;
201 for( i=0; i<numSec; ++i )protnorm[i] = 0.0;
203 for (npos = 0; npos < (numSec/3); ++npos) {
204 for (nneg = std::max(0,npos-2); nneg <= npos; ++nneg) {
205 for (nzero = 0; nzero < numSec/3; ++nzero) {
206 if (++counter < numMul) {
207 nt = npos+nneg+nzero;
208 if (nt > 0 && nt <= numSec) {
209 protmul[counter] =
Pmltpc(npos,nneg,nzero,nt,b[0],c);
210 protnorm[nt-1] += protmul[counter];
216 for (i = 0; i < numMul; ++i) neutmul[i] = 0.0;
217 for (i = 0; i < numSec; ++i) neutnorm[i] = 0.0;
219 for (npos = 0; npos < numSec/3; ++npos) {
220 for (nneg = std::max(0,npos-1); nneg <= (npos+1); ++nneg) {
221 for (nzero = 0; nzero < numSec/3; ++nzero) {
222 if (++counter < numMul) {
223 nt = npos+nneg+nzero;
224 if ( (nt > 0) && (nt <= numSec) ) {
225 neutmul[counter] =
Pmltpc(npos,nneg,nzero,nt,b[1],c);
226 neutnorm[nt-1] += neutmul[counter];
232 for (i = 0; i < numSec; ++i) {
233 if (protnorm[i] > 0.0) protnorm[i] = 1.0/protnorm[i];
234 if (neutnorm[i] > 0.0) neutnorm[i] = 1.0/neutnorm[i];
238 for( i=0; i<numMulA; ++i )protmulA[i] = 0.0;
239 for( i=0; i<numSec; ++i )protnormA[i] = 0.0;
241 for (npos = 1; npos < (numSec/3); ++npos) {
243 for (nzero = 0; nzero < numSec/3; ++nzero) {
244 if (++counter < numMulA) {
245 nt = npos+nneg+nzero;
246 if (nt > 1 && nt <= numSec) {
247 protmulA[counter] =
Pmltpc(npos,nneg,nzero,nt,b[0],c);
248 protnormA[nt-1] += protmulA[counter];
253 for (i = 0; i < numMulA; ++i) neutmulA[i] = 0.0;
254 for (i = 0; i < numSec; ++i) neutnormA[i] = 0.0;
256 for (npos = 0; npos < numSec/3; ++npos) {
258 for (nzero = 0; nzero < numSec/3; ++nzero) {
259 if (++counter < numMulA) {
260 nt = npos+nneg+nzero;
261 if (nt > 1 && nt <= numSec) {
262 neutmulA[counter] =
Pmltpc(npos,nneg,nzero,nt,b[1],c);
263 neutnormA[nt-1] += neutmulA[counter];
268 for (i = 0; i < numSec; ++i) {
269 if (protnormA[i] > 0.0) protnormA[i] = 1.0/protnormA[i];
270 if (neutnormA[i] > 0.0) neutnormA[i] = 1.0/neutnormA[i];
284 const G4double anhl[] = {1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,0.97,0.88,
285 0.85,0.81,0.75,0.64,0.64,0.55,0.55,0.45,0.47,0.40,
286 0.39,0.36,0.33,0.10,0.01};
288 if( iplab > 9 )iplab =
G4int( (pOriginal/GeV- 1.0)*5.0 ) + 10;
289 if( iplab > 14 )iplab =
G4int( pOriginal/GeV- 2.0 ) + 15;
290 if( iplab > 22 )iplab =
G4int( (pOriginal/GeV-10.0)/10.0 ) + 23;
291 if( iplab > 24 )iplab = 24;
293 if (availableEnergy <= aPiPlus->GetPDGMass()/MeV) {
297 G4int ieab =
static_cast<G4int>(availableEnergy*5.0/GeV);
298 const G4double supp[] = {0.,0.4,0.55,0.65,0.75,0.82,0.86,0.90,0.94,0.98};
300 if ((availableEnergy < 2.0*GeV) && (
G4UniformRand() >= supp[ieab]) ) {
303 npos = nneg = nzero = 0;
305 test = std::exp(std::min(expxu,
306 std::max( expxl, -(1.0+b[0])*(1.0+b[0])/(2.0*c*c) ) ) );
313 test = std::exp(std::min(expxu,
314 std::max( expxl, -(1.0+b[1])*(1.0+b[1])/(2.0*c*c) ) ) );
317 test = std::exp(std::min(expxu,
318 std::max( expxl, -(-1.0+b[1])*(-1.0+b[1])/(2.0*c*c) ) ) );
325 else if( ran < wp/wt )
338 for (npos = 0; npos < numSec/3 && ran>=excs; ++npos) {
339 for (nneg = std::max(0,npos-2); nneg <= npos && ran >= excs; ++nneg) {
340 for (nzero = 0; nzero < numSec/3 && ran >= excs; ++nzero) {
341 if (++counter < numMul) {
342 nt = npos + nneg + nzero;
344 test = std::exp(std::min(expxu,
345 std::max(expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
346 dum = (
pi/anpn)*nt*protmul[counter]*protnorm[nt-1]/(2.0*n*n);
347 if( std::fabs(dum) < 1.0 ) {
348 if( test >= 1.0e-10 )excs += dum*test;
362 npos--; nneg--; nzero--;
367 for (npos = 0; npos < numSec/3 && ran >= excs; ++npos) {
368 for (nneg = std::max(0,npos-1); nneg <= (npos+1) && ran >= excs; ++nneg) {
369 for (nzero = 0; nzero < numSec/3 && ran>=excs; ++nzero) {
370 if (++counter < numMul) {
371 nt = npos+nneg+nzero;
372 if ((nt >= 1) && (nt <= numSec) ) {
373 test = std::exp(std::min(expxu,
374 std::max(expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
375 dum = (
pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
376 if (std::fabs(dum) < 1.0) {
377 if (test >= 1.0e-10) excs += dum*test;
391 npos--; nneg--; nzero--;
402 incidentHasChanged =
true;
407 targetHasChanged =
true;
413 incidentHasChanged =
true;
414 targetHasChanged =
true;
427 incidentHasChanged =
true;
428 targetHasChanged =
true;
433 incidentHasChanged =
true;
437 targetHasChanged =
true;
443 if (centerofmassEnergy <= 2*aPiPlus->GetPDGMass()/MeV) {
455 for (npos = 1; (npos < numSec/3) && (ran>=excs); ++npos) {
457 for (nzero = 0; (nzero < numSec/3) && (ran>=excs); ++nzero) {
458 if (++counter < numMulA) {
459 nt = npos+nneg+nzero;
460 if (nt > 1 && nt <= numSec) {
461 test = std::exp(std::min(expxu,
462 std::max(expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
463 dum = (
pi/anpn)*nt*protmulA[counter]*protnormA[nt-1]/(2.0*n*n);
464 if (std::fabs(dum) < 1.0)
466 if( test >= 1.0e-10 )excs += dum*test;
477 for (npos = 0; (npos < numSec/3) && (ran >= excs); ++npos) {
479 for (nzero = 0; (nzero < numSec/3) && (ran >= excs); ++nzero) {
480 if (++counter < numMulA) {
481 nt = npos+nneg+nzero;
482 if ((nt > 1) && (nt <= numSec) ) {
483 test = std::exp(std::min(expxu,
484 std::max(expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
485 dum = (
pi/anpn)*nt*neutmulA[counter]*neutnormA[nt-1]/(2.0*n*n);
486 if (std::fabs(dum) < 1.0) {
487 if (test >= 1.0e-10 )excs += dum*test;
502 currentParticle.
SetMass( 0.0 );
506 while(npos+nneg+nzero < 3) nzero++;
G4DLLIMPORT std::ostream G4cout
static G4AntiProton * AntiProton()
G4ParticleDefinition * GetDefinition() const
void Initialize(G4int items)
const G4Material * GetMaterial() const
G4double GetTotalMomentum() const
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() 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)
G4LEAntiNeutronInelastic(const G4String &name="G4LEAntiNeutronInelastic")
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
virtual void ModelDescription(std::ostream &outFile) const
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 GetTotalMomentum() const
G4double GetKineticEnergy() const
G4ThreeVector GetMomentum() const
void SetSide(const G4int sid)
void SetDefinitionAndUpdateE(G4ParticleDefinition *aParticleDefinition)
void SetKineticEnergy(const G4double en)
G4ParticleDefinition * GetDefinition() const
void SetMass(const G4double mas)