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
@@ -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;
}