47 G4cout <<
"G4RPGAntiNeutronInelastic::ApplyYourself called" <<
G4endl;
49 G4cout <<
"target material = " << targetMaterial->
GetName() <<
", ";
60 modifiedOriginal = *originalIncident;
66 G4double p = std::sqrt( std::abs((et-amas)*(et+amas)) );
80 p = std::sqrt( std::abs((et-amas)*(et+amas)) );
90 targetParticle = *originalTarget;
93 G4bool incidentHasChanged =
false;
94 G4bool targetHasChanged =
false;
95 G4bool quasiElastic =
false;
105 Cascade( vec, vecLen,
106 originalIncident, currentParticle, targetParticle,
107 incidentHasChanged, targetHasChanged, quasiElastic );
112 originalIncident, originalTarget, modifiedOriginal,
113 targetNucleus, currentParticle, targetParticle,
114 incidentHasChanged, targetHasChanged, quasiElastic );
117 currentParticle, targetParticle,
118 incidentHasChanged );
120 delete originalTarget;
125void G4RPGAntiNeutronInelastic::Cascade(
131 G4bool &incidentHasChanged,
148 G4double centerofmassEnergy = std::sqrt( mOriginal*mOriginal +
149 targetMass*targetMass +
150 2.0*targetMass*etOriginal );
151 G4double availableEnergy = centerofmassEnergy-(targetMass+mOriginal);
154 const G4int numMul = 1200;
155 const G4int numMulA = 400;
156 const G4int numSec = 60;
163 G4int counter, nt=0, np=0, nneg=0, nz=0;
166 const G4double b[] = { 0.70, 0.70 };
170 for (i = 0; i < numMul; ++i) protmul[i] = 0.0;
171 for (i = 0; i < numSec; ++i) protnorm[i] = 0.0;
173 for (np = 0; np < (numSec/3); ++np) {
174 for (nneg = std::max(0,np-2); nneg <= np; ++nneg) {
175 for (nz = 0; nz < numSec/3; ++nz) {
176 if (++counter < numMul) {
178 if (nt > 0 && nt <= numSec) {
179 protmul[counter] =
Pmltpc(np,nneg,nz,nt,b[0],c);
180 protnorm[nt-1] += protmul[counter];
187 for( i=0; i<numMul; ++i )neutmul[i] = 0.0;
188 for( i=0; i<numSec; ++i )neutnorm[i] = 0.0;
190 for (np = 0; np < numSec/3; ++np) {
191 for (nneg=std::max(0,np-1); nneg<=(np+1); ++nneg ) {
192 for (nz=0; nz<numSec/3; ++nz ) {
193 if (++counter < numMul ) {
195 if ((nt>0) && (nt<=numSec) ) {
196 neutmul[counter] =
Pmltpc(np,nneg,nz,nt,b[1],c);
197 neutnorm[nt-1] += neutmul[counter];
204 for (i=0; i<numSec; ++i ) {
205 if (protnorm[i] > 0.0 )protnorm[i] = 1.0/protnorm[i];
206 if (neutnorm[i] > 0.0 )neutnorm[i] = 1.0/neutnorm[i];
211 for( i=0; i<numMulA; ++i )protmulA[i] = 0.0;
212 for( i=0; i<numSec; ++i )protnormA[i] = 0.0;
215 for (np=1; np<(numSec/3); ++np ) {
217 for (nz=0; nz<numSec/3; ++nz ) {
218 if (++counter < numMulA ) {
220 if (nt>1 && nt<=numSec ) {
221 protmulA[counter] =
Pmltpc(np,nneg,nz,nt,b[0],c);
222 protnormA[nt-1] += protmulA[counter];
228 for( i=0; i<numMulA; ++i )neutmulA[i] = 0.0;
229 for( i=0; i<numSec; ++i )neutnormA[i] = 0.0;
231 for (np=0; np<numSec/3; ++np ) {
233 for (nz=0; nz<numSec/3; ++nz) {
234 if (++counter < numMulA ) {
236 if (nt>1 && nt<=numSec ) {
237 neutmulA[counter] =
Pmltpc(np,nneg,nz,nt,b[1],c);
238 neutnormA[nt-1] += neutmulA[counter];
244 for (i=0; i<numSec; ++i ) {
245 if( protnormA[i] > 0.0 )protnormA[i] = 1.0/protnormA[i];
246 if( neutnormA[i] > 0.0 )neutnormA[i] = 1.0/neutnormA[i];
260 const G4double anhl[] = {1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,0.97,0.88,
261 0.85,0.81,0.75,0.64,0.64,0.55,0.55,0.45,0.47,0.40,
262 0.39,0.36,0.33,0.10,0.01};
264 if( iplab > 9 )iplab =
G4int( (pOriginal/GeV- 1.0)*5.0 ) + 10;
265 if( iplab > 14 )iplab =
G4int( pOriginal/GeV- 2.0 ) + 15;
266 if( iplab > 22 )iplab =
G4int( (pOriginal/GeV-10.0)/10.0 ) + 23;
267 if( iplab > 24 )iplab = 24;
270 if( availableEnergy <= aPiPlus->GetPDGMass()/MeV )
275 G4int ieab =
static_cast<G4int>(availableEnergy*5.0/GeV);
276 const G4double supp[] = {0.,0.4,0.55,0.65,0.75,0.82,0.86,0.90,0.94,0.98};
278 if( (availableEnergy < 2.0*GeV) && (
G4UniformRand() >= supp[ieab]) )
286 test =
G4Exp( std::min( expxu, std::max( expxl, -(1.0+b[0])*(1.0+b[0])/(2.0*c*c) ) ) );
296 test =
G4Exp( std::min( expxu, std::max( expxl, -(1.0+b[1])*(1.0+b[1])/(2.0*c*c) ) ) );
299 test =
G4Exp( std::min( expxu, std::max( expxl, -(-1.0+b[1])*(-1.0+b[1])/(2.0*c*c) ) ) );
306 else if( ran < wp/wt )
321 for( np=0; np<numSec/3 && ran>=excs; ++np )
323 for( nneg=std::max(0,np-2); nneg<=np && ran>=excs; ++nneg )
325 for( nz=0; nz<numSec/3 && ran>=excs; ++nz )
327 if( ++counter < numMul )
332 test =
G4Exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
333 dum = (
pi/anpn)*nt*protmul[counter]*protnorm[nt-1]/(2.0*n*n);
334 if( std::fabs(dum) < 1.0 )
336 if( test >= 1.0e-10 )excs += dum*test;
355 for( np=0; np<numSec/3 && ran>=excs; ++np )
357 for( nneg=std::max(0,np-1); nneg<=(np+1) && ran>=excs; ++nneg )
359 for( nz=0; nz<numSec/3 && ran>=excs; ++nz )
361 if( ++counter < numMul )
364 if( (nt>=1) && (nt<=numSec) )
366 test =
G4Exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
367 dum = (
pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
368 if( std::fabs(dum) < 1.0 )
370 if( test >= 1.0e-10 )excs += dum*test;
395 incidentHasChanged =
true;
400 targetHasChanged =
true;
406 incidentHasChanged =
true;
407 targetHasChanged =
true;
422 incidentHasChanged =
true;
423 targetHasChanged =
true;
428 incidentHasChanged =
true;
432 targetHasChanged =
true;
437 if (centerofmassEnergy <= 2*aPiPlus->GetPDGMass()/MeV ) {
451 for (np=1; (np<numSec/3) && (ran>=excs); ++np ) {
453 for (nz=0; (nz<numSec/3) && (ran>=excs); ++nz ) {
454 if (++counter < numMulA) {
456 if (nt>1 && nt<=numSec ) {
457 test =
G4Exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
458 dum = (
pi/anpn)*nt*protmulA[counter]*protnormA[nt-1]/(2.0*n*n);
459 if (std::fabs(dum) < 1.0 ) {
460 if (test >= 1.0e-10) excs += dum*test;
470 for (np=0; (np<numSec/3) && (ran>=excs); ++np ) {
472 for (nz=0; (nz<numSec/3) && (ran>=excs); ++nz ) {
473 if (++counter < numMulA ) {
475 if ((nt>1) && (nt<=numSec) ) {
476 test =
G4Exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
477 dum = (
pi/anpn)*nt*neutmulA[counter]*neutnormA[nt-1]/(2.0*n*n);
478 if (std::fabs(dum) < 1.0 ) {
479 if( test >= 1.0e-10 )excs += dum*test;
494 currentParticle.
SetMass( 0.0 );
500 ed <<
" While count exceeded " <<
G4endl;
501 while(np+nneg+nz<3) {
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4GLOB_DLL 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
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()
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
void SetUpPions(const G4int np, const G4int nm, const G4int nz, G4FastVector< G4ReactionProduct, 256 > &vec, G4int &vecLen)
void GetNormalizationConstant(const G4double availableEnergy, G4double &n, G4double &anpn)
void CalculateMomenta(G4FastVector< G4ReactionProduct, 256 > &vec, G4int &vecLen, const G4HadProjectile *originalIncident, const G4DynamicParticle *originalTarget, G4ReactionProduct &modifiedOriginal, G4Nucleus &targetNucleus, G4ReactionProduct ¤tParticle, G4ReactionProduct &targetParticle, G4bool &incidentHasChanged, G4bool &targetHasChanged, G4bool quasiElastic)
void SetUpChange(G4FastVector< G4ReactionProduct, 256 > &vec, G4int &vecLen, G4ReactionProduct ¤tParticle, G4ReactionProduct &targetParticle, G4bool &incidentHasChanged)
G4double Pmltpc(G4int np, G4int nm, G4int nz, G4int n, G4double b, G4double c)
void SetMomentum(const G4double x, const G4double y, const G4double z)
G4double GetTotalMomentum() const
G4double GetKineticEnergy() const
const G4ParticleDefinition * GetDefinition() const
G4ThreeVector GetMomentum() const
void SetSide(const G4int sid)
void SetDefinitionAndUpdateE(const G4ParticleDefinition *aParticleDefinition)
void SetKineticEnergy(const G4double en)
void SetMass(const G4double mas)