52 G4cout <<
"G4RPGXiZeroInelastic::ApplyYourself called" <<
G4endl;
54 G4cout <<
"target material = " << targetMaterial->
GetName() <<
", ";
64 modifiedOriginal = *originalIncident;
70 G4double p = std::sqrt( std::abs((et-amas)*(et+amas)) );
84 p = std::sqrt( std::abs((et-amas)*(et+amas)) );
93 targetParticle = *originalTarget;
96 G4bool incidentHasChanged =
false;
97 G4bool targetHasChanged =
false;
98 G4bool quasiElastic =
false;
105 Cascade(vec, vecLen, originalIncident, currentParticle, targetParticle,
106 incidentHasChanged, targetHasChanged, quasiElastic);
109 modifiedOriginal, targetNucleus, currentParticle,
110 targetParticle, incidentHasChanged, targetHasChanged,
113 SetUpChange(vec, vecLen, currentParticle, targetParticle, incidentHasChanged);
115 delete originalTarget;
126 G4bool& incidentHasChanged,
143 G4double centerofmassEnergy = std::sqrt(mOriginal*mOriginal +
144 targetMass*targetMass +
145 2.0*targetMass*etOriginal);
146 G4double availableEnergy = centerofmassEnergy-(targetMass+mOriginal);
152 const G4int numMul = 1200;
153 const G4int numSec = 60;
158 G4int counter, nt=0, np=0, nneg=0, nz=0;
165 for (i = 0; i < numMul; ++i) protmul[i] = 0.0;
166 for (i = 0; i < numSec; ++i) protnorm[i] = 0.0;
168 for( np=0; np<(numSec/3); ++np )
170 for( nneg=
std::max(0,np-2); nneg<=(np+1); ++nneg )
172 for( nz=0; nz<numSec/3; ++nz )
174 if( ++counter < numMul )
177 if( nt>0 && nt<=numSec )
179 protmul[counter] =
Pmltpc(np,nneg,nz,nt,b[0],c);
180 protnorm[nt-1] += protmul[counter];
186 for( i=0; i<numMul; ++i )neutmul[i] = 0.0;
187 for( i=0; i<numSec; ++i )neutnorm[i] = 0.0;
189 for( np=0; np<numSec/3; ++np )
191 for( nneg=
std::max(0,np-1); nneg<=(np+2); ++nneg )
193 for( nz=0; nz<numSec/3; ++nz )
195 if( ++counter < numMul )
198 if( nt>0 && nt<=numSec )
200 neutmul[counter] =
Pmltpc(np,nneg,nz,nt,b[1],c);
201 neutnorm[nt-1] += neutmul[counter];
207 for( i=0; i<numSec; ++i )
209 if( protnorm[i] > 0.0 )protnorm[i] = 1.0/protnorm[i];
210 if( neutnorm[i] > 0.0 )neutnorm[i] = 1.0/neutnorm[i];
231 for( np=0; np<numSec/3 && ran>=excs; ++np )
233 for( nneg=
std::max(0,np-2); nneg<=(np+1) && ran>=excs; ++nneg )
235 for( nz=0; nz<numSec/3 && ran>=excs; ++nz )
237 if( ++counter < numMul )
240 if( nt>0 && nt<=numSec )
243 dum = (
pi/anpn)*nt*protmul[counter]*protnorm[nt-1]/(2.0*n*n);
244 if( std::fabs(dum) < 1.0 )
246 if( test >= 1.0
e-10 )excs += dum*test;
272 incidentHasChanged =
true;
284 else if( np == nneg+1 )
289 targetHasChanged =
true;
294 incidentHasChanged =
true;
300 incidentHasChanged =
true;
302 targetHasChanged =
true;
308 for( np=0; np<numSec/3 && ran>=excs; ++np )
310 for( nneg=
std::max(0,np-1); nneg<=(np+2) && ran>=excs; ++nneg )
312 for( nz=0; nz<numSec/3 && ran>=excs; ++nz )
314 if( ++counter < numMul )
317 if( nt>0 && 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.0
e-10 )excs += dum*test;
343 targetHasChanged =
true;
348 incidentHasChanged =
true;
350 targetHasChanged =
true;
362 else if( np == nneg )
367 incidentHasChanged =
true;
369 targetHasChanged =
true;
375 incidentHasChanged =
true;
void Initialize(G4int items)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
T max(const T t1, const T t2)
brief Return the largest of the two arguments
void SetUpChange(G4FastVector< G4ReactionProduct, 256 > &vec, G4int &vecLen, G4ReactionProduct ¤tParticle, G4ReactionProduct &targetParticle, G4bool &incidentHasChanged)
static constexpr double MeV
G4double Cinema(G4double kineticEnergy)
void SetMomentumChange(const G4ThreeVector &aV)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetMomentum(const G4double x, const G4double y, const G4double z)
void SetDefinitionAndUpdateE(const G4ParticleDefinition *aParticleDefinition)
const G4String & GetParticleName() const
static G4PionPlus * PionPlus()
void GetNormalizationConstant(const G4double availableEnergy, G4double &n, G4double &anpn)
const G4ParticleDefinition * GetDefinition() const
static G4Proton * Proton()
static G4XiMinus * XiMinus()
G4double GetTotalEnergy() const
static G4KaonMinus * KaonMinus()
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)
G4double GetPDGMass() const
G4DynamicParticle * ReturnTargetParticle() const
const G4String & GetName() const
static G4SigmaPlus * SigmaPlus()
void SetEnergyChange(G4double anEnergy)
G4double Pmltpc(G4int np, G4int nm, G4int nz, G4int n, G4double b, G4double c)
void SetKineticEnergy(const G4double en)
G4double GetKineticEnergy() const
G4ParticleDefinition * GetDefinition() const
const G4Material * GetMaterial() const
void SetUpPions(const G4int np, const G4int nm, const G4int nz, G4FastVector< G4ReactionProduct, 256 > &vec, G4int &vecLen)
G4ThreeVector GetMomentum() const
void SetSide(const G4int sid)
const G4LorentzVector & Get4Momentum() const
void Cascade(G4FastVector< G4ReactionProduct, GHADLISTSIZE > &vec, G4int &vecLen, const G4HadProjectile *originalIncident, G4ReactionProduct ¤tParticle, G4ReactionProduct &targetParticle, G4bool &incidentHasChanged, G4bool &targetHasChanged, G4bool &quasiElastic)
G4double GetKineticEnergy() const
void SetElement(G4int anIndex, Type *anElement)
const G4ParticleDefinition * GetDefinition() const
static G4Neutron * Neutron()
G4GLOB_DLL std::ostream G4cout
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
static constexpr double pi
G4double EvaporationEffects(G4double kineticEnergy)
G4HadFinalState theParticleChange
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
void SetStatusChange(G4HadFinalStateStatus aS)