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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user