42 #define MAX_SECONDARIES 100
46 G4KaonMinusAbsorption::G4KaonMinusAbsorption(
const G4String& processName,
102 return ( &particle == pdefKaonMinus );
135 G4cout <<
"G4KaonMinusAbsorptionProcess::AtRestGetPhysicalInteractionLength ";
172 for (
G4int i1=0; i1 < numberOfElements; i1++ )
174 normalization += theAtomicNumberDensity[i1] ;
179 for (
G4int i2=0; i2 < numberOfElements; i2++ )
181 runningSum += theAtomicNumberDensity[i2];
183 if (random<=runningSum)
185 targetCharge =
G4double( ((*theElementVector)[i2])->GetZ());
186 targetAtomicMass = (*theElementVector)[i2]->GetN();
189 if (random>runningSum)
191 targetCharge =
G4double((*theElementVector)[numberOfElements-1]->GetZ());
192 targetAtomicMass = (*theElementVector)[numberOfElements-1]->GetN();
197 G4cout <<
"G4KaonMinusAbsorption::AtRestDoIt is invoked " <<
G4endl;
205 GenerateSecondaries();
209 for (
G4int isec = 0; isec < ngkine; isec++ ) {
214 localtime = globalTime + gkin[isec].
GetTOF();
216 G4Track* aNewTrack =
new G4Track( aNewParticle, localtime*
s, position );
235 void G4KaonMinusAbsorption::GenerateSecondaries()
250 result.
SetMass( massKaonMinus );
255 KaonMinusAbsorption(&nopt);
274 for (l = 1; l <= ntot; ++l) {
280 gkin[ngkine] = eve[
index];
281 gkin[ngkine].
SetTOF( eve[index].GetTOF() * 5
e-11 );
300 void G4KaonMinusAbsorption::Poisso(
G4float xav,
G4int *iran)
305 static G4float rr, ran, rrr, ran1;
315 ran1 = xav + ran1 * std::sqrt(xav);
329 for (i = 1; i <= fivex; ++i) {
332 rrr = std::pow(xav,
G4float(i)) / NFac(i);
336 rrr = std::exp(i * std::log(xav) -
349 p1 = xav * std::exp(-
G4double(xav));
390 for (i = 2; i <= j; ++i) {
399 void G4KaonMinusAbsorption::Normal(
G4float *ran)
407 for (i = 1; i <= 12; ++i) {
414 void G4KaonMinusAbsorption::KaonMinusAbsorption(
G4int *nopt)
421 static G4float ran2, tof1, ekin, ekin1, ekin2, black;
434 pv[1].
SetMass( massKaonMinus );
438 if (targetAtomicMass <=
G4float(1.5)) {
440 tof1 = std::log(ran) *
G4float(-12.5);
453 pcm = massKaonMinus + massProton - massLambda;
462 pcm = pcm * pcm - massPionZero * massPionZero;
467 pv[2].
SetEnergy( std::sqrt(pcm + massPionZero * massPionZero) );
485 black = std::log(targetAtomicMass) *
G4float(.5);
495 for (i = 1; i <= nbl; ++i) {
500 ekin1 = -
G4double(ekin) * std::log(ran2);
503 pnrat =
G4float(1.) - targetCharge / targetAtomicMass;
518 black = std::log(targetAtomicMass) *
G4float(.5);
528 for (i = 1; i <= nbl; ++i) {
533 ekin1 = -
G4double(ekin) * std::log(ran2);
558 tof1 = std::log(ran) *
G4float(-12.5);
560 for (i = 2; i <=
nt; ++i) {
564 for (i = 3; i <=
nt; ++i) {