59 G4cout <<
"target material = " << targetMaterial->
GetName() <<
", ";
70 modifiedOriginal = *originalIncident;
76 G4double p = std::sqrt( std::abs((et-amas)*(et+amas)) );
90 p = std::sqrt( std::abs((et-amas)*(et+amas)) );
99 targetParticle = *originalTarget;
102 G4bool incidentHasChanged =
false;
103 G4bool targetHasChanged =
false;
104 G4bool quasiElastic =
false;
113 Cascade( vec, vecLen,
114 originalIncident, currentParticle, targetParticle,
115 incidentHasChanged, targetHasChanged, quasiElastic );
118 originalIncident, originalTarget, modifiedOriginal,
119 targetNucleus, currentParticle, targetParticle,
120 incidentHasChanged, targetHasChanged, quasiElastic );
123 currentParticle, targetParticle,
124 incidentHasChanged );
126 delete originalTarget;
137 G4bool& incidentHasChanged,
153 G4double centerofmassEnergy = std::sqrt( mOriginal*mOriginal +
154 targetMass*targetMass +
155 2.0*targetMass*etOriginal );
156 G4double availableEnergy = centerofmassEnergy-(targetMass+mOriginal);
162 static G4bool first =
true;
163 const G4int numMul = 1200;
164 const G4int numSec = 60;
165 static G4double protmul[numMul], protnorm[numSec];
166 static G4double neutmul[numMul], neutnorm[numSec];
169 G4int counter, nt=0, np=0, nneg=0, nz=0;
176 for( i=0; i<numMul; ++i )protmul[i] = 0.0;
177 for( i=0; i<numSec; ++i )protnorm[i] = 0.0;
179 for( np=0; np<(numSec/3); ++np )
181 for( nneg=std::max(0,np-1); nneg<=(np+1); ++nneg )
183 for( nz=0; nz<numSec/3; ++nz )
185 if( ++counter < numMul )
188 if( nt>0 && nt<=numSec )
190 protmul[counter] =
Pmltpc(np,nneg,nz,nt,b[0],c);
191 protnorm[nt-1] += protmul[counter];
197 for( i=0; i<numMul; ++i )neutmul[i] = 0.0;
198 for( i=0; i<numSec; ++i )neutnorm[i] = 0.0;
200 for( np=0; np<numSec/3; ++np )
202 for( nneg=np; nneg<=(np+2); ++nneg )
204 for( nz=0; nz<numSec/3; ++nz )
206 if( ++counter < numMul )
209 if( nt>0 && nt<=numSec )
211 neutmul[counter] =
Pmltpc(np,nneg,nz,nt,b[1],c);
212 neutnorm[nt-1] += neutmul[counter];
218 for( i=0; i<numSec; ++i )
220 if( protnorm[i] > 0.0 )protnorm[i] = 1.0/protnorm[i];
221 if( neutnorm[i] > 0.0 )neutnorm[i] = 1.0/neutnorm[i];
240 for( np=0; np<numSec/3 && ran>=excs; ++np )
242 for( nneg=std::max(0,np-1); nneg<=(np+1) && ran>=excs; ++nneg )
244 for( nz=0; nz<numSec/3 && ran>=excs; ++nz )
246 if( ++counter < numMul )
249 if( nt>0 && nt<=numSec )
251 test = std::exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
252 dum = (
pi/anpn)*nt*protmul[counter]*protnorm[nt-1]/(2.0*n*n);
253 if( std::fabs(dum) < 1.0 )
255 if( test >= 1.0e-10 )excs += dum*test;
281 incidentHasChanged =
true;
287 incidentHasChanged =
true;
294 targetHasChanged =
true;
300 for( np=0; np<numSec/3 && ran>=excs; ++np )
302 for( nneg=np; nneg<=(np+2) && ran>=excs; ++nneg )
304 for( nz=0; nz<numSec/3 && ran>=excs; ++nz )
306 if( ++counter < numMul )
309 if( nt>0 && nt<=numSec )
311 test = std::exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
312 dum = (
pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
313 if( std::fabs(dum) < 1.0 )
315 if( test >= 1.0e-10 )excs += dum*test;
335 incidentHasChanged =
true;
341 incidentHasChanged =
true;
345 targetHasChanged =
true;
347 else if( np+1 == nneg )
350 targetHasChanged =
true;
355 for (
G4int i = 0; i < vecLen && nvefix > 0; ++i) {
358 if( nvefix >= 1 )vec[i]->SetDefinitionAndUpdateE( aKaonMinus );
G4DLLIMPORT std::ostream G4cout
G4ParticleDefinition * GetDefinition() const
void Initialize(G4int items)
void SetStatusChange(G4HadFinalStateStatus aS)
void SetEnergyChange(G4double anEnergy)
void SetMomentumChange(const G4ThreeVector &aV)
const G4Material * GetMaterial() const
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4double GetTotalEnergy() const
G4HadFinalState theParticleChange
static G4KaonMinus * KaonMinus()
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 G4PionMinus * PionMinus()
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
G4ThreeVector GetMomentum() const
void SetSide(const G4int sid)
void SetDefinitionAndUpdateE(G4ParticleDefinition *aParticleDefinition)
void SetKineticEnergy(const G4double en)
G4ParticleDefinition * GetDefinition() const
static G4SigmaPlus * SigmaPlus()
static G4XiZero * XiZero()