42 #define MAX_SECONDARIES 100
46 G4NeutronCaptureAtRest::G4NeutronCaptureAtRest(
const G4String& processName,
95 return ( &particle == pdefNeutron );
128 G4cout <<
"G4NeutronCaptureAtRestProcess::AtRestGetPhysicalInteractionLength ";
165 for (
G4int i1=0; i1 < numberOfElements; i1++ )
167 normalization += theAtomicNumberDensity[i1] ;
172 for (
G4int i2=0; i2 < numberOfElements; i2++ )
174 runningSum += theAtomicNumberDensity[i2];
176 if (random<=runningSum)
178 targetCharge =
G4double((*theElementVector)[i2]->GetZ());
179 targetAtomicMass = (*theElementVector)[i2]->GetN();
182 if (random>runningSum)
184 targetCharge =
G4double((*theElementVector)[numberOfElements-1]->GetZ());
185 targetAtomicMass = (*theElementVector)[numberOfElements-1]->GetN();
190 G4cout <<
"G4NeutronCaptureAtRest::AtRestDoIt is invoked " <<
G4endl;
198 GenerateSecondaries();
202 for (
G4int isec = 0; isec < ngkine; isec++ ) {
207 localtime = globalTime + gkin[isec].
GetTOF();
209 G4Track* aNewTrack =
new G4Track( aNewParticle, localtime*
s, position );
228 void G4NeutronCaptureAtRest::GenerateSecondaries()
248 NeutronCapture(&nopt);
267 for (l = 1; l <= ntot; ++l) {
273 gkin[ngkine] = eve[
index];
274 gkin[ngkine].
SetTOF( eve[index].GetTOF() * 5
e-11 );
293 void G4NeutronCaptureAtRest::Normal(
G4float *ran)
301 for (i = 1; i <= 12; ++i) {
308 void G4NeutronCaptureAtRest::NeutronCapture(
G4int *nopt)
321 pv[2].
SetMass( AtomAs(targetAtomicMass, targetCharge) );
347 pv[4].
Lor( pv[4], pv[MAX_SECONDARIES] );
351 if (ntot < MAX_SECONDARIES-1) {
380 rmel = massElectron *
G4float(1e3);
382 rmp = massProton *
G4float(1e3);
384 rmn = massNeutron *
G4float(1e3);
386 rmd = massDeuteron *
G4float(1e3) + rmel;
398 if (iz < 0 || iz > ia) {
410 else if (ia == 2 && iz == 1) {
413 else if (ia == 4 && iz == 2) {
416 else if ( (ia == 2 && iz != 1) || ia == 3 || (ia == 4 && iz != 2) || ia > 4) {
419 mass = (aa -
zz) * rmn + zz * rmp + zz * rmel - aa *
G4float(15.67) +
420 std::pow(aa, .6666667) *
G4float(17.23) + d__1 * d__1 *
G4float(93.15) / aa +
421 d__2 * d__2 *
G4float(.6984523) / std::pow(aa, .3333333);
425 mass += (ipp + izz - 1) *
G4float(12.) * std::pow(aa, -.5);
428 ret_val = mass *
G4float(.001);