42 #define MAX_SECONDARIES 100
46 G4AntiNeutronAnnihilationAtRest::G4AntiNeutronAnnihilationAtRest(
const G4String& processName,
104 return ( &particle == pdefAntiNeutron );
137 G4cout <<
"G4AntiNeutronAnnihilationAtRestProcess::AtRestGetPhysicalInteractionLength ";
174 for (
G4int i1=0; i1 < numberOfElements; i1++ )
176 normalization += theAtomicNumberDensity[i1] ;
181 for (
G4int i2=0; i2 < numberOfElements; i2++ )
183 runningSum += theAtomicNumberDensity[i2];
185 if (random<=runningSum)
187 targetCharge =
G4double( ((*theElementVector)[i2])->GetZ());
188 targetAtomicMass = (*theElementVector)[i2]->GetN();
191 if (random>runningSum)
193 targetCharge =
G4double( ((*theElementVector)[numberOfElements-1])->GetZ());
194 targetAtomicMass = (*theElementVector)[numberOfElements-1]->GetN();
198 G4cout <<
"G4AntiNeutronAnnihilationAtRest::AtRestDoIt is invoked " <<
G4endl;
206 GenerateSecondaries();
210 for (
G4int isec = 0; isec < ngkine; isec++ ) {
215 localtime = globalTime + gkin[isec].
GetTOF();
217 G4Track* aNewTrack =
new G4Track( aNewParticle, localtime*
s, position );
236 void G4AntiNeutronAnnihilationAtRest::GenerateSecondaries()
252 result.
SetMass( massAntiNeutron );
259 AntiNeutronAnnihilation(&nopt);
278 for (l = 1; l <= ntot; ++l) {
284 gkin[ngkine] = eve[
index];
285 gkin[ngkine].
SetTOF( eve[index].GetTOF() * 5
e-11 );
304 void G4AntiNeutronAnnihilationAtRest::Poisso(
G4float xav,
G4int *iran)
309 static G4float rr, ran, rrr, ran1;
319 ran1 = xav + ran1 * std::sqrt(xav);
333 for (i = 1; i <= fivex; ++i) {
336 rrr = std::pow(xav,
G4float(i)) / NFac(i);
340 rrr = std::exp(i * std::log(xav) -
353 p1 = xav * std::exp(-
G4double(xav));
379 G4int G4AntiNeutronAnnihilationAtRest::NFac(
G4int n)
394 for (i = 2; i <= j; ++i) {
403 void G4AntiNeutronAnnihilationAtRest::Normal(
G4float *ran)
411 for (i = 1; i <= 12; ++i) {
418 void G4AntiNeutronAnnihilationAtRest::AntiNeutronAnnihilation(
G4int *nopt)
424 static G4int i, ii, kk;
427 static G4int ika, nbl;
432 static G4float ran1, ran2, ekin, tkin;
435 static G4float ekin1, ekin2, black;
436 static G4float pnrat, rmnve1, rmnve2;
450 pv[1].
SetMass( massAntiNeutron );
469 rmnve1 = massPionPlus;
470 rmnve2 = massPionMinus;
472 rmnve1 = massPionZero;
475 rmnve2 = massPionZero;
478 rmnve2 = massPionZero;
486 ek = massNeutron + massAntiNeutron - rmnve1 - rmnve2;
493 en = ek + (rmnve1 + rmnve2) /
G4float(2.);
494 r__1 = en * en - rmnve1 * rmnve2;
495 pcm = r__1 > 0 ? std::sqrt(r__1) : 0;
506 pv[3].
SetEnergy( std::sqrt(pv[3].GetMass()*pv[3].GetMass()+pcm*pcm) );
530 if (targetAtomicMass >=
G4float(1.5)) {
537 black = (targ *
G4float(1.25) +
538 G4float(1.5)) * evapEnergy1 / (evapEnergy1 + evapEnergy3);
541 nbl =
G4int(targetAtomicMass - targ);
549 for (i = 1; i <= nbl; ++i) {
558 ekin1 = -
G4double(ekin) * std::log(ran1) -
561 ekin1 = std::log(ran1) *
G4float(-.01);
566 ekin1 = tex - (ekin2 - ekin1);
572 pnrat =
G4float(1.) - targetCharge / targetAtomicMass;
594 for (i = 1; i <=
nt; ++i) {
596 if (pv[ii].GetParticleDef() != pdefProton) {
616 (evapEnergy1 + evapEnergy3);
624 for (i = 1; i <= nbl; ++i) {
633 ekin1 = -
G4double(ekin) * std::log(ran1) -
636 ekin1 = std::log(ran1) *
G4float(-.01);
641 ekin1 = tex - (ekin2 - ekin1);
668 for (i = 3; i <=
nt; ++i) {
682 static G4float cfa, gfa, ran1, ran2, ekin1, atno3;
692 if (targetAtomicMass >=
G4float(1.5)) {
706 cfa =
G4float(.13043478260869565);
707 cfa = cfa * std::log(ekin1) +
G4float(.35);
712 atno3 = targetAtomicMass;
724 gfa = (targetAtomicMass -
G4float(1.)) /
727 evapEnergy1 = ret_val * fpdiv;
728 evapEnergy3 = ret_val - evapEnergy1;
735 evapEnergy1 *= ran1 * gfa +
G4float(1.);
736 if (evapEnergy1 <
G4float(0.)) {
739 evapEnergy3 *= ran2 * gfa +
G4float(1.);
740 if (evapEnergy3 <
G4float(0.)) {
743 while ((ret_val = evapEnergy1 + evapEnergy3) >= ek1) {