Import Geant4 10.6.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2019-06-28 11:59:04 +02:00
parent 28a70706e0
commit d0f911957d
1056 changed files with 95168 additions and 78160 deletions
@@ -54,7 +54,7 @@
////////////////////////////////////////////////////////////////////////////////
//
G4NucleusLimits::G4NucleusLimits ()
: aMin(1), aMax(250), zMin(0), zMax(100)
: aMin(1), aMax(260), zMin(0), zMax(100)
//
// Default constructor sets the limits to cover all nuclei with Z<100.
//
@@ -25,7 +25,7 @@
//
////////////////////////////////////////////////////////////////////////////////
// //
// File: G4Radioactivation.hh //
// File: G4Radioactivation.cc //
// Author: D.H. Wright (SLAC) //
// Date: 29 August 2017 //
// Description: activation process derived from the original //
@@ -52,6 +52,7 @@
#include "G4AlphaDecay.hh"
#include "G4ProtonDecay.hh"
#include "G4NeutronDecay.hh"
#include "G4SFDecay.hh"
#include "G4VDecayChannel.hh"
#include "G4NuclearDecay.hh"
#include "G4RadioactiveDecayMode.hh"
@@ -115,7 +116,8 @@ G4Radioactivation::G4Radioactivation(const G4String& processName)
G4RadioactivityTable* rTable = new G4RadioactivityTable() ;
theRadioactivityTables.push_back(rTable);
NSplit = 1;
BRBias = true ;
AnalogueMC = true;
BRBias = true;
halflifethreshold = nanosecond;
}
@@ -187,13 +189,11 @@ G4Radioactivation::ConvolveSourceTimeProfile(const G4double t, const G4double ta
nbin = 0;
G4int loop = 0;
G4ExceptionDescription ed;
ed << " While count exceeded " << G4endl;
while (t > SBin[nbin]) { // Loop checking, 01.09.2015, D.Wright
loop++;
if (loop > 1000) {
G4Exception("G4RadioactiveDecay::ConvolveSourceTimeProfile()",
"HAD_RDM_100", JustWarning, ed);
"HAD_RDM_100", JustWarning, "While loop count exceeded");
break;
}
nbin++;
@@ -248,15 +248,14 @@ G4double G4Radioactivation::GetDecayTime()
G4int i = 0;
G4int loop = 0;
G4ExceptionDescription ed;
ed << " While count exceeded " << G4endl;
while ( DProfile[i] < rand) { /* Loop checking, 01.09.2015, D.Wright */
while (DProfile[i] < rand) { /* Loop checking, 01.09.2015, D.Wright */
// Entries in DProfile[i] are all between 0 and 1 and arranged in inreaseing order
// Comparison with rand chooses which time bin to sample
i++;
loop++;
if (loop > 100000) {
G4Exception("G4RadioactiveDecay::GetDecayTime()", "HAD_RDM_100", JustWarning, ed);
G4Exception("G4RadioactiveDecay::GetDecayTime()", "HAD_RDM_100",
JustWarning, "While loop count exceeded");
break;
}
}
@@ -276,13 +275,12 @@ G4int G4Radioactivation::GetDecayTimeBin(const G4double aDecayTime)
G4int i = 0;
G4int loop = 0;
G4ExceptionDescription ed;
ed << " While count exceeded " << G4endl;
while ( aDecayTime > DBin[i] ) { /* Loop checking, 01.09.2015, D.Wright */
while (aDecayTime > DBin[i] ) { /* Loop checking, 01.09.2015, D.Wright */
i++;
loop++;
if (loop > 100000) {
G4Exception("G4RadioactiveDecay::GetDecayTimeBin()", "HAD_RDM_100", JustWarning, ed);
G4Exception("G4RadioactiveDecay::GetDecayTimeBin()", "HAD_RDM_100",
JustWarning, "While loop count exceeded");
break;
}
}
@@ -358,6 +356,8 @@ CalculateChainsFromParent(const G4ParticleDefinition& theParentNucleus)
G4AlphaDecay* theAlphaChannel = 0;
G4ProtonDecay* theProtonChannel = 0;
G4NeutronDecay* theNeutronChannel = 0;
G4SFDecay* theFissionChannel = 0;
G4RadioactiveDecayMode theDecayMode;
G4double theBR = 0.0;
G4int AP = 0;
@@ -378,20 +378,18 @@ CalculateChainsFromParent(const G4ParticleDefinition& theParentNucleus)
G4double TaoPlus;
G4int nS = 0; // Running index of first decay in a given generation
G4int nT = nEntry; // Total number of decays accumulated over entire history
const G4int nMode = 9;
const G4int nMode = 11;
G4double brs[nMode];
//
theIonTable =
(G4IonTable*)(G4ParticleTable::GetParticleTable()->GetIonTable());
G4int loop = 0;
G4ExceptionDescription ed;
ed << " While count exceeded " << G4endl;
while (!stable) { /* Loop checking, 01.09.2015, D.Wright */
loop++;
if (loop > 10000) {
G4Exception("G4RadioactiveDecay::CalculateChainsFromParent()", "HAD_RDM_100", JustWarning, ed);
G4Exception("G4RadioactiveDecay::CalculateChainsFromParent()", "HAD_RDM_100",
JustWarning, "While loop count exceeded");
break;
}
nGeneration++;
@@ -460,11 +458,11 @@ CalculateChainsFromParent(const G4ParticleDefinition& theParentNucleus)
}
} // Combine decay channels (loop i)
brs[2] = brs[2]+brs[3]+brs[4]+brs[5]; // Combine beta+ and EC
brs[3] = brs[4] =brs[5] = 0.0;
for (i= 0; i<nMode; i++){ // loop over decay modes
brs[2] = brs[2]+brs[3]+brs[4]+brs[5]+brs[6]; // Combine beta+ and EC
brs[3] = brs[4] = brs[5] = brs[6] = 0.0;
for (i = 0; i < nMode; i++) { // loop over decay modes
if (brs[i] > 0.) {
switch ( i ) {
switch (i) {
case 0:
// Decay mode is isomeric transition
theITChannel = new G4ITDecay(aParentNucleus, brs[0], 0.0, 0.0,
@@ -489,26 +487,34 @@ CalculateChainsFromParent(const G4ParticleDefinition& theParentNucleus)
summedDecayTable->Insert(theBetaPlusChannel);
break;
case 6:
case 7:
// Decay mode is alpha.
theAlphaChannel = new G4AlphaDecay(aParentNucleus, brs[6], 0.*MeV,
theAlphaChannel = new G4AlphaDecay(aParentNucleus, brs[7], 0.*MeV,
0.*MeV, noFloat);
summedDecayTable->Insert(theAlphaChannel);
break;
case 7:
case 8:
// Decay mode is proton.
theProtonChannel = new G4ProtonDecay(aParentNucleus, brs[7], 0.*MeV,
theProtonChannel = new G4ProtonDecay(aParentNucleus, brs[8], 0.*MeV,
0.*MeV, noFloat);
summedDecayTable->Insert(theProtonChannel);
break;
case 8:
case 9:
// Decay mode is neutron.
theNeutronChannel = new G4NeutronDecay(aParentNucleus, brs[8], 0.*MeV,
0.*MeV, noFloat);
theNeutronChannel = new G4NeutronDecay(aParentNucleus, brs[9], 0.*MeV,
0.*MeV, noFloat);
summedDecayTable->Insert(theNeutronChannel);
break;
case 10:
// Decay mode is spontaneous fission
theFissionChannel = new G4SFDecay(aParentNucleus, brs[10], 0.*MeV,
0.*MeV, noFloat);
summedDecayTable->Insert(theFissionChannel);
break;
default:
break;
}
@@ -593,8 +599,9 @@ CalculateChainsFromParent(const G4ParticleDefinition& theParentNucleus)
nEntry++;
} // there are entries in the table
} // nuclide is OK to decay
} // end of loop (i) over decay table branches
// delete summedDecayTable;
} // end of loop (i) over decay table branches
delete summedDecayTable;
} // Getting contents of decay rate vector (end loop on j)
nS = nT;
@@ -638,13 +645,11 @@ void G4Radioactivation::SetSourceTimeProfile(G4String filename)
NSourceBin = -1;
G4int loop = 0;
G4ExceptionDescription ed;
ed << " While count exceeded " << G4endl;
while (infile >> bin >> flux ) { /* Loop checking, 01.09.2015, D.Wright */
while (infile >> bin >> flux) { /* Loop checking, 01.09.2015, D.Wright */
loop++;
if (loop > 10000) {
G4Exception("G4RadioactiveDecay::SetSourceTimeProfile()", "HAD_RDM_100", JustWarning, ed);
G4Exception("G4RadioactiveDecay::SetSourceTimeProfile()", "HAD_RDM_100",
JustWarning, "While loop count exceeded");
break;
}
@@ -659,6 +664,7 @@ void G4Radioactivation::SetSourceTimeProfile(G4String filename)
}
}
AnalogueMC = false;
infile.close();
#ifdef G4VERBOSE
@@ -676,7 +682,6 @@ void G4Radioactivation::SetSourceTimeProfile(G4String filename)
void G4Radioactivation::SetDecayBias(G4String filename)
{
std::ifstream infile(filename, std::ios::in);
if (!infile) G4Exception("G4RadioactiveDecay::SetDecayBias()", "HAD_RDM_003",
FatalException, "Unable to open bias data file" );
@@ -690,14 +695,12 @@ void G4Radioactivation::SetDecayBias(G4String filename)
NDecayBin = -1;
G4int loop = 0;
G4ExceptionDescription ed;
ed << " While count exceeded " << G4endl;
while (infile >> bin >> flux ) { /* Loop checking, 01.09.2015, D.Wright */
NDecayBin++;
loop++;
if (loop > 10000) {
G4Exception("G4RadioactiveDecay::SetDecayBias()", "HAD_RDM_100", JustWarning, ed);
G4Exception("G4RadioactiveDecay::SetDecayBias()", "HAD_RDM_100",
JustWarning, "While loop count exceeded");
break;
}
@@ -720,6 +723,7 @@ void G4Radioactivation::SetDecayBias(G4String filename)
// Normalize so entries increase from 0 to 1
// converted to accumulated probabilities
AnalogueMC = false;
infile.close();
#ifdef G4VERBOSE
@@ -1010,7 +1014,7 @@ G4Radioactivation::DecayIt(const G4Track& theTrack, const G4Step&)
currentTime = finalGlobalTime + theDecayTime;
for (index = 0; index < numberOfSecondaries; index++) {
asecondaryparticle = tempprods->PopProducts();
if (asecondaryparticle->GetDefinition()->GetBaryonNumber() < 5) {
if (asecondaryparticle->GetDefinition()->GetPDGStable() ) {
pw.push_back(weight);
ptime.push_back(currentTime);
secondaryparticles.push_back(asecondaryparticle);
@@ -43,59 +43,19 @@ G4RadioactivationMessenger::G4RadioactivationMessenger(G4Radioactivation* theRad
{
grdmDirectory = new G4UIdirectory("/grdm/");
grdmDirectory->SetGuidance("Controls the biased version of radioactive decay");
/*
// Command to define the limits on nuclei the RDM will treat
nucleuslimitsCmd = new G4UIcmdWithNucleusLimits("/grdm/nucleusLimits",this);
nucleuslimitsCmd->SetGuidance
("Set the atomic weight and number limits for the RDM.");
nucleuslimitsCmd->SetParameterName("aMin","aMax","zMin","zMax",true);
// Command to contols whether beta decay will be treated faithfully or
// in fast mode (no longer used)
fbetaCmd = new G4UIcmdWithABool ("/grdm/fBeta",this);
fbetaCmd->SetGuidance("false: use 3-body decay, true: use histogram method");
fbetaCmd->SetParameterName("fBeta",true);
fbetaCmd->SetDefaultValue(false);
// Command to turn on/off variance reduction options
analoguemcCmd = new G4UIcmdWithABool ("/grdm/analogueMC",this);
analoguemcCmd->SetGuidance("false: variance reduction method; true: analogue method");
analoguemcCmd->SetParameterName("AnalogueMC",true);
analoguemcCmd->SetDefaultValue(true);
// Command to select a logical volume for RDM
avolumeCmd = new G4UIcmdWithAString("/grdm/selectVolume",this);
avolumeCmd->SetGuidance
("Suppply a logical volumes name to add it to the RDM apply list");
avolumeCmd->SetParameterName("aVolume",false);
// Command to de-select a logical volume for RDM
deavolumeCmd = new G4UIcmdWithAString("/grdm/deselectVolume",this);
deavolumeCmd->SetGuidance
("Suppply a logical volumes name to remove it from the RDM apply list");
deavolumeCmd->SetParameterName("aVolume",false);
// Command to select all logical volumes for RDM
allvolumesCmd = new G4UIcmdWithoutParameter("/grdm/allVolumes",this);
allvolumesCmd->SetGuidance
(" apply RDM to all logical volumes. No parameter required.");
// Command to de-selete a logical volume for RDM.
deallvolumesCmd = new G4UIcmdWithoutParameter("/grdm/noVolumes",this);
deallvolumesCmd->SetGuidance(" RDM is not applied to any logical volumes");
*/
// Command to use branching ratio biasing or not
brbiasCmd = new G4UIcmdWithABool ("/grdm/BRbias",this);
brbiasCmd->SetGuidance("false: no biasing; true: all branches are treated as equal");
brbiasCmd->SetParameterName("BRBias",true);
brbiasCmd->SetDefaultValue(true);
/*
// Command to apply internal conversion or not
icmCmd = new G4UIcmdWithABool ("/grdm/applyICM",this);
icmCmd->SetGuidance("True: ICM is applied; false: no");
icmCmd->SetParameterName("applyICM",true);
icmCmd->SetDefaultValue(true);
// Command to apply atomic relaxation or not
armCmd = new G4UIcmdWithABool ("/grdm/applyARM",this);
armCmd->SetGuidance("True: ARM is applied; false: no");
armCmd->SetParameterName("applyARM",true);
armCmd->SetDefaultValue(true);
*/
// Command to set the half-life thresold for isomer production
hlthCmd = new G4UIcmdWithADoubleAndUnit("/grdm/hlThreshold",this);
hlthCmd->SetGuidance("Set the h-l threshold for isomer production");
@@ -115,108 +75,34 @@ G4RadioactivationMessenger::G4RadioactivationMessenger(G4Radioactivation* theRad
("Supply the name of the ascii file containing the decay bias time profile");
decaybiasprofileCmd->SetParameterName("DBiasProfile",true);
decaybiasprofileCmd->SetDefaultValue("bias.data");
/*
// Command to set the directional bias (collimation) vector
colldirCmd = new G4UIcmdWith3Vector("/grdm/decayDirection",this);
colldirCmd->SetGuidance("Supply the direction vector for decay products");
colldirCmd->SetParameterName("X","Y","Z",false);
// Command to set the directional bias (collimation) half angle ("cone")
collangleCmd = new G4UIcmdWithADoubleAndUnit("/grdm/decayHalfAngle",this);
collangleCmd->SetGuidance
("Supply maximum angle from direction vector for decay products");
collangleCmd->SetParameterName("halfAngle",false);
collangleCmd->SetUnitCategory("Angle");
*/
// Command to set nuclei spliting parameter
splitnucleiCmd = new G4UIcmdWithAnInteger("/grdm/splitNuclei",this);
splitnucleiCmd->SetGuidance("Set number of spliting for the isotopes.");
splitnucleiCmd->SetParameterName("NSplit",true);
splitnucleiCmd->SetDefaultValue(1);
splitnucleiCmd->SetRange("NSplit>=1");
/*
// Command to set verbosity
verboseCmd = new G4UIcmdWithAnInteger("/grdm/verbose",this);
verboseCmd->SetGuidance("Set verbose level: 0, 1, 2 or 3");
verboseCmd->SetParameterName("VerboseLevel",true);
verboseCmd->SetDefaultValue(1);
verboseCmd->SetRange("VerboseLevel>=0");
//This commansd allows the user to define its own decay datafile for
// a given isotope
//
userDecayDataCmd = new G4UIcommand("/grdm/setRadioactiveDecayFile",this);
G4UIparameter* Z_para= new G4UIparameter("Z_isotope",'i',true);
Z_para->SetParameterRange("Z_isotope > 0");
Z_para->SetGuidance("Z: Charge number of isotope");
G4UIparameter* A_para= new G4UIparameter("A_isotope",'i',true);
A_para->SetParameterRange("A_isotope > 1");
A_para->SetGuidance("A: mass number of isotope");
G4UIparameter* FileName_para= new G4UIparameter("file_name",'s',true);
FileName_para->SetGuidance("Name of the user data file");
userDecayDataCmd->SetParameter(Z_para);
userDecayDataCmd->SetParameter(A_para);
userDecayDataCmd->SetParameter(FileName_para);
// Command allowing user-defined evaporation data file to be used
// a given isotope
userEvaporationDataCmd = new G4UIcommand("/grdm/setPhotoEvaporationFile",this);
userEvaporationDataCmd->SetParameter(Z_para);
userEvaporationDataCmd->SetParameter(A_para);
userEvaporationDataCmd->SetParameter(FileName_para);
*/
}
G4RadioactivationMessenger::~G4RadioactivationMessenger()
{
delete grdmDirectory;
// delete nucleuslimitsCmd;
delete analoguemcCmd;
delete sourcetimeprofileCmd;
delete decaybiasprofileCmd;
// delete fbetaCmd;
delete brbiasCmd;
delete splitnucleiCmd;
// delete verboseCmd;
// delete avolumeCmd;
// delete deavolumeCmd;
// delete allvolumesCmd;
// delete deallvolumesCmd;
// delete icmCmd;
// delete armCmd;
delete hlthCmd;
// delete userDecayDataCmd;
// delete userEvaporationDataCmd;
// delete colldirCmd;
// delete collangleCmd;
}
void G4RadioactivationMessenger::SetNewValue(G4UIcommand* command, G4String newValues)
{
// if (command==nucleuslimitsCmd) {theRadioactivationContainer->
// SetNucleusLimits(nucleuslimitsCmd->GetNewNucleusLimitsValue(newValues));
/*
} else if (command==fbetaCmd) {theRadioactivationContainer->
SetFBeta(fbetaCmd->GetNewBoolValue(newValues));
if (command==analoguemcCmd) {theRadioactivationContainer->
SetAnalogueMonteCarlo(analoguemcCmd->GetNewBoolValue(newValues));
} else if (command==avolumeCmd) {theRadioactivationContainer->
SelectAVolume(newValues);
} else if (command==deavolumeCmd) {theRadioactivationContainer->
DeselectAVolume(newValues);
} else if (command==allvolumesCmd) {theRadioactivationContainer->
SelectAllVolumes();
} else if (command==deallvolumesCmd) {theRadioactivationContainer->
DeselectAllVolumes();
*/
if (command==brbiasCmd) {theRadioactivationContainer->
} else if (command==brbiasCmd) {theRadioactivationContainer->
SetBRBias(brbiasCmd->GetNewBoolValue(newValues));
} else if (command==sourcetimeprofileCmd) {theRadioactivationContainer->
@@ -227,41 +113,9 @@ void G4RadioactivationMessenger::SetNewValue(G4UIcommand* command, G4String newV
} else if (command==splitnucleiCmd) {theRadioactivationContainer->
SetSplitNuclei(splitnucleiCmd->GetNewIntValue(newValues));
/*
} else if (command==verboseCmd) {theRadioactivationContainer->
SetVerboseLevel(verboseCmd->GetNewIntValue(newValues));
} else if (command==icmCmd ) {theRadioactivationContainer->
SetICM(icmCmd->GetNewBoolValue(newValues));
} else if (command==armCmd ) {theRadioactivationContainer->
SetARM(armCmd->GetNewBoolValue(newValues));
*/
} else if (command==hlthCmd ) {theRadioactivationContainer->
SetHLThreshold(hlthCmd->GetNewDoubleValue(newValues));
/*
} else if (command ==userDecayDataCmd) {
G4int Z,A;
G4String file_name;
const char* nv = (const char*)newValues;
std::istringstream is(nv);
is >> Z >> A >> file_name;
theRadioactivationContainer->AddUserDecayDataFile(Z,A,file_name);
} else if (command ==userEvaporationDataCmd) {
G4int Z,A;
G4String file_name;
const char* nv = (const char*)newValues;
std::istringstream is(nv);
is >> Z >> A >> file_name;
G4NuclearLevelData::GetInstance()->AddPrivateData(Z,A,file_name);
} else if (command==colldirCmd) {theRadioactivationContainer->
SetDecayDirection(colldirCmd->GetNew3VectorValue(newValues));
} else if (command==collangleCmd) {theRadioactivationContainer->
SetDecayHalfAngle(collangleCmd->GetNewDoubleValue(newValues));
*/
}
}
@@ -114,6 +114,7 @@
#include "G4AlphaDecay.hh"
#include "G4ProtonDecay.hh"
#include "G4NeutronDecay.hh"
#include "G4SFDecay.hh"
#include "G4VDecayChannel.hh"
#include "G4NuclearDecay.hh"
#include "G4RadioactiveDecayMode.hh"
@@ -136,6 +137,7 @@
#include "G4Proton.hh"
#include "G4HadronicProcessType.hh"
#include "G4HadronicProcessStore.hh"
#include "G4HadronicException.hh"
#include "G4PhotonEvaporation.hh"
@@ -153,6 +155,12 @@ const G4ThreeVector G4RadioactiveDecay::origin(0.,0.,0.);
#include "G4AutoLock.hh"
G4Mutex G4RadioactiveDecay::radioactiveDecayMutex = G4MUTEX_INITIALIZER;
DecayTableMap* G4RadioactiveDecay::master_dkmap = 0;
G4int& G4RadioactiveDecay::NumberOfInstances()
{
static G4int numberOfInstances = 0;
return numberOfInstances;
}
#endif
G4RadioactiveDecay::G4RadioactiveDecay(const G4String& processName)
@@ -200,6 +208,7 @@ G4RadioactiveDecay::G4RadioactiveDecay(const G4String& processName)
// Instantiate the map of decay tables
#ifdef G4MULTITHREADED
G4AutoLock lk(&G4RadioactiveDecay::radioactiveDecayMutex);
NumberOfInstances()++;
if(!master_dkmap) master_dkmap = new DecayTableMap;
#endif
dkmap = new DecayTableMap;
@@ -229,6 +238,7 @@ G4RadioactiveDecay::G4RadioactiveDecay(const G4String& processName)
// RDM applies to all logical volumes by default
isAllVolumesMode = true;
SelectAllVolumes();
G4HadronicProcessStore::Instance()->RegisterExtraProcess(this);
}
@@ -251,6 +261,18 @@ G4RadioactiveDecay::~G4RadioactiveDecay()
}
dkmap->clear();
delete dkmap;
#ifdef G4MULTITHREADED
G4AutoLock lk(&G4RadioactiveDecay::radioactiveDecayMutex);
--NumberOfInstances();
if(NumberOfInstances()==0)
{
for (DecayTableMap::iterator i = master_dkmap->begin(); i != master_dkmap->end(); i++) {
delete i->second;
}
master_dkmap->clear();
delete master_dkmap;
}
#endif
}
@@ -428,13 +450,11 @@ G4RadioactiveDecay::ConvolveSourceTimeProfile(const G4double t, const G4double t
nbin = 0;
G4int loop = 0;
G4ExceptionDescription ed;
ed << " While count exceeded " << G4endl;
while (t > SBin[nbin]) {
loop++;
if (loop > 1000) {
G4Exception("G4RadioactiveDecay::ConvolveSourceTimeProfile()",
"HAD_RDM_100", JustWarning, ed);
"HAD_RDM_100", JustWarning, "While loop count exceeded");
break;
}
@@ -493,13 +513,11 @@ G4RadioactiveDecay::ConvolveSourceTimeProfile(const G4double t, const G4double t
nbin = 0;
G4int loop = 0;
G4ExceptionDescription ed;
ed << " While count exceeded " << G4endl;
while (t > SBin[nbin]) { // Loop checking, 01.09.2015, D.Wright
loop++;
if (loop > 1000) {
G4Exception("G4RadioactiveDecay::ConvolveSourceTimeProfile()",
"HAD_RDM_100", JustWarning, ed);
"HAD_RDM_100", JustWarning,"While loop count exceeded");
break;
}
nbin++;
@@ -554,13 +572,12 @@ G4double G4RadioactiveDecay::GetDecayTime()
G4int i = 0;
G4int loop = 0;
G4ExceptionDescription ed;
ed << " While count exceeded " << G4endl;
while ( DProfile[i] < rand) { /* Loop checking, 01.09.2015, D.Wright */
i++;
loop++;
if (loop > 100000) {
G4Exception("G4RadioactiveDecay::GetDecayTime()", "HAD_RDM_100", JustWarning, ed);
G4Exception("G4RadioactiveDecay::GetDecayTime()", "HAD_RDM_100",
JustWarning, "While loop count exceeded");
break;
}
}
@@ -580,13 +597,12 @@ G4int G4RadioactiveDecay::GetDecayTimeBin(const G4double aDecayTime)
G4int i = 0;
G4int loop = 0;
G4ExceptionDescription ed;
ed << " While count exceeded " << G4endl;
while ( aDecayTime > DBin[i] ) { /* Loop checking, 01.09.2015, D.Wright */
i++;
loop++;
if (loop > 100000) {
G4Exception("G4RadioactiveDecay::GetDecayTimeBin()", "HAD_RDM_100", JustWarning, ed);
G4Exception("G4RadioactiveDecay::GetDecayTimeBin()", "HAD_RDM_100",
JustWarning, "While loop count exceeded");
break;
}
}
@@ -715,6 +731,8 @@ void G4RadioactiveDecay::BuildPhysicsTable(const G4ParticleDefinition&)
if(G4Threading::IsMasterThread()) { StreamInfo(G4cout, "\n"); }
#endif
}
G4HadronicProcessStore::
Instance()->RegisterParticleForExtraProcess(this,G4GenericIon::GenericIon());
}
////////////////////////////////////////////////////////////////////////
@@ -809,7 +827,7 @@ G4RadioactiveDecay::LoadDecayTable(const G4ParticleDefinition& theParentNucleus)
if (DecaySchemeFile.good()) {
// Initialize variables used for reading in radioactive decay data
G4bool floatMatch(false);
const G4int nMode = 10;
const G4int nMode = 11;
G4double modeTotalBR[nMode] = {0.0};
G4double modeSumBR[nMode];
for (G4int i = 0; i < nMode; i++) {
@@ -837,13 +855,11 @@ G4RadioactiveDecay::LoadDecayTable(const G4ParticleDefinition& theParentNucleus)
G4bool complete(false); // bool insures only one set of values read for any
// given parent energy level
G4int loop = 0;
G4ExceptionDescription ed;
ed << " While count exceeded " << G4endl;
while (!complete && !DecaySchemeFile.getline(inputChars, 120).eof()) { /* Loop checking, 01.09.2015, D.Wright */
loop++;
if (loop > 100000) {
G4Exception("G4RadioactiveDecay::LoadDecayTable()", "HAD_RDM_100", JustWarning, ed);
G4Exception("G4RadioactiveDecay::LoadDecayTable()", "HAD_RDM_100",
JustWarning, "While loop count exceeded");
break;
}
@@ -920,7 +936,7 @@ G4RadioactiveDecay::LoadDecayTable(const G4ParticleDefinition& theParentNucleus)
case Neutron2:
break;
case SpFission:
break;
modeTotalBR[10] = decayModeTotal; break;
case RDM_ERROR:
default:
@@ -1007,17 +1023,17 @@ G4RadioactiveDecay::LoadDecayTable(const G4ParticleDefinition& theParentNucleus)
}
break;
case NshellEC: // M-shell electron capture
{
G4ECDecay* aMECChannel =
new G4ECDecay(&theParentNucleus, b, c*MeV, a*MeV,
daughterFloatLevel, NshellEC);
// aMECChannel->DumpNuclearInfo();
aMECChannel->SetHLThreshold(halflifethreshold);
aMECChannel->SetARM(applyARM);
theDecayTable->Insert(aMECChannel);
modeSumBR[6] += b;
}
case NshellEC: // N-shell electron capture
{
G4ECDecay* aNECChannel =
new G4ECDecay(&theParentNucleus, b, c*MeV, a*MeV,
daughterFloatLevel, NshellEC);
// aNECChannel->DumpNuclearInfo();
aNECChannel->SetHLThreshold(halflifethreshold);
aNECChannel->SetARM(applyARM);
theDecayTable->Insert(aNECChannel);
modeSumBR[6] += b;
}
break;
case Alpha:
@@ -1081,9 +1097,16 @@ G4RadioactiveDecay::LoadDecayTable(const G4ParticleDefinition& theParentNucleus)
// G4cout << " Double beta- decay, a = " << a << ", b = " << b << ", c = " << c << G4endl;
break;
case SpFission:
// Not yet implemented
//G4cout<<"Sp fission channel"<<a<<'\t'<<b<<'\t'<<c<<std::endl;
break;
{
G4SFDecay* aSpontFissChannel =
// new G4SFDecay(&theParentNucleus, decayModeTotal, 0.0, 0.0);
new G4SFDecay(&theParentNucleus, b, c*MeV, a*MeV,
daughterFloatLevel);
theDecayTable->Insert(aSpontFissChannel);
modeSumBR[10] += b;
}
break;
case RDM_ERROR:
default:
@@ -1219,6 +1242,8 @@ CalculateChainsFromParent(const G4ParticleDefinition& theParentNucleus)
G4AlphaDecay* theAlphaChannel = 0;
G4ProtonDecay* theProtonChannel = 0;
G4NeutronDecay* theNeutronChannel = 0;
G4SFDecay* theFissionChannel = 0;
G4RadioactiveDecayMode theDecayMode;
G4double theBR = 0.0;
G4int AP = 0;
@@ -1239,20 +1264,19 @@ CalculateChainsFromParent(const G4ParticleDefinition& theParentNucleus)
G4double TaoPlus;
G4int nS = 0; // Running index of first decay in a given generation
G4int nT = nEntry; // Total number of decays accumulated over entire history
const G4int nMode = 9;
const G4int nMode = 11;
G4double brs[nMode];
//
theIonTable =
(G4IonTable*)(G4ParticleTable::GetParticleTable()->GetIonTable());
G4int loop = 0;
G4ExceptionDescription ed;
ed << " While count exceeded " << G4endl;
while (!stable) { /* Loop checking, 01.09.2015, D.Wright */
loop++;
if (loop > 10000) {
G4Exception("G4RadioactiveDecay::CalculateChainsFromParent()", "HAD_RDM_100", JustWarning, ed);
G4Exception("G4RadioactiveDecay::CalculateChainsFromParent()", "HAD_RDM_100",
JustWarning, "While loop count exceeded");
break;
}
nGeneration++;
@@ -1321,11 +1345,11 @@ CalculateChainsFromParent(const G4ParticleDefinition& theParentNucleus)
}
} // Combine decay channels (loop i)
brs[2] = brs[2]+brs[3]+brs[4]+brs[5]; // Combine beta+ and EC
brs[3] = brs[4] =brs[5] = 0.0;
for (i= 0; i<nMode; i++){ // loop over decay modes
brs[2] = brs[2]+brs[3]+brs[4]+brs[5]+brs[6]; // Combine beta+ and EC
brs[3] = brs[4] = brs[5] = brs[6] = 0.0;
for (i = 0; i < nMode; i++) { // loop over decay modes
if (brs[i] > 0.) {
switch ( i ) {
switch (i) {
case 0:
// Decay mode is isomeric transition
theITChannel = new G4ITDecay(aParentNucleus, brs[0], 0.0, 0.0,
@@ -1350,26 +1374,34 @@ CalculateChainsFromParent(const G4ParticleDefinition& theParentNucleus)
summedDecayTable->Insert(theBetaPlusChannel);
break;
case 6:
case 7:
// Decay mode is alpha.
theAlphaChannel = new G4AlphaDecay(aParentNucleus, brs[6], 0.*MeV,
theAlphaChannel = new G4AlphaDecay(aParentNucleus, brs[7], 0.*MeV,
0.*MeV, noFloat);
summedDecayTable->Insert(theAlphaChannel);
break;
case 7:
case 8:
// Decay mode is proton.
theProtonChannel = new G4ProtonDecay(aParentNucleus, brs[7], 0.*MeV,
theProtonChannel = new G4ProtonDecay(aParentNucleus, brs[8], 0.*MeV,
0.*MeV, noFloat);
summedDecayTable->Insert(theProtonChannel);
break;
case 8:
case 9:
// Decay mode is neutron.
theNeutronChannel = new G4NeutronDecay(aParentNucleus, brs[8], 0.*MeV,
0.*MeV, noFloat);
theNeutronChannel = new G4NeutronDecay(aParentNucleus, brs[9], 0.*MeV,
0.*MeV, noFloat);
summedDecayTable->Insert(theNeutronChannel);
break;
case 10:
// Decay mode is spontaneous fission
theFissionChannel = new G4SFDecay(aParentNucleus, brs[10], 0.*MeV,
0.*MeV, noFloat);
summedDecayTable->Insert(theFissionChannel);
break;
default:
break;
}
@@ -1454,8 +1486,9 @@ CalculateChainsFromParent(const G4ParticleDefinition& theParentNucleus)
nEntry++;
} // there are entries in the table
} // nuclide is OK to decay
} // end of loop (i) over decay table branches
// delete summedDecayTable;
} // end of loop (i) over decay table branches
delete summedDecayTable;
} // Getting contents of decay rate vector (end loop on j)
nS = nT;
@@ -1499,13 +1532,11 @@ void G4RadioactiveDecay::SetSourceTimeProfile(G4String filename)
NSourceBin = -1;
G4int loop = 0;
G4ExceptionDescription ed;
ed << " While count exceeded " << G4endl;
while (infile >> bin >> flux ) { /* Loop checking, 01.09.2015, D.Wright */
while (infile >> bin >> flux) { /* Loop checking, 01.09.2015, D.Wright */
loop++;
if (loop > 10000) {
G4Exception("G4RadioactiveDecay::SetSourceTimeProfile()", "HAD_RDM_100", JustWarning, ed);
G4Exception("G4RadioactiveDecay::SetSourceTimeProfile()", "HAD_RDM_100",
JustWarning, "While loop count exceeded");
break;
}
@@ -1551,14 +1582,12 @@ void G4RadioactiveDecay::SetDecayBias(G4String filename)
NDecayBin = -1;
G4int loop = 0;
G4ExceptionDescription ed;
ed << " While count exceeded " << G4endl;
while (infile >> bin >> flux ) { /* Loop checking, 01.09.2015, D.Wright */
NDecayBin++;
loop++;
if (loop > 10000) {
G4Exception("G4RadioactiveDecay::SetDecayBias()", "HAD_RDM_100", JustWarning, ed);
G4Exception("G4RadioactiveDecay::SetDecayBias()", "HAD_RDM_100",
JustWarning, "While loop count exceeded");
break;
}
@@ -25,7 +25,7 @@
//
////////////////////////////////////////////////////////////////////////////////
// //
// File: G4RadioactiveDecayBase.hh //
// File: G4RadioactiveDecayBase.cc //
// Author: D.H. Wright (SLAC) //
// Date: 9 August 2017 //
// Description: version the G4RadioactiveDecay process by F. Lei and //
@@ -52,6 +52,7 @@
#include "G4AlphaDecay.hh"
#include "G4ProtonDecay.hh"
#include "G4NeutronDecay.hh"
#include "G4SFDecay.hh"
#include "G4VDecayChannel.hh"
#include "G4NuclearDecay.hh"
#include "G4RadioactiveDecayMode.hh"
@@ -94,6 +95,12 @@ const G4ThreeVector G4RadioactiveDecayBase::origin(0.,0.,0.);
#include "G4AutoLock.hh"
G4Mutex G4RadioactiveDecayBase::radioactiveDecayMutex = G4MUTEX_INITIALIZER;
DecayTableMap* G4RadioactiveDecayBase::master_dkmap = 0;
G4int& G4RadioactiveDecayBase::NumberOfInstances()
{
static G4int numberOfInstances = 0;
return numberOfInstances;
}
#endif
G4RadioactiveDecayBase::G4RadioactiveDecayBase(const G4String& processName)
@@ -143,6 +150,7 @@ G4RadioactiveDecayBase::G4RadioactiveDecayBase(const G4String& processName)
// Instantiate the map of decay tables
#ifdef G4MULTITHREADED
G4AutoLock lk(&G4RadioactiveDecayBase::radioactiveDecayMutex);
NumberOfInstances()++;
if(!master_dkmap) master_dkmap = new DecayTableMap;
#endif
dkmap = new DecayTableMap;
@@ -176,6 +184,18 @@ G4RadioactiveDecayBase::~G4RadioactiveDecayBase()
}
dkmap->clear();
delete dkmap;
#ifdef G4MULTITHREADED
G4AutoLock lk(&G4RadioactiveDecayBase::radioactiveDecayMutex);
--NumberOfInstances();
if(NumberOfInstances()==0)
{
for (DecayTableMap::iterator i = master_dkmap->begin(); i != master_dkmap->end(); i++) {
delete i->second;
}
master_dkmap->clear();
delete master_dkmap;
}
#endif
}
@@ -320,26 +340,24 @@ G4double G4RadioactiveDecayBase::GetMeanLifeTime(const G4Track& theTrack,
// In analogueMC mode it returns the particle's mean-life.
G4double meanlife = 0.;
// if (AnalogueMC) {
const G4DynamicParticle* theParticle = theTrack.GetDynamicParticle();
const G4ParticleDefinition* theParticleDef = theParticle->GetDefinition();
G4double theLife = theParticleDef->GetPDGLifeTime();
const G4DynamicParticle* theParticle = theTrack.GetDynamicParticle();
const G4ParticleDefinition* theParticleDef = theParticle->GetDefinition();
G4double theLife = theParticleDef->GetPDGLifeTime();
#ifdef G4VERBOSE
if (GetVerboseLevel() > 2) {
G4cout << "G4RadioactiveDecay::GetMeanLifeTime() " << G4endl;
G4cout << "KineticEnergy: " << theParticle->GetKineticEnergy()/GeV
<< " GeV, Mass: " << theParticle->GetMass()/GeV
<< " GeV, Life time: " << theLife/ns << " ns " << G4endl;
}
if (GetVerboseLevel() > 2) {
G4cout << "G4RadioactiveDecay::GetMeanLifeTime() " << G4endl;
G4cout << "KineticEnergy: " << theParticle->GetKineticEnergy()/GeV
<< " GeV, Mass: " << theParticle->GetMass()/GeV
<< " GeV, Life time: " << theLife/ns << " ns " << G4endl;
}
#endif
if (theParticleDef->GetPDGStable()) {meanlife = DBL_MAX;}
else if (theLife < 0.0) {meanlife = DBL_MAX;}
else {meanlife = theLife;}
// Set meanlife to zero for excited istopes which are not in the
// RDM database
if (((const G4Ions*)(theParticleDef))->GetExcitationEnergy() > 0. &&
meanlife == DBL_MAX) {meanlife = 0.;}
// }
if (theParticleDef->GetPDGStable()) {meanlife = DBL_MAX;}
else if (theLife < 0.0) {meanlife = DBL_MAX;}
else {meanlife = theLife;}
// Set meanlife to zero for excited istopes which are not in the
// RDM database
if (((const G4Ions*)(theParticleDef))->GetExcitationEnergy() > 0. &&
meanlife == DBL_MAX) {meanlife = 0.;}
#ifdef G4VERBOSE
if (GetVerboseLevel() > 1)
G4cout << " mean life time: " << meanlife/s << " s " << G4endl;
@@ -348,11 +366,11 @@ G4double G4RadioactiveDecayBase::GetMeanLifeTime(const G4Track& theTrack,
return meanlife;
}
////////////////////////////////////////////////////////////////////////
// //
// GetMeanFreePath for decay in flight //
// //
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// //
// GetMeanFreePath for decay in flight //
// //
////////////////////////////////////////////////////////////////////////////////
G4double G4RadioactiveDecayBase::GetMeanFreePath (const G4Track& aTrack, G4double,
G4ForceCondition*)
@@ -413,22 +431,70 @@ G4double G4RadioactiveDecayBase::GetMeanFreePath (const G4Track& aTrack, G4doubl
return pathlength;
}
////////////////////////////////////////////////////////////////////////
// //
// BuildPhysicsTable - initialization of atomic de-excitation //
// //
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// //
// BuildPhysicsTable - initialization of atomic de-excitation //
// //
////////////////////////////////////////////////////////////////////////////////
void G4RadioactiveDecayBase::BuildPhysicsTable(const G4ParticleDefinition&)
{
if (!isInitialised) {
isInitialised = true;
#ifdef G4VERBOSE
if(G4Threading::IsMasterThread()) { StreamInfo(G4cout, "\n"); }
#endif
}
G4HadronicProcessStore::
Instance()->RegisterParticleForExtraProcess(this,G4GenericIon::GenericIon());
}
////////////////////////////////////////////////////////////////////////////////
// //
// StreamInfo - stream out parameters //
// //
////////////////////////////////////////////////////////////////////////////////
void
G4RadioactiveDecayBase::StreamInfo(std::ostream& os, const G4String& endline)
{
G4DeexPrecoParameters* deex =
G4NuclearLevelData::GetInstance()->GetParameters();
G4EmParameters* emparam = G4EmParameters::Instance();
G4int prec = os.precision(5);
os << "======================================================================"
<< endline;
os << "====== Radioactive Decay Physics Parameters ======="
<< endline;
os << "======================================================================"
<< endline;
os << "Max life time "
<< deex->GetMaxLifeTime()/CLHEP::ps << " ps" << endline;
os << "Internal e- conversion flag "
<< deex->GetInternalConversionFlag() << endline;
os << "Stored internal conversion coefficients "
<< deex->StoreICLevelData() << endline;
os << "Enable correlated gamma emission "
<< deex->CorrelatedGamma() << endline;
os << "Max 2J for sampling of angular correlations "
<< deex->GetTwoJMAX() << endline;
os << "Atomic de-excitation enabled "
<< emparam->Fluo() << endline;
os << "Auger electron emission enabled "
<< emparam->Auger() << endline;
os << "Auger cascade enabled "
<< emparam->AugerCascade() << endline;
os << "Check EM cuts disabled for atomic de-excitation "
<< emparam->DeexcitationIgnoreCut() << endline;
os << "Use Bearden atomic level energies "
<< emparam->BeardenFluoDir() << endline;
os << "======================================================================"
<< endline;
os.precision(prec);
}
////////////////////////////////////////////////////////////////////////////////
// //
// LoadDecayTable loads the decay scheme from the RadioactiveDecay database //
@@ -463,14 +529,6 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
G4String file = theUserRadioactiveDataFiles[1000*A+Z];
if (file == "") {
/*
if (!getenv("G4RADIOACTIVEDATA") ) {
G4cout << "Please setenv G4RADIOACTIVEDATA to point to the radioactive decay data files."
<< G4endl;
throw G4HadronicException(__FILE__, __LINE__, " Please setenv G4RADIOACTIVEDATA to point to the radioactive decay data files.");
}
G4String dirName = getenv("G4RADIOACTIVEDATA");
*/
std::ostringstream os;
os << dirPath << "/z" << Z << ".a" << A << '\0';
file = os.str();
@@ -485,7 +543,7 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
if (DecaySchemeFile.good()) {
// Initialize variables used for reading in radioactive decay data
G4bool floatMatch(false);
const G4int nMode = 9;
const G4int nMode = 11;
G4double modeTotalBR[nMode] = {0.0};
G4double modeSumBR[nMode];
for (G4int i = 0; i < nMode; i++) {
@@ -513,13 +571,11 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
G4bool complete(false); // bool insures only one set of values read for any
// given parent energy level
G4int loop = 0;
G4ExceptionDescription ed;
ed << " While count exceeded " << G4endl;
while (!complete && !DecaySchemeFile.getline(inputChars, 120).eof()) { /* Loop checking, 01.09.2015, D.Wright */
loop++;
if (loop > 100000) {
G4Exception("G4RadioactiveDecay::LoadDecayTable()", "HAD_RDM_100", JustWarning, ed);
G4Exception("G4RadioactiveDecay::LoadDecayTable()", "HAD_RDM_100",
JustWarning, "While loop count exceeded");
break;
}
@@ -575,12 +631,14 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
modeTotalBR[4] = decayModeTotal; break;
case MshellEC:
modeTotalBR[5] = decayModeTotal; break;
case Alpha:
case NshellEC:
modeTotalBR[6] = decayModeTotal; break;
case Proton:
case Alpha:
modeTotalBR[7] = decayModeTotal; break;
case Neutron:
case Proton:
modeTotalBR[8] = decayModeTotal; break;
case Neutron:
modeTotalBR[9] = decayModeTotal; break;
case BDProton:
break;
case BDNeutron:
@@ -594,7 +652,7 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
case Neutron2:
break;
case SpFission:
break;
modeTotalBR[10] = decayModeTotal; break;
case RDM_ERROR:
default:
@@ -680,6 +738,19 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
}
break;
case NshellEC: // N-shell electron capture
{
G4ECDecay* aNECChannel =
new G4ECDecay(&theParentNucleus, b, c*MeV, a*MeV,
daughterFloatLevel, NshellEC);
// aNECChannel->DumpNuclearInfo();
// aNECChannel->SetHLThreshold(halflifethreshold);
aNECChannel->SetARM(applyARM);
theDecayTable->Insert(aNECChannel);
modeSumBR[6] += b;
}
break;
case Alpha:
{
G4AlphaDecay* anAlphaChannel =
@@ -688,7 +759,7 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
// anAlphaChannel->DumpNuclearInfo();
// anAlphaChannel->SetHLThreshold(halflifethreshold);
theDecayTable->Insert(anAlphaChannel);
modeSumBR[6] += b;
modeSumBR[7] += b;
}
break;
@@ -700,7 +771,7 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
// aProtonChannel->DumpNuclearInfo();
// aProtonChannel->SetHLThreshold(halflifethreshold);
theDecayTable->Insert(aProtonChannel);
modeSumBR[7] += b;
modeSumBR[8] += b;
}
break;
@@ -712,7 +783,7 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
// aNeutronChannel->DumpNuclearInfo();
// aNeutronChannel->SetHLThreshold(halflifethreshold);
theDecayTable->Insert(aNeutronChannel);
modeSumBR[8] += b;
modeSumBR[9] += b;
}
break;
@@ -741,9 +812,16 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
// G4cout << " Double beta- decay, a = " << a << ", b = " << b << ", c = " << c << G4endl;
break;
case SpFission:
// Not yet implemented
//G4cout<<"Sp fission channel"<<a<<'\t'<<b<<'\t'<<c<<std::endl;
break;
{
G4SFDecay* aSpontFissChannel =
// new G4SFDecay(&theParentNucleus, decayModeTotal, 0.0, 0.0);
new G4SFDecay(&theParentNucleus, b, c*MeV, a*MeV,
daughterFloatLevel);
theDecayTable->Insert(aSpontFissChannel);
modeSumBR[10] += b;
}
break;
case RDM_ERROR:
default:
@@ -871,6 +949,7 @@ G4RadioactiveDecayBase::DecayIt(const G4Track& theTrack, const G4Step&)
ClearNumberOfInteractionLengthLeft();
return &fParticleChangeForRadDecay;
}
G4DecayTable* theDecayTable = GetDecayTable(theParticleDef);
if (theDecayTable == 0 || theDecayTable->entries() == 0) {
@@ -55,15 +55,6 @@ G4RadioactiveDecayBaseMessenger::G4RadioactiveDecayBaseMessenger
("Set the atomic weight and number limits for the RDM.");
nucleuslimitsCmd->SetParameterName("aMin","aMax","zMin","zMax",true);
// Command controlling whether beta decay will be treated faithfully or
// in fast mode (obsolete)
fbetaCmd = new G4UIcmdWithABool ("/grdm/fBeta",this);
// fbetaCmd->SetGuidance("false: use 3-body decay, true: use histogram method");
fbetaCmd->SetGuidance("Fast (approximate) beta decay no longer used.");
fbetaCmd->SetGuidance("Kept for backward compatibility.");
fbetaCmd->SetParameterName("fBeta",true);
fbetaCmd->SetDefaultValue(false);
// Select a logical volume for RDM
avolumeCmd = new
G4UIcmdWithAString("/grdm/selectVolume",this);
@@ -169,7 +160,6 @@ G4RadioactiveDecayBaseMessenger::~G4RadioactiveDecayBaseMessenger ()
{
delete grdmDirectory;
delete nucleuslimitsCmd;
delete fbetaCmd;
delete verboseCmd;
delete avolumeCmd;
delete deavolumeCmd;
@@ -187,38 +177,35 @@ G4RadioactiveDecayBaseMessenger::~G4RadioactiveDecayBaseMessenger ()
void
G4RadioactiveDecayBaseMessenger::SetNewValue(G4UIcommand *command, G4String newValues)
{
if (command==nucleuslimitsCmd) {
if (command == nucleuslimitsCmd) {
theRadioactiveDecayContainer->
SetNucleusLimits(nucleuslimitsCmd->GetNewNucleusLimitsValue(newValues));
} else if (command==fbetaCmd) {
theRadioactiveDecayContainer->
SetFBeta(fbetaCmd->GetNewBoolValue(newValues));
} else if (command==avolumeCmd) {
} else if (command == avolumeCmd) {
theRadioactiveDecayContainer->SelectAVolume(newValues);
} else if (command==deavolumeCmd) {
} else if (command == deavolumeCmd) {
theRadioactiveDecayContainer->DeselectAVolume(newValues);
} else if (command==allvolumesCmd) {
} else if (command == allvolumesCmd) {
theRadioactiveDecayContainer->SelectAllVolumes();
} else if (command==deallvolumesCmd) {
} else if (command == deallvolumesCmd) {
theRadioactiveDecayContainer->DeselectAllVolumes();
} else if (command==verboseCmd) {
} else if (command == verboseCmd) {
theRadioactiveDecayContainer->
SetVerboseLevel(verboseCmd->GetNewIntValue(newValues));
} else if (command==icmCmd) {
} else if (command == icmCmd) {
theRadioactiveDecayContainer->
SetICM(icmCmd->GetNewBoolValue(newValues));
} else if (command==armCmd) {
} else if (command == armCmd) {
theRadioactiveDecayContainer->
SetARM(armCmd->GetNewBoolValue(newValues));
} else if (command ==userDecayDataCmd) {
} else if (command == userDecayDataCmd) {
G4int Z,A;
G4String file_name;
const char* nv = (const char*)newValues;
@@ -226,7 +213,7 @@ G4RadioactiveDecayBaseMessenger::SetNewValue(G4UIcommand *command, G4String newV
is >> Z >> A >> file_name;
theRadioactiveDecayContainer->AddUserDecayDataFile(Z,A,file_name);
} else if (command ==userEvaporationDataCmd) {
} else if (command == userEvaporationDataCmd) {
G4int Z,A;
G4String file_name;
const char* nv = (const char*)newValues;
@@ -234,11 +221,11 @@ G4RadioactiveDecayBaseMessenger::SetNewValue(G4UIcommand *command, G4String newV
is >> Z >> A >> file_name;
G4NuclearLevelData::GetInstance()->AddPrivateData(Z,A,file_name);
} else if (command==colldirCmd) {
} else if (command == colldirCmd) {
theRadioactiveDecayContainer->
SetDecayDirection(colldirCmd->GetNew3VectorValue(newValues));
} else if (command==collangleCmd) {
} else if (command == collangleCmd) {
theRadioactiveDecayContainer->
SetDecayHalfAngle(collangleCmd->GetNewDoubleValue(newValues));
}
@@ -50,6 +50,8 @@ std::istream &operator >> (std::istream& strm, G4RadioactiveDecayMode& q)
{q = Proton;}
else if (a == "Neutron")
{q = Neutron;}
else if (a == "SpFission")
{q = SpFission;}
else if (a == "BDProton")
{q = BDProton;}
else if (a == "BDNeutron")
@@ -62,8 +64,6 @@ std::istream &operator >> (std::istream& strm, G4RadioactiveDecayMode& q)
{q = Proton2;}
else if (a == "Neutron2")
{q = Neutron2;}
else if (a == "SpFission")
{q = SpFission;}
else
{q = RDM_ERROR;}
return strm;
@@ -192,7 +192,6 @@ G4RadioactiveDecaymessenger::G4RadioactiveDecaymessenger
Z_para->SetParameterRange("Z_isotope > 0");
Z_para->SetGuidance("Z: Charge number of isotope");
G4UIparameter* A_para= new G4UIparameter("A_isotope",'i',true);
A_para->SetParameterRange("A_isotope > 1");
A_para->SetGuidance("A: mass number of isotope");
@@ -208,9 +207,19 @@ G4RadioactiveDecaymessenger::G4RadioactiveDecaymessenger
// a given isotope
//
userEvaporationDataCmd = new G4UIcommand("/grdm/setPhotoEvaporationFile",this);
userEvaporationDataCmd->SetParameter(Z_para);
userEvaporationDataCmd->SetParameter(A_para);
userEvaporationDataCmd->SetParameter(FileName_para);
G4UIparameter* Z_para_ = new G4UIparameter("Z_isotope",'i',true);
Z_para->SetParameterRange("Z_isotope > 0");
Z_para->SetGuidance("Z: Charge number of isotope");
G4UIparameter* A_para_ = new G4UIparameter("A_isotope",'i',true);
A_para->SetParameterRange("A_isotope > 1");
A_para->SetGuidance("A: mass number of isotope");
G4UIparameter* FileName_para_ = new G4UIparameter("file_name",'s',true);
FileName_para->SetGuidance("Name of the user data file");
userEvaporationDataCmd->SetParameter(Z_para_ );
userEvaporationDataCmd->SetParameter(A_para_ );
userEvaporationDataCmd->SetParameter(FileName_para_ );
}
@@ -0,0 +1,155 @@
//
// ********************************************************************
// * 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: G4SFDecay.cc //
// Author: D.H. Wright (SLAC) //
// Date: 27 March 2019 //
// //
////////////////////////////////////////////////////////////////////////////////
#include "G4SFDecay.hh"
#include "G4fissionEvent.hh"
#include "G4IonTable.hh"
#include "G4ThreeVector.hh"
#include "G4LorentzVector.hh"
#include "G4DynamicParticle.hh"
#include "G4DecayProducts.hh"
#include "G4Neutron.hh"
#include "G4Gamma.hh"
#include "G4SystemOfUnits.hh"
#include "G4PhysicalConstants.hh"
G4SFDecay::G4SFDecay(const G4ParticleDefinition* theParentNucleus,
const G4double& branch, const G4double& Qvalue,
const G4double& excitationE,
const G4Ions::G4FloatLevelBase& flb)
: G4NuclearDecay("SF decay", SpFission, excitationE, flb), transitionQ(Qvalue)
{
SetParent(theParentNucleus); // Store name of parent nucleus, delete G4MT_parent
SetBR(branch);
parentZ = theParentNucleus->GetAtomicNumber();
parentA = theParentNucleus->GetAtomicMass();
// SetNumberOfDaughters(0); doesn't seem to work
// Set to 1 for now
// When we later install proper fragment generation, set this to 2
// and modify Z and A in DecayIt()
SetNumberOfDaughters(1);
G4IonTable* theIonTable =
(G4IonTable*)(G4ParticleTable::GetParticleTable()->GetIonTable());
SetDaughter(0, theIonTable->GetIon(parentZ, parentA, excitationE, flb) );
}
G4SFDecay::~G4SFDecay()
{}
G4DecayProducts* G4SFDecay::DecayIt(G4double)
{
// Fill G4MT_parent with theParentNucleus (stored by SetParent in ctor)
CheckAndFillParent();
// Set up final state
// parentParticle is set at rest here because boost with correct momentum
// is done later
G4LorentzVector atRest(G4MT_parent->GetPDGMass(),
G4ThreeVector(0.,0.,0.) );
G4DynamicParticle parentParticle(G4MT_parent, atRest);
G4DecayProducts* products = new G4DecayProducts(parentParticle);
// Generate LLNL code for parent nucleus
G4int code = 1000*G4MT_parent->GetAtomicNumber() +
G4MT_parent->GetAtomicMass();
// Let G4fissionEvent do the decay
// Argument 2 : time, passed through to set time of secondary
// Argument 3 : nubar, when set to -1, selects spontaneous fission
// Argument 4 : energy used in Watt spectrum
G4fissionEvent aFission(code, 10.0, -1, 0.);
G4int nNeut = aFission.getNeutronNu();
G4int nGam = aFission.getPhotonNu();
G4DynamicParticle* dynPart = 0;
G4ThreeVector direction(0.,0.,0.);
G4double KE = 0.; // energy from generator is in MeV
if (nNeut > 0) {
// Put neutrons on the stack
for (G4int i = 0; i < nNeut; i++) {
KE = aFission.getNeutronEnergy(i);
direction.setX(aFission.getNeutronDircosu(i) );
direction.setY(aFission.getNeutronDircosv(i) );
direction.setZ(aFission.getNeutronDircosw(i) );
dynPart = new G4DynamicParticle(G4Neutron::Neutron(), direction, KE);
// Not needed - time comes from parent track
// dynPart->SetProperTime(aFission.getNeutronAge(i) );
products->PushProducts(dynPart);
}
// Put gammas on the stack
for (G4int i = 0; i < nGam; i++) {
KE = aFission.getPhotonEnergy(i);
direction.setX(aFission.getPhotonDircosu(i) );
direction.setY(aFission.getPhotonDircosv(i) );
direction.setZ(aFission.getPhotonDircosw(i) );
dynPart = new G4DynamicParticle(G4Gamma::Gamma(), direction, KE);
// Not needed - time comes from parent track
// dynPart->SetProperTime(aFission.getPhotonAge(i) );
products->PushProducts(dynPart);
// No residual nucleus in this model
}
} else {
// No data for this isotope, return parent nucleus for now
// G4cout << " No fission data for this isotope " << G4endl;
G4DynamicParticle* parent =
new G4DynamicParticle(G4MT_parent, G4ThreeVector(0.,0.,0.) );
products->PushProducts(parent);
}
// Energy conservation check not valid in this model
return products;
}
void G4SFDecay::DumpNuclearInfo()
{
G4cout << " G4SFDecay for parent nucleus " << GetParentName() << G4endl;
G4cout << " decays to neutrons and gammas, with branching ratio " << GetBR()
<< "% and Q value " << transitionQ << G4endl;
}