Import Geant4 10.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 12:08:39 +02:00
parent 286caacf06
commit c9b32a6c0a
5770 changed files with 1050949 additions and 367105 deletions
@@ -0,0 +1,127 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
////////////////////////////////////////////////////////////////////////////////
// //
// File: G4AlphaDecay.cc //
// Author: D.H. Wright (SLAC) //
// Date: 20 October 2014 //
// //
////////////////////////////////////////////////////////////////////////////////
#include "G4AlphaDecay.hh"
#include "G4IonTable.hh"
#include "Randomize.hh"
#include "G4ThreeVector.hh"
#include "G4DynamicParticle.hh"
#include "G4DecayProducts.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include <iostream>
#include <iomanip>
G4AlphaDecay::G4AlphaDecay(const G4ParticleDefinition* theParentNucleus,
const G4double& branch, const G4double& Qvalue,
const G4double& excitationE)
: G4VDecayChannel("alpha decay"), transitionQ(Qvalue), daughterEx(excitationE),
halflifeThreshold(nanosecond)
{
SetParent(theParentNucleus); // Store name of parent nucleus, delete G4MT_parent
SetBR(branch);
SetNumberOfDaughters(2);
SetDaughter(0, "alpha"); // Store name of 1st daughter
G4IonTable* theIonTable =
(G4IonTable*)(G4ParticleTable::GetParticleTable()->GetIonTable());
G4int daughterZ = theParentNucleus->GetAtomicNumber() - 2;
G4int daughterA = theParentNucleus->GetAtomicMass() - 4;
SetDaughter(1, theIonTable->GetIon(daughterZ, daughterA, daughterEx) );
}
G4AlphaDecay::G4AlphaDecay(const G4AlphaDecay& right)
: G4VDecayChannel(right), transitionQ(right.transitionQ),
daughterEx(right.daughterEx), halflifeThreshold(right.halflifeThreshold)
{}
G4AlphaDecay::~G4AlphaDecay()
{}
G4DecayProducts* G4AlphaDecay::DecayIt(G4double)
{
// Fill G4MT_parent with theParentNucleus (stored by SetParent in ctor)
if (G4MT_parent == 0) FillParent();
// Fill G4MT_daughters with alpha and residual nucleus (stored by SetDaughter)
if (G4MT_daughters == 0) FillDaughters();
G4double alphaMass = G4MT_daughters[0]->GetPDGMass();
// Excitation energy included in PDG mass
G4double nucleusMass = G4MT_daughters[1]->GetPDGMass();
// Q value was calculated from atomic masses.
// Use it to get correct alpha energy.
G4double cmMomentum = std::sqrt(transitionQ*(transitionQ + 2.*alphaMass)*
(transitionQ + 2.*nucleusMass)*
(transitionQ + 2.*alphaMass + 2.*nucleusMass) )/
(transitionQ + alphaMass + nucleusMass)/2.;
// Set up final state
// parentParticle is set at rest here because boost with correct momentum
// is done later
G4DynamicParticle parentParticle(G4MT_parent, G4ThreeVector(0,0,0), 0.0);
G4DecayProducts* products = new G4DecayProducts(parentParticle);
G4double costheta = 2.*G4UniformRand()-1.0;
G4double sintheta = std::sqrt(1.0 - costheta*costheta);
G4double phi = twopi*G4UniformRand()*rad;
G4ThreeVector direction(sintheta*std::cos(phi),sintheta*std::sin(phi),
costheta);
G4double KE = std::sqrt(cmMomentum*cmMomentum + alphaMass*alphaMass)
- alphaMass;
G4DynamicParticle* daughterparticle =
new G4DynamicParticle(G4MT_daughters[0], direction, KE, alphaMass);
products->PushProducts(daughterparticle);
KE = std::sqrt(cmMomentum*cmMomentum + nucleusMass*nucleusMass) - nucleusMass;
daughterparticle =
new G4DynamicParticle(G4MT_daughters[1], -1.0*direction, KE, nucleusMass);
products->PushProducts(daughterparticle);
return products;
}
void G4AlphaDecay::DumpInfo()
{
G4cout << " G4AlphaDecay for parent nucleus " << GetParentName() << G4endl;
G4cout << " decays to " << GetDaughterName(0) << " + " << GetDaughterName(1)
<< " with branching ratio " << GetBR() << " and Q value "
<< transitionQ << G4endl;
}
@@ -29,7 +29,7 @@
#include "G4BetaDecayType.hh"
#include "G4BetaDecayCorrections.hh"
G4BetaDecayCorrections::G4BetaDecayCorrections(G4int theZ, G4int theA)
G4BetaDecayCorrections::G4BetaDecayCorrections(const G4int theZ, const G4int theA)
: Z(theZ), A(theA)
{
// alphaZ = fine_structure_const*std::abs(Z);
@@ -72,7 +72,6 @@
#include "G4PhysicsLogVector.hh"
#include "G4ParticleChangeForRadDecay.hh"
#include "G4IonTable.hh"
#include "G4BetaFermiFunction.hh"
#include "G4PhotonEvaporation.hh"
@@ -80,29 +79,23 @@
#include "G4AtomicShells.hh"
#include "G4LossTableManager.hh"
//#include "G4AtomicTransitionManager.hh"
//#include "G4AtomicShell.hh"
//#include "G4AtomicDeexcitation.hh"
//Model const parameters
const G4double G4NuclearDecayChannel:: pTolerance = 0.001;
const G4double G4NuclearDecayChannel:: levelTolerance = 2.0*keV;
//const G4bool G4NuclearDecayChannel:: FermiOn = true;
//These are a kind of "cache"
//This is a kind of "cache"
G4ThreadLocal G4DynamicParticle* G4NuclearDecayChannel::dynamicDaughter = 0;
// Constructor for one decay product (the nucleus).
//
// Constructor for one decay product (the nucleus)
G4NuclearDecayChannel::
G4NuclearDecayChannel(const G4RadioactiveDecayMode& theMode,
G4int Verbose,
const G4ParticleDefinition* theParentNucleus,
G4double theBR,
G4double theQtransition,
G4int A,
G4int Z,
G4double theDaughterExcitation)
const G4double theBR,
const G4double theQtransition,
const G4int A, const G4int Z,
const G4double theDaughterExcitation)
:G4GeneralPhaseSpaceDecay(Verbose), decayMode(theMode),
Qtransition(theQtransition), RandomEnergy(0)
{
@@ -129,12 +122,11 @@ G4NuclearDecayChannel(const G4RadioactiveDecayMode& theMode,
G4NuclearDecayChannel::
G4NuclearDecayChannel(const G4RadioactiveDecayMode& theMode,
G4int Verbose,
const G4ParticleDefinition *theParentNucleus,
G4double theBR,
G4double theQtransition,
G4int A,
G4int Z,
G4double theDaughterExcitation,
const G4ParticleDefinition* theParentNucleus,
const G4double theBR,
const G4double theQtransition,
const G4int A, const G4int Z,
const G4double theDaughterExcitation,
const G4String theDaughterName1)
:G4GeneralPhaseSpaceDecay(Verbose), decayMode(theMode),
Qtransition(theQtransition), RandomEnergy(0)
@@ -164,14 +156,13 @@ G4NuclearDecayChannel::
G4NuclearDecayChannel(const G4RadioactiveDecayMode &theMode,
G4int Verbose,
const G4ParticleDefinition *theParentNucleus,
G4double theBR,
const G4double theBR,
G4double /* theFFN */,
G4bool /* betaS */,
G4RandGeneral* randBeta,
G4double theQtransition,
G4int A,
G4int Z,
G4double theDaughterExcitation,
const G4double theQtransition,
const G4int A, const G4int Z,
const G4double theDaughterExcitation,
const G4String theDaughterName1,
const G4String theDaughterName2)
:G4GeneralPhaseSpaceDecay(Verbose), decayMode(theMode),
@@ -203,7 +194,7 @@ G4NuclearDecayChannel::~G4NuclearDecayChannel()
{}
void G4NuclearDecayChannel::FillDaughterNucleus(G4int index, G4int A, G4int Z,
G4double theDaughterExcitation)
const G4double theDaughterExcitation)
{
// Determine if the proposed daughter nucleus has a sensible A, Z and
// excitation energy.
@@ -286,6 +277,7 @@ G4DecayProducts* G4NuclearDecayChannel::DecayIt(G4double)
FatalException, ed);
}
}
if (products == 0) {
G4ExceptionDescription ed;
ed << " Parent nucleus " << *parent_name << " was not decayed " << G4endl;
@@ -345,29 +337,39 @@ G4DecayProducts* G4NuclearDecayChannel::DecayIt(G4double)
// The fragment vector from photon evaporation contains the list of
// evaporated gammas, some of which may have been replaced by conversion
// electrons. The last element is the residual nucleus.
G4FragmentVector* gammas = deexcitation->BreakUp(nucleus); // Evaporate only one photon
G4int nGammas = gammas->size() - 1;
G4double finalDaughterExcitation =
gammas->operator[](nGammas)->GetExcitationEnergy();
// Go through each gamma/e- and add it to the decay product. The
// angular distribution of the gammas is isotropic, and the residual
// nucleus is assumed not to have suffered any recoil as a result of
// this de-excitation.
G4double Egamma = 0.0;
for (G4int ig = 0; ig < nGammas; ig++) {
G4DynamicParticle* theGammaRay =
new G4DynamicParticle(gammas->operator[](ig)->GetParticleDefinition(),
gammas->operator[](ig)->GetMomentum());
theGammaRay -> SetProperTime(gammas->operator[](ig)->GetCreationTime());
products->PushProducts (theGammaRay);
Egamma = (gammas->operator[](ig)->GetMomentum()).e();
}
// Note: try photoEvapProducts as a name instead of gammas
G4FragmentVector* gammas = deexcitation->BreakUp(nucleus);
G4int nFrags = G4int(gammas->size());
G4double eOrGammaEnergy = 0.0;
if (nFrags < 1) {
G4ExceptionDescription ed;
ed << nFrags << " No fragments produced by photon evaporation. " << G4endl;
G4Exception("G4NuclearDecayChannel::DecayIt()","HAD_RDM_012",
FatalException, ed);
} else if (nFrags > 1) {
// Add gamma/e- to the decay product. The angular distribution of this
// particle is assumed to be isotropic
G4Fragment* eOrGamma;
G4DynamicParticle* eOrGammaDyn;
for (G4int i = 0; i < nFrags - 1; i++) {
eOrGamma = gammas->operator[](i);
eOrGammaDyn = new G4DynamicParticle(eOrGamma->GetParticleDefinition(),
eOrGamma->GetMomentum() );
eOrGammaDyn->SetProperTime(eOrGamma->GetCreationTime() );
products->PushProducts(eOrGammaDyn);
eOrGammaEnergy += eOrGamma->GetMomentum().e();
}
}
G4double finalDaughterExcitation =
gammas->operator[](nFrags-1)->GetExcitationEnergy();
if (finalDaughterExcitation <= 1.0*keV) finalDaughterExcitation = 0;
// Get new ion with excitation energy reduced by emitted gamma energy
daughterIon =
theIonTable->GetIon(daughterZ, daughterA, finalDaughterExcitation);
daughterMomentum.setE(daughterMomentum.e() - Egamma);
daughterMomentum.setE(daughterMomentum.e() - eOrGammaEnergy);
// Delete/reset variables associated with the gammas.
while (!gammas->empty() ) {
@@ -375,9 +377,8 @@ G4DecayProducts* G4NuclearDecayChannel::DecayIt(G4double)
gammas->pop_back();
}
delete gammas;
} // end if decayMode == 0
G4ThreeVector const daughterMomentum1(static_cast<const G4LorentzVector> (daughterMomentum));
dynamicDaughter = new G4DynamicParticle(daughterIon, daughterMomentum1);
products->PushProducts(dynamicDaughter);
@@ -459,7 +460,6 @@ G4DecayProducts* G4NuclearDecayChannel::DecayIt(G4double)
}
} // Parent nucleus decayed
/*
if (atomDeex && aZ > 5 && aZ < 100) { // only applies to 5< Z <100
// Retrieve the corresponding identifier and binding energy of the selected shell
const G4AtomicTransitionManager* transitionManager = G4AtomicTransitionManager::Instance();
@@ -504,7 +504,7 @@ G4DecayProducts* G4NuclearDecayChannel::DecayIt(G4double)
G4cout <<" The binding energy = " << bindingEnergy << G4endl;
G4cout <<" Total ARM particle kinetic energy = " << tARMEnergy << G4endl;
}
#endif
#endif
delete armProducts;
delete atomDeex;
@@ -536,7 +536,8 @@ G4DecayProducts* G4NuclearDecayChannel::BetaDecayIt()
G4double daughtermomentum[3];
G4double daughterenergy[3];
// Use the histogram distribution to generate the beta energy
daughterenergy[0] = Qtransition*RandomEnergy->shoot(G4Random::getTheEngine());
// 0 = electron, 1 = daughter, 2 = neutrino
daughterenergy[0] = Qtransition*RandomEnergy->shoot(G4Random::getTheEngine());
daughtermomentum[0] = std::sqrt(daughterenergy[0]*(daughterenergy[0] + 2.*daughtermass[0]) );
// neutrino energy distribution is flat within the kinematical limits
@@ -576,11 +577,12 @@ G4DecayProducts* G4NuclearDecayChannel::BetaDecayIt()
phi = twopi*G4UniformRand()*rad;
sinphi = std::sin(phi);
cosphi = std::cos(phi);
// electron chosen isotropically
G4ParticleMomentum direction0(sintheta*cosphi,sintheta*sinphi,costheta);
G4DynamicParticle * daughterparticle
= new G4DynamicParticle( G4MT_daughters[0], direction0*daughtermomentum[0]);
products->PushProducts(daughterparticle);
// cos of angle between electron and neutrino
costhetan = (daughtermomentum[1]*daughtermomentum[1]-
daughtermomentum[2]*daughtermomentum[2]-
daughtermomentum[0]*daughtermomentum[0])/
@@ -601,7 +603,7 @@ G4DecayProducts* G4NuclearDecayChannel::BetaDecayIt()
daughterparticle = new G4DynamicParticle(G4MT_daughters[2],
direction2*(daughtermomentum[2]/direction2.mag()));
products->PushProducts(daughterparticle);
// daughter nucleus p = - (p_e + p_nu )
daughterparticle =
new G4DynamicParticle(G4MT_daughters[1],
(direction0*daughtermomentum[0] +
@@ -70,6 +70,7 @@
#include "G4KshellECDecayChannel.hh"
#include "G4LshellECDecayChannel.hh"
#include "G4AlphaDecayChannel.hh"
#include "G4ProtonDecayChannel.hh"
*/
#include "G4ios.hh"
#include "globals.hh"
@@ -79,38 +80,36 @@
const G4double G4RIsotopeTable::levelTolerance = 2.0*keV;
///////////////////////////////////////////////////////////////////////////////
//
G4RIsotopeTable::G4RIsotopeTable()
{//
//Reset the list of user define data file
//
theUserRadioactiveDataFiles.clear();
{
// Reset the list of user defined data files
theUserRadioactiveDataFiles.clear();
}
///////////////////////////////////////////////////////////////////////////////
//
G4RIsotopeTable::~G4RIsotopeTable()
{
for (G4int i = 0; i < G4int(fIsotopeList.size()); i++) delete fIsotopeList[i];
fIsotopeList.clear();
fIsotopeNameList.clear();
}
///////////////////////////////////////////////////////////////////////////////
//
G4int G4RIsotopeTable::GetVerboseLevel() const
{
return G4ParticleTable::GetParticleTable()->GetVerboseLevel();
}
///////////////////////////////////////////////////////////////////////////////
//
G4bool G4RIsotopeTable::FindIsotope(G4IsotopeProperty* )
{
// do nothing, it is here just for the compiler
// it is required by the base class
return true;
}
///////////////////////////////////////////////////////////////////////////////
//
G4IsotopeProperty* G4RIsotopeTable::GetIsotope(G4int Z, G4int A, G4double E)
{
G4String fname = GetIsotopeName(Z, A, E);
@@ -118,19 +117,19 @@ G4IsotopeProperty* G4RIsotopeTable::GetIsotope(G4int Z, G4int A, G4double E)
for (G4int i = 0 ; i< Entries(); i++) {
if(fIsotopeNameList[i] == fname) j = i;}
if (j >=0) {
if (GetVerboseLevel()>1) {
G4cout <<"G4RIsotopeTable::GetIsotope No. : ";
G4cout <<j<<G4endl;
if (GetVerboseLevel() > 1) {
G4cout <<"G4RIsotopeTable::GetIsotope No. : ";
G4cout <<j<<G4endl;
}
return GetIsotope(j);}
// isotope property data has been loaded already and just return the pointer
else{
return GetIsotope(j);
// isotope property data has been loaded already - just return the pointer
} else {
G4double meanlife = GetMeanLifeTime(Z, A, E);
// E is pass as a refence hence on entry E is supplied by the user and it
// E is passed as a refence hence on entry E is supplied by the user and it
// could be slightly different from the returned value which is the one
// defined in the database.
// this call is to ensure the code uses a consistane E value through out.
//
// this call is to ensure the code uses a consistent E value throughout.
G4IsotopeProperty* fProperty = new G4IsotopeProperty();
// Set Isotope Property
@@ -43,6 +43,8 @@
//
// CHANGE HISTORY
// --------------
// 06 Aug 2014, L.G. Sarmiento Proton decay mode added mimicking the alpha decay
//
// 03 Oct 2012, V. Ivanchenko removed internal table for mean free path
// similar to what is done for as G4Decay
// 10 July 2012, L. Desorgher
@@ -107,7 +109,9 @@
#include "G4KshellECDecayChannel.hh"
#include "G4LshellECDecayChannel.hh"
#include "G4MshellECDecayChannel.hh"
#include "G4AlphaDecayChannel.hh"
// #include "G4AlphaDecayChannel.hh"
#include "G4AlphaDecay.hh"
#include "G4ProtonDecayChannel.hh"
#include "G4VDecayChannel.hh"
#include "G4RadioactiveDecayMode.hh"
#include "G4Ions.hh"
@@ -125,6 +129,7 @@
#include "G4Neutron.hh"
#include "G4Gamma.hh"
#include "G4Alpha.hh"
#include "G4Proton.hh"
#include "G4HadronicProcessType.hh"
#include "G4LossTableManager.hh"
@@ -211,6 +216,11 @@ G4RadioactiveDecay::~G4RadioactiveDecay()
{
delete theRadioactiveDecaymessenger;
delete theIsotopeTable;
for (DecayTableMap::iterator i = dkmap->begin(); i != dkmap->end(); i++) {
delete i->second;
}
dkmap->clear();
delete dkmap;
}
@@ -235,7 +245,7 @@ G4bool G4RadioactiveDecay::IsApplicable(const G4ParticleDefinition& aParticle)
return true;
}
G4DecayTable* G4RadioactiveDecay::GetDecayTable(G4ParticleDefinition* aNucleus)
G4DecayTable* G4RadioactiveDecay::GetDecayTable(const G4ParticleDefinition* aNucleus)
{
G4String key = aNucleus->GetParticleName();
DecayTableMap::iterator table_ptr = dkmap->find(key);
@@ -565,7 +575,7 @@ G4double G4RadioactiveDecay::GetMeanLifeTime(const G4Track& theTrack,
G4double meanlife = 0.;
if (AnalogueMC) {
const G4DynamicParticle* theParticle = theTrack.GetDynamicParticle();
G4ParticleDefinition* theParticleDef = theParticle->GetDefinition();
const G4ParticleDefinition* theParticleDef = theParticle->GetDefinition();
G4double theLife = theParticleDef->GetPDGLifeTime();
#ifdef G4VERBOSE
@@ -602,7 +612,7 @@ G4double G4RadioactiveDecay::GetMeanFreePath (const G4Track& aTrack, G4double,
G4ForceCondition*)
{
const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle();
G4ParticleDefinition* aParticleDef = aParticle->GetDefinition();
const G4ParticleDefinition* aParticleDef = aParticle->GetDefinition();
G4double tau = aParticleDef->GetPDGLifeTime();
G4double aMass = aParticle->GetMass();
@@ -618,7 +628,11 @@ G4double G4RadioactiveDecay::GetMeanFreePath (const G4Track& aTrack, G4double,
if (tau != -1) {
// Ion can decay
if (tau < 0.0) {
if (tau < -1000.0) {
pathlength = DBL_MIN; // nuclide had very short lifetime or wasn't in table
} else if (tau < 0.0) {
G4cout << aParticleDef->GetParticleName() << " has lifetime " << tau << G4endl;
G4ExceptionDescription ed;
ed << "Ion has negative lifetime " << tau
<< " but is not stable. Setting mean free path to DBL_MAX" << G4endl;
@@ -682,7 +696,7 @@ G4Mutex G4RadioactiveDecay::radioactiveDecayMutex = G4MUTEX_INITIALIZER;
#endif
G4DecayTable*
G4RadioactiveDecay::LoadDecayTable(G4ParticleDefinition& theParentNucleus)
G4RadioactiveDecay::LoadDecayTable(const G4ParticleDefinition& theParentNucleus)
{
// Generate input data file name using Z and A of the parent nucleus
// file containing radioactive decay data.
@@ -726,10 +740,10 @@ G4RadioactiveDecay::LoadDecayTable(G4ParticleDefinition& theParentNucleus)
G4bool found(false);
if (DecaySchemeFile) {
// Initialise variables used for reading in radioactive decay data.
G4int nMode = 7;
G4bool modeFirstRecord[7];
G4double modeTotalBR[7] = {0.0};
G4double modeSumBR[7];
G4int nMode = 8;
G4bool modeFirstRecord[8];
G4double modeTotalBR[8] = {0.0};
G4double modeSumBR[8];
for (G4int i = 0; i < nMode; i++) {
modeFirstRecord[i] = true;
modeSumBR[i] = 0.0;
@@ -952,23 +966,61 @@ G4RadioactiveDecay::LoadDecayTable(G4ParticleDefinition& theParentNucleus)
break;
case Alpha:
if (modeFirstRecord[6]) {
if (modeFirstRecord[6]) {
modeFirstRecord[6] = false;
modeTotalBR[6] = b;
} else {
G4AlphaDecay* anAlphaChannel =
new G4AlphaDecay(&theParentNucleus, b, c*MeV, a*MeV);
// anAlphaChannel->DumpInfo();
/*
G4AlphaDecayChannel* anAlphaChannel =
new G4AlphaDecayChannel(GetVerboseLevel(),
&theParentNucleus,
b, c*MeV, a*MeV);
anAlphaChannel->SetICM(applyICM);
anAlphaChannel->SetARM(applyARM);
*/
anAlphaChannel->SetHLThreshold(halflifethreshold);
theDecayTable->Insert(anAlphaChannel);
modeSumBR[6] += b;
}
break;
case Proton:
if (modeFirstRecord[7]) {
modeFirstRecord[7] = false;
modeTotalBR[7] = b;
} else {
G4ProtonDecayChannel* aProtonChannel =
new G4ProtonDecayChannel(GetVerboseLevel(),
&theParentNucleus,
b, c*MeV, a*MeV);
aProtonChannel->SetICM(applyICM);
aProtonChannel->SetARM(applyARM);
aProtonChannel->SetHLThreshold(halflifethreshold);
theDecayTable->Insert(aProtonChannel);
modeSumBR[7] += b;
}
break;
case Beta2Minus:
// Not yet implemented
// G4cout << " Double beta- decay, a = " << a << ", b = " << b << ", c = " << c << G4endl;
break;
case Beta2Plus:
// Not yet implemented
// G4cout << " Double beta+ decay, a = " << a << ", b = " << b << ", c = " << c << G4endl;
break;
case Proton2:
// Not yet implemented
// G4cout << " Double proton decay, a = " << a << ", b = " << b << ", c = " << c << G4endl;
break;
case SpFission:
//Still needed to be implemented
// Not yet implemented
//G4cout<<"Sp fission channel"<<a<<'\t'<<b<<'\t'<<c<<std::endl;
break;
case RDM_ERROR:
@@ -992,9 +1044,12 @@ G4RadioactiveDecay::LoadDecayTable(G4ParticleDefinition& theParentNucleus)
G4double theBR = 0.0;
for (G4int i = 0; i < theDecayTable->entries(); i++) {
theChannel = theDecayTable->GetDecayChannel(i);
theNuclearDecayChannel = static_cast<G4NuclearDecayChannel*>(theChannel);
theDecayMode = theNuclearDecayChannel->GetDecayMode();
if (theChannel->GetKinematicsName() == "alpha decay") {
theDecayMode = Alpha;
} else {
theNuclearDecayChannel = static_cast<G4NuclearDecayChannel*>(theChannel);
theDecayMode = theNuclearDecayChannel->GetDecayMode();
}
if (theDecayMode != IT) {
theBR = theChannel->GetBR();
theChannel->SetBR(theBR*modeTotalBR[theDecayMode]/modeSumBR[theDecayMode]);
@@ -1024,7 +1079,6 @@ G4RadioactiveDecay::LoadDecayTable(G4ParticleDefinition& theParentNucleus)
}
if (theDecayTable && GetVerboseLevel() > 1) {
G4cout << "G4RadioactiveDecay::LoadDecayTable()" << G4endl;
theDecayTable->DumpInfo();
}
@@ -1113,7 +1167,9 @@ G4RadioactiveDecay::AddDecayRateTable(const G4ParticleDefinition& theParentNucle
G4ITDecayChannel* theITChannel = 0;
G4BetaMinusDecayChannel *theBetaMinusChannel = 0;
G4BetaPlusDecayChannel *theBetaPlusChannel = 0;
G4AlphaDecayChannel *theAlphaChannel = 0;
// G4AlphaDecayChannel *theAlphaChannel = 0;
G4AlphaDecay* theAlphaChannel = 0;
G4ProtonDecayChannel *theProtonChannel = 0;
G4RadioactiveDecayMode theDecayMode;
G4double theBR = 0.0;
G4int AP = 0;
@@ -1132,7 +1188,7 @@ G4RadioactiveDecay::AddDecayRateTable(const G4ParticleDefinition& theParentNucle
G4double TaoPlus;
G4int nS = 0;
G4int nT = nEntry;
G4double brs[7];
G4double brs[8];
//
theIonTable =
(G4IonTable*)(G4ParticleTable::GetParticleTable()->GetIonTable());
@@ -1156,7 +1212,7 @@ G4RadioactiveDecay::AddDecayRateTable(const G4ParticleDefinition& theParentNucle
aTempDecayTable = GetDecayTable(aParentNucleus);
G4DecayTable* theDecayTable = new G4DecayTable();
for (G4int k = 0; k < 7; k++) brs[k] = 0.0;
for (G4int k = 0; k < 8; k++) brs[k] = 0.0;
// Go through the decay table and to combine the same decay channels
for (i = 0; i < aTempDecayTable->entries(); i++) {
@@ -1191,7 +1247,7 @@ G4RadioactiveDecay::AddDecayRateTable(const G4ParticleDefinition& theParentNucle
}
brs[2] = brs[2]+brs[3]+brs[4]+brs[5];
brs[3] = brs[4] =brs[5] = 0.0;
for (i= 0; i<7; i++){
for (i= 0; i<8; i++){
if (brs[i] > 0.) {
switch ( i ) {
case 0:
@@ -1217,12 +1273,25 @@ G4RadioactiveDecay::AddDecayRateTable(const G4ParticleDefinition& theParentNucle
case 6:
// Decay mode is alpha.
/*
theAlphaChannel = new G4AlphaDecayChannel(GetVerboseLevel(),
aParentNucleus,
brs[6], 0.*MeV, 0.*MeV);
*/
theAlphaChannel = new G4AlphaDecay(aParentNucleus, brs[6], 0.*MeV,
0.*MeV);
theDecayTable->Insert(theAlphaChannel);
break;
case 7:
// Decay mode is proton.
theProtonChannel = new G4ProtonDecayChannel(GetVerboseLevel(),
aParentNucleus,
brs[7], 0.*MeV, 0.*MeV);
theDecayTable->Insert(theProtonChannel);
break;
default:
break;
}
@@ -1432,8 +1501,7 @@ G4RadioactiveDecay::DecayIt(const G4Track& theTrack, const G4Step&)
fParticleChangeForRadDecay.Initialize(theTrack);
const G4DynamicParticle* theParticle = theTrack.GetDynamicParticle();
G4ParticleDefinition* theParticleDef = theParticle->GetDefinition();
const G4ParticleDefinition* theParticleDef = theParticle->GetDefinition();
// First check whether RDM applies to the current logical volume
if (!isAllVolumesMode) {
@@ -1763,7 +1831,7 @@ G4RadioactiveDecay::DecayIt(const G4Track& theTrack, const G4Step&)
G4DecayProducts*
G4RadioactiveDecay::DoDecay(G4ParticleDefinition& theParticleDef)
G4RadioactiveDecay::DoDecay(const G4ParticleDefinition& theParticleDef)
{
G4DecayProducts* products = 0;
G4DecayTable* theDecayTable = GetDecayTable(&theParticleDef);
@@ -1787,8 +1855,7 @@ G4RadioactiveDecay::DoDecay(G4ParticleDefinition& theParticleDef)
G4cerr << theDecayChannel << G4endl;
}
#endif
G4double tempmass = theParticleDef.GetPDGMass();
products = theDecayChannel->DecayIt(tempmass);
products = theDecayChannel->DecayIt(theParticleDef.GetPDGMass() );
// Apply directional bias if requested by user
CollimateDecay(products);
@@ -1798,7 +1865,7 @@ G4RadioactiveDecay::DoDecay(G4ParticleDefinition& theParticleDef)
}
// Apply directional bias for "visible" daughters (e+-, gamma, n, alpha)
// Apply directional bias for "visible" daughters (e+-, gamma, n, p, alpha)
void G4RadioactiveDecay::CollimateDecay(G4DecayProducts* products) {
if (origin == forceDecayDirection) return; // No collimation requested
@@ -1815,6 +1882,7 @@ void G4RadioactiveDecay::CollimateDecay(G4DecayProducts* products) {
static const G4ParticleDefinition* neutron = G4Neutron::Definition();
static const G4ParticleDefinition* gamma = G4Gamma::Definition();
static const G4ParticleDefinition* alpha = G4Alpha::Definition();
static const G4ParticleDefinition* proton = G4Proton::Definition();
G4ThreeVector newDirection; // Re-use to avoid memory churn
for (G4int i=0; i<products->entries(); i++) {
@@ -1823,7 +1891,7 @@ void G4RadioactiveDecay::CollimateDecay(G4DecayProducts* products) {
daughter->GetParticleDefinition();
if (daughterType == electron || daughterType == positron ||
daughterType == neutron || daughterType == gamma ||
daughterType == alpha) CollimateDecayProduct(daughter);
daughterType == alpha || daughterType == proton) CollimateDecayProduct(daughter);
}
}
@@ -44,6 +44,12 @@ std::istream &operator >> (std::istream& strm, G4RadioactiveDecayMode& q)
{q = MshellEC;}
else if (a == "Alpha")
{q = Alpha;}
else if (a == "Proton")
{q = Proton;}
else if (a == "Beta2Minus")
{q = Beta2Minus;}
else if (a == "Beta2Plus")
{q = Beta2Plus;}
else if (a == "SpFission")
{q = SpFission;}
else