44 G4bool& incidentHasChanged,
65 if( vecLen == 0 )
return true;
69 if( currentParticle.
GetMass() == 0.0 || targetParticle.
GetMass() == 0.0 )
return true;
74 G4double centerofmassEnergy = std::sqrt( mOriginal*mOriginal +
75 targetMass*targetMass +
76 2.0*targetMass*etOriginal );
78 G4double availableEnergy = centerofmassEnergy-(targetMass+currentMass);
79 if( availableEnergy <= 1.0 )
return true;
103 const G4double avrs[] = {3.,4.,5.,6.,7.,8.,9.,10.,20.,30.,40.,50.};
111 ed <<
" While count exceeded " <<
G4endl;
112 while ((i<12) && (centerofmassEnergy>avrs[i]) ) {
136 i4 = i3 =
G4int(vecLen*rnd);
141 i4 =
G4int(vecLen*rnd);
147 const G4double avkkb[] = { 0.0015, 0.005, 0.012, 0.0285, 0.0525, 0.075,
148 0.0975, 0.123, 0.28, 0.398, 0.495, 0.573 };
149 const G4double avky[] = { 0.005, 0.03, 0.064, 0.095, 0.115, 0.13,
150 0.145, 0.155, 0.20, 0.205, 0.210, 0.212 };
151 const G4double avnnb[] = { 0.00001, 0.0001, 0.0006, 0.0025, 0.01, 0.02,
152 0.04, 0.05, 0.12, 0.15, 0.18, 0.20 };
154 avk = (
G4Log(avkkb[ibin])-
G4Log(avkkb[ibin-1]))*(centerofmassEnergy-avrs[ibin-1])
155 /(avrs[ibin]-avrs[ibin-1]) +
G4Log(avkkb[ibin-1]);
158 avy = (
G4Log(avky[ibin])-
G4Log(avky[ibin-1]))*(centerofmassEnergy-avrs[ibin-1])
159 /(avrs[ibin]-avrs[ibin-1]) +
G4Log(avky[ibin-1]);
162 avn = (
G4Log(avnnb[ibin])-
G4Log(avnnb[ibin-1]))*(centerofmassEnergy-avrs[ibin-1])
163 /(avrs[ibin]-avrs[ibin-1]) +
G4Log(avnnb[ibin-1]);
166 if( avk+avy+avn <= 0.0 )
return true;
168 if( currentMass < protonMass )avy /= 2.0;
169 if( targetMass < protonMass )avy = 0.0;
175 if( availableEnergy < 2.0 )
return true;
181 vec[0]->SetDefinition( aNeutron );
184 vec[0]->SetMayBeKilled(
false);
189 vec[0]->SetDefinition( aProton );
192 vec[0]->SetMayBeKilled(
false);
202 vec[i3]->SetDefinition( aNeutron );
203 vec[i4]->SetDefinition( anAntiNeutron );
204 vec[i3]->SetMayBeKilled(
false);
205 vec[i4]->SetMayBeKilled(
false);
209 vec[i3]->SetDefinition( aProton );
210 vec[i4]->SetDefinition( anAntiProton );
211 vec[i3]->SetMayBeKilled(
false);
212 vec[i4]->SetMayBeKilled(
false);
218 if( availableEnergy < 1.0 )
return true;
220 const G4double kkb[] = { 0.2500, 0.3750, 0.5000, 0.5625, 0.6250,
221 0.6875, 0.7500, 0.8750, 1.000 };
222 const G4int ipakkb1[] = { 10, 10, 10, 11, 11, 12, 12, 11, 12 };
223 const G4int ipakkb2[] = { 13, 11, 12, 11, 12, 11, 12, 13, 13 };
229 eda <<
" While count exceeded " <<
G4endl;
230 while( (i<9) && (ran>=kkb[i]) ) {
239 if( i == 9 )
return true;
247 vec[i3]->SetDefinition( aKaonPlus );
248 vec[i3]->SetMayBeKilled(
false);
251 vec[i3]->SetDefinition( aKaonZS );
252 vec[i3]->SetMayBeKilled(
false);
255 vec[i3]->SetDefinition( aKaonZL );
256 vec[i3]->SetMayBeKilled(
false);
287 vec[i4]->SetDefinition( aKaonZS );
288 vec[i4]->SetMayBeKilled(
false);
291 vec[i4]->SetDefinition( aKaonZL );
292 vec[i4]->SetMayBeKilled(
false);
295 vec[i4]->SetDefinition( aKaonMinus );
296 vec[i4]->SetMayBeKilled(
false);
301 }
else if( ran < avy ) {
302 if( availableEnergy < 1.6 )
return true;
304 const G4double ky[] = { 0.200, 0.300, 0.400, 0.550, 0.625, 0.700,
305 0.800, 0.850, 0.900, 0.950, 0.975, 1.000 };
306 const G4int ipaky1[] = { 18, 18, 18, 20, 20, 20, 21, 21, 21, 22, 22, 22 };
307 const G4int ipaky2[] = { 10, 11, 12, 10, 11, 12, 10, 11, 12, 10, 11, 12 };
308 const G4int ipakyb1[] = { 19, 19, 19, 23, 23, 23, 24, 24, 24, 25, 25, 25 };
309 const G4int ipakyb2[] = { 13, 12, 11, 13, 12, 11, 13, 12, 11, 13, 12, 11 };
315 edb <<
" While count exceeded " <<
G4endl;
316 while( (i<12) && (ran>ky[i]) ) {
325 if( i == 12 )
return true;
347 targetHasChanged =
true;
351 vec[i3]->SetDefinition( aKaonPlus );
352 vec[i3]->SetMayBeKilled(
false);
355 vec[i3]->SetDefinition( aKaonZS );
356 vec[i3]->SetMayBeKilled(
false);
359 vec[i3]->SetDefinition( aKaonZL );
360 vec[i3]->SetMayBeKilled(
false);
370 (currentMass > sigmaMinusMass) ) {
386 incidentHasChanged =
true;
390 vec[i3]->SetDefinition( aKaonZS );
391 vec[i3]->SetMayBeKilled(
false);
394 vec[i3]->SetDefinition( aKaonZL );
395 vec[i3]->SetMayBeKilled(
false);
398 vec[i3]->SetDefinition( aKaonMinus );
399 vec[i3]->SetMayBeKilled(
false);
419 incidentHasChanged =
true;
423 vec[i3]->SetDefinition( aKaonPlus );
424 vec[i3]->SetMayBeKilled(
false);
427 vec[i3]->SetDefinition( aKaonZS );
428 vec[i3]->SetMayBeKilled(
false);
431 vec[i3]->SetDefinition( aKaonZL );
432 vec[i3]->SetMayBeKilled(
false);
449 currentMass = currentParticle.
GetMass()/GeV;
450 targetMass = targetParticle.
GetMass()/GeV;
452 G4double energyCheck = centerofmassEnergy-(currentMass+targetMass);
453 for( i=0; i<vecLen; ++i )
455 energyCheck -= vec[i]->GetMass()/GeV;
456 if( energyCheck < 0.0 )
458 vecLen = std::max( 0, --i );
460 for(j=i; j<vecLen; j++)
delete vec[j];
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double G4Log(G4double x)
static G4AntiLambda * AntiLambda()
static G4AntiNeutron * AntiNeutron()
static G4AntiProton * AntiProton()
static G4AntiSigmaMinus * AntiSigmaMinus()
static G4AntiSigmaPlus * AntiSigmaPlus()
static G4AntiSigmaZero * AntiSigmaZero()
G4ParticleDefinition * GetDefinition() const
void SetElement(G4int anIndex, Type *anElement)
static G4KaonMinus * KaonMinus()
static G4KaonPlus * KaonPlus()
static G4KaonZeroLong * KaonZeroLong()
static G4KaonZeroShort * KaonZeroShort()
static G4Lambda * Lambda()
static G4Neutron * Neutron()
G4double GetPDGMass() const
static G4Proton * Proton()
G4bool ReactionStage(const G4HadProjectile *, G4ReactionProduct &, G4bool &, const G4DynamicParticle *, G4ReactionProduct &, G4bool &, const G4Nucleus &, G4ReactionProduct &, G4FastVector< G4ReactionProduct, 256 > &, G4int &, G4bool, G4ReactionProduct &)
const G4ParticleDefinition * GetDefinition() const
G4double GetTotalEnergy() const
void SetMayBeKilled(const G4bool f)
void SetSide(const G4int sid)
void SetDefinitionAndUpdateE(const G4ParticleDefinition *aParticleDefinition)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
static G4SigmaMinus * SigmaMinus()
static G4SigmaPlus * SigmaPlus()
static G4SigmaZero * SigmaZero()