Import Geant4 11.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2021-12-10 14:46:44 +01:00
committed by Ben Morgan
parent 6399a014b6
commit 80e2389dd8
3932 changed files with 202519 additions and 246221 deletions
@@ -14,6 +14,47 @@ track of all tags.
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
29 October 2021 Vladimir Ivanchenko radioactive_decay-V10-07-13
---------------------------------------------------------------
- G4RadioactiveDecay - updated printout of parameters according
to the recent modifications in atomic de-excitation module
11 October 2021 Alberto Ribon radioactive_decay-V10-07-12
---------------------------------------------------------
- Included github Pull Request #26 by "mirguest" (Tao), aimed to
improve the branching ratio consistency in radioactive decays,
by replacing hardwired radioactive-decay-mode numbers with
corresponding enum values.
Modified classes: G4RadioactiveDecayMode, G4RadioactiveDecay,
G4Radioactivation.
7 October 2021 Dennis Wright radioactive_decay-V10-07-11
--------------------------------------------------------
- remove obsolete classes G4RadioactiveDecayBase and
G4RadioactiveDecayBaseMessenger
1 October 2021 Ben Morgan radioactive_decay-V10-07-10
-----------------------------------------------------
- Use proper enum interface for G4String::strip
12 August 2021 Dennis Wright radioactive_decay-V10-07-09
--------------------------------------------------------
- Next to last step in RadioactiveDecay code migration
create G4RadioactiveDecay.hh, .cc, G4RadioactiveDecayMessenger.hh, .cc
to eventually replace G4RadioactiveDecayBase.hh, .cc,
G4RadioactiveDecayBaseMessenger.hh, .cc
Code in new files is identical except for class name changes
G4Radioactivation.hh, .cc: replace base class G4RadioactiveDecayBase
with G4RadioactiveDecay
update sources.cmake to add new files
04 August 2021 Alberto Ribon radioactive_decay-V10-07-08
--------------------------------------------------------
- G4RadioactiveDecayBase : migrated to the new approach of
creator model ID, using the new version of G4PhysicsModelCatalog
21 May 2021 Dennis Wright radioactive_decay-V10-07-07
-----------------------------------------------------
- remove G4RadioactiveDecay.hh, .cc
@@ -1,38 +0,0 @@
This README file provides instructions for reading the radioactive decay
schemes in the files zXX.aYYY found in the directory RadioactiveDecay3.2
(most recent version). This directory, as well as previous versions, is
available from the Geant4 download page
http://geant4.web.cern.ch/geant4/support/download.shtml
under the Data files heading. In order to use the radioactive decay module
correctly, you must download and unpack the above directory in your local
area, and set the environment variable
G4RADIOACTIVEDATA
to point to it.
**************************************************************************
In each of the files, lines beginning with either a 'W' or a '#' are
comments.
Lines beginning with a 'P' are headers, each of which describes a level of
the nucleus. The first number is the excitation energy in keV, the second
is the half life in seconds. Indented lines under the 'P' lines are decay
modes for that excitation. There are two type of records here,
distinguished by the number of columns.
If there are 3 columns only, this is a header which describes all decays of
that type from this level. The first column is the decay mode, the second
column is zero, and the third column in the branching ratio to this mode,
as a fraction of unity. Therefore, the third columns of all the 3-column
records under a given 'P' line should sum to 1.0.
If there are four columns, this is a record which describes a subset of the
decay type, specific to a given lower level in the daughter species. The
first column is the decay type, the second column is the excitation level
of the daughter (in keV), and the third column is the branching ratio as a
percentage (! note... not a fraction of unity) of the total branching ratio
which came from the 3-column record for this decay.
@@ -26,7 +26,7 @@
#ifndef G4Radioactivation_h
#define G4Radioactivation_h 1
#include "G4RadioactiveDecayBase.hh"
#include "G4RadioactiveDecay.hh"
#include <vector>
#include <map>
@@ -52,7 +52,7 @@ typedef std::vector<G4RadioactiveDecayRatesToDaughter> G4RadioactiveDecayRates;
typedef std::map<G4String, G4DecayTable*> DecayTableMap;
class G4Radioactivation : public G4RadioactiveDecayBase
class G4Radioactivation : public G4RadioactiveDecay
{
public: // with description
@@ -25,7 +25,7 @@
//
////////////////////////////////////////////////////////////////////////////////
// //
// File: G4RadioactiveDecayBase.hh //
// File: G4RadioactiveDecay.hh //
// Author: D.H. Wright (SLAC) //
// Date: 9 August 2017 //
// Description: version the G4RadioactiveDecay process by F. Lei and //
@@ -36,9 +36,8 @@
// //
////////////////////////////////////////////////////////////////////////////////
#ifndef G4RadioactiveDecayBase_h
#define G4RadioactiveDecayBase_h 1
#ifndef G4RadioactiveDecay_h
#define G4RadioactiveDecay_h 1
#include <vector>
#include <map>
@@ -55,13 +54,13 @@
#include "G4RadioactiveDecayMode.hh"
class G4Fragment;
class G4RadioactiveDecayBaseMessenger;
class G4RadioactiveDecayMessenger;
class G4PhotonEvaporation;
typedef std::map<G4String, G4DecayTable*> DecayTableMap;
class G4RadioactiveDecayBase : public G4VRestDiscreteProcess
class G4RadioactiveDecay : public G4VRestDiscreteProcess
{
// class description
@@ -75,8 +74,8 @@ class G4RadioactiveDecayBase : public G4VRestDiscreteProcess
public: // with description
G4RadioactiveDecayBase(const G4String& processName="RadioactiveDecayBase");
~G4RadioactiveDecayBase();
G4RadioactiveDecay(const G4String& processName="RadioactiveDecay");
~G4RadioactiveDecay();
virtual void ProcessDescription(std::ostream& outFile) const;
@@ -181,7 +180,7 @@ class G4RadioactiveDecayBase : public G4VRestDiscreteProcess
// ParticleChange for decay process
G4ParticleChangeForRadDecay fParticleChangeForRadDecay;
G4RadioactiveDecayBaseMessenger* theRadioactiveDecayBaseMessenger;
G4RadioactiveDecayMessenger* theRadioactiveDecayMessenger;
G4PhotonEvaporation* photonEvaporation;
std::vector<G4String> ValidVolumes;
@@ -199,8 +198,8 @@ class G4RadioactiveDecayBase : public G4VRestDiscreteProcess
void StreamInfo(std::ostream& os, const G4String& endline);
G4RadioactiveDecayBase(const G4RadioactiveDecayBase &right);
G4RadioactiveDecayBase& operator=(const G4RadioactiveDecayBase &right);
G4RadioactiveDecay(const G4RadioactiveDecay& right);
G4RadioactiveDecay& operator=(const G4RadioactiveDecay& right);
G4NucleusLimits theNucleusLimits;
@@ -23,12 +23,12 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
#ifndef G4RadioactiveDecayBaseMessenger_h
#define G4RadioactiveDecayBaseMessenger_h 1
#ifndef G4RadioactiveDecayMessenger_h
#define G4RadioactiveDecayMessenger_h 1
////////////////////////////////////////////////////////////////////////////////
// //
// File: G4RadioactiveDecayBaseMessenger.hh //
// File: G4RadioactiveDecayMessenger.hh //
// Author: D.H. Wright (SLAC) //
// Date: 29 August 2017 //
// Description: messenger class for the non-biased version of //
@@ -49,21 +49,21 @@
#include "G4UIcmdWithoutParameter.hh"
#include "globals.hh"
#include "G4RadioactiveDecayBase.hh"
#include "G4RadioactiveDecay.hh"
#include "G4UIcmdWithNucleusLimits.hh"
class G4RadioactiveDecayBase;
class G4RadioactiveDecay;
class G4RadioactiveDecayBaseMessenger: public G4UImessenger
class G4RadioactiveDecayMessenger: public G4UImessenger
{
public: //with description
G4RadioactiveDecayBaseMessenger(G4RadioactiveDecayBase* theRadioactiveDecayContainer);
~G4RadioactiveDecayBaseMessenger();
G4RadioactiveDecayMessenger(G4RadioactiveDecay* theRadioactiveDecayContainer);
~G4RadioactiveDecayMessenger();
void SetNewValue (G4UIcommand *command, G4String newValues);
private:
G4RadioactiveDecayBase* theRadioactiveDecayContainer;
G4RadioactiveDecay* theRadioactiveDecayContainer;
G4UIdirectory* rdmDirectory;
G4UIcmdWithNucleusLimits* nucleuslimitsCmd;
@@ -63,11 +63,14 @@
#include "globals.hh"
////////////////////////////////////////////////////////////////////////////////
//
enum G4RadioactiveDecayMode
{RDM_ERROR=-1, IT=0, BetaMinus=1, BetaPlus=2, KshellEC=3, LshellEC=4,
MshellEC=5, NshellEC=6, Alpha=7, Proton=8, Neutron=9, SpFission=10,
BDProton=11, BDNeutron=12, Beta2Minus=13, Beta2Plus=14, Proton2=15,
Neutron2=16, Triton=17};
enum G4RadioactiveDecayMode {
RDM_ERROR=-1, IT=0, BetaMinus=1, BetaPlus=2,
KshellEC=3, LshellEC=4, MshellEC=5, NshellEC=6,
Alpha=7, Proton=8, Neutron=9, SpFission=10,
BDProton=11, BDNeutron=12, Beta2Minus=13, Beta2Plus=14,
Proton2=15, Neutron2=16, Triton=17,
G4RadioactiveDecayModeSize // Note: the value G4RadioactiveDecayModeSize must remain the last one!
};
std::istream &operator >> (std::istream &s, G4RadioactiveDecayMode &q);
@@ -16,8 +16,8 @@ geant4_add_module(G4hadronic_radioactivedecay
G4NuclearDecay.hh
G4NucleusLimits.hh
G4ProtonDecay.hh
G4RadioactiveDecayBase.hh
G4RadioactiveDecayBaseMessenger.hh
G4RadioactiveDecay.hh
G4RadioactiveDecayMessenger.hh
G4Radioactivation.hh
G4RadioactivationMessenger.hh
G4RadioactiveDecayMode.hh
@@ -41,8 +41,8 @@ geant4_add_module(G4hadronic_radioactivedecay
G4NuclearDecay.cc
G4NucleusLimits.cc
G4ProtonDecay.cc
G4RadioactiveDecayBase.cc
G4RadioactiveDecayBaseMessenger.cc
G4RadioactiveDecay.cc
G4RadioactiveDecayMessenger.cc
G4Radioactivation.cc
G4RadioactivationMessenger.cc
G4RadioactiveDecayMode.cc
@@ -91,7 +91,7 @@
using namespace CLHEP;
G4Radioactivation::G4Radioactivation(const G4String& processName)
: G4RadioactiveDecayBase(processName)
: G4RadioactiveDecay(processName)
{
#ifdef G4VERBOSE
if (GetVerboseLevel() > 1) {
@@ -317,7 +317,7 @@ G4double G4Radioactivation::GetMeanLifeTime(const G4Track& theTrack,
// to decay immediately.
// In analogue mode it returns the particle's mean-life.
G4double meanlife = 0.;
if (AnalogueMC) meanlife = G4RadioactiveDecayBase::GetMeanLifeTime(theTrack, 0);
if (AnalogueMC) meanlife = G4RadioactiveDecay::GetMeanLifeTime(theTrack, 0);
return meanlife;
}
@@ -412,7 +412,7 @@ 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 = 12;
const G4int nMode = G4RadioactiveDecayModeSize;
G4double brs[nMode];
//
theIonTable =
@@ -495,65 +495,90 @@ CalculateChainsFromParent(const G4ParticleDefinition& theParentNucleus)
} // Combine decay channels (loop i)
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;
brs[BetaPlus] = brs[BetaPlus]+brs[KshellEC]+brs[LshellEC]+brs[MshellEC]+brs[NshellEC]; // Combine beta+ and EC
brs[KshellEC] = brs[LshellEC] = brs[MshellEC] = brs[NshellEC] = 0.0;
for (G4int i = 0; i < nMode; i++) { // loop over decay modes
if (brs[i] > 0.) {
switch (i) {
case 0:
case IT:
// Decay mode is isomeric transition
theITChannel = new G4ITDecay(aParentNucleus, brs[0], 0.0, 0.0,
theITChannel = new G4ITDecay(aParentNucleus, brs[IT], 0.0, 0.0,
photonEvaporation);
summedDecayTable->Insert(theITChannel);
break;
case 1:
case BetaMinus:
// Decay mode is beta-
theBetaMinusChannel = new G4BetaMinusDecay(aParentNucleus, brs[1],
theBetaMinusChannel = new G4BetaMinusDecay(aParentNucleus, brs[BetaMinus],
0.*MeV, 0.*MeV,
noFloat, allowed);
summedDecayTable->Insert(theBetaMinusChannel);
break;
case 2:
case BetaPlus:
// Decay mode is beta+ + EC.
theBetaPlusChannel = new G4BetaPlusDecay(aParentNucleus, brs[2],
theBetaPlusChannel = new G4BetaPlusDecay(aParentNucleus, brs[BetaPlus],
0.*MeV, 0.*MeV,
noFloat, allowed);
summedDecayTable->Insert(theBetaPlusChannel);
break;
case 7:
case Alpha:
// Decay mode is alpha.
theAlphaChannel = new G4AlphaDecay(aParentNucleus, brs[7], 0.*MeV,
theAlphaChannel = new G4AlphaDecay(aParentNucleus, brs[Alpha], 0.*MeV,
0.*MeV, noFloat);
summedDecayTable->Insert(theAlphaChannel);
break;
case 8:
case Proton:
// Decay mode is proton.
theProtonChannel = new G4ProtonDecay(aParentNucleus, brs[8], 0.*MeV,
theProtonChannel = new G4ProtonDecay(aParentNucleus, brs[Proton], 0.*MeV,
0.*MeV, noFloat);
summedDecayTable->Insert(theProtonChannel);
break;
case 9:
case Neutron:
// Decay mode is neutron.
theNeutronChannel = new G4NeutronDecay(aParentNucleus, brs[9], 0.*MeV,
theNeutronChannel = new G4NeutronDecay(aParentNucleus, brs[Neutron], 0.*MeV,
0.*MeV, noFloat);
summedDecayTable->Insert(theNeutronChannel);
break;
case 10:
case SpFission:
// Decay mode is spontaneous fission
theFissionChannel = new G4SFDecay(aParentNucleus, brs[10], 0.*MeV,
theFissionChannel = new G4SFDecay(aParentNucleus, brs[SpFission], 0.*MeV,
0.*MeV, noFloat);
summedDecayTable->Insert(theFissionChannel);
break;
case 11:
case BDProton:
// Not yet implemented
break;
case BDNeutron:
// Not yet implemented
break;
case Beta2Minus:
// Not yet implemented
break;
case Beta2Plus:
// Not yet implemented
break;
case Proton2:
// Not yet implemented
break;
case Neutron2:
// Not yet implemented
break;
case Triton:
// Decay mode is Triton.
theTritonChannel = new G4TritonDecay(aParentNucleus, brs[9], 0.*MeV,
theTritonChannel = new G4TritonDecay(aParentNucleus, brs[Triton], 0.*MeV,
0.*MeV, noFloat);
summedDecayTable->Insert(theTritonChannel);
break;
@@ -861,7 +886,7 @@ G4Radioactivation::DecayIt(const G4Track& theTrack, const G4Step&)
} else {
// Data found. Try to decay nucleus
if (AnalogueMC) {
G4RadioactiveDecayBase::DecayAnalog(theTrack);
G4RadioactiveDecay::DecayAnalog(theTrack);
} else {
// Proceed with decay using variance reduction
@@ -25,7 +25,7 @@
//
////////////////////////////////////////////////////////////////////////////////
// //
// File: G4RadioactiveDecayBase.cc //
// File: G4RadioactiveDecay.cc //
// Author: D.H. Wright (SLAC) //
// Date: 9 August 2017 //
// Description: version the G4RadioactiveDecay process by F. Lei and //
@@ -36,8 +36,8 @@
// //
////////////////////////////////////////////////////////////////////////////////
#include "G4RadioactiveDecayBase.hh"
#include "G4RadioactiveDecayBaseMessenger.hh"
#include "G4RadioactiveDecay.hh"
#include "G4RadioactiveDecayMessenger.hh"
#include "G4SystemOfUnits.hh"
#include "G4DynamicParticle.hh"
@@ -89,24 +89,26 @@
#include <algorithm>
#include <fstream>
#include "G4PhysicsModelCatalog.hh"
using namespace CLHEP;
const G4double G4RadioactiveDecayBase::levelTolerance = 10.0*eV;
const G4ThreeVector G4RadioactiveDecayBase::origin(0.,0.,0.);
const G4double G4RadioactiveDecay::levelTolerance = 10.0*eV;
const G4ThreeVector G4RadioactiveDecay::origin(0.,0.,0.);
#ifdef G4MULTITHREADED
#include "G4AutoLock.hh"
G4Mutex G4RadioactiveDecayBase::radioactiveDecayMutex = G4MUTEX_INITIALIZER;
DecayTableMap* G4RadioactiveDecayBase::master_dkmap = 0;
G4Mutex G4RadioactiveDecay::radioactiveDecayMutex = G4MUTEX_INITIALIZER;
DecayTableMap* G4RadioactiveDecay::master_dkmap = 0;
G4int& G4RadioactiveDecayBase::NumberOfInstances()
G4int& G4RadioactiveDecay::NumberOfInstances()
{
static G4int numberOfInstances = 0;
return numberOfInstances;
}
#endif
G4RadioactiveDecayBase::G4RadioactiveDecayBase(const G4String& processName)
G4RadioactiveDecay::G4RadioactiveDecay(const G4String& processName)
: G4VRestDiscreteProcess(processName, fDecay), isInitialised(false),
forceDecayDirection(0.,0.,0.), forceDecayHalfAngle(0.*deg), dirPath(""),
verboseLevel(1),
@@ -114,14 +116,14 @@ G4RadioactiveDecayBase::G4RadioactiveDecayBase(const G4String& processName)
{
#ifdef G4VERBOSE
if (GetVerboseLevel() > 1) {
G4cout << "G4RadioactiveDecayBase constructor: processName = " << processName
G4cout << "G4RadioactiveDecay constructor: processName = " << processName
<< G4endl;
}
#endif
SetProcessSubType(fRadioactiveDecay);
theRadioactiveDecayBaseMessenger = new G4RadioactiveDecayBaseMessenger(this);
theRadioactiveDecayMessenger = new G4RadioactiveDecayMessenger(this);
pParticleChange = &fParticleChangeForRadDecay;
// Set up photon evaporation for use in G4ITDecay
@@ -153,7 +155,7 @@ G4RadioactiveDecayBase::G4RadioactiveDecayBase(const G4String& processName)
// Instantiate the map of decay tables
#ifdef G4MULTITHREADED
G4AutoLock lk(&G4RadioactiveDecayBase::radioactiveDecayMutex);
G4AutoLock lk(&G4RadioactiveDecay::radioactiveDecayMutex);
NumberOfInstances()++;
if(!master_dkmap) master_dkmap = new DecayTableMap;
#endif
@@ -169,7 +171,7 @@ G4RadioactiveDecayBase::G4RadioactiveDecayBase(const G4String& processName)
G4HadronicProcessStore::Instance()->RegisterExtraProcess(this);
}
void G4RadioactiveDecayBase::ProcessDescription(std::ostream& outFile) const
void G4RadioactiveDecay::ProcessDescription(std::ostream& outFile) const
{
outFile << "The radioactive decay process (G4RadioactiveDecay) handles the\n"
<< "alpha, beta+, beta-, electron capture and isomeric transition\n"
@@ -179,9 +181,9 @@ void G4RadioactiveDecayBase::ProcessDescription(std::ostream& outFile) const
}
G4RadioactiveDecayBase::~G4RadioactiveDecayBase()
G4RadioactiveDecay::~G4RadioactiveDecay()
{
delete theRadioactiveDecayBaseMessenger;
delete theRadioactiveDecayMessenger;
delete photonEvaporation;
for (DecayTableMap::iterator i = dkmap->begin(); i != dkmap->end(); i++) {
delete i->second;
@@ -189,7 +191,7 @@ G4RadioactiveDecayBase::~G4RadioactiveDecayBase()
dkmap->clear();
delete dkmap;
#ifdef G4MULTITHREADED
G4AutoLock lk(&G4RadioactiveDecayBase::radioactiveDecayMutex);
G4AutoLock lk(&G4RadioactiveDecay::radioactiveDecayMutex);
--NumberOfInstances();
if(NumberOfInstances()==0)
{
@@ -203,7 +205,7 @@ G4RadioactiveDecayBase::~G4RadioactiveDecayBase()
}
G4bool G4RadioactiveDecayBase::IsApplicable(const G4ParticleDefinition& aParticle)
G4bool G4RadioactiveDecay::IsApplicable(const G4ParticleDefinition& aParticle)
{
// All particles other than G4Ions, are rejected by default
if (((const G4Ions*)(&aParticle))->GetExcitationEnergy() > 0.) {return true;}
@@ -225,7 +227,7 @@ G4bool G4RadioactiveDecayBase::IsApplicable(const G4ParticleDefinition& aParticl
return true;
}
G4DecayTable* G4RadioactiveDecayBase::GetDecayTable(const G4ParticleDefinition* aNucleus)
G4DecayTable* G4RadioactiveDecay::GetDecayTable(const G4ParticleDefinition* aNucleus)
{
G4String key = aNucleus->GetParticleName();
DecayTableMap::iterator table_ptr = dkmap->find(key);
@@ -241,7 +243,7 @@ G4DecayTable* G4RadioactiveDecayBase::GetDecayTable(const G4ParticleDefinition*
}
void G4RadioactiveDecayBase::SelectAVolume(const G4String& aVolume)
void G4RadioactiveDecay::SelectAVolume(const G4String& aVolume)
{
G4LogicalVolumeStore* theLogicalVolumes = G4LogicalVolumeStore::GetInstance();
G4LogicalVolume* volume = nullptr;
@@ -261,13 +263,13 @@ void G4RadioactiveDecayBase::SelectAVolume(const G4String& aVolume)
ed << aVolume << " is not a valid logical volume name."
<< " Decay not activated for it."
<< G4endl;
G4Exception("G4RadioactiveDecayBase::SelectAVolume()", "HAD_RDM_300",
G4Exception("G4RadioactiveDecay::SelectAVolume()", "HAD_RDM_300",
JustWarning, ed);
}
}
void G4RadioactiveDecayBase::DeselectAVolume(const G4String& aVolume)
void G4RadioactiveDecay::DeselectAVolume(const G4String& aVolume)
{
G4LogicalVolumeStore* theLogicalVolumes = G4LogicalVolumeStore::GetInstance();
G4LogicalVolume* volume = nullptr;
@@ -288,7 +290,7 @@ void G4RadioactiveDecayBase::DeselectAVolume(const G4String& aVolume)
{
G4ExceptionDescription ed;
ed << aVolume << " is not in the list. No action taken." << G4endl;
G4Exception("G4RadioactiveDecayBase::DeselectAVolume()", "HAD_RDM_300",
G4Exception("G4RadioactiveDecay::DeselectAVolume()", "HAD_RDM_300",
JustWarning, ed);
}
}
@@ -297,13 +299,13 @@ void G4RadioactiveDecayBase::DeselectAVolume(const G4String& aVolume)
G4ExceptionDescription ed;
ed << aVolume << " is not a valid logical volume name. No action taken."
<< G4endl;
G4Exception("G4RadioactiveDecayBase::DeselectAVolume()", "HAD_RDM_300",
G4Exception("G4RadioactiveDecay::DeselectAVolume()", "HAD_RDM_300",
JustWarning, ed);
}
}
void G4RadioactiveDecayBase::SelectAllVolumes()
void G4RadioactiveDecay::SelectAllVolumes()
{
G4LogicalVolumeStore* theLogicalVolumes = G4LogicalVolumeStore::GetInstance();
G4LogicalVolume* volume = nullptr;
@@ -326,7 +328,7 @@ void G4RadioactiveDecayBase::SelectAllVolumes()
}
void G4RadioactiveDecayBase::DeselectAllVolumes()
void G4RadioactiveDecay::DeselectAllVolumes()
{
ValidVolumes.clear();
isAllVolumesMode=false;
@@ -342,7 +344,7 @@ void G4RadioactiveDecayBase::DeselectAllVolumes()
// //
////////////////////////////////////////////////////////////////////////////////
G4double G4RadioactiveDecayBase::GetMeanLifeTime(const G4Track& theTrack,
G4double G4RadioactiveDecay::GetMeanLifeTime(const G4Track& theTrack,
G4ForceCondition*)
{
G4double meanlife = 0.;
@@ -378,8 +380,8 @@ G4double G4RadioactiveDecayBase::GetMeanLifeTime(const G4Track& theTrack,
// //
////////////////////////////////////////////////////////////////////////////////
G4double G4RadioactiveDecayBase::GetMeanFreePath (const G4Track& aTrack, G4double,
G4ForceCondition*)
G4double G4RadioactiveDecay::GetMeanFreePath(const G4Track& aTrack, G4double,
G4ForceCondition*)
{
const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle();
const G4ParticleDefinition* aParticleDef = aParticle->GetDefinition();
@@ -443,7 +445,7 @@ G4double G4RadioactiveDecayBase::GetMeanFreePath (const G4Track& aTrack, G4doubl
// //
////////////////////////////////////////////////////////////////////////////////
void G4RadioactiveDecayBase::BuildPhysicsTable(const G4ParticleDefinition&)
void G4RadioactiveDecay::BuildPhysicsTable(const G4ParticleDefinition&)
{
if (!isInitialised) {
isInitialised = true;
@@ -463,7 +465,7 @@ void G4RadioactiveDecayBase::BuildPhysicsTable(const G4ParticleDefinition&)
////////////////////////////////////////////////////////////////////////////////
void
G4RadioactiveDecayBase::StreamInfo(std::ostream& os, const G4String& endline)
G4RadioactiveDecay::StreamInfo(std::ostream& os, const G4String& endline)
{
G4DeexPrecoParameters* deex =
G4NuclearLevelData::GetInstance()->GetParameters();
@@ -490,12 +492,12 @@ G4RadioactiveDecayBase::StreamInfo(std::ostream& os, const G4String& endline)
<< 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 << "Use ANSTO fluorescence model "
<< emparam->ANSTOFluoDir() << endline;
os << "Threshold for very long decay time at rest "
<< fThresholdForVeryLongDecayTime/CLHEP::ns << " ns" << endline;
os << "======================================================================"
@@ -512,7 +514,7 @@ G4RadioactiveDecayBase::StreamInfo(std::ostream& os, const G4String& endline)
////////////////////////////////////////////////////////////////////////////////
G4DecayTable*
G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucleus)
G4RadioactiveDecay::LoadDecayTable(const G4ParticleDefinition& theParentNucleus)
{
// Generate input data file name using Z and A of the parent nucleus
// file containing radioactive decay data.
@@ -524,7 +526,7 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
((const G4Ions*)(&theParentNucleus))->GetFloatLevelBase();
#ifdef G4MULTITHREADED
G4AutoLock lk(&G4RadioactiveDecayBase::radioactiveDecayMutex);
G4AutoLock lk(&G4RadioactiveDecay::radioactiveDecayMutex);
G4String key = theParentNucleus.GetParticleName();
DecayTableMap::iterator master_table_ptr = master_dkmap->find(key);
@@ -552,7 +554,7 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
if (DecaySchemeFile.good()) {
// Initialize variables used for reading in radioactive decay data
G4bool floatMatch(false);
const G4int nMode = 12;
const G4int nMode = G4RadioactiveDecayModeSize;
G4double modeTotalBR[nMode] = {0.0};
G4double modeSumBR[nMode];
for (G4int i = 0; i < nMode; i++) {
@@ -589,7 +591,7 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
}
inputLine = inputChars;
inputLine = inputLine.strip(1);
G4StrUtil::rstrip(inputLine);
if (inputChars[0] != '#' && inputLine.length() != 0) {
std::istringstream tmpStream(inputLine);
@@ -631,39 +633,39 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
}
break;
case BetaMinus:
modeTotalBR[1] = decayModeTotal; break;
modeTotalBR[BetaMinus] = decayModeTotal; break;
case BetaPlus:
modeTotalBR[2] = decayModeTotal; break;
modeTotalBR[BetaPlus] = decayModeTotal; break;
case KshellEC:
modeTotalBR[3] = decayModeTotal; break;
modeTotalBR[KshellEC] = decayModeTotal; break;
case LshellEC:
modeTotalBR[4] = decayModeTotal; break;
modeTotalBR[LshellEC] = decayModeTotal; break;
case MshellEC:
modeTotalBR[5] = decayModeTotal; break;
modeTotalBR[MshellEC] = decayModeTotal; break;
case NshellEC:
modeTotalBR[6] = decayModeTotal; break;
modeTotalBR[NshellEC] = decayModeTotal; break;
case Alpha:
modeTotalBR[7] = decayModeTotal; break;
modeTotalBR[Alpha] = decayModeTotal; break;
case Proton:
modeTotalBR[8] = decayModeTotal; break;
modeTotalBR[Proton] = decayModeTotal; break;
case Neutron:
modeTotalBR[9] = decayModeTotal; break;
case BDProton:
break;
case BDNeutron:
break;
case Beta2Minus:
break;
case Beta2Plus:
break;
case Proton2:
break;
case Neutron2:
break;
modeTotalBR[Neutron] = decayModeTotal; break;
case SpFission:
modeTotalBR[10] = decayModeTotal; break;
modeTotalBR[SpFission] = decayModeTotal; break;
case BDProton:
/* Not yet implemented */ break;
case BDNeutron:
/* Not yet implemented */ break;
case Beta2Minus:
/* Not yet implemented */ break;
case Beta2Plus:
/* Not yet implemented */ break;
case Proton2:
/* Not yet implemented */ break;
case Neutron2:
/* Not yet implemented */ break;
case Triton:
modeTotalBR[11] = decayModeTotal; break;
modeTotalBR[Triton] = decayModeTotal; break;
case RDM_ERROR:
default:
@@ -695,7 +697,7 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
// aBetaMinusChannel->DumpNuclearInfo();
// aBetaMinusChannel->SetHLThreshold(halflifethreshold);
theDecayTable->Insert(aBetaMinusChannel);
modeSumBR[1] += b;
modeSumBR[BetaMinus] += b;
}
break;
@@ -707,7 +709,7 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
// aBetaPlusChannel->DumpNuclearInfo();
// aBetaPlusChannel->SetHLThreshold(halflifethreshold);
theDecayTable->Insert(aBetaPlusChannel);
modeSumBR[2] += b;
modeSumBR[BetaPlus] += b;
}
break;
@@ -720,7 +722,7 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
// aKECChannel->SetHLThreshold(halflifethreshold);
aKECChannel->SetARM(applyARM);
theDecayTable->Insert(aKECChannel);
modeSumBR[3] += b;
modeSumBR[KshellEC] += b;
}
break;
@@ -733,7 +735,7 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
// aLECChannel->SetHLThreshold(halflifethreshold);
aLECChannel->SetARM(applyARM);
theDecayTable->Insert(aLECChannel);
modeSumBR[4] += b;
modeSumBR[LshellEC] += b;
}
break;
@@ -746,7 +748,7 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
// aMECChannel->SetHLThreshold(halflifethreshold);
aMECChannel->SetARM(applyARM);
theDecayTable->Insert(aMECChannel);
modeSumBR[5] += b;
modeSumBR[MshellEC] += b;
}
break;
@@ -759,7 +761,7 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
// aNECChannel->SetHLThreshold(halflifethreshold);
aNECChannel->SetARM(applyARM);
theDecayTable->Insert(aNECChannel);
modeSumBR[6] += b;
modeSumBR[NshellEC] += b;
}
break;
@@ -771,7 +773,7 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
// anAlphaChannel->DumpNuclearInfo();
// anAlphaChannel->SetHLThreshold(halflifethreshold);
theDecayTable->Insert(anAlphaChannel);
modeSumBR[7] += b;
modeSumBR[Alpha] += b;
}
break;
@@ -783,7 +785,7 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
// aProtonChannel->DumpNuclearInfo();
// aProtonChannel->SetHLThreshold(halflifethreshold);
theDecayTable->Insert(aProtonChannel);
modeSumBR[8] += b;
modeSumBR[Proton] += b;
}
break;
@@ -795,34 +797,10 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
// aNeutronChannel->DumpNuclearInfo();
// aNeutronChannel->SetHLThreshold(halflifethreshold);
theDecayTable->Insert(aNeutronChannel);
modeSumBR[9] += b;
modeSumBR[Neutron] += b;
}
break;
case BDProton:
// Not yet implemented
// G4cout << " beta-delayed proton decay, a = " << a << ", b = " << b << ", c = " << c << G4endl;
break;
case BDNeutron:
// Not yet implemented
// G4cout << " beta-delayed neutron decay, a = " << a << ", b = " << b << ", c = " << c << G4endl;
break;
case Beta2Minus:
// Not yet implemented
// G4cout << " Double beta- decay, a = " << a << ", b = " << b << ", c = " << c << G4endl;
break;
case Beta2Plus:
// Not yet implemented
// G4cout << " Double beta+ decay, a = " << a << ", b = " << b << ", c = " << c << G4endl;
break;
case Proton2:
// Not yet implemented
// G4cout << " Double proton decay, a = " << a << ", b = " << b << ", c = " << c << G4endl;
break;
case Neutron2:
// Not yet implemented
// G4cout << " Double beta- decay, a = " << a << ", b = " << b << ", c = " << c << G4endl;
break;
case SpFission:
{
G4SFDecay* aSpontFissChannel =
@@ -830,9 +808,40 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
new G4SFDecay(&theParentNucleus, b, c*MeV, a*MeV,
daughterFloatLevel);
theDecayTable->Insert(aSpontFissChannel);
modeSumBR[10] += b;
modeSumBR[SpFission] += b;
}
break;
case BDProton:
// Not yet implemented
// G4cout << " beta-delayed proton decay, a = " << a << ", b = " << b << ", c = " << c << G4endl;
break;
case BDNeutron:
// Not yet implemented
// G4cout << " beta-delayed neutron decay, a = " << a << ", b = " << b << ", c = " << c << G4endl;
break;
case Beta2Minus:
// Not yet implemented
// G4cout << " Double beta- decay, a = " << a << ", b = " << b << ", c = " << c << G4endl;
break;
case Beta2Plus:
// Not yet implemented
// G4cout << " Double beta+ decay, a = " << a << ", b = " << b << ", c = " << c << G4endl;
break;
case Proton2:
// Not yet implemented
// G4cout << " Double proton decay, a = " << a << ", b = " << b << ", c = " << c << G4endl;
break;
case Neutron2:
// Not yet implemented
// G4cout << " Double beta- decay, a = " << a << ", b = " << b << ", c = " << c << G4endl;
break;
case Triton:
{
G4TritonDecay* aTritonChannel =
@@ -841,7 +850,7 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
// anAlphaChannel->DumpNuclearInfo();
// anAlphaChannel->SetHLThreshold(halflifethreshold);
theDecayTable->Insert(aTritonChannel);
modeSumBR[11] += b;
modeSumBR[Triton] += b;
}
break;
@@ -899,7 +908,7 @@ G4RadioactiveDecayBase::LoadDecayTable(const G4ParticleDefinition& theParentNucl
}
void
G4RadioactiveDecayBase::AddUserDecayDataFile(G4int Z, G4int A, G4String filename)
G4RadioactiveDecay::AddUserDecayDataFile(G4int Z, G4int A, G4String filename)
{
if (Z < 1 || A < 2) G4cout << "Z and A not valid!" << G4endl;
@@ -910,7 +919,7 @@ G4RadioactiveDecayBase::AddUserDecayDataFile(G4int Z, G4int A, G4String filename
} else {
G4ExceptionDescription ed;
ed << filename << " does not exist! " << G4endl;
G4Exception("G4RadioactiveDecayBase::AddUserDecayDataFile()", "HAD_RDM_001",
G4Exception("G4RadioactiveDecay::AddUserDecayDataFile()", "HAD_RDM_001",
FatalException, ed);
}
}
@@ -922,7 +931,7 @@ G4RadioactiveDecayBase::AddUserDecayDataFile(G4int Z, G4int A, G4String filename
////////////////////////////////////////////////////////////////////////////////
G4VParticleChange*
G4RadioactiveDecayBase::DecayIt(const G4Track& theTrack, const G4Step&)
G4RadioactiveDecay::DecayIt(const G4Track& theTrack, const G4Step&)
{
// Initialize G4ParticleChange object, get particle details and decay table
fParticleChangeForRadDecay.Initialize(theTrack);
@@ -1089,7 +1098,7 @@ G4RadioactiveDecayBase::DecayIt(const G4Track& theTrack, const G4Step&)
}
void G4RadioactiveDecayBase::DecayAnalog(const G4Track& theTrack)
void G4RadioactiveDecay::DecayAnalog(const G4Track& theTrack)
{
const G4DynamicParticle* theParticle = theTrack.GetDynamicParticle();
const G4ParticleDefinition* theParticleDef = theParticle->GetDefinition();
@@ -1170,23 +1179,29 @@ void G4RadioactiveDecayBase::DecayAnalog(const G4Track& theTrack)
products->IsChecked();
}
for (G4int index = 0; index < numberOfSecondaries; index++) {
G4Track* secondary = new G4Track(products->PopProducts(), finalGlobalTime,
theTrack.GetPosition() );
secondary->SetWeight(theTrack.GetWeight());
secondary->SetCreatorModelIndex(theRadDecayMode);
//Change for atomics relaxation
if (theRadDecayMode == IT && index>0){
if (index == numberOfSecondaries-1) secondary->SetCreatorModelIndex(IT);
else secondary->SetCreatorModelIndex(30);
}
else if (theRadDecayMode >= KshellEC && theRadDecayMode <= NshellEC
&& index <numberOfSecondaries-1){
secondary->SetCreatorModelIndex(30);
const G4int modelID_forIT = G4PhysicsModelCatalog::GetModelID( "model_RDM_IT" );
G4int modelID = modelID_forIT + 10*theRadDecayMode;
const G4int modelID_forAtomicRelaxation =
G4PhysicsModelCatalog::GetModelID( "model_RDM_AtomicRelaxation" );
for ( G4int index = 0; index < numberOfSecondaries; ++index ) {
G4Track* secondary = new G4Track( products->PopProducts(), finalGlobalTime,
theTrack.GetPosition() );
secondary->SetWeight( theTrack.GetWeight() );
secondary->SetCreatorModelID( modelID );
// Change for atomics relaxation
if ( theRadDecayMode == IT && index > 0 ) {
if ( index == numberOfSecondaries-1 ) {
secondary->SetCreatorModelID( modelID_forIT );
} else {
secondary->SetCreatorModelID( modelID_forAtomicRelaxation) ;
}
} else if ( theRadDecayMode >= KshellEC && theRadDecayMode <= NshellEC &&
index < numberOfSecondaries-1 ) {
secondary->SetCreatorModelID( modelID_forAtomicRelaxation );
}
secondary->SetGoodForTrackingFlag();
secondary->SetTouchableHandle(theTrack.GetTouchableHandle());
fParticleChangeForRadDecay.AddSecondary(secondary);
secondary->SetTouchableHandle( theTrack.GetTouchableHandle() );
fParticleChangeForRadDecay.AddSecondary( secondary );
}
delete products;
@@ -1202,7 +1217,7 @@ void G4RadioactiveDecayBase::DecayAnalog(const G4Track& theTrack)
G4DecayProducts*
G4RadioactiveDecayBase::DoDecay(const G4ParticleDefinition& theParticleDef)
G4RadioactiveDecay::DoDecay(const G4ParticleDefinition& theParticleDef)
{
G4DecayProducts* products = 0;
G4DecayTable* theDecayTable = GetDecayTable(&theParticleDef);
@@ -1241,7 +1256,8 @@ G4RadioactiveDecayBase::DoDecay(const G4ParticleDefinition& theParticleDef)
// Apply directional bias for "visible" daughters (e+-, gamma, n, p, alpha)
void G4RadioactiveDecayBase::CollimateDecay(G4DecayProducts* products) {
void G4RadioactiveDecay::CollimateDecay(G4DecayProducts* products) {
if (origin == forceDecayDirection) return; // No collimation requested
if (180.*deg == forceDecayHalfAngle) return;
if (0 == products || 0 == products->entries()) return;
@@ -1270,7 +1286,7 @@ void G4RadioactiveDecayBase::CollimateDecay(G4DecayProducts* products) {
}
}
void G4RadioactiveDecayBase::CollimateDecayProduct(G4DynamicParticle* daughter) {
void G4RadioactiveDecay::CollimateDecayProduct(G4DynamicParticle* daughter) {
#ifdef G4VERBOSE
if (GetVerboseLevel() > 1) {
G4cout << "CollimateDecayProduct for daughter "
@@ -1285,7 +1301,7 @@ void G4RadioactiveDecayBase::CollimateDecayProduct(G4DynamicParticle* daughter)
// Choose random direction within collimation cone
G4ThreeVector G4RadioactiveDecayBase::ChooseCollimationDirection() const {
G4ThreeVector G4RadioactiveDecay::ChooseCollimationDirection() const {
if (origin == forceDecayDirection) return origin; // Don't do collimation
if (forceDecayHalfAngle == 180.*deg) return origin;
@@ -26,7 +26,7 @@
////////////////////////////////////////////////////////////////////////////////
// //
// File: G4RadioactiveDecayBaseMessenger.cc //
// File: G4RadioactiveDecayMessenger.cc //
// Author: D.H. Wright (SLAC) //
// Date: 29 August 2017 //
// Description: messenger class for the non-biased version of //
@@ -35,14 +35,14 @@
// //
////////////////////////////////////////////////////////////////////////////////
#include "G4RadioactiveDecayBaseMessenger.hh"
#include "G4RadioactiveDecayMessenger.hh"
#include "G4NuclearLevelData.hh"
#include <sstream>
#include "G4HadronicException.hh"
G4RadioactiveDecayBaseMessenger::G4RadioactiveDecayBaseMessenger
(G4RadioactiveDecayBase* theRadioactiveDecayContainer1)
G4RadioactiveDecayMessenger::G4RadioactiveDecayMessenger
(G4RadioactiveDecay* theRadioactiveDecayContainer1)
:theRadioactiveDecayContainer(theRadioactiveDecayContainer1)
{
rdmDirectory = new G4UIdirectory("/process/had/rdm/");
@@ -144,7 +144,7 @@ G4RadioactiveDecayBaseMessenger::G4RadioactiveDecayBaseMessenger
}
G4RadioactiveDecayBaseMessenger::~G4RadioactiveDecayBaseMessenger ()
G4RadioactiveDecayMessenger::~G4RadioactiveDecayMessenger ()
{
delete rdmDirectory;
delete nucleuslimitsCmd;
@@ -164,7 +164,7 @@ G4RadioactiveDecayBaseMessenger::~G4RadioactiveDecayBaseMessenger ()
void
G4RadioactiveDecayBaseMessenger::SetNewValue(G4UIcommand *command, G4String newValues)
G4RadioactiveDecayMessenger::SetNewValue(G4UIcommand *command, G4String newValues)
{
if ( command == nucleuslimitsCmd ) {
theRadioactiveDecayContainer->