155 G4double centerofmassEnergy = std::sqrt( mOriginal*mOriginal +
156 targetMass*targetMass +
157 2.0*targetMass*etOriginal );
158 G4double availableEnergy = centerofmassEnergy-(targetMass+mOriginal);
164 const G4int numMul = 1200;
165 const G4int numSec = 60;
170 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];
243 for( np=0; np<numSec/3 && ran>=excs; ++np )
245 for( nneg=
std::max(0,np-1); nneg<=(np+1) && ran>=excs; ++nneg )
247 for( nz=0; nz<numSec/3 && ran>=excs; ++nz )
249 if( ++counter < numMul )
252 if( nt>0 && nt<=numSec )
255 dum = (
pi/anpn)*nt*protmul[counter]*protnorm[nt-1]/(2.0*n*n);
256 if( std::fabs(dum) < 1.0 )
258 if( test >= 1.0
e-10 )excs += dum*
test;
284 incidentHasChanged =
true;
289 incidentHasChanged =
true;
301 else if( np == nneg )
306 incidentHasChanged =
true;
308 targetHasChanged =
true;
314 targetHasChanged =
true;
320 for( np=0; np<numSec/3 && ran>=excs; ++np )
322 for( nneg=np; nneg<=(np+2) && ran>=excs; ++nneg )
324 for( nz=0; nz<numSec/3 && ran>=excs; ++nz )
326 if( ++counter < numMul )
329 if( nt>0 && nt<=numSec )
332 dum = (
pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
333 if( std::fabs(dum) < 1.0 )
335 if( test >= 1.0
e-10 )excs += dum*
test;
355 incidentHasChanged =
true;
357 targetHasChanged =
true;
362 incidentHasChanged =
true;
364 targetHasChanged =
true;
376 else if( np+1 == nneg )
381 incidentHasChanged =
true;
386 targetHasChanged =
true;
void SetElement(G4int anIndex, Type *anElement)
G4double GetTotalEnergy() const
void SetSide(const G4int sid)
void Initialize(G4int items)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
static G4KaonMinus * KaonMinus()
G4double Pmltpc(G4int np, G4int nm, G4int nz, G4int n, G4double b, G4double c)
static G4XiZero * XiZero()
static G4Proton * Proton()
static G4PionPlus * PionPlus()
void SetDefinitionAndUpdateE(const G4ParticleDefinition *aParticleDefinition)
static G4Neutron * Neutron()
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
const G4ParticleDefinition * GetDefinition() const
G4double GetPDGMass() const
const G4ParticleDefinition * GetDefinition() const
static G4SigmaPlus * SigmaPlus()
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)