54{
55
56
57
58
59
60
61
62
63
64
65 if( vecLen == 0 )return true;
66
67
68
69 if( currentParticle.
GetMass() == 0.0 || targetParticle.
GetMass() == 0.0 )
return true;
70
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;
80
97
100
101
102
103 const G4double avrs[] = {3.,4.,5.,6.,7.,8.,9.,10.,20.,30.,40.,50.};
104
108 while( (i<12) && (centerofmassEnergy>avrs[i]) )++i;
109 if( i == 12 )
110 ibin = 11;
111 else
112 ibin = i;
113
114
115
116
117 if (vecLen == 1) {
118 i3 = 0;
119 i4 = 1;
120 } else {
123 i4 = i3 =
G4int(vecLen*rnd);
124 while(i3 == i4) {
127 i4 =
G4int(vecLen*rnd);
128 }
129 }
130
131
132
133 const G4double avkkb[] = { 0.0015, 0.005, 0.012, 0.0285, 0.0525, 0.075,
134 0.0975, 0.123, 0.28, 0.398, 0.495, 0.573 };
135 const G4double avky[] = { 0.005, 0.03, 0.064, 0.095, 0.115, 0.13,
136 0.145, 0.155, 0.20, 0.205, 0.210, 0.212 };
137 const G4double avnnb[] = { 0.00001, 0.0001, 0.0006, 0.0025, 0.01, 0.02,
138 0.04, 0.05, 0.12, 0.15, 0.18, 0.20 };
139
140 avk = (std::log(avkkb[ibin])-std::log(avkkb[ibin-1]))*(centerofmassEnergy-avrs[ibin-1])
141 /(avrs[ibin]-avrs[ibin-1]) + std::log(avkkb[ibin-1]);
142 avk = std::exp(avk);
143
144 avy = (std::log(avky[ibin])-std::log(avky[ibin-1]))*(centerofmassEnergy-avrs[ibin-1])
145 /(avrs[ibin]-avrs[ibin-1]) + std::log(avky[ibin-1]);
146 avy = std::exp(avy);
147
148 avn = (std::log(avnnb[ibin])-std::log(avnnb[ibin-1]))*(centerofmassEnergy-avrs[ibin-1])
149 /(avrs[ibin]-avrs[ibin-1]) + std::log(avnnb[ibin-1]);
150 avn = std::exp(avn);
151
152 if( avk+avy+avn <= 0.0 )return true;
153
154 if( currentMass < protonMass )avy /= 2.0;
155 if( targetMass < protonMass )avy = 0.0;
156 avy += avk+avn;
157 avk += avn;
159 if( ran < avn )
160 {
161 if( availableEnergy < 2.0 )return true;
162 if( vecLen == 1 )
163 {
166 {
167 vec[0]->SetDefinition( aNeutron );
170 vec[0]->SetMayBeKilled(false);
172 }
173 else
174 {
175 vec[0]->SetDefinition( aProton );
178 vec[0]->SetMayBeKilled(false);
180 }
182
183 }
184 else
185 {
187 {
188 vec[i3]->SetDefinition( aNeutron );
189 vec[i4]->SetDefinition( anAntiNeutron );
190 vec[i3]->SetMayBeKilled(false);
191 vec[i4]->SetMayBeKilled(false);
192 }
193 else
194 {
195 vec[i3]->SetDefinition( aProton );
196 vec[i4]->SetDefinition( anAntiProton );
197 vec[i3]->SetMayBeKilled(false);
198 vec[i4]->SetMayBeKilled(false);
199 }
200 }
201 }
202 else if( ran < avk )
203 {
204 if( availableEnergy < 1.0 )return true;
205
206 const G4double kkb[] = { 0.2500, 0.3750, 0.5000, 0.5625, 0.6250,
207 0.6875, 0.7500, 0.8750, 1.000 };
208 const G4int ipakkb1[] = { 10, 10, 10, 11, 11, 12, 12, 11, 12 };
209 const G4int ipakkb2[] = { 13, 11, 12, 11, 12, 11, 12, 13, 13 };
211 i = 0;
212 while( (i<9) && (ran>=kkb[i]) )++i;
213 if( i == 9 )return true;
214
215
216
217
218 switch( ipakkb1[i] )
219 {
220 case 10:
221 vec[i3]->SetDefinition( aKaonPlus );
222 vec[i3]->SetMayBeKilled(false);
223 break;
224 case 11:
225 vec[i3]->SetDefinition( aKaonZS );
226 vec[i3]->SetMayBeKilled(false);
227 break;
228 case 12:
229 vec[i3]->SetDefinition( aKaonZL );
230 vec[i3]->SetMayBeKilled(false);
231 break;
232 }
233
234 if( vecLen == 1 )
235 {
237 switch( ipakkb2[i] )
238 {
239 case 11:
242 break;
243 case 12:
246 break;
247 case 13:
250 break;
251 }
254
255 }
256 else
257 {
258 switch( ipakkb2[i] )
259 {
260 case 11:
261 vec[i4]->SetDefinition( aKaonZS );
262 vec[i4]->SetMayBeKilled(false);
263 break;
264 case 12:
265 vec[i4]->SetDefinition( aKaonZL );
266 vec[i4]->SetMayBeKilled(false);
267 break;
268 case 13:
269 vec[i4]->SetDefinition( aKaonMinus );
270 vec[i4]->SetMayBeKilled(false);
271 break;
272 }
273 }
274 }
275 else if( ran < avy )
276 {
277 if( availableEnergy < 1.6 )return true;
278
279 const G4double ky[] = { 0.200, 0.300, 0.400, 0.550, 0.625, 0.700,
280 0.800, 0.850, 0.900, 0.950, 0.975, 1.000 };
281 const G4int ipaky1[] = { 18, 18, 18, 20, 20, 20, 21, 21, 21, 22, 22, 22 };
282 const G4int ipaky2[] = { 10, 11, 12, 10, 11, 12, 10, 11, 12, 10, 11, 12 };
283 const G4int ipakyb1[] = { 19, 19, 19, 23, 23, 23, 24, 24, 24, 25, 25, 25 };
284 const G4int ipakyb2[] = { 13, 12, 11, 13, 12, 11, 13, 12, 11, 13, 12, 11 };
286 i = 0;
287 while( (i<12) && (ran>ky[i]) )++i;
288 if( i == 12 )return true;
290 {
291
292
293
294
295
296 switch( ipaky1[i] )
297 {
298 case 18:
300 break;
301 case 20:
303 break;
304 case 21:
306 break;
307 case 22:
309 break;
310 }
311 targetHasChanged = true;
312 switch( ipaky2[i] )
313 {
314 case 10:
315 vec[i3]->SetDefinition( aKaonPlus );
316 vec[i3]->SetMayBeKilled(false);
317 break;
318 case 11:
319 vec[i3]->SetDefinition( aKaonZS );
320 vec[i3]->SetMayBeKilled(false);
321 break;
322 case 12:
323 vec[i3]->SetDefinition( aKaonZL );
324 vec[i3]->SetMayBeKilled(false);
325 break;
326 }
327 }
328 else
329 {
330
331
335 (currentMass > sigmaMinusMass) )
336 {
337 switch( ipakyb1[i] )
338 {
339 case 19:
341 break;
342 case 23:
344 break;
345 case 24:
347 break;
348 case 25:
350 break;
351 }
352 incidentHasChanged = true;
353 switch( ipakyb2[i] )
354 {
355 case 11:
356 vec[i3]->SetDefinition( aKaonZS );
357 vec[i3]->SetMayBeKilled(false);
358 break;
359 case 12:
360 vec[i3]->SetDefinition( aKaonZL );
361 vec[i3]->SetMayBeKilled(false);
362 break;
363 case 13:
364 vec[i3]->SetDefinition( aKaonMinus );
365 vec[i3]->SetMayBeKilled(false);
366 break;
367 }
368 }
369 else
370 {
371 switch( ipaky1[i] )
372 {
373 case 18:
375 break;
376 case 20:
378 break;
379 case 21:
381 break;
382 case 22:
384 break;
385 }
386 incidentHasChanged = true;
387 switch( ipaky2[i] )
388 {
389 case 10:
390 vec[i3]->SetDefinition( aKaonPlus );
391 vec[i3]->SetMayBeKilled(false);
392 break;
393 case 11:
394 vec[i3]->SetDefinition( aKaonZS );
395 vec[i3]->SetMayBeKilled(false);
396 break;
397 case 12:
398 vec[i3]->SetDefinition( aKaonZL );
399 vec[i3]->SetMayBeKilled(false);
400 break;
401 }
402 }
403 }
404 }
405 else return true;
406
407
408
409
410
411
412
413
414
415
416 currentMass = currentParticle.
GetMass()/GeV;
417 targetMass = targetParticle.
GetMass()/GeV;
418
419 G4double energyCheck = centerofmassEnergy-(currentMass+targetMass);
420 for( i=0; i<vecLen; ++i )
421 {
422 energyCheck -= vec[i]->GetMass()/GeV;
423 if( energyCheck < 0.0 )
424 {
425 vecLen = std::max( 0, --i );
427 for(j=i; j<vecLen; j++) delete vec[j];
428 break;
429 }
430 }
431
432 return true;
433}
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()
G4double GetTotalEnergy() const
void SetMayBeKilled(const G4bool f)
void SetSide(const G4int sid)
void SetDefinitionAndUpdateE(G4ParticleDefinition *aParticleDefinition)
G4ParticleDefinition * GetDefinition() const
void SetDefinition(G4ParticleDefinition *aParticleDefinition)
static G4SigmaMinus * SigmaMinus()
static G4SigmaPlus * SigmaPlus()
static G4SigmaZero * SigmaZero()