Import Geant4 3.0.0 source tree
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
//
|
||||
// MODULE: G4NuclearDecayChannel.cc
|
||||
// MODULES: G4NuclearDecayChannel.cc
|
||||
//
|
||||
// Version: 0.b.4
|
||||
// Date: 14/04/00
|
||||
@@ -38,11 +38,11 @@
|
||||
#include "G4PhotonEvaporation.hh"
|
||||
#include "G4VGammaDeexcitation.hh"
|
||||
#include "G4Gamma.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
|
||||
const G4double G4NuclearDecayChannel:: pTolerance = 0.001;
|
||||
const G4double G4NuclearDecayChannel:: levelTolerance = 2.0*keV;
|
||||
const G4bool G4NuclearDecayChannel:: FermiOn = true;
|
||||
//const G4bool G4NuclearDecayChannel:: FermiOn = true;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -87,7 +87,7 @@ G4NuclearDecayChannel::G4NuclearDecayChannel
|
||||
G4int Z,
|
||||
G4double theDaughterExcitation,
|
||||
const G4String theDaughterName1) :
|
||||
G4GeneralPhaseSpaceDecay(Verbose), decayMode(theMode)
|
||||
G4GeneralPhaseSpaceDecay(Verbose), decayMode(theMode)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>1)
|
||||
@@ -113,13 +113,17 @@ G4NuclearDecayChannel::G4NuclearDecayChannel
|
||||
const G4ParticleDefinition *theParentNucleus,
|
||||
G4double theBR,
|
||||
G4double theFFN,
|
||||
G4bool betaS,
|
||||
RandGeneral* randBeta,
|
||||
G4double theQtransition,
|
||||
G4int A,
|
||||
G4int Z,
|
||||
G4double theDaughterExcitation,
|
||||
const G4String theDaughterName1,
|
||||
const G4String theDaughterName2) :
|
||||
G4GeneralPhaseSpaceDecay(Verbose), decayMode(theMode)
|
||||
G4GeneralPhaseSpaceDecay(Verbose), decayMode(theMode)
|
||||
//,BetaSimple(betaS),
|
||||
// RandomEnergy(randBeta), Qtransition(theQtransition),FermiFN(theFFN)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>1)
|
||||
@@ -133,6 +137,8 @@ G4NuclearDecayChannel::G4NuclearDecayChannel
|
||||
SetDaughter(0, theDaughterName1);
|
||||
SetDaughter(2, theDaughterName2);
|
||||
FillDaughterNucleus(1, A, Z, theDaughterExcitation);
|
||||
BetaSimple = betaS;
|
||||
RandomEnergy = randBeta;
|
||||
Qtransition = theQtransition;
|
||||
FermiFN = theFFN;
|
||||
}
|
||||
@@ -383,6 +389,7 @@ G4DecayProducts *G4NuclearDecayChannel::DecayIt (G4double theParentMass)
|
||||
|
||||
|
||||
G4DecayProducts *G4NuclearDecayChannel::BetaDecayIt()
|
||||
|
||||
{
|
||||
if (GetVerboseLevel()>1) G4cout << "G4Decay::BetaDecayIt()"<<G4endl;
|
||||
|
||||
@@ -404,134 +411,172 @@ G4DecayProducts *G4NuclearDecayChannel::BetaDecayIt()
|
||||
G4DecayProducts *products = new G4DecayProducts(*parentparticle);
|
||||
delete parentparticle;
|
||||
|
||||
|
||||
//calculate daughter momentum
|
||||
// Generate two
|
||||
G4double rd1, rd2, rd;
|
||||
G4double daughtermomentum[3];
|
||||
G4double daughterenergy[3];
|
||||
G4double momentummax=0.0, momentumsum = 0.0;
|
||||
G4double Q = pmass - sumofdaughtermass;
|
||||
G4double fermif;
|
||||
G4BetaFermiFunction* aBetaFermiFunction;
|
||||
if (decayMode == 1) {
|
||||
// beta-decay
|
||||
aBetaFermiFunction = new G4BetaFermiFunction (daughterA, daughterZ);
|
||||
G4double Q = pmass - sumofdaughtermass;
|
||||
|
||||
if (BetaSimple == true) {
|
||||
|
||||
// Use the histogramed distribution to generate the beta energy
|
||||
G4double daughtermomentum[2];
|
||||
G4double daughterenergy[2];
|
||||
daughterenergy[0] = RandomEnergy->shoot() * Q;
|
||||
daughtermomentum[0] = sqrt(daughterenergy[0]*daughterenergy[0] +
|
||||
2.0*daughterenergy[0] * daughtermass[0]);
|
||||
// the recoil neuleus is asummed to have a maximum energy of Q/daughterA/1000.
|
||||
daughterenergy[1] = G4UniformRand() * Q/(1000.*daughterA);
|
||||
daughtermomentum[1] = sqrt(daughterenergy[1]*daughterenergy[1] +
|
||||
2.0*daughterenergy[1] * daughtermass[1]);
|
||||
//
|
||||
//create daughter G4DynamicParticle
|
||||
G4double costheta, sintheta, phi, sinphi, cosphi;
|
||||
G4double costhetan, sinthetan, phin, sinphin, cosphin;
|
||||
costheta = 2.*G4UniformRand()-1.0;
|
||||
sintheta = sqrt((1.0-costheta)*(1.0+costheta));
|
||||
phi = 2.0*M_PI*G4UniformRand()*rad;
|
||||
sinphi = sin(phi);
|
||||
cosphi = cos(phi);
|
||||
G4ParticleMomentum direction0(sintheta*cosphi,sintheta*sinphi,costheta);
|
||||
G4DynamicParticle * daughterparticle
|
||||
= new G4DynamicParticle( daughters[0], direction0*daughtermomentum[0]);
|
||||
products->PushProducts(daughterparticle);
|
||||
// The two products are independent in directions
|
||||
costheta = 2.*G4UniformRand()-1.0;
|
||||
sintheta = sqrt((1.0-costheta)*(1.0+costheta));
|
||||
phi = 2.0*M_PI*G4UniformRand()*rad;
|
||||
sinphi = sin(phi);
|
||||
cosphi = cos(phi);
|
||||
G4ParticleMomentum direction1(sintheta*cosphi,sintheta*sinphi,costheta);
|
||||
daughterparticle
|
||||
= new G4DynamicParticle( daughters[1], direction1*daughtermomentum[1]);
|
||||
products->PushProducts(daughterparticle);
|
||||
|
||||
// the neutrino is igored in this case
|
||||
|
||||
} else {
|
||||
// beta+decay
|
||||
aBetaFermiFunction = new G4BetaFermiFunction (daughterA, -daughterZ);
|
||||
//calculate daughter momentum
|
||||
// Generate two
|
||||
G4double rd1, rd2, rd;
|
||||
G4double daughtermomentum[3];
|
||||
G4double daughterenergy[3];
|
||||
G4double momentummax=0.0, momentumsum = 0.0;
|
||||
G4double fermif;
|
||||
G4BetaFermiFunction* aBetaFermiFunction;
|
||||
if (decayMode == 1) {
|
||||
// beta-decay
|
||||
aBetaFermiFunction = new G4BetaFermiFunction (daughterA, daughterZ);
|
||||
} else {
|
||||
// beta+decay
|
||||
aBetaFermiFunction = new G4BetaFermiFunction (daughterA, -daughterZ);
|
||||
}
|
||||
if (GetVerboseLevel()>1) {
|
||||
G4cout<< " Q = " <<Q<<G4endl;
|
||||
G4cout<< " daughterA = " <<daughterA<<G4endl;
|
||||
G4cout<< " daughterZ = " <<daughterZ<<G4endl;
|
||||
G4cout<< " decayMode = " <<decayMode << G4endl;
|
||||
G4cout<< " FermiFN = " <<FermiFN<<G4endl;
|
||||
}
|
||||
do
|
||||
{
|
||||
rd1 = G4UniformRand();
|
||||
rd2 = G4UniformRand();
|
||||
|
||||
momentummax = 0.0;
|
||||
momentumsum = 0.0;
|
||||
|
||||
// daughter 0
|
||||
|
||||
// energy = rd2*(pmass - sumofdaughtermass);
|
||||
daughtermomentum[0] = sqrt(rd2) * sqrt((Q + 2.0*daughtermass[0])*Q);
|
||||
daughterenergy[0] = sqrt(daughtermomentum[0]*daughtermomentum[0] +
|
||||
daughtermass[0] * daughtermass[0]) - daughtermass[0];
|
||||
if ( daughtermomentum[0] >momentummax )momentummax = daughtermomentum[0];
|
||||
momentumsum += daughtermomentum[0];
|
||||
|
||||
// daughter 2
|
||||
// energy = (1.-rd1)*(pmass - sumofdaughtermass);
|
||||
daughtermomentum[2] = sqrt(rd1)*sqrt((Q + 2.0*daughtermass[2])*Q);
|
||||
daughterenergy[2] = sqrt(daughtermomentum[2]*daughtermomentum[2] +
|
||||
daughtermass[2] * daughtermass[2]) - daughtermass[2];
|
||||
if ( daughtermomentum[2] >momentummax )momentummax = daughtermomentum[2];
|
||||
momentumsum += daughtermomentum[2];
|
||||
|
||||
// daughter 1
|
||||
|
||||
daughterenergy[1] = Q - daughterenergy[0] - daughterenergy[2];
|
||||
if (daughterenergy[1] > 0.0) {
|
||||
daughtermomentum[1] = sqrt(daughterenergy[1]*daughterenergy[1] +
|
||||
2.0*daughterenergy[1] * daughtermass[1]);
|
||||
if ( daughtermomentum[1] >momentummax ) momentummax =
|
||||
daughtermomentum[1];
|
||||
momentumsum += daughtermomentum[1];
|
||||
} else {
|
||||
momentummax = momentumsum = Q;
|
||||
}
|
||||
// beta particles is sampled with no coulomb effects applied above. Now
|
||||
// apply the Fermi function using rejection method.
|
||||
daughterenergy[0] = daughterenergy[0]*MeV/0.511;
|
||||
fermif = aBetaFermiFunction->GetFF(daughterenergy[0])/FermiFN;
|
||||
// fermif: normalised Fermi factor
|
||||
if (G4UniformRand() > fermif) momentummax = momentumsum = Q;
|
||||
// rejection method
|
||||
} while (momentummax > momentumsum - momentummax );
|
||||
delete aBetaFermiFunction;
|
||||
|
||||
// output message
|
||||
if (GetVerboseLevel()>1) {
|
||||
G4cout <<" daughter 0:" <<daughtermomentum[0]/GeV <<"[GeV/c]" <<G4endl;
|
||||
G4cout <<" daughter 1:" <<daughtermomentum[1]/GeV <<"[GeV/c]" <<G4endl;
|
||||
G4cout <<" daughter 2:" <<daughtermomentum[2]/GeV <<"[GeV/c]" <<G4endl;
|
||||
G4cout <<" momentum sum:" <<momentumsum/GeV <<"[GeV/c]" <<G4endl;
|
||||
}
|
||||
|
||||
|
||||
//create daughter G4DynamicParticle
|
||||
G4double costheta, sintheta, phi, sinphi, cosphi;
|
||||
G4double costhetan, sinthetan, phin, sinphin, cosphin;
|
||||
costheta = 2.*G4UniformRand()-1.0;
|
||||
sintheta = sqrt((1.0-costheta)*(1.0+costheta));
|
||||
phi = 2.0*M_PI*G4UniformRand()*rad;
|
||||
sinphi = sin(phi);
|
||||
cosphi = cos(phi);
|
||||
G4ParticleMomentum direction0(sintheta*cosphi,sintheta*sinphi,costheta);
|
||||
G4DynamicParticle * daughterparticle
|
||||
= new G4DynamicParticle( daughters[0], direction0*daughtermomentum[0]);
|
||||
products->PushProducts(daughterparticle);
|
||||
|
||||
costhetan = (daughtermomentum[1]*daughtermomentum[1]-
|
||||
daughtermomentum[2]*daughtermomentum[2]-
|
||||
daughtermomentum[0]*daughtermomentum[0])/
|
||||
(2.0*daughtermomentum[2]*daughtermomentum[0]);
|
||||
sinthetan = sqrt((1.0-costhetan)*(1.0+costhetan));
|
||||
phin = 2.0*M_PI*G4UniformRand()*rad;
|
||||
sinphin = sin(phin);
|
||||
cosphin = cos(phin);
|
||||
G4ParticleMomentum direction2;
|
||||
direction2.setX( sinthetan*cosphin*costheta*cosphi -
|
||||
sinthetan*sinphin*sinphi + costhetan*sintheta*cosphi);
|
||||
direction2.setY( sinthetan*cosphin*costheta*sinphi +
|
||||
sinthetan*sinphin*cosphi + costhetan*sintheta*sinphi);
|
||||
direction2.setZ( -sinthetan*cosphin*sintheta +
|
||||
costhetan*costheta);
|
||||
daughterparticle = new G4DynamicParticle
|
||||
( daughters[2], direction2*(daughtermomentum[2]/direction2.mag()));
|
||||
products->PushProducts(daughterparticle);
|
||||
|
||||
daughterparticle =
|
||||
new G4DynamicParticle (daughters[1],
|
||||
(direction0*daughtermomentum[0] +
|
||||
direction2*(daughtermomentum[2]/direction2.mag()))*(-1.0));
|
||||
products->PushProducts(daughterparticle);
|
||||
}
|
||||
if (GetVerboseLevel()>1) {
|
||||
G4cout<< " Q = " <<Q<<G4endl;
|
||||
G4cout<< " daughterA = " <<daughterA<<G4endl;
|
||||
G4cout<< " daughterZ = " <<daughterZ<<G4endl;
|
||||
G4cout<< " decayMode = " <<decayMode << G4endl;
|
||||
G4cout<< " FermiFN = " <<FermiFN<<G4endl;
|
||||
}
|
||||
do
|
||||
{
|
||||
rd1 = G4UniformRand();
|
||||
rd2 = G4UniformRand();
|
||||
|
||||
momentummax = 0.0;
|
||||
momentumsum = 0.0;
|
||||
|
||||
// daughter 0
|
||||
|
||||
// energy = rd2*(pmass - sumofdaughtermass);
|
||||
daughtermomentum[0] = sqrt(rd2) * sqrt((Q + 2.0*daughtermass[0])*Q);
|
||||
daughterenergy[0] = sqrt(daughtermomentum[0]*daughtermomentum[0] +
|
||||
daughtermass[0] * daughtermass[0]) - daughtermass[0];
|
||||
if ( daughtermomentum[0] >momentummax )momentummax = daughtermomentum[0];
|
||||
momentumsum += daughtermomentum[0];
|
||||
|
||||
// daughter 2
|
||||
// energy = (1.-rd1)*(pmass - sumofdaughtermass);
|
||||
daughtermomentum[2] = sqrt(rd1)*sqrt((Q + 2.0*daughtermass[2])*Q);
|
||||
daughterenergy[2] = sqrt(daughtermomentum[2]*daughtermomentum[2] +
|
||||
daughtermass[2] * daughtermass[2]) - daughtermass[2];
|
||||
if ( daughtermomentum[2] >momentummax )momentummax = daughtermomentum[2];
|
||||
momentumsum += daughtermomentum[2];
|
||||
|
||||
// daughter 1
|
||||
|
||||
daughterenergy[1] = Q - daughterenergy[0] - daughterenergy[2];
|
||||
if (daughterenergy[1] > 0.0) {
|
||||
daughtermomentum[1] = sqrt(daughterenergy[1]*daughterenergy[1] +
|
||||
2.0*daughterenergy[1] * daughtermass[1]);
|
||||
if ( daughtermomentum[1] >momentummax ) momentummax =
|
||||
daughtermomentum[1];
|
||||
momentumsum += daughtermomentum[1];
|
||||
} else {
|
||||
momentummax = momentumsum = Q;
|
||||
}
|
||||
// beta particles is sampled with no coulomb effects applied above. Now
|
||||
// apply the Fermi function using rejection method.
|
||||
if (FermiOn) {
|
||||
daughterenergy[0] = daughterenergy[0]*MeV/0.511;
|
||||
fermif = aBetaFermiFunction->GetFF(daughterenergy[0])/FermiFN;
|
||||
// fermif: normalised Fermi factor
|
||||
if (G4UniformRand() > fermif) momentummax = momentumsum = Q;
|
||||
// rejection method
|
||||
}
|
||||
} while (momentummax > momentumsum - momentummax );
|
||||
|
||||
delete aBetaFermiFunction;
|
||||
|
||||
// output message
|
||||
if (GetVerboseLevel()>1) {
|
||||
G4cout <<" daughter 0:" <<daughtermomentum[0]/GeV <<"[GeV/c]" <<G4endl;
|
||||
G4cout <<" daughter 1:" <<daughtermomentum[1]/GeV <<"[GeV/c]" <<G4endl;
|
||||
G4cout <<" daughter 2:" <<daughtermomentum[2]/GeV <<"[GeV/c]" <<G4endl;
|
||||
G4cout <<" momentum sum:" <<momentumsum/GeV <<"[GeV/c]" <<G4endl;
|
||||
}
|
||||
|
||||
//create daughter G4DynamicParticle
|
||||
G4double costheta, sintheta, phi, sinphi, cosphi;
|
||||
G4double costhetan, sinthetan, phin, sinphin, cosphin;
|
||||
costheta = 2.*G4UniformRand()-1.0;
|
||||
sintheta = sqrt((1.0-costheta)*(1.0+costheta));
|
||||
phi = 2.0*M_PI*G4UniformRand()*rad;
|
||||
sinphi = sin(phi);
|
||||
cosphi = cos(phi);
|
||||
G4ParticleMomentum direction0(sintheta*cosphi,sintheta*sinphi,costheta);
|
||||
G4DynamicParticle * daughterparticle
|
||||
= new G4DynamicParticle( daughters[0], direction0*daughtermomentum[0]);
|
||||
products->PushProducts(daughterparticle);
|
||||
|
||||
costhetan = (daughtermomentum[1]*daughtermomentum[1]-
|
||||
daughtermomentum[2]*daughtermomentum[2]-
|
||||
daughtermomentum[0]*daughtermomentum[0])/
|
||||
(2.0*daughtermomentum[2]*daughtermomentum[0]);
|
||||
sinthetan = sqrt((1.0-costhetan)*(1.0+costhetan));
|
||||
phin = 2.0*M_PI*G4UniformRand()*rad;
|
||||
sinphin = sin(phin);
|
||||
cosphin = cos(phin);
|
||||
G4ParticleMomentum direction2;
|
||||
direction2.setX( sinthetan*cosphin*costheta*cosphi -
|
||||
sinthetan*sinphin*sinphi + costhetan*sintheta*cosphi);
|
||||
direction2.setY( sinthetan*cosphin*costheta*sinphi +
|
||||
sinthetan*sinphin*cosphi + costhetan*sintheta*sinphi);
|
||||
direction2.setZ( -sinthetan*cosphin*sintheta +
|
||||
costhetan*costheta);
|
||||
daughterparticle = new G4DynamicParticle
|
||||
( daughters[2], direction2*(daughtermomentum[2]/direction2.mag()));
|
||||
products->PushProducts(daughterparticle);
|
||||
|
||||
daughterparticle =
|
||||
new G4DynamicParticle (daughters[1],
|
||||
(direction0*daughtermomentum[0] +
|
||||
direction2*(daughtermomentum[2]/direction2.mag()))*(-1.0));
|
||||
products->PushProducts(daughterparticle);
|
||||
|
||||
// delete daughterparticle;
|
||||
|
||||
if (GetVerboseLevel()>1) {
|
||||
G4cout << "G4NuclearDecayChannel::BetaDecayIt ";
|
||||
G4cout << " create decay products in rest frame " <<G4endl;
|
||||
products->DumpInfo();
|
||||
G4cout << "G4NuclearDecayChannel::BetaDecayIt ";
|
||||
G4cout << " create decay products in rest frame " <<G4endl;
|
||||
products->DumpInfo();
|
||||
}
|
||||
return products;}
|
||||
return products;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4IsotopeProperty.hh"
|
||||
#include "G4RIsotopeTable.hh"
|
||||
/*
|
||||
#include "G4RadioactiveDecayMode.hh"
|
||||
#include "G4ITDecayChannel.hh"
|
||||
#include "G4BetaMinusDecayChannel.hh"
|
||||
@@ -37,7 +38,7 @@
|
||||
#include "G4KshellECDecayChannel.hh"
|
||||
#include "G4LshellECDecayChannel.hh"
|
||||
#include "G4AlphaDecayChannel.hh"
|
||||
|
||||
*/
|
||||
#include "G4ios.hh"
|
||||
#include "globals.hh"
|
||||
#include "g4std/iomanip"
|
||||
|
||||
@@ -2,26 +2,45 @@
|
||||
//
|
||||
// MODULE: G4RadioactiveDecay.cc
|
||||
//
|
||||
// Version: 0.b.4
|
||||
// Date: 14/04/00
|
||||
// Author: F Lei & P R Truscott
|
||||
// Organisation: DERA UK
|
||||
// Customer: ESA/ESTEC, NOORDWIJK
|
||||
// Contract: 12115/96/JG/NL Work Order No. 3
|
||||
//
|
||||
// Documentation avaialable at http://www.space.dera.gov.uk/space_env/rdm.html
|
||||
// These include:
|
||||
// User Requirement Document (URD)
|
||||
// Software Specification Documents (SSD)
|
||||
// Software User Manual (SUM)
|
||||
// Technical Note (TN) on the physics and algorithms
|
||||
//
|
||||
// The test and example programs are not included in the public release of
|
||||
// G4 but they can be downloaded from
|
||||
// http://www.space.dera.gov.uk/space_env/rdm.html
|
||||
//
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
//
|
||||
// CHANGE HISTORY
|
||||
// --------------
|
||||
//
|
||||
// 29 February 2000, P R Truscott, DERA UK
|
||||
// 0.b.3 release.
|
||||
// 01 November 2000, F.Lei
|
||||
// added " ee = e0 +1. ;" as line 763
|
||||
// tagged as "radiative_decay-V02-00-02"
|
||||
// 28 October 2000, F Lei
|
||||
// added fast beta decay mode. Many files have been changed.
|
||||
// tagged as "radiative_decay-V02-00-01"
|
||||
//
|
||||
// 25 October 2000, F Lei, DERA UK
|
||||
// 1) line 1185 added 'const' to work with tag "Track-V02-00-00"
|
||||
// tagged as "radiative_decay-V02-00-00"
|
||||
// 14 April 2000, F Lei, DERA UK
|
||||
// 0.b.4 release. Changes are:
|
||||
// 1) Use PhotonEvaporation instead of DiscreteGammaDeexcitation
|
||||
// 2) VR: Significant efficiency inprovement
|
||||
//
|
||||
//
|
||||
// 29 February 2000, P R Truscott, DERA UK
|
||||
// 0.b.3 release.
|
||||
//
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -64,7 +83,7 @@ const G4double G4RadioactiveDecay::levelTolerance =2.0*keV;
|
||||
G4RadioactiveDecay::G4RadioactiveDecay
|
||||
(const G4String& processName)
|
||||
:G4VRestDiscreteProcess(processName, fDecay), HighestBinValue(10.0),
|
||||
LowestBinValue(1.0e-3), TotBin(200), verboseLevel(1)
|
||||
LowestBinValue(1.0e-3), TotBin(200), verboseLevel(1)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>1) {
|
||||
@@ -106,6 +125,7 @@ G4RadioactiveDecay::G4RadioactiveDecay
|
||||
DProfile[1] = 0.;
|
||||
NSplit = 1;
|
||||
AnalogueMC = true ;
|
||||
FBeta = false ;
|
||||
BRBias = true ;
|
||||
//
|
||||
// RDM applies to xall logical volumes as default
|
||||
@@ -698,11 +718,28 @@ G4DecayTable *G4RadioactiveDecay::LoadDecayTable (G4ParticleDefinition
|
||||
e0 = c*MeV/0.511;
|
||||
n = aBetaFermiFunction->GetFFN(e0);
|
||||
|
||||
// now to work out the histogram and initialise the random generator
|
||||
G4int npti = 100;
|
||||
G4double* pdf = new G4double[npti];
|
||||
G4int ptn;
|
||||
G4double g,e,ee,f;
|
||||
ee = e0+1.;
|
||||
for (ptn=0; ptn<npti; ptn++) {
|
||||
e =e0*(ptn+1.)/102.;
|
||||
g = e+1.;
|
||||
f = sqrt(g*g-1)*(ee-g)*(ee-g)*g;
|
||||
pdf[ptn] = f*aBetaFermiFunction->GetFF(e);
|
||||
}
|
||||
RandGeneral* aRandomEnergy = new RandGeneral( pdf, npti);
|
||||
|
||||
G4BetaMinusDecayChannel *aBetaMinusChannel = new
|
||||
G4BetaMinusDecayChannel (GetVerboseLevel(), &theParentNucleus,
|
||||
b, c*MeV, a*MeV, n);
|
||||
b, c*MeV, a*MeV, n, FBeta, aRandomEnergy);
|
||||
theDecayTable->Insert(aBetaMinusChannel);
|
||||
modeSumBR[1] += b;
|
||||
|
||||
|
||||
delete[] pdf;
|
||||
delete aBetaFermiFunction;
|
||||
}
|
||||
break;
|
||||
@@ -718,11 +755,27 @@ G4DecayTable *G4RadioactiveDecay::LoadDecayTable (G4ParticleDefinition
|
||||
G4BetaFermiFunction* aBetaFermiFunction = new G4BetaFermiFunction (A, -(Z-1));
|
||||
e0 = c*MeV/0.511;
|
||||
n = aBetaFermiFunction->GetFFN(e0);
|
||||
|
||||
// now to work out the histogram and initialise the random generator
|
||||
G4int npti = 100;
|
||||
G4double* pdf = new G4double[npti];
|
||||
G4int ptn;
|
||||
G4double g,e,ee,f;
|
||||
ee = e0+1.;
|
||||
for (ptn=0; ptn<npti; ptn++) {
|
||||
e =e0*(ptn+1.)/102.;
|
||||
g = e+1.;
|
||||
f = sqrt(g*g-1)*(ee-g)*(ee-g)*g;
|
||||
pdf[ptn] = f*aBetaFermiFunction->GetFF(e);
|
||||
}
|
||||
RandGeneral* aRandomEnergy = new RandGeneral( pdf, npti);
|
||||
G4BetaPlusDecayChannel *aBetaPlusChannel = new
|
||||
G4BetaPlusDecayChannel (GetVerboseLevel(), &theParentNucleus,
|
||||
b, c*MeV, a*MeV, n);
|
||||
b, c*MeV, a*MeV, n, FBeta, aRandomEnergy);
|
||||
theDecayTable->Insert(aBetaPlusChannel);
|
||||
modeSumBR[2] += b;
|
||||
|
||||
delete[] pdf;
|
||||
delete aBetaFermiFunction;
|
||||
}
|
||||
break;
|
||||
@@ -1004,7 +1057,7 @@ void G4RadioactiveDecay::AddDecayRateTable(const G4ParticleDefinition &theParent
|
||||
// Decay mode is beta-.
|
||||
//
|
||||
theBetaMinusChannel = new G4BetaMinusDecayChannel (0, aParentNucleus,
|
||||
brs[1], 0.*MeV, 0.*MeV, 1);
|
||||
brs[1], 0.*MeV, 0.*MeV, 1, false, NULL);
|
||||
theDecayTable->Insert(theBetaMinusChannel);
|
||||
|
||||
break;
|
||||
@@ -1015,7 +1068,7 @@ void G4RadioactiveDecay::AddDecayRateTable(const G4ParticleDefinition &theParent
|
||||
// Decay mode is beta+ + EC.
|
||||
//
|
||||
theBetaPlusChannel = new G4BetaPlusDecayChannel (GetVerboseLevel(), aParentNucleus,
|
||||
brs[2], 0.*MeV, 0.*MeV, 1);
|
||||
brs[2], 0.*MeV, 0.*MeV, 1, false, NULL);
|
||||
theDecayTable->Insert(theBetaPlusChannel);
|
||||
break;
|
||||
|
||||
@@ -1182,7 +1235,7 @@ G4VParticleChange* G4RadioactiveDecay::DecayIt(const G4Track& theTrack, const G4
|
||||
// decay table.
|
||||
//
|
||||
fParticleChangeForRadDecay.Initialize(theTrack);
|
||||
G4DynamicParticle* theParticle = theTrack.GetDynamicParticle();
|
||||
const G4DynamicParticle* theParticle = theTrack.GetDynamicParticle();
|
||||
G4ParticleDefinition *theParticleDef = theParticle->GetDefinition();
|
||||
|
||||
// First check whether RDM applies to the current logical volume
|
||||
|
||||
@@ -35,6 +35,14 @@ G4RadioactiveDecaymessenger::G4RadioactiveDecaymessenger
|
||||
analoguemcCmd->SetGuidance("false: variance reduction method; true: analogue method");
|
||||
analoguemcCmd->SetParameterName("AnalogueMC",true);
|
||||
analoguemcCmd->SetDefaultValue(true);
|
||||
//
|
||||
// The next command contols whether beta decay will be treated faithfully or
|
||||
// in fast mode
|
||||
//
|
||||
fbetaCmd = new G4UIcmdWithABool ("/grdm/fBeta",this);
|
||||
fbetaCmd->SetGuidance("false: use 3-body decay, true: use histogram method");
|
||||
fbetaCmd->SetParameterName("fBeta",true);
|
||||
fbetaCmd->SetDefaultValue(false);
|
||||
|
||||
//
|
||||
//
|
||||
@@ -131,6 +139,7 @@ G4RadioactiveDecaymessenger::~G4RadioactiveDecaymessenger ()
|
||||
delete sourcetimeprofileCmd;
|
||||
delete decaybiasprofileCmd;
|
||||
delete analoguemcCmd;
|
||||
delete fbetaCmd;
|
||||
delete brbiasCmd;
|
||||
delete splitnucleiCmd;
|
||||
delete verboseCmd;
|
||||
@@ -151,6 +160,12 @@ void G4RadioactiveDecaymessenger::SetNewValue (G4UIcommand *command, G4String ne
|
||||
G4std::istrstream is((char*)t);
|
||||
is >> vl;
|
||||
theRadioactiveDecayContainer->SetAnalogueMonteCarlo(vl!=0);}
|
||||
else if (command==fbetaCmd) {
|
||||
G4int vl;
|
||||
const char* t = newValues;
|
||||
G4std::istrstream is((char*)t);
|
||||
is >> vl;
|
||||
theRadioactiveDecayContainer->SetFBeta(vl!=0);}
|
||||
else if (command==avolumeCmd) {theRadioactiveDecayContainer->
|
||||
SelectAVolume(newValues);}
|
||||
else if (command==deavolumeCmd) {theRadioactiveDecayContainer->
|
||||
|
||||
Reference in New Issue
Block a user