56 G4cout <<
"G4RPGKPlusInelastic::ApplyYourself called" <<
G4endl;
58 G4cout <<
"target material = " << targetMaterial->
GetName() <<
", ";
76 G4double p = std::sqrt( std::abs((et-amas)*(et+amas)) );
90 p = std::sqrt( std::abs((et-amas)*(et+amas)) );
101 targetParticle.SetSide( -1 );
102 G4bool incidentHasChanged =
false;
103 G4bool targetHasChanged =
false;
104 G4bool quasiElastic =
false;
111 Cascade( vec, vecLen,
112 originalIncident, currentParticle, targetParticle,
113 incidentHasChanged, targetHasChanged, quasiElastic );
116 originalIncident, originalTarget, modifiedOriginal,
117 targetNucleus, currentParticle, targetParticle,
118 incidentHasChanged, targetHasChanged, quasiElastic );
121 currentParticle, targetParticle,
122 incidentHasChanged );
124 delete originalTarget;
130 void G4RPGKPlusInelastic::Cascade(
136 G4bool &incidentHasChanged,
153 G4double centerofmassEnergy = std::sqrt( mOriginal*mOriginal +
154 targetMass*targetMass +
155 2.0*targetMass*etOriginal );
156 G4double availableEnergy = centerofmassEnergy-(targetMass+mOriginal);
163 const G4int numMul = 1200;
164 const G4int numSec = 60;
170 G4int 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-2); nneg<=np; ++nneg )
184 for( nz=0; nz<numSec/3; ++nz )
186 if( ++counter < numMul )
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=
std::max(0,np-1); nneg<=(np+1); ++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];
233 const G4double supp[] = {0.,0.4,0.55,0.65,0.75,0.82,0.86,0.90,0.94,0.98};
263 else if( ran < wp/wt )
278 for( np=0; (np<numSec/3) && (ran>=excs); ++np )
280 for( nneg=
std::max(0,np-2); (nneg<=np) && (ran>=excs); ++nneg )
282 for( nz=0; (nz<numSec/3) && (ran>=excs); ++nz )
284 if( ++counter < numMul )
290 dum = (
pi/anpn)*nt*protmul[counter]*protnorm[nt-1]/(2.0*n*n);
291 if( std::fabs(dum) < 1.0 )
293 if( test >= 1.0e-10 )excs += dum*
test;
302 if( ran >= excs )
return;
308 for( np=0; (np<numSec/3) && (ran>=excs); ++np )
310 for( nneg=
std::max(0,np-1); (nneg<=(np+1)) && (ran>=excs); ++nneg )
312 for( nz=0; (nz<numSec/3) && (ran>=excs); ++nz )
314 if( ++counter < numMul )
317 if( (nt>=1) && (nt<=numSec) )
320 dum = (
pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
321 if( std::fabs(dum) < 1.0 )
323 if( test >= 1.0e-10 )excs += dum*
test;
332 if( ran >= excs )
return;
348 incidentHasChanged =
true;
353 targetHasChanged =
true;
361 incidentHasChanged =
true;
363 incidentHasChanged =
true;
364 targetHasChanged =
true;
382 incidentHasChanged =
true;
383 targetHasChanged =
true;
391 incidentHasChanged =
true;
395 targetHasChanged =
true;
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
static G4KaonZeroLong * KaonZeroLong()
void SetSide(const G4int sid)
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
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
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)
G4GLOB_DLL std::ostream G4cout
const G4ParticleDefinition * GetDefinition() const
static G4KaonZeroShort * KaonZeroShort()
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)
G4double GetTotalEnergy() const