Import Geant4 10.6.1 source tree
This commit is contained in:
@@ -38,7 +38,7 @@ G4BetaDecayCorrections::G4BetaDecayCorrections(const G4int theZ, const G4int the
|
||||
// Nuclear radius in units of hbar/m_e/c
|
||||
Rnuc = 0.5*fine_structure_const*std::pow(A, 0.33333);
|
||||
|
||||
// Electron screening potential in units of electrom mass
|
||||
// Electron screening potential in units of electron mass
|
||||
V0 = 1.13*fine_structure_const*fine_structure_const
|
||||
*std::pow(std::abs(Z), 1.33333);
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ G4BetaPlusDecay::SetUpBetaSpectrumSampler(const G4int& daughterZ,
|
||||
const G4BetaDecayType& betaType)
|
||||
{
|
||||
G4double e0 = endpointEnergy/CLHEP::electron_mass_c2;
|
||||
G4BetaDecayCorrections corrections(daughterZ, daughterA);
|
||||
G4BetaDecayCorrections corrections(-daughterZ, daughterA);
|
||||
spectrumSampler = 0;
|
||||
|
||||
// Check for cases in which Q < 2Me (e.g. z67.a162)
|
||||
|
||||
@@ -181,7 +181,7 @@ G4Radioactivation::GetChainsFromParent(const G4ParticleDefinition& aParticle)
|
||||
}
|
||||
}
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 0) {
|
||||
if (GetVerboseLevel() > 1) {
|
||||
G4cout << "The DecayRate Table for " << aParticleName << " is selected."
|
||||
<< G4endl;
|
||||
}
|
||||
@@ -208,7 +208,7 @@ G4Radioactivation::ConvolveSourceTimeProfile(const G4double t, const G4double ta
|
||||
while (t > SBin[nbin]) { // Loop checking, 01.09.2015, D.Wright
|
||||
loop++;
|
||||
if (loop > 1000) {
|
||||
G4Exception("G4RadioactiveDecay::ConvolveSourceTimeProfile()",
|
||||
G4Exception("G4Radioactivation::ConvolveSourceTimeProfile()",
|
||||
"HAD_RDM_100", JustWarning, "While loop count exceeded");
|
||||
break;
|
||||
}
|
||||
@@ -242,7 +242,7 @@ G4Radioactivation::ConvolveSourceTimeProfile(const G4double t, const G4double ta
|
||||
convolvedTime = 0.;
|
||||
}
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 1)
|
||||
if (GetVerboseLevel() > 2)
|
||||
G4cout << " Convolved time: " << convolvedTime << G4endl;
|
||||
#endif
|
||||
return convolvedTime;
|
||||
@@ -270,7 +270,7 @@ G4double G4Radioactivation::GetDecayTime()
|
||||
i++;
|
||||
loop++;
|
||||
if (loop > 100000) {
|
||||
G4Exception("G4RadioactiveDecay::GetDecayTime()", "HAD_RDM_100",
|
||||
G4Exception("G4Radioactivation::GetDecayTime()", "HAD_RDM_100",
|
||||
JustWarning, "While loop count exceeded");
|
||||
break;
|
||||
}
|
||||
@@ -279,7 +279,7 @@ G4double G4Radioactivation::GetDecayTime()
|
||||
rand = G4UniformRand();
|
||||
decaytime = DBin[i] + rand*(DBin[i+1]-DBin[i]);
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 1)
|
||||
if (GetVerboseLevel() > 2)
|
||||
G4cout <<" Decay time: " <<decaytime/s <<"[s]" <<G4endl;
|
||||
#endif
|
||||
return decaytime;
|
||||
@@ -295,7 +295,7 @@ G4int G4Radioactivation::GetDecayTimeBin(const G4double aDecayTime)
|
||||
i++;
|
||||
loop++;
|
||||
if (loop > 100000) {
|
||||
G4Exception("G4RadioactiveDecay::GetDecayTimeBin()", "HAD_RDM_100",
|
||||
G4Exception("G4Radioactivation::GetDecayTimeBin()", "HAD_RDM_100",
|
||||
JustWarning, "While loop count exceeded");
|
||||
break;
|
||||
}
|
||||
@@ -422,7 +422,7 @@ CalculateChainsFromParent(const G4ParticleDefinition& theParentNucleus)
|
||||
while (!stable) { /* Loop checking, 01.09.2015, D.Wright */
|
||||
loop++;
|
||||
if (loop > 10000) {
|
||||
G4Exception("G4RadioactiveDecay::CalculateChainsFromParent()", "HAD_RDM_100",
|
||||
G4Exception("G4Radioactivation::CalculateChainsFromParent()", "HAD_RDM_100",
|
||||
JustWarning, "While loop count exceeded");
|
||||
break;
|
||||
}
|
||||
@@ -434,7 +434,7 @@ CalculateChainsFromParent(const G4ParticleDefinition& theParentNucleus)
|
||||
EP = theDecayRateVector[j].GetE();
|
||||
RP = theDecayRateVector[j].GetDecayRateC();
|
||||
TP = theDecayRateVector[j].GetTaos();
|
||||
if (GetVerboseLevel() > 0) {
|
||||
if (GetVerboseLevel() > 1) {
|
||||
G4cout << "G4RadioactiveDecay::CalculateChainsFromParent: daughters of ("
|
||||
<< ZP << ", " << AP << ", " << EP
|
||||
<< ") are being calculated, generation = " << nGeneration
|
||||
@@ -680,7 +680,7 @@ void G4Radioactivation::SetSourceTimeProfile(G4String filename)
|
||||
if (!infile) {
|
||||
G4ExceptionDescription ed;
|
||||
ed << " Could not open file " << filename << G4endl;
|
||||
G4Exception("G4RadioactiveDecay::SetSourceTimeProfile()", "HAD_RDM_001",
|
||||
G4Exception("G4Radioactivation::SetSourceTimeProfile()", "HAD_RDM_001",
|
||||
FatalException, ed);
|
||||
}
|
||||
|
||||
@@ -691,14 +691,14 @@ void G4Radioactivation::SetSourceTimeProfile(G4String filename)
|
||||
while (infile >> bin >> flux) { /* Loop checking, 01.09.2015, D.Wright */
|
||||
loop++;
|
||||
if (loop > 10000) {
|
||||
G4Exception("G4RadioactiveDecay::SetSourceTimeProfile()", "HAD_RDM_100",
|
||||
G4Exception("G4Radioactivation::SetSourceTimeProfile()", "HAD_RDM_100",
|
||||
JustWarning, "While loop count exceeded");
|
||||
break;
|
||||
}
|
||||
|
||||
NSourceBin++;
|
||||
if (NSourceBin > 99) {
|
||||
G4Exception("G4RadioactiveDecay::SetSourceTimeProfile()", "HAD_RDM_002",
|
||||
G4Exception("G4Radioactivation::SetSourceTimeProfile()", "HAD_RDM_002",
|
||||
FatalException, "Input source time file too big (>100 rows)");
|
||||
|
||||
} else {
|
||||
@@ -711,7 +711,7 @@ void G4Radioactivation::SetSourceTimeProfile(G4String filename)
|
||||
infile.close();
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 1)
|
||||
if (GetVerboseLevel() > 2)
|
||||
G4cout <<" Source Timeprofile Nbin = " << NSourceBin <<G4endl;
|
||||
#endif
|
||||
}
|
||||
@@ -726,7 +726,7 @@ 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",
|
||||
if (!infile) G4Exception("G4Radioactivation::SetDecayBias()", "HAD_RDM_001",
|
||||
FatalException, "Unable to open bias data file" );
|
||||
|
||||
G4double bin, flux;
|
||||
@@ -742,13 +742,13 @@ void G4Radioactivation::SetDecayBias(G4String filename)
|
||||
NDecayBin++;
|
||||
loop++;
|
||||
if (loop > 10000) {
|
||||
G4Exception("G4RadioactiveDecay::SetDecayBias()", "HAD_RDM_100",
|
||||
G4Exception("G4Radioactivation::SetDecayBias()", "HAD_RDM_100",
|
||||
JustWarning, "While loop count exceeded");
|
||||
break;
|
||||
}
|
||||
|
||||
if (NDecayBin > 99) {
|
||||
G4Exception("G4RadioactiveDecay::SetDecayBias()", "HAD_RDM_004",
|
||||
G4Exception("G4Radioactivation::SetDecayBias()", "HAD_RDM_002",
|
||||
FatalException, "Input bias file too big (>100 rows)" );
|
||||
} else {
|
||||
DBin[NDecayBin] = bin * s; // Convert read-in time to ns
|
||||
@@ -770,7 +770,7 @@ void G4Radioactivation::SetDecayBias(G4String filename)
|
||||
infile.close();
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 1)
|
||||
if (GetVerboseLevel() > 2)
|
||||
G4cout <<" Decay Bias Profile Nbin = " << NDecayBin <<G4endl;
|
||||
#endif
|
||||
}
|
||||
@@ -819,7 +819,7 @@ G4Radioactivation::DecayIt(const G4Track& theTrack, const G4Step&)
|
||||
if (!(IsApplicable(*theParticleDef) ) ) {
|
||||
// Particle is not an ion or is outside the nucleuslimits for decay
|
||||
|
||||
if (GetVerboseLevel() > 0) {
|
||||
if (GetVerboseLevel() > 1) {
|
||||
G4cout << "G4RadioactiveDecay::DecayIt : "
|
||||
<< theParticleDef->GetParticleName()
|
||||
<< " is not an ion or is outside (Z,A) limits set for the decay. "
|
||||
@@ -863,247 +863,227 @@ G4Radioactivation::DecayIt(const G4Track& theTrack, const G4Step&)
|
||||
|
||||
} else {
|
||||
// Proceed with decay using variance reduction
|
||||
G4double energyDeposit = 0.0;
|
||||
G4double finalGlobalTime = theTrack.GetGlobalTime();
|
||||
G4double finalLocalTime = theTrack.GetLocalTime();
|
||||
G4int index;
|
||||
G4ThreeVector currentPosition;
|
||||
currentPosition = theTrack.GetPosition();
|
||||
G4double energyDeposit = 0.0;
|
||||
G4double finalGlobalTime = theTrack.GetGlobalTime();
|
||||
G4double finalLocalTime = theTrack.GetLocalTime();
|
||||
G4int index;
|
||||
G4ThreeVector currentPosition;
|
||||
currentPosition = theTrack.GetPosition();
|
||||
|
||||
G4IonTable* theIonTable;
|
||||
G4ParticleDefinition* parentNucleus;
|
||||
G4IonTable* theIonTable;
|
||||
G4ParticleDefinition* parentNucleus;
|
||||
|
||||
// Get decay chains for the given nuclide
|
||||
if (!IsRateTableReady(*theParticleDef)) CalculateChainsFromParent(*theParticleDef);
|
||||
GetChainsFromParent(*theParticleDef);
|
||||
// Get decay chains for the given nuclide
|
||||
if (!IsRateTableReady(*theParticleDef)) CalculateChainsFromParent(*theParticleDef);
|
||||
GetChainsFromParent(*theParticleDef);
|
||||
|
||||
// Declare some of the variables required in the implementation
|
||||
// G4ParticleDefinition* parentNucleus;
|
||||
// G4IonTable* theIonTable;
|
||||
G4int PZ;
|
||||
G4int PA;
|
||||
G4double PE;
|
||||
G4String keyName;
|
||||
std::vector<G4double> PT;
|
||||
std::vector<G4double> PR;
|
||||
G4double taotime;
|
||||
long double decayRate;
|
||||
// Declare some of the variables required in the implementation
|
||||
G4int PZ;
|
||||
G4int PA;
|
||||
G4double PE;
|
||||
G4String keyName;
|
||||
std::vector<G4double> PT;
|
||||
std::vector<G4double> PR;
|
||||
G4double taotime;
|
||||
long double decayRate;
|
||||
|
||||
size_t i;
|
||||
// size_t j;
|
||||
G4int numberOfSecondaries;
|
||||
G4int totalNumberOfSecondaries = 0;
|
||||
G4double currentTime = 0.;
|
||||
G4int ndecaych;
|
||||
G4DynamicParticle* asecondaryparticle;
|
||||
std::vector<G4DynamicParticle*> secondaryparticles;
|
||||
std::vector<G4double> pw;
|
||||
std::vector<G4double> ptime;
|
||||
pw.clear();
|
||||
ptime.clear();
|
||||
size_t i;
|
||||
G4int numberOfSecondaries;
|
||||
G4int totalNumberOfSecondaries = 0;
|
||||
G4double currentTime = 0.;
|
||||
G4int ndecaych;
|
||||
G4DynamicParticle* asecondaryparticle;
|
||||
std::vector<G4DynamicParticle*> secondaryparticles;
|
||||
std::vector<G4double> pw;
|
||||
std::vector<G4double> ptime;
|
||||
pw.clear();
|
||||
ptime.clear();
|
||||
|
||||
// Now apply the nucleus splitting
|
||||
for (G4int n = 0; n < NSplit; n++) {
|
||||
// Get the decay time following the decay probability function
|
||||
// supplied by user
|
||||
G4double theDecayTime = GetDecayTime();
|
||||
G4int nbin = GetDecayTimeBin(theDecayTime);
|
||||
// Now apply the nucleus splitting
|
||||
for (G4int n = 0; n < NSplit; n++) {
|
||||
// Get the decay time following the decay probability function
|
||||
// supplied by user
|
||||
G4double theDecayTime = GetDecayTime();
|
||||
G4int nbin = GetDecayTimeBin(theDecayTime);
|
||||
|
||||
// calculate the first part of the weight function
|
||||
G4double weight1 = 1.;
|
||||
if (nbin == 1) {
|
||||
weight1 = 1./DProfile[nbin-1]
|
||||
*(DBin[nbin]-DBin[nbin-1])/NSplit; // width of window in ns
|
||||
} else if (nbin > 1) {
|
||||
// Go from nbin to nbin-2 because flux entries in file alternate between 0 and 1
|
||||
weight1 = 1./(DProfile[nbin]-DProfile[nbin-2])
|
||||
*(DBin[nbin]-DBin[nbin-1])/NSplit;
|
||||
// weight1 = (probability of choosing one of the bins)*(time width of bin)/NSplit
|
||||
}
|
||||
// it should be calculated in seconds
|
||||
weight1 /= s ;
|
||||
// calculate the first part of the weight function
|
||||
G4double weight1 = 1.;
|
||||
if (nbin == 1) {
|
||||
weight1 = 1./DProfile[nbin-1]
|
||||
*(DBin[nbin]-DBin[nbin-1])/NSplit; // width of window in ns
|
||||
} else if (nbin > 1) {
|
||||
// Go from nbin to nbin-2 because flux entries in file alternate between 0 and 1
|
||||
weight1 = 1./(DProfile[nbin]-DProfile[nbin-2])
|
||||
*(DBin[nbin]-DBin[nbin-1])/NSplit;
|
||||
// weight1 = (probability of choosing one of the bins)*(time width of bin)/NSplit
|
||||
}
|
||||
// it should be calculated in seconds
|
||||
weight1 /= s ;
|
||||
|
||||
// loop over all the possible secondaries of the nucleus
|
||||
// the first one is itself.
|
||||
for (i = 0; i < theDecayRateVector.size(); i++) {
|
||||
PZ = theDecayRateVector[i].GetZ();
|
||||
PA = theDecayRateVector[i].GetA();
|
||||
PE = theDecayRateVector[i].GetE();
|
||||
PT = theDecayRateVector[i].GetTaos();
|
||||
PR = theDecayRateVector[i].GetDecayRateC();
|
||||
// loop over all the possible secondaries of the nucleus
|
||||
// the first one is itself.
|
||||
for (i = 0; i < theDecayRateVector.size(); i++) {
|
||||
PZ = theDecayRateVector[i].GetZ();
|
||||
PA = theDecayRateVector[i].GetA();
|
||||
PE = theDecayRateVector[i].GetE();
|
||||
PT = theDecayRateVector[i].GetTaos();
|
||||
PR = theDecayRateVector[i].GetDecayRateC();
|
||||
|
||||
// The array of arrays theDecayRateVector contains all possible decay
|
||||
// chains of a given parent nucleus (ZP,AP,EP) to a given descendant
|
||||
// nuclide (Z,A,E).
|
||||
//
|
||||
// theDecayRateVector[0] contains the decay parameters of the parent
|
||||
// nucleus
|
||||
// PZ = ZP
|
||||
// PA = AP
|
||||
// PE = EP
|
||||
// PT[] = {TP}
|
||||
// PR[] = {RP}
|
||||
//
|
||||
// theDecayRateVector[1] contains the decay of the parent to the first
|
||||
// generation daughter (Z1,A1,E1).
|
||||
// PZ = Z1
|
||||
// PA = A1
|
||||
// PE = E1
|
||||
// PT[] = {TP, T1}
|
||||
// PR[] = {RP, R1}
|
||||
//
|
||||
// theDecayRateVector[2] contains the decay of the parent to the first
|
||||
// generation daughter (Z1,A1,E1) and the decay of the first
|
||||
// generation daughter to the second generation daughter (Z2,A2,E2).
|
||||
// PZ = Z2
|
||||
// PA = A2
|
||||
// PE = E2
|
||||
// PT[] = {TP, T1, T2}
|
||||
// PR[] = {RP, R1, R2}
|
||||
//
|
||||
// theDecayRateVector[3] may contain a branch chain
|
||||
// PZ = Z2a
|
||||
// PA = A2a
|
||||
// PE = E2a
|
||||
// PT[] = {TP, T1, T2a}
|
||||
// PR[] = {RP, R1, R2a}
|
||||
//
|
||||
// and so on.
|
||||
// The array of arrays theDecayRateVector contains all possible decay
|
||||
// chains of a given parent nucleus (ZP,AP,EP) to a given descendant
|
||||
// nuclide (Z,A,E).
|
||||
//
|
||||
// theDecayRateVector[0] contains the decay parameters of the parent
|
||||
// nucleus
|
||||
// PZ = ZP
|
||||
// PA = AP
|
||||
// PE = EP
|
||||
// PT[] = {TP}
|
||||
// PR[] = {RP}
|
||||
//
|
||||
// theDecayRateVector[1] contains the decay of the parent to the first
|
||||
// generation daughter (Z1,A1,E1).
|
||||
// PZ = Z1
|
||||
// PA = A1
|
||||
// PE = E1
|
||||
// PT[] = {TP, T1}
|
||||
// PR[] = {RP, R1}
|
||||
//
|
||||
// theDecayRateVector[2] contains the decay of the parent to the first
|
||||
// generation daughter (Z1,A1,E1) and the decay of the first
|
||||
// generation daughter to the second generation daughter (Z2,A2,E2).
|
||||
// PZ = Z2
|
||||
// PA = A2
|
||||
// PE = E2
|
||||
// PT[] = {TP, T1, T2}
|
||||
// PR[] = {RP, R1, R2}
|
||||
//
|
||||
// theDecayRateVector[3] may contain a branch chain
|
||||
// PZ = Z2a
|
||||
// PA = A2a
|
||||
// PE = E2a
|
||||
// PT[] = {TP, T1, T2a}
|
||||
// PR[] = {RP, R1, R2a}
|
||||
//
|
||||
// and so on.
|
||||
|
||||
// Calculate the decay rate of the isotope. decayRate is the
|
||||
// radioactivity of isotope (PZ,PA,PE) at 'theDecayTime'
|
||||
// it will be used to calculate the statistical weight of the
|
||||
// decay products of this isotope
|
||||
// Calculate the decay rate of the isotope. decayRate is the
|
||||
// radioactivity of isotope (PZ,PA,PE) at 'theDecayTime'
|
||||
// it will be used to calculate the statistical weight of the
|
||||
// decay products of this isotope
|
||||
|
||||
// For each nuclide, calculate all the decay chains which can reach
|
||||
// the parent nuclide
|
||||
decayRate = 0.L;
|
||||
for (G4int j = 0; j < G4int(PT.size() ); j++) {
|
||||
// G4cout << " RDM::DecayIt: tau input to Convolve: " << PT[j] << G4endl;
|
||||
taotime = ConvolveSourceTimeProfile(theDecayTime,PT[j]);
|
||||
// taotime = GetTaoTime(theDecayTime,PT[j]);
|
||||
decayRate -= PR[j] * (long double)taotime; // PRs are Acoeffs, taotime is inverse time
|
||||
// Eq.4.23 of of the TN
|
||||
// note the negative here is required as the rate in the
|
||||
// equation is defined to be negative,
|
||||
// i.e. decay away, but we need positive value here.
|
||||
// For each nuclide, calculate all the decay chains which can reach
|
||||
// the parent nuclide
|
||||
decayRate = 0.L;
|
||||
for (G4int j = 0; j < G4int(PT.size() ); j++) {
|
||||
taotime = ConvolveSourceTimeProfile(theDecayTime,PT[j]);
|
||||
decayRate -= PR[j] * (long double)taotime; // PRs are Acoeffs, taotime is inverse time
|
||||
// Eq.4.23 of of the TN
|
||||
// note the negative here is required as the rate in the
|
||||
// equation is defined to be negative,
|
||||
// i.e. decay away, but we need positive value here.
|
||||
|
||||
// G4cout << j << "\t"<< PT[j]/s << "\t" << PR[j] << "\t" << decayRate << G4endl;
|
||||
}
|
||||
// G4cout << j << "\t"<< PT[j]/s << "\t" << PR[j] << "\t" << decayRate << G4endl;
|
||||
}
|
||||
|
||||
// At this point any negative decay rates are probably small enough
|
||||
// (order 10**-30) that negative values are likely due to cancellation
|
||||
// errors. Set them to zero.
|
||||
if (decayRate < 0.0) decayRate = 0.0;
|
||||
// At this point any negative decay rates are probably small enough
|
||||
// (order 10**-30) that negative values are likely due to cancellation
|
||||
// errors. Set them to zero.
|
||||
if (decayRate < 0.0) decayRate = 0.0;
|
||||
|
||||
// // Test code
|
||||
// if (decayRate < 0.0) {
|
||||
// if (-decayRate > 1.0e-30) {
|
||||
// G4ExceptionDescription ed;
|
||||
// ed << " Negative decay probability (magnitude > 1e-30) \n"
|
||||
// << " in variance reduction branch " << G4endl;
|
||||
// G4Exception("G4RadioactiveDecay::DecayIt()",
|
||||
// "HAD_RDM_200", JustWarning, ed);
|
||||
// } else {
|
||||
// // Decay probability is small enough that negative value is likely
|
||||
// // due to cancellation errors. Set it to zero.
|
||||
// decayRate = 0.0;
|
||||
// }
|
||||
// }
|
||||
// G4cout << " VR in i loop after decayRate < 0 " << G4endl;
|
||||
// if (decayRate < 0.0) G4cout << " NEGATIVE decay rate = " << decayRate << G4endl;
|
||||
// G4cout <<theDecayTime/s <<"\t"<<nbin<<G4endl;
|
||||
// G4cout << theTrack.GetWeight() <<"\t"<<weight1<<"\t"<<decayRate<< G4endl;
|
||||
|
||||
// G4cout <<theDecayTime/s <<"\t"<<nbin<<G4endl;
|
||||
// G4cout << theTrack.GetWeight() <<"\t"<<weight1<<"\t"<<decayRate<< G4endl;
|
||||
// Add isotope to the radioactivity tables
|
||||
// One table for each observation time window specifed in
|
||||
// SetDecayBias(G4String filename)
|
||||
|
||||
// Add isotope to the radioactivity tables
|
||||
// One table for each observation time window specifed in
|
||||
// SetDecayBias(G4String filename)
|
||||
theRadioactivityTables[decayWindows[nbin-1]]
|
||||
->AddIsotope(PZ,PA,PE,weight1*decayRate,theTrack.GetWeight());
|
||||
|
||||
theRadioactivityTables[decayWindows[nbin-1]]
|
||||
->AddIsotope(PZ,PA,PE,weight1*decayRate,theTrack.GetWeight());
|
||||
// Now calculate the statistical weight
|
||||
// One needs to fold the source bias function with the decaytime
|
||||
// also need to include the track weight! (F.Lei, 28/10/10)
|
||||
G4double weight = weight1*decayRate*theTrack.GetWeight();
|
||||
|
||||
// Now calculate the statistical weight
|
||||
// One needs to fold the source bias function with the decaytime
|
||||
// also need to include the track weight! (F.Lei, 28/10/10)
|
||||
G4double weight = weight1*decayRate*theTrack.GetWeight();
|
||||
// decay the isotope
|
||||
theIonTable = (G4IonTable *)(G4ParticleTable::GetParticleTable()->GetIonTable());
|
||||
parentNucleus = theIonTable->GetIon(PZ,PA,PE);
|
||||
|
||||
// decay the isotope
|
||||
theIonTable = (G4IonTable *)(G4ParticleTable::GetParticleTable()->GetIonTable());
|
||||
parentNucleus = theIonTable->GetIon(PZ,PA,PE);
|
||||
// Create a temprary products buffer.
|
||||
// Its contents to be transfered to the products at the end of the loop
|
||||
G4DecayProducts* tempprods = 0;
|
||||
|
||||
// Create a temprary products buffer.
|
||||
// Its contents to be transfered to the products at the end of the loop
|
||||
G4DecayProducts* tempprods = 0;
|
||||
// Decide whether to apply branching ratio bias or not
|
||||
if (BRBias) {
|
||||
G4DecayTable* decayTable = GetDecayTable1(parentNucleus);
|
||||
ndecaych = G4int(decayTable->entries()*G4UniformRand());
|
||||
G4VDecayChannel* theDecayChannel = decayTable->GetDecayChannel(ndecaych);
|
||||
|
||||
// Decide whether to apply branching ratio bias or not
|
||||
if (BRBias) {
|
||||
G4DecayTable* decayTable = GetDecayTable1(parentNucleus);
|
||||
ndecaych = G4int(decayTable->entries()*G4UniformRand());
|
||||
G4VDecayChannel* theDecayChannel = decayTable->GetDecayChannel(ndecaych);
|
||||
if (theDecayChannel == 0) {
|
||||
// Decay channel not found.
|
||||
|
||||
if (theDecayChannel == 0) {
|
||||
// Decay channel not found.
|
||||
if (GetVerboseLevel() > 0) {
|
||||
G4cout << " G4RadioactiveDecay::DoIt : cannot determine decay channel ";
|
||||
G4cout << " for this nucleus; decay as if no biasing active. ";
|
||||
G4cout << G4endl;
|
||||
decayTable ->DumpInfo();
|
||||
}
|
||||
|
||||
if (GetVerboseLevel() > 0) {
|
||||
G4cout << " G4RadioactiveDecay::DoIt : cannot determine decay channel ";
|
||||
G4cout << " for this nucleus; decay as if no biasing active. ";
|
||||
G4cout << G4endl;
|
||||
decayTable ->DumpInfo();
|
||||
}
|
||||
|
||||
tempprods = DoDecay(*parentNucleus); // DHW 6 Dec 2010 - do decay as if no biasing
|
||||
tempprods = DoDecay(*parentNucleus); // DHW 6 Dec 2010 - do decay as if no biasing
|
||||
// to avoid deref of temppprods = 0
|
||||
} else {
|
||||
// A decay channel has been identified, so execute the DecayIt.
|
||||
G4double tempmass = parentNucleus->GetPDGMass();
|
||||
tempprods = theDecayChannel->DecayIt(tempmass);
|
||||
weight *= (theDecayChannel->GetBR())*(decayTable->entries());
|
||||
}
|
||||
} else {
|
||||
// A decay channel has been identified, so execute the DecayIt.
|
||||
G4double tempmass = parentNucleus->GetPDGMass();
|
||||
tempprods = theDecayChannel->DecayIt(tempmass);
|
||||
weight *= (theDecayChannel->GetBR())*(decayTable->entries());
|
||||
tempprods = DoDecay(*parentNucleus);
|
||||
}
|
||||
} else {
|
||||
tempprods = DoDecay(*parentNucleus);
|
||||
}
|
||||
|
||||
// save the secondaries for buffers
|
||||
numberOfSecondaries = tempprods->entries();
|
||||
currentTime = finalGlobalTime + theDecayTime;
|
||||
for (index = 0; index < numberOfSecondaries; index++) {
|
||||
asecondaryparticle = tempprods->PopProducts();
|
||||
if (asecondaryparticle->GetDefinition()->GetPDGStable() ) {
|
||||
pw.push_back(weight);
|
||||
ptime.push_back(currentTime);
|
||||
secondaryparticles.push_back(asecondaryparticle);
|
||||
// save the secondaries for buffers
|
||||
numberOfSecondaries = tempprods->entries();
|
||||
currentTime = finalGlobalTime + theDecayTime;
|
||||
for (index = 0; index < numberOfSecondaries; index++) {
|
||||
asecondaryparticle = tempprods->PopProducts();
|
||||
if (asecondaryparticle->GetDefinition()->GetPDGStable() ) {
|
||||
pw.push_back(weight);
|
||||
ptime.push_back(currentTime);
|
||||
secondaryparticles.push_back(asecondaryparticle);
|
||||
}
|
||||
// Generate gammas and Xrays from excited nucleus, added by L.Desorgher
|
||||
else if (((const G4Ions*)(asecondaryparticle->GetDefinition()))
|
||||
->GetExcitationEnergy() > 0. && weight > 0.) { //Compute the gamma
|
||||
G4ParticleDefinition* apartDef = asecondaryparticle->GetDefinition();
|
||||
AddDeexcitationSpectrumForBiasMode(apartDef,weight,currentTime,pw,
|
||||
ptime,secondaryparticles);
|
||||
}
|
||||
}
|
||||
//Generate gammas and XRays from excited nucleus, added by L.Desorgher
|
||||
else if (((const G4Ions*)(asecondaryparticle->GetDefinition()))->GetExcitationEnergy()>0. && weight>0.){//Compute the gamma
|
||||
G4ParticleDefinition* apartDef =asecondaryparticle->GetDefinition();
|
||||
AddDeexcitationSpectrumForBiasMode(apartDef,weight,currentTime,pw,ptime,secondaryparticles);
|
||||
}
|
||||
}
|
||||
|
||||
delete tempprods;
|
||||
} // end of i loop
|
||||
} // end of n loop
|
||||
delete tempprods;
|
||||
} // end of i loop
|
||||
} // end of n loop
|
||||
|
||||
// now deal with the secondaries in the two stl containers
|
||||
// and submmit them back to the tracking manager
|
||||
totalNumberOfSecondaries = pw.size();
|
||||
fParticleChangeForRadDecay.SetNumberOfSecondaries(totalNumberOfSecondaries);
|
||||
for (index=0; index < totalNumberOfSecondaries; index++) {
|
||||
G4Track* secondary = new G4Track(secondaryparticles[index],
|
||||
// now deal with the secondaries in the two stl containers
|
||||
// and submmit them back to the tracking manager
|
||||
totalNumberOfSecondaries = pw.size();
|
||||
fParticleChangeForRadDecay.SetNumberOfSecondaries(totalNumberOfSecondaries);
|
||||
for (index=0; index < totalNumberOfSecondaries; index++) {
|
||||
G4Track* secondary = new G4Track(secondaryparticles[index],
|
||||
ptime[index], currentPosition);
|
||||
secondary->SetGoodForTrackingFlag();
|
||||
secondary->SetTouchableHandle(theTrack.GetTouchableHandle());
|
||||
secondary->SetWeight(pw[index]);
|
||||
fParticleChangeForRadDecay.AddSecondary(secondary);
|
||||
}
|
||||
secondary->SetGoodForTrackingFlag();
|
||||
secondary->SetTouchableHandle(theTrack.GetTouchableHandle());
|
||||
secondary->SetWeight(pw[index]);
|
||||
fParticleChangeForRadDecay.AddSecondary(secondary);
|
||||
}
|
||||
|
||||
// Kill the parent particle
|
||||
fParticleChangeForRadDecay.ProposeTrackStatus(fStopAndKill) ;
|
||||
fParticleChangeForRadDecay.ProposeLocalEnergyDeposit(energyDeposit);
|
||||
fParticleChangeForRadDecay.ProposeLocalTime(finalLocalTime);
|
||||
// Reset NumberOfInteractionLengthLeft.
|
||||
ClearNumberOfInteractionLengthLeft();
|
||||
// Kill the parent particle
|
||||
fParticleChangeForRadDecay.ProposeTrackStatus(fStopAndKill) ;
|
||||
fParticleChangeForRadDecay.ProposeLocalEnergyDeposit(energyDeposit);
|
||||
fParticleChangeForRadDecay.ProposeLocalTime(finalLocalTime);
|
||||
// Reset NumberOfInteractionLengthLeft.
|
||||
ClearNumberOfInteractionLengthLeft();
|
||||
} // end VR decay
|
||||
|
||||
return &fParticleChangeForRadDecay;
|
||||
@@ -1123,7 +1103,7 @@ G4Radioactivation::AddDeexcitationSpectrumForBiasMode(G4ParticleDefinition* apar
|
||||
G4double life_time=apartDef->GetPDGLifeTime();
|
||||
G4ITDecay* anITChannel = 0;
|
||||
|
||||
while (life_time <halflifethreshold && elevel>0.) {
|
||||
while (life_time < halflifethreshold && elevel > 0.) {
|
||||
anITChannel = new G4ITDecay(apartDef, 100., elevel, elevel, photonEvaporation);
|
||||
G4DecayProducts* pevap_products = anITChannel->DecayIt(0.);
|
||||
G4int nb_pevapSecondaries = pevap_products->entries();
|
||||
@@ -1151,6 +1131,7 @@ G4Radioactivation::AddDeexcitationSpectrumForBiasMode(G4ParticleDefinition* apar
|
||||
}
|
||||
|
||||
delete anITChannel;
|
||||
delete pevap_products;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ G4int& G4RadioactiveDecay::NumberOfInstances()
|
||||
G4RadioactiveDecay::G4RadioactiveDecay(const G4String& processName)
|
||||
: G4VRestDiscreteProcess(processName, fDecay), isInitialised(false),
|
||||
forceDecayDirection(0.,0.,0.), forceDecayHalfAngle(0.*deg), dirPath(""),
|
||||
verboseLevel(0)
|
||||
verboseLevel(1)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 1) {
|
||||
@@ -177,6 +177,10 @@ G4RadioactiveDecay::G4RadioactiveDecay(const G4String& processName)
|
||||
}
|
||||
#endif
|
||||
|
||||
G4cout << " G4RadioactiveDecay is deprecated and will be removed in Geant4 version 11. " << G4endl;
|
||||
G4cout << " Please replace it with G4RadioactiveDecayBase if you want the unbiased radioactive deacy process." << G4endl;
|
||||
G4cout << " If you want the general process, with optional biasing, use G4Radioactivation. " << G4endl;
|
||||
|
||||
SetProcessSubType(fRadioactiveDecay);
|
||||
|
||||
theRadioactiveDecaymessenger = new G4RadioactiveDecaymessenger(this);
|
||||
@@ -333,12 +337,15 @@ void G4RadioactiveDecay::SelectAVolume(const G4String aVolume)
|
||||
std::sort(ValidVolumes.begin(), ValidVolumes.end());
|
||||
// sort need for performing binary_search
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>0)
|
||||
if (GetVerboseLevel()>1)
|
||||
G4cout << " RDM Applies to : " << aVolume << G4endl;
|
||||
#endif
|
||||
} else if(i == theLogicalVolumes->size()) {
|
||||
G4cerr << "SelectAVolume: "<< aVolume
|
||||
<< " is not a valid logical volume name" << G4endl;
|
||||
G4ExceptionDescription ed;
|
||||
ed << aVolume << " is not a valid logical volume name. Decay not activated for it."
|
||||
<< G4endl;
|
||||
G4Exception("G4RadioactiveDecayBase::SelectAVolume()", "HAD_RDM_300",
|
||||
JustWarning, ed);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -359,8 +366,10 @@ void G4RadioactiveDecay::DeselectAVolume(const G4String aVolume)
|
||||
std::sort(ValidVolumes.begin(), ValidVolumes.end());
|
||||
isAllVolumesMode =false;
|
||||
} else {
|
||||
G4cerr << " DeselectVolume:" << aVolume << " is not in the list "
|
||||
<< G4endl;
|
||||
G4ExceptionDescription ed;
|
||||
ed << aVolume << " is not in the list " << G4endl;
|
||||
G4Exception("G4RadioactiveDecayBase::DeselectAVolume()", "HAD_RDM_300",
|
||||
JustWarning, ed);
|
||||
}
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 0)
|
||||
@@ -368,8 +377,10 @@ void G4RadioactiveDecay::DeselectAVolume(const G4String aVolume)
|
||||
<< G4endl;
|
||||
#endif
|
||||
} else if (i == theLogicalVolumes->size()) {
|
||||
G4cerr << " DeselectVolume:" << aVolume
|
||||
<< "is not a valid logical volume name" << G4endl;
|
||||
G4ExceptionDescription ed;
|
||||
ed << aVolume << " is not a valid logical volume name " << G4endl;
|
||||
G4Exception("G4RadioactiveDecayBase::SelectAVolume()", "HAD_RDM_300",
|
||||
JustWarning, ed);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -382,14 +393,14 @@ void G4RadioactiveDecay::SelectAllVolumes()
|
||||
theLogicalVolumes = G4LogicalVolumeStore::GetInstance();
|
||||
ValidVolumes.clear();
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>0)
|
||||
if (GetVerboseLevel()>1)
|
||||
G4cout << " RDM Applies to all Volumes" << G4endl;
|
||||
#endif
|
||||
for (size_t i = 0; i < theLogicalVolumes->size(); i++){
|
||||
volume = (*theLogicalVolumes)[i];
|
||||
ValidVolumes.push_back(volume->GetName());
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>0)
|
||||
if (GetVerboseLevel()>1)
|
||||
G4cout << " RDM Applies to Volume " << volume->GetName() << G4endl;
|
||||
#endif
|
||||
}
|
||||
@@ -404,7 +415,7 @@ void G4RadioactiveDecay::DeselectAllVolumes()
|
||||
ValidVolumes.clear();
|
||||
isAllVolumesMode=false;
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 0) G4cout << "RDM removed from all volumes" << G4endl;
|
||||
if (GetVerboseLevel() > 1) G4cout << "RDM removed from all volumes" << G4endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -433,7 +444,7 @@ G4RadioactiveDecay::GetChainsFromParent(const G4ParticleDefinition& aParticle)
|
||||
}
|
||||
}
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 0) {
|
||||
if (GetVerboseLevel() > 1) {
|
||||
G4cout << "The DecayRate Table for " << aParticleName << " is selected."
|
||||
<< G4endl;
|
||||
}
|
||||
@@ -647,7 +658,7 @@ G4double G4RadioactiveDecay::GetMeanLifeTime(const G4Track& theTrack,
|
||||
meanlife == DBL_MAX) {meanlife = 0.;}
|
||||
}
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 1)
|
||||
if (GetVerboseLevel() > 2)
|
||||
G4cout << " mean life time: " << meanlife/s << " s " << G4endl;
|
||||
#endif
|
||||
|
||||
@@ -1304,7 +1315,7 @@ CalculateChainsFromParent(const G4ParticleDefinition& theParentNucleus)
|
||||
EP = theDecayRateVector[j].GetE();
|
||||
RP = theDecayRateVector[j].GetDecayRateC();
|
||||
TP = theDecayRateVector[j].GetTaos();
|
||||
if (GetVerboseLevel() > 0) {
|
||||
if (GetVerboseLevel() > 1) {
|
||||
G4cout << "G4RadioactiveDecay::CalculateChainsFromParent: daughters of ("
|
||||
<< ZP << ", " << AP << ", " << EP
|
||||
<< ") are being calculated, generation = " << nGeneration
|
||||
@@ -1662,7 +1673,7 @@ G4RadioactiveDecay::DecayIt(const G4Track& theTrack, const G4Step&)
|
||||
if (!std::binary_search(ValidVolumes.begin(), ValidVolumes.end(),
|
||||
theTrack.GetVolume()->GetLogicalVolume()->GetName())) {
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>0) {
|
||||
if (GetVerboseLevel()>1) {
|
||||
G4cout <<"G4RadioactiveDecay::DecayIt : "
|
||||
<< theTrack.GetVolume()->GetLogicalVolume()->GetName()
|
||||
<< " is not selected for the RDM"<< G4endl;
|
||||
@@ -1686,13 +1697,13 @@ G4RadioactiveDecay::DecayIt(const G4Track& theTrack, const G4Step&)
|
||||
if (!(IsApplicable(*theParticleDef) ) ) {
|
||||
// Particle is not an ion or is outside the nucleuslimits for decay
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>0) {
|
||||
G4cerr << "G4RadioactiveDecay::DecayIt : "
|
||||
if (GetVerboseLevel() > 1) {
|
||||
G4cout << " G4RadioactiveDecay::DecayIt : "
|
||||
<< theParticleDef->GetParticleName()
|
||||
<< " is not a valid nucleus for the RDM"<< G4endl;
|
||||
<< " is not a valid nucleus for the RDM. "<< G4endl;
|
||||
G4cout << " Set particle change accordingly. " << G4endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
fParticleChangeForRadDecay.SetNumberOfSecondaries(0);
|
||||
|
||||
// Kill the parent particle
|
||||
@@ -1706,12 +1717,11 @@ G4RadioactiveDecay::DecayIt(const G4Track& theTrack, const G4Step&)
|
||||
if (theDecayTable == 0 || theDecayTable->entries() == 0) {
|
||||
// No data in the decay table. Set particle change parameters
|
||||
// to indicate this.
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 0) {
|
||||
G4cerr <<"G4RadioactiveDecay::DecayIt : decay table not defined for ";
|
||||
G4cerr <<theParticleDef->GetParticleName() <<G4endl;
|
||||
if (GetVerboseLevel() > 1) {
|
||||
G4cout <<" G4RadioactiveDecay::DecayIt : decay table not defined for ";
|
||||
G4cout << theParticleDef->GetParticleName() << G4endl;
|
||||
G4cout << " Set particle change to indicate this. " << G4endl;
|
||||
}
|
||||
#endif
|
||||
fParticleChangeForRadDecay.SetNumberOfSecondaries(0);
|
||||
|
||||
// Kill the parent particle.
|
||||
@@ -1732,7 +1742,7 @@ G4RadioactiveDecay::DecayIt(const G4Track& theTrack, const G4Step&)
|
||||
// Check whether use Analogue or VR implementation
|
||||
if (AnalogueMC) {
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 0)
|
||||
if (GetVerboseLevel() > 1)
|
||||
G4cout <<"DecayIt: Analogue MC version " << G4endl;
|
||||
# endif
|
||||
|
||||
@@ -1987,10 +1997,10 @@ G4RadioactiveDecay::DecayIt(const G4Track& theTrack, const G4Step&)
|
||||
if (theDecayChannel == 0) {
|
||||
// Decay channel not found.
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>0) {
|
||||
G4cerr << " G4RadioactiveDecay::DoIt : cannot determine decay channel ";
|
||||
G4cerr << " for this nucleus; decay as if no biasing active ";
|
||||
G4cerr << G4endl;
|
||||
if (GetVerboseLevel() > 0) {
|
||||
G4cout << " G4RadioactiveDecay::DoIt : cannot determine decay ";
|
||||
G4cout << " channel for this nucleus; decay as if no biasing active ";
|
||||
G4cout << G4endl;
|
||||
decayTable ->DumpInfo();
|
||||
}
|
||||
#endif
|
||||
@@ -2066,16 +2076,11 @@ G4RadioactiveDecay::DoDecay(const G4ParticleDefinition& theParticleDef)
|
||||
G4DecayTable* theDecayTable = GetDecayTable(&theParticleDef);
|
||||
|
||||
// Choose a decay channel.
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 0) G4cout << "Select a channel..." << G4endl;
|
||||
#endif
|
||||
|
||||
// G4DecayTable::SelectADecayChannel checks to see if sum of daughter masses
|
||||
// exceeds parent mass. Pass it the parent mass + maximum Q value to account
|
||||
// for difference in mass defect.
|
||||
G4double parentPlusQ = theParticleDef.GetPDGMass() + 30.*MeV;
|
||||
G4VDecayChannel* theDecayChannel = theDecayTable->SelectADecayChannel(parentPlusQ);
|
||||
theRadDecayMode = (static_cast<G4NuclearDecay*>(theDecayChannel))->GetDecayMode();
|
||||
if (theDecayChannel == 0) {
|
||||
// Decay channel not found.
|
||||
G4ExceptionDescription ed;
|
||||
@@ -2086,10 +2091,11 @@ G4RadioactiveDecay::DoDecay(const G4ParticleDefinition& theParticleDef)
|
||||
// A decay channel has been identified, so execute the DecayIt.
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 1) {
|
||||
G4cerr << "G4RadioactiveDecay::DoIt : selected decay channel addr:";
|
||||
G4cerr << theDecayChannel << G4endl;
|
||||
G4cout << "G4RadioactiveDecay::DoIt : selected decay channel address:";
|
||||
G4cout << theDecayChannel << G4endl;
|
||||
}
|
||||
#endif
|
||||
theRadDecayMode = (static_cast<G4NuclearDecay*>(theDecayChannel))->GetDecayMode();
|
||||
products = theDecayChannel->DecayIt(theParticleDef.GetPDGMass() );
|
||||
|
||||
// Apply directional bias if requested by user
|
||||
@@ -2108,7 +2114,7 @@ void G4RadioactiveDecay::CollimateDecay(G4DecayProducts* products) {
|
||||
if (0 == products || 0 == products->entries()) return;
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 0) G4cout << "Begin of CollimateDecay..." << G4endl;
|
||||
if (GetVerboseLevel() > 1) G4cout << "Begin decay collimation " << G4endl;
|
||||
#endif
|
||||
|
||||
// Particles suitable for directional biasing (for if-blocks below)
|
||||
|
||||
@@ -108,7 +108,7 @@ G4int& G4RadioactiveDecayBase::NumberOfInstances()
|
||||
G4RadioactiveDecayBase::G4RadioactiveDecayBase(const G4String& processName)
|
||||
: G4VRestDiscreteProcess(processName, fDecay), isInitialised(false),
|
||||
forceDecayDirection(0.,0.,0.), forceDecayHalfAngle(0.*deg), dirPath(""),
|
||||
verboseLevel(0)
|
||||
verboseLevel(1)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 1) {
|
||||
@@ -255,9 +255,11 @@ void G4RadioactiveDecayBase::SelectAVolume(const G4String aVolume)
|
||||
G4cout << " Radioactive decay applied to " << aVolume << G4endl;
|
||||
|
||||
} else if (i == theLogicalVolumes->size() ) {
|
||||
G4cout << " G4RadioactiveDecay::SelectAVolume: " << aVolume
|
||||
<< " is not a valid logical volume name."
|
||||
<< " Decay not activated for it." << G4endl;
|
||||
G4ExceptionDescription ed;
|
||||
ed << aVolume << " is not a valid logical volume name. Decay not activated for it."
|
||||
<< G4endl;
|
||||
G4Exception("G4RadioactiveDecayBase::SelectAVolume()", "HAD_RDM_300",
|
||||
JustWarning, ed);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -281,13 +283,17 @@ void G4RadioactiveDecayBase::DeselectAVolume(const G4String aVolume)
|
||||
G4cout << " G4RadioactiveDecay::DeselectAVolume: " << aVolume
|
||||
<< " is removed from list " << G4endl;
|
||||
} else {
|
||||
G4cout << " G4RadioactiveDecay::DeselectAVolume: " << aVolume
|
||||
<< " is not in the list. No action taken. " << G4endl;
|
||||
G4ExceptionDescription ed;
|
||||
ed << aVolume << " is not in the list. No action taken." << G4endl;
|
||||
G4Exception("G4RadioactiveDecayBase::DeselectAVolume()", "HAD_RDM_300",
|
||||
JustWarning, ed);
|
||||
}
|
||||
} else if (i == theLogicalVolumes->size()) {
|
||||
G4cout << " G4RadioactiveDecay::DeselectVolume:" << aVolume
|
||||
<< " is not a valid logical volume name. No action taken."
|
||||
<< G4endl;
|
||||
G4ExceptionDescription ed;
|
||||
ed << aVolume << " is not a valid logical volume name. No action taken."
|
||||
<< G4endl;
|
||||
G4Exception("G4RadioactiveDecayBase::DeselectAVolume()", "HAD_RDM_300",
|
||||
JustWarning, ed);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -300,14 +306,14 @@ void G4RadioactiveDecayBase::SelectAllVolumes()
|
||||
theLogicalVolumes = G4LogicalVolumeStore::GetInstance();
|
||||
ValidVolumes.clear();
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>0)
|
||||
if (GetVerboseLevel()>1)
|
||||
G4cout << " RDM Applies to all Volumes" << G4endl;
|
||||
#endif
|
||||
for (size_t i = 0; i < theLogicalVolumes->size(); i++){
|
||||
volume = (*theLogicalVolumes)[i];
|
||||
ValidVolumes.push_back(volume->GetName());
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>0)
|
||||
if (GetVerboseLevel()>1)
|
||||
G4cout << " RDM Applies to Volume " << volume->GetName() << G4endl;
|
||||
#endif
|
||||
}
|
||||
@@ -322,7 +328,7 @@ void G4RadioactiveDecayBase::DeselectAllVolumes()
|
||||
ValidVolumes.clear();
|
||||
isAllVolumesMode=false;
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 0) G4cout << "RDM removed from all volumes" << G4endl;
|
||||
if (GetVerboseLevel() > 1) G4cout << "RDM removed from all volumes" << G4endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -356,7 +362,7 @@ G4double G4RadioactiveDecayBase::GetMeanLifeTime(const G4Track& theTrack,
|
||||
if (((const G4Ions*)(theParticleDef))->GetExcitationEnergy() > 0. &&
|
||||
meanlife == DBL_MAX) {meanlife = 0.;}
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 1)
|
||||
if (GetVerboseLevel() > 2)
|
||||
G4cout << " mean life time: " << meanlife/s << " s " << G4endl;
|
||||
#endif
|
||||
|
||||
@@ -421,7 +427,7 @@ G4double G4RadioactiveDecayBase::GetMeanFreePath (const G4Track& aTrack, G4doubl
|
||||
}
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 1) {
|
||||
if (GetVerboseLevel() > 2) {
|
||||
G4cout << "mean free path: "<< pathlength/m << " m" << G4endl;
|
||||
}
|
||||
#endif
|
||||
@@ -896,7 +902,10 @@ G4RadioactiveDecayBase::AddUserDecayDataFile(G4int Z, G4int A, G4String filename
|
||||
G4int ID_ion = A*1000 + Z;
|
||||
theUserRadioactiveDataFiles[ID_ion] = filename;
|
||||
} else {
|
||||
G4cout << "The file " << filename << " does not exist!" << G4endl;
|
||||
G4ExceptionDescription ed;
|
||||
ed << filename << " does not exist! " << G4endl;
|
||||
G4Exception("G4RadioactiveDecayBase::AddUserDecayDataFile()", "HAD_RDM_001",
|
||||
FatalException, ed);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -920,7 +929,7 @@ G4RadioactiveDecayBase::DecayIt(const G4Track& theTrack, const G4Step&)
|
||||
if (!std::binary_search(ValidVolumes.begin(), ValidVolumes.end(),
|
||||
theTrack.GetVolume()->GetLogicalVolume()->GetName())) {
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>0) {
|
||||
if (GetVerboseLevel()>1) {
|
||||
G4cout <<"G4RadioactiveDecay::DecayIt : "
|
||||
<< theTrack.GetVolume()->GetLogicalVolume()->GetName()
|
||||
<< " is not selected for the RDM"<< G4endl;
|
||||
@@ -944,7 +953,7 @@ G4RadioactiveDecayBase::DecayIt(const G4Track& theTrack, const G4Step&)
|
||||
if (!(IsApplicable(*theParticleDef) ) ) {
|
||||
// Particle is not an ion or is outside the nucleuslimits for decay
|
||||
|
||||
if (GetVerboseLevel() > 0) {
|
||||
if (GetVerboseLevel() > 1) {
|
||||
G4cout << "G4RadioactiveDecay::DecayIt : "
|
||||
<< theParticleDef->GetParticleName()
|
||||
<< " is not an ion or is outside (Z,A) limits set for the decay. "
|
||||
@@ -965,7 +974,7 @@ G4RadioactiveDecayBase::DecayIt(const G4Track& theTrack, const G4Step&)
|
||||
if (theDecayTable == 0 || theDecayTable->entries() == 0) {
|
||||
// No data in the decay table. Set particle change parameters
|
||||
// to indicate this.
|
||||
if (GetVerboseLevel() > 0) {
|
||||
if (GetVerboseLevel() > 1) {
|
||||
G4cout << "G4RadioactiveDecay::DecayIt : "
|
||||
<< "decay table not defined for "
|
||||
<< theParticleDef->GetParticleName()
|
||||
@@ -1169,17 +1178,13 @@ G4RadioactiveDecayBase::DoDecay(const G4ParticleDefinition& theParticleDef)
|
||||
{
|
||||
G4DecayProducts* products = 0;
|
||||
G4DecayTable* theDecayTable = GetDecayTable(&theParticleDef);
|
||||
// Choose a decay channel.
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 0) G4cout << "Select a channel..." << G4endl;
|
||||
#endif
|
||||
|
||||
// Choose a decay channel.
|
||||
// G4DecayTable::SelectADecayChannel checks to see if sum of daughter masses
|
||||
// exceeds parent mass. Pass it the parent mass + maximum Q value to account
|
||||
// for difference in mass defect.
|
||||
G4double parentPlusQ = theParticleDef.GetPDGMass() + 30.*MeV;
|
||||
G4VDecayChannel* theDecayChannel = theDecayTable->SelectADecayChannel(parentPlusQ);
|
||||
theRadDecayMode = (static_cast<G4NuclearDecay*>(theDecayChannel))->GetDecayMode();
|
||||
|
||||
if (theDecayChannel == 0) {
|
||||
// Decay channel not found.
|
||||
@@ -1195,6 +1200,7 @@ G4RadioactiveDecayBase::DoDecay(const G4ParticleDefinition& theParticleDef)
|
||||
<< theDecayChannel << G4endl;
|
||||
}
|
||||
#endif
|
||||
theRadDecayMode = (static_cast<G4NuclearDecay*>(theDecayChannel))->GetDecayMode();
|
||||
products = theDecayChannel->DecayIt(theParticleDef.GetPDGMass() );
|
||||
|
||||
// Apply directional bias if requested by user
|
||||
@@ -1213,7 +1219,7 @@ void G4RadioactiveDecayBase::CollimateDecay(G4DecayProducts* products) {
|
||||
if (0 == products || 0 == products->entries()) return;
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 0) G4cout << "Begin of CollimateDecay..." << G4endl;
|
||||
if (GetVerboseLevel() > 1) G4cout << "Begin of CollimateDecay..." << G4endl;
|
||||
#endif
|
||||
|
||||
// Particles suitable for directional biasing (for if-blocks below)
|
||||
|
||||
Reference in New Issue
Block a user