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;
132 void 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 )
182 for( nneg=
std::max(0,np-1); nneg<=(np+1); ++nneg )
184 for( nz=0; nz<numSec/3; ++nz )
186 if( ++counter < numMul )
189 if( nt>0 && nt<=numSec )
191 protmul[counter] =
Pmltpc(np,nneg,nz,nt,b[0],c);
192 protnorm[nt-1] += protmul[counter];
198 for( i=0; i<numMul; ++i )neutmul[i] = 0.0;
199 for( i=0; i<numSec; ++i )neutnorm[i] = 0.0;
201 for( np=0; np<numSec/3; ++np )
203 for( nneg=np; nneg<=(np+2); ++nneg )
205 for( nz=0; nz<numSec/3; ++nz )
207 if( ++counter < numMul )
210 if( (nt>0) && (nt<=numSec) )
212 neutmul[counter] =
Pmltpc(np,nneg,nz,nt,b[1],c);
213 neutnorm[nt-1] += neutmul[counter];
219 for( i=0; i<numSec; ++i )
221 if( protnorm[i] > 0.0 )protnorm[i] = 1.0/protnorm[i];
222 if( neutnorm[i] > 0.0 )neutnorm[i] = 1.0/neutnorm[i];
227 for( i=0; i<numMulA; ++i )protmulA[i] = 0.0;
228 for( i=0; i<numSec; ++i )protnormA[i] = 0.0;
230 for( np=0; np<(numSec/3); ++np )
233 for( nz=0; nz<numSec/3; ++nz )
235 if( ++counter < numMulA )
238 if( nt>1 && nt<=numSec )
240 protmulA[counter] =
Pmltpc(np,nneg,nz,nt,b[0],c);
241 protnormA[nt-1] += protmulA[counter];
246 for( i=0; i<numMulA; ++i )neutmulA[i] = 0.0;
247 for( i=0; i<numSec; ++i )neutnormA[i] = 0.0;
249 for( np=0; np<numSec/3; ++np )
252 for( nz=0; nz<numSec/3; ++nz )
254 if( ++counter < numMulA )
257 if( (nt>1) && (nt<=numSec) )
259 neutmulA[counter] =
Pmltpc(np,nneg,nz,nt,b[1],c);
260 neutnormA[nt-1] += neutmulA[counter];
265 for( i=0; i<numSec; ++i )
267 if( protnormA[i] > 0.0 )protnormA[i] = 1.0/protnormA[i];
268 if( neutnormA[i] > 0.0 )neutnormA[i] = 1.0/neutnormA[i];
282 const G4double anhl[] = {1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.90,
283 0.6,0.52,0.47,0.44,0.41,0.39,0.37,0.35,0.34,0.24,
284 0.19,0.15,0.12,0.10,0.09,0.07,0.06,0.05,0.0};
287 if( iplab > 9 )iplab =
G4int( pOriginal/
GeV ) + 9;
288 if( iplab > 18 )iplab =
G4int( pOriginal/
GeV/10.0 ) + 18;
289 if( iplab > 27 )iplab = 28;
292 if( availableEnergy <= aPiPlus->GetPDGMass()/
MeV )
298 const G4double supp[] = {0.,0.4,0.55,0.65,0.75,0.82,0.86,0.90,0.94,0.98};
309 test = std::exp(
std::min( expxu,
std::max( expxl, -(1.0+b[1])*(1.0+b[1])/(2.0*c*c) ) ) );
312 test = std::exp(
std::min( expxu,
std::max( expxl, -(-1.0+b[1])*(-1.0+b[1])/(2.0*c*c) ) ) );
319 else if( ran < wp/wt )
326 test = std::exp(
std::min( expxu,
std::max( expxl, -(1.0+b[0])*(1.0+b[0])/(2.0*c*c) ) ) );
328 test = std::exp(
std::min( expxu,
std::max( expxl, -(-1.0+b[0])*(-1.0+b[0])/(2.0*c*c) ) ) );
331 if( ran < w0/(w0+wm) )
346 for( np=0; np<numSec/3 && ran>=excs; ++np )
348 for( nneg=
std::max(0,np-1); nneg<=(np+1) && ran>=excs; ++nneg )
350 for( nz=0; nz<numSec/3 && ran>=excs; ++nz )
352 if( ++counter < numMul )
355 if( (nt>0) && (nt<=numSec) )
358 dum = (
pi/anpn)*nt*protmul[counter]*protnorm[nt-1]/(2.0*n*n);
359 if( std::fabs(dum) < 1.0 )
361 if( test >= 1.0e-10 )excs += dum*
test;
379 for( np=0; np<numSec/3 && ran>=excs; ++np )
381 for( nneg=np; nneg<=(np+2) && ran>=excs; ++nneg )
383 for( nz=0; nz<numSec/3 && ran>=excs; ++nz )
385 if( ++counter < numMul )
388 if( (nt>0) && (nt<=numSec) )
391 dum = (
pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
392 if( std::fabs(dum) < 1.0 )
394 if( test >= 1.0e-10 )excs += dum*
test;
420 incidentHasChanged =
true;
421 targetHasChanged =
true;
426 targetHasChanged =
true;
430 incidentHasChanged =
true;
442 targetHasChanged =
true;
447 incidentHasChanged =
true;
455 incidentHasChanged =
true;
456 targetHasChanged =
true;
463 if( centerofmassEnergy <= 2*aPiPlus->GetPDGMass()/
MeV )
478 for( np=0; (np<numSec/3) && (ran>=excs); ++np )
481 for( nz=0; (nz<numSec/3) && (ran>=excs); ++nz )
483 if( ++counter < numMulA )
486 if( (nt>1) && (nt<=numSec) )
489 dum = (
pi/anpn)*nt*protmulA[counter]*protnormA[nt-1]/(2.0*n*n);
490 if( std::abs(dum) < 1.0 )
492 if( test >= 1.0e-10 )excs += dum*
test;
504 for( np=0; (np<numSec/3) && (ran>=excs); ++np )
507 for( nz=0; (nz<numSec/3) && (ran>=excs); ++nz )
509 if( ++counter < numMulA )
512 if( (nt>1) && (nt<=numSec) )
515 dum = (
pi/anpn)*nt*neutmulA[counter]*neutnormA[nt-1]/(2.0*n*n);
516 if( std::fabs(dum) < 1.0 )
518 if( test >= 1.0e-10 )excs += dum*
test;
533 currentParticle.
SetMass( 0.0 );
537 while(np + nneg + nz < 3) nz++;
G4double EvaporationEffects(G4double kineticEnergy)
void SetUpChange(G4FastVector< G4ReactionProduct, 256 > &vec, G4int &vecLen, G4ReactionProduct ¤tParticle, G4ReactionProduct &targetParticle, G4bool &incidentHasChanged)
void SetKineticEnergy(const G4double en)
void SetMomentum(const G4double x, const G4double y, const G4double z)
const G4String & GetName() const
void SetSide(const G4int sid)
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)
G4ParticleDefinition * GetDefinition() const
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
void Initialize(G4int items)
G4DynamicParticle * ReturnTargetParticle() const
void SetDefinitionAndUpdateE(G4ParticleDefinition *aParticleDefinition)
const G4String & GetParticleName() const
G4ParticleDefinition * GetDefinition() const
void SetStatusChange(G4HadFinalStateStatus aS)
G4double Pmltpc(G4int np, G4int nm, G4int nz, G4int n, G4double b, G4double c)
void SetMass(const G4double mas)
G4GLOB_DLL std::ostream G4cout
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
static G4Proton * Proton()
static G4PionPlus * PionPlus()
static G4Neutron * Neutron()
const G4LorentzVector & Get4Momentum() const
G4double GetKineticEnergy() const
void SetEnergyChange(G4double anEnergy)
G4double GetPDGMass() const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4double Cinema(G4double kineticEnergy)
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4ThreeVector GetMomentum() const
G4HadFinalState theParticleChange
const G4Material * GetMaterial() const
void GetNormalizationConstant(const G4double availableEnergy, G4double &n, G4double &anpn)
void SetUpPions(const G4int np, const G4int nm, const G4int nz, G4FastVector< G4ReactionProduct, 256 > &vec, G4int &vecLen)
void SetMomentumChange(const G4ThreeVector &aV)
static G4AntiNeutron * AntiNeutron()
G4double GetTotalMomentum() const
G4double GetTotalEnergy() const