55 G4cout <<
"G4RPGAntiProtonInelastic::ApplyYourself called" <<
G4endl;
57 G4cout <<
"target material = " << targetMaterial->
GetName() <<
", ";
68 modifiedOriginal = *originalIncident;
74 G4double p = std::sqrt( std::abs((et-amas)*(et+amas)) );
88 p = std::sqrt( std::abs((et-amas)*(et+amas)) );
97 targetParticle = *originalTarget;
100 G4bool incidentHasChanged =
false;
101 G4bool targetHasChanged =
false;
102 G4bool quasiElastic =
false;
112 Cascade( vec, vecLen,
113 originalIncident, currentParticle, targetParticle,
114 incidentHasChanged, targetHasChanged, quasiElastic );
119 originalIncident, originalTarget, modifiedOriginal,
120 targetNucleus, currentParticle, targetParticle,
121 incidentHasChanged, targetHasChanged, quasiElastic );
124 currentParticle, targetParticle,
125 incidentHasChanged );
127 delete originalTarget;
132void G4RPGAntiProtonInelastic::Cascade(
138 G4bool &incidentHasChanged,
155 G4double centerofmassEnergy = std::sqrt( mOriginal*mOriginal +
156 targetMass*targetMass +
157 2.0*targetMass*etOriginal );
158 G4double availableEnergy = centerofmassEnergy-(targetMass+mOriginal);
161 const G4int numMul = 1200;
162 const G4int numMulA = 400;
163 const G4int numSec = 60;
169 G4int counter, nt=0, np=0, nneg=0, nz=0;
177 for( i=0; i<numMul; ++i )protmul[i] = 0.0;
178 for( i=0; i<numSec; ++i )protnorm[i] = 0.0;
180 for (np=0; np<(numSec/3); ++np ) {
181 for (nneg=std::max(0,np-1); nneg<=(np+1); ++nneg ) {
182 for (nz=0; nz<numSec/3; ++nz ) {
183 if (++counter < numMul ) {
185 if (nt>0 && nt<=numSec ) {
186 protmul[counter] =
Pmltpc(np,nneg,nz,nt,b[0],c);
187 protnorm[nt-1] += protmul[counter];
194 for (i=0; i<numMul; ++i )neutmul[i] = 0.0;
195 for (i=0; i<numSec; ++i )neutnorm[i] = 0.0;
197 for (np=0; np<numSec/3; ++np ) {
198 for( nneg=np; nneg<=(np+2); ++nneg )
200 for( nz=0; nz<numSec/3; ++nz )
202 if( ++counter < numMul )
205 if( (nt>0) && (nt<=numSec) )
207 neutmul[counter] =
Pmltpc(np,nneg,nz,nt,b[1],c);
208 neutnorm[nt-1] += neutmul[counter];
215 for (i=0; i<numSec; ++i ) {
216 if( protnorm[i] > 0.0 )protnorm[i] = 1.0/protnorm[i];
217 if( neutnorm[i] > 0.0 )neutnorm[i] = 1.0/neutnorm[i];
222 for (i=0; i<numMulA; ++i )protmulA[i] = 0.0;
223 for (i=0; i<numSec; ++i )protnormA[i] = 0.0;
226 for (np=0; np<(numSec/3); ++np ) {
228 for (nz=0; nz<numSec/3; ++nz ) {
229 if ( ++counter < numMulA ) {
231 if ( nt>1 && nt<=numSec ) {
232 protmulA[counter] =
Pmltpc(np,nneg,nz,nt,b[0],c);
233 protnormA[nt-1] += protmulA[counter];
239 for( i=0; i<numMulA; ++i )neutmulA[i] = 0.0;
240 for( i=0; i<numSec; ++i )neutnormA[i] = 0.0;
243 for (np=0; np<numSec/3; ++np ) {
245 for (nz=0; nz<numSec/3; ++nz ) {
246 if (++counter < numMulA ) {
248 if ( (nt>1) && (nt<=numSec) ) {
249 neutmulA[counter] =
Pmltpc(np,nneg,nz,nt,b[1],c);
250 neutnormA[nt-1] += neutmulA[counter];
255 for (i=0; i<numSec; ++i) {
256 if( protnormA[i] > 0.0 )protnormA[i] = 1.0/protnormA[i];
257 if( neutnormA[i] > 0.0 )neutnormA[i] = 1.0/neutnormA[i];
271 const G4double anhl[] = {1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.90,
272 0.6,0.52,0.47,0.44,0.41,0.39,0.37,0.35,0.34,0.24,
273 0.19,0.15,0.12,0.10,0.09,0.07,0.06,0.05,0.0};
276 if( iplab > 9 )iplab =
G4int( pOriginal/GeV ) + 9;
277 if( iplab > 18 )iplab =
G4int( pOriginal/GeV/10.0 ) + 18;
278 if( iplab > 27 )iplab = 28;
280 if (availableEnergy <= aPiPlus->GetPDGMass()/MeV ) {
284 G4int ieab =
static_cast<G4int>(availableEnergy*5.0/GeV);
285 const G4double supp[] = {0.,0.4,0.55,0.65,0.75,0.82,0.86,0.90,0.94,0.98};
287 if ( (availableEnergy < 2.0*GeV) && (
G4UniformRand() >= supp[ieab]) ) {
294 test =
G4Exp( std::min( expxu, std::max( expxl, -(1.0+b[1])*(1.0+b[1])/(2.0*c*c) ) ) );
297 test =
G4Exp( std::min( expxu, std::max( expxl, -(-1.0+b[1])*(-1.0+b[1])/(2.0*c*c) ) ) );
304 else if( ran < wp/wt )
309 test =
G4Exp( std::min( expxu, std::max( expxl, -(1.0+b[0])*(1.0+b[0])/(2.0*c*c) ) ) );
311 test =
G4Exp( std::min( expxu, std::max( expxl, -(-1.0+b[0])*(-1.0+b[0])/(2.0*c*c) ) ) );
314 if( ran < w0/(w0+wm) )
326 for (np=0; np<numSec/3 && ran>=excs; ++np ) {
327 for (nneg=std::max(0,np-1); nneg<=(np+1) && ran>=excs; ++nneg ) {
328 for (nz=0; nz<numSec/3 && ran>=excs; ++nz ) {
329 if (++counter < numMul ) {
331 if ((nt>0) && (nt<=numSec) ) {
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 ) {
335 if( test >= 1.0e-10 )excs += dum*test;
350 for ( np=0; np<numSec/3 && ran>=excs; ++np ) {
351 for ( nneg=np; nneg<=(np+2) && ran>=excs; ++nneg ) {
352 for ( nz=0; nz<numSec/3 && ran>=excs; ++nz ) {
353 if ( ++counter < numMul ) {
355 if ( (nt>0) && (nt<=numSec) ) {
356 test =
G4Exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
357 dum = (
pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
358 if ( std::fabs(dum) < 1.0 )
360 if( test >= 1.0e-10 )excs += dum*test;
386 incidentHasChanged =
true;
387 targetHasChanged =
true;
392 targetHasChanged =
true;
396 incidentHasChanged =
true;
407 targetHasChanged =
true;
412 incidentHasChanged =
true;
420 incidentHasChanged =
true;
421 targetHasChanged =
true;
427 if (centerofmassEnergy <= 2*aPiPlus->GetPDGMass()/MeV ) {
440 for( np=0; (np<numSec/3) && (ran>=excs); ++np )
443 for( nz=0; (nz<numSec/3) && (ran>=excs); ++nz )
445 if( ++counter < numMulA )
448 if( (nt>1) && (nt<=numSec) )
450 test =
G4Exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
451 dum = (
pi/anpn)*nt*protmulA[counter]*protnormA[nt-1]/(2.0*n*n);
452 if( std::abs(dum) < 1.0 )
454 if( test >= 1.0e-10 )excs += dum*test;
464 for( np=0; (np<numSec/3) && (ran>=excs); ++np )
467 for( nz=0; (nz<numSec/3) && (ran>=excs); ++nz )
469 if( ++counter < numMulA )
472 if( (nt>1) && (nt<=numSec) )
474 test =
G4Exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
475 dum = (
pi/anpn)*nt*neutmulA[counter]*neutnormA[nt-1]/(2.0*n*n);
476 if( std::fabs(dum) < 1.0 )
478 if( test >= 1.0e-10 )excs += dum*test;
492 currentParticle.
SetMass( 0.0 );
498 ed <<
" While count exceeded " <<
G4endl;
499 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 G4AntiNeutron * AntiNeutron()
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
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 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)