Import Geant4 10.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 11:51:14 +02:00
parent e2d2f9810a
commit 286caacf06
12421 changed files with 730077 additions and 502383 deletions
@@ -24,7 +24,6 @@
// ********************************************************************
//
// $Id: $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// Description: enum codes for beta decay types
// Author: Dennis Wright (SLAC)
@@ -50,6 +50,7 @@
#include <CLHEP/Units/SystemOfUnits.h>
#include "globals.hh"
#include "Randomize.hh"
#include "G4NuclearDecayChannel.hh"
#include "G4RadioactiveDecayMode.hh"
////////////////////////////////////////////////////////////////////////////////
@@ -70,7 +71,7 @@ class G4BetaMinusDecayChannel : public G4NuclearDecayChannel
G4double theDaughterExcitation=0.0,
G4double theFFN=1.0,
G4bool theBetaSimple = false,
CLHEP::RandGeneral* theRandEnergy = 0):
G4RandGeneral* theRandEnergy = 0):
G4NuclearDecayChannel (BetaMinus, Verbose, theParentNucleus, theBR,
theFFN,
theBetaSimple,
@@ -51,6 +51,7 @@
#include <CLHEP/Units/SystemOfUnits.h>
#include "globals.hh"
#include "Randomize.hh"
#include "G4NuclearDecayChannel.hh"
#include "G4RadioactiveDecayMode.hh"
@@ -74,7 +75,7 @@ class G4BetaPlusDecayChannel : public G4NuclearDecayChannel
G4double theDaughterExcitation=0.0,
G4double theFFN=0.0,
G4bool theBetaSimple = false,
CLHEP::RandGeneral* theRandEnergy = 0) :
G4RandGeneral* theRandEnergy = 0) :
G4NuclearDecayChannel (BetaPlus,
Verbose,
theParentNucleus,
@@ -27,32 +27,28 @@
#define G4ITDecayChannel_h 1
#include <CLHEP/Units/SystemOfUnits.h>
#include "globals.hh"
#include "G4NuclearDecayChannel.hh"
////////////////////////////////////////////////////////////////////////////////
//
class G4ITDecayChannel : public G4NuclearDecayChannel
{
// class description
//
// Derived class from G4NuclearDecayChannel. It is specific for
// Isomeric Transitions
// Specific decay channel for isomeric transitions
//
// class description - end
public:
G4ITDecayChannel (G4int Verbose,
const G4Ions *theParentNucleus,
G4double theBR) :
G4NuclearDecayChannel (IT, Verbose, theParentNucleus, theBR, 0.0,
theParentNucleus->GetBaryonNumber(),
int(theParentNucleus->GetPDGCharge()/CLHEP::eplus),
theParentNucleus->GetExcitationEnergy())
G4ITDecayChannel(G4int Verbose, const G4Ions* theParentNucleus,
G4double theBR)
: G4NuclearDecayChannel(IT, Verbose, theParentNucleus, theBR, 0.0,
theParentNucleus->GetBaryonNumber(),
G4int(theParentNucleus->GetPDGCharge()/CLHEP::eplus),
theParentNucleus->GetExcitationEnergy())
{
#ifdef G4VERBOSE
if (GetVerboseLevel()>1)
G4cout <<"G4ITDecayChannel constructor" << G4endl;
if (GetVerboseLevel() > 1)
G4cout << "G4ITDecayChannel constructor" << G4endl;
#endif
}
~G4ITDecayChannel () {;}
@@ -23,6 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
#ifndef G4NuclearDecayChannel_h
#define G4NuclearDecayChannel_h 1
@@ -34,11 +35,9 @@
#include "G4ParticleTable.hh"
#include "G4GeneralPhaseSpaceDecay.hh"
#include "G4RadioactiveDecayMode.hh"
#include "Randomize.hh"
#include <CLHEP/Random/RandGeneral.h>
////////////////////////////////////////////////////////////////////////////////
//
class G4NuclearDecayChannel : public G4GeneralPhaseSpaceDecay
{
// class description
@@ -50,102 +49,106 @@ class G4NuclearDecayChannel : public G4GeneralPhaseSpaceDecay
//
// class description - end
public: // with description
public: // with description
G4NuclearDecayChannel(const G4RadioactiveDecayMode&, G4int Verbose) :
G4GeneralPhaseSpaceDecay(Verbose) {;}
// default constructor
//
G4NuclearDecayChannel(const G4RadioactiveDecayMode& theMode, G4int Verbose,
const G4ParticleDefinition* theParentNucleus,
G4double theBR, G4double theQtransition, G4int A,
G4int Z, G4double theDaughterExcitation);
// constructor decay channel with one decay product
//
G4NuclearDecayChannel(const G4RadioactiveDecayMode& theMode, G4int Verbose,
const G4ParticleDefinition* theParentNucleus,
G4double theBR, G4double theQtransition, G4int A,
G4int Z, G4double theDaughterExcitation,
const G4String theDaughterName1);
// constructor decay channel with two decay products
//
G4NuclearDecayChannel(const G4RadioactiveDecayMode& theMode, G4int Verbose,
const G4ParticleDefinition* theParentNucleus,
G4double theBR, G4double /* theFFN */,
G4bool /* betaS */, CLHEP::RandGeneral* randBeta,
G4double theQtransition, G4int A, G4int Z,
G4double theDaughterExcitation,
const G4String theDaughterName1,
const G4String theDaughterName2);
// constructor decay channel with three decay product
//
G4NuclearDecayChannel(const G4RadioactiveDecayMode& theMode, G4int Verbose)
: G4GeneralPhaseSpaceDecay(Verbose), decayMode(theMode),Qtransition(0) {;}
// default constructor
~G4NuclearDecayChannel(){;}
G4NuclearDecayChannel(const G4RadioactiveDecayMode& theMode, G4int Verbose,
const G4ParticleDefinition* theParentNucleus,
G4double theBR, G4double theQtransition, G4int A,
G4int Z, G4double theDaughterExcitation);
// constructor decay channel with one decay product
// destructor
//
G4DecayProducts* DecayIt(G4double theParentMass);
// Returns the decay products
//
void SetHLThreshold(G4double hl) {halflifethreshold = hl;}
// Set the half-life threshold for isomer production
//
void SetICM(G4bool icm) {applyICM = icm;}
// Enable/disable ICM
//
void SetARM (G4bool arm) {applyARM = arm;}
// Enable/disable ARM
//
inline G4RadioactiveDecayMode GetDecayMode () {return decayMode;}
// Returns the decay mode
//
inline G4double GetDaughterExcitation () {return daughterExcitation;}
// Returns the excitaion energy of the daughter nuclide
//
inline G4ParticleDefinition* GetDaughterNucleus () {return daughterNucleus;}
// Returns the daughter nuclide.
//
private:
G4NuclearDecayChannel(const G4String& theName, const G4String& theParentName,
G4double theBR, G4int theNumberOfDaughters,
const G4String theDaughterName1,
const G4String theDaughterName2,
const G4String theDaughterName3,
const G4String theDaughterName4);
G4NuclearDecayChannel(const G4RadioactiveDecayMode& theMode, G4int Verbose,
const G4ParticleDefinition* theParentNucleus,
G4double theBR, G4double theQtransition, G4int A,
G4int Z, G4double theDaughterExcitation,
const G4String theDaughterName1);
// constructor decay channel with two decay products
G4NuclearDecayChannel(const G4RadioactiveDecayMode& theMode, G4int Verbose,
const G4ParticleDefinition* theParentNucleus,
G4double theBR, G4double theFFN,
G4bool betaS, G4RandGeneral* randBeta,
G4double theQtransition, G4int A, G4int Z,
G4double theDaughterExcitation,
const G4String theDaughterName1,
const G4String theDaughterName2);
// constructor decay channel with three decay product
G4NuclearDecayChannel(const G4String& theParentName,
G4double theBR, G4int theNumberOfDaughters,
const G4String& theDaughterName1,
const G4String& theDaughterName2 = "",
const G4String& theDaughterName3 = "");
virtual ~G4NuclearDecayChannel();
G4NuclearDecayChannel(const G4String& theParentName,
G4double theParentMass, G4double theBR,
G4int theNumberOfDaughters,
const G4String& theDaughterName1,
const G4String& theDaughterName2 = "",
const G4String& theDaughterName3 = "");
// Returns the decay products
G4DecayProducts* DecayIt(G4double);
void FillDaughterNucleus(G4int index, G4int A, G4int Z,
G4double theDaughterExcitation);
// Set the half-life threshold for isomer production
void SetHLThreshold(G4double hl) {halflifethreshold = hl;}
G4DecayProducts* BetaDecayIt();
// to replace the ThreeBodyDecayIt() to generate the correct beta spectrum
// Enable/disable ICM
void SetICM(G4bool icm) {applyICM = icm;}
protected:
G4RadioactiveDecayMode decayMode;
static const G4double pTolerance;
static const G4double levelTolerance;
G4double daughterExcitation;
G4int daughterA;
G4int daughterZ;
G4ParticleDefinition *daughterNucleus;
G4DynamicParticle* dynamicDaughter;
G4double Qtransition;
G4double halflifethreshold;
G4bool applyICM;
G4bool applyARM;
CLHEP::RandGeneral* RandomEnergy;
// Enable/disable ARM
void SetARM (G4bool arm) {applyARM = arm;}
inline G4RadioactiveDecayMode GetDecayMode () {return decayMode;}
// Returns the decay mode
inline G4double GetDaughterExcitation () {return daughterExcitation;}
// Returns the excitaion energy of the daughter nuclide
inline G4ParticleDefinition* GetDaughterNucleus () {return daughterNucleus;}
// Returns the daughter nuclide.
private:
G4NuclearDecayChannel(const G4String& theName, const G4String& theParentName,
G4double theBR, G4int theNumberOfDaughters,
const G4String theDaughterName1,
const G4String theDaughterName2,
const G4String theDaughterName3,
const G4String theDaughterName4);
G4NuclearDecayChannel(const G4String& theParentName,
G4double theBR, G4int theNumberOfDaughters,
const G4String& theDaughterName1,
const G4String& theDaughterName2 = "",
const G4String& theDaughterName3 = "");
G4NuclearDecayChannel(const G4String& theParentName,
G4double theParentMass, G4double theBR,
G4int theNumberOfDaughters,
const G4String& theDaughterName1,
const G4String& theDaughterName2 = "",
const G4String& theDaughterName3 = "");
void FillDaughterNucleus(G4int index, G4int A, G4int Z,
G4double theDaughterExcitation);
G4DecayProducts* BetaDecayIt();
// to replace the ThreeBodyDecayIt() to generate the correct beta spectrum
// Add copy and assignment prototypes even though no dynamic allocation
// of class members
G4NuclearDecayChannel(const G4NuclearDecayChannel &right);
G4NuclearDecayChannel& operator=(const G4NuclearDecayChannel &right);
protected:
//Data members marked with G4ThreadLocal are not invariant among threads
//Need to make them TLS
const G4RadioactiveDecayMode decayMode;
static const G4double pTolerance;
static const G4double levelTolerance;
G4double daughterExcitation;
G4int daughterA;
G4int daughterZ;
G4ParticleDefinition* daughterNucleus;
static G4ThreadLocal G4DynamicParticle* dynamicDaughter;
const G4double Qtransition;
G4double halflifethreshold;
G4bool applyICM;
G4bool applyARM;
G4RandGeneral* RandomEnergy; // not dynamically allocated
};
#endif
@@ -53,7 +53,7 @@
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
////////////////////////////////////////////////////////////////////////////////
//
#include <vector>
#include <map>
#include <CLHEP/Units/SystemOfUnits.h>
@@ -70,11 +70,13 @@
#include "G4RIsotopeTable.hh"
#include "G4RadioactivityTable.hh"
#include "G4ThreeVector.hh"
#include "G4Threading.hh"
class G4RadioactiveDecaymessenger;
typedef std::vector<G4RadioactiveDecayRateVector> G4RadioactiveDecayRateTable;
typedef std::vector<G4RadioactiveDecayRate> G4RadioactiveDecayRates;
typedef std::map<G4String, G4DecayTable*> DecayTableMap;
class G4RadioactiveDecay : public G4VRestDiscreteProcess
@@ -94,40 +96,40 @@ class G4RadioactiveDecay : public G4VRestDiscreteProcess
G4RadioactiveDecay(const G4String& processName="RadioactiveDecay");
~G4RadioactiveDecay();
G4bool IsApplicable(const G4ParticleDefinition&);
// Returns true if the specified isotope is
// Return true if the specified isotope is
// 1) defined as "nucleus" and
// 2) it is within theNucleusLimit
G4bool IsApplicable(const G4ParticleDefinition&);
G4bool IsLoaded(const G4ParticleDefinition &);
// Returns true if the decay table of the specified nucleus is ready
// Return decay table if it exists, if not, load it from file
G4DecayTable* GetDecayTable(G4ParticleDefinition*);
void SelectAVolume(const G4String aVolume);
// Select a logical volume in which RDM applies
void SelectAVolume(const G4String aVolume);
// Remove a logical volume from the RDM applied list
void DeselectAVolume(const G4String aVolume);
// remove a logical volume from the RDM applied list
void SelectAllVolumes();
// Select all logical volumes for the application of RDM
void SelectAllVolumes();
void DeselectAllVolumes();
// Remove all logical volumes from RDM applications
void DeselectAllVolumes();
void SetDecayBias (G4String filename);
// Sets the decay biasing scheme using the data in "filename"
// Set the decay biasing scheme using the data in "filename"
void SetDecayBias(G4String filename);
void SetHLThreshold (G4double hl) {halflifethreshold = hl;}
// Set the half-life threshold for isomer production
void SetHLThreshold(G4double hl) {halflifethreshold = hl;}
void SetICM (G4bool icm) {applyICM = icm;}
// Enable/disable ICM
// Enable/disable ICM
void SetICM(G4bool icm) {applyICM = icm;}
void SetARM (G4bool arm) {applyARM = arm;}
// Enable/disable ARM
void SetARM(G4bool arm) {applyARM = arm;}
void SetSourceTimeProfile (G4String filename) ;
// Sets source exposure function using histograms in "filename"
// Set source exposure function using histograms in "filename"
void SetSourceTimeProfile(G4String filename);
G4bool IsRateTableReady(const G4ParticleDefinition &);
// Returns true if the coefficient and decay time table for all the
@@ -155,16 +157,14 @@ class G4RadioactiveDecay : public G4VRestDiscreteProcess
{return theRadioactivityTables;}
// Return vector of G4Radioactivity map - should be used in VR mode only
G4DecayTable *LoadDecayTable (G4ParticleDefinition & theParentNucleus);
G4DecayTable* LoadDecayTable(G4ParticleDefinition& theParentNucleus);
// Load the decay data of isotope theParentNucleus
void AddUserDecayDataFile(G4int Z, G4int A,G4String filename);
//Allow the user to replace the radio-active decay data provided in Geant4
// Allow the user to replace the radio-active decay data provided in Geant4
// by its own data file for a given isotope
inline void SetVerboseLevel(G4int value) {verboseLevel = value;}
// Sets the VerboseLevel which controls duggering display
@@ -269,8 +269,6 @@ class G4RadioactiveDecay : public G4VRestDiscreteProcess
G4NucleusLimits theNucleusLimits;
G4double HighestValue;
G4bool isInitialised;
G4bool AnalogueMC;
G4bool BRBias;
@@ -293,7 +291,6 @@ class G4RadioactiveDecay : public G4VRestDiscreteProcess
G4double DBin[100];
G4double DProfile[100];
std::vector<G4String> LoadedNuclei;
std::vector<G4String> ValidVolumes;
bool isAllVolumesMode;
@@ -310,6 +307,11 @@ class G4RadioactiveDecay : public G4VRestDiscreteProcess
//User define radioactive decay data files replacing some files in the G4RADECAY database
std::map<G4int, G4String> theUserRadioactiveDataFiles;
// Library of decay tables
DecayTableMap* dkmap;
#ifdef G4MULTITHREADED
static DecayTableMap* master_dkmap;
#endif
// Remainder of life time at rest
G4double fRemainderLifeTime;
@@ -338,6 +340,11 @@ class G4RadioactiveDecay : public G4VRestDiscreteProcess
G4VParticleChange* PostStepDoIt(const G4Track& theTrack,
const G4Step& theStep)
{return DecayIt(theTrack, theStep);}
#ifdef G4MULTITHREADED
public:
static G4Mutex radioactiveDecayMutex;
#endif
};
#endif
@@ -62,7 +62,7 @@
////////////////////////////////////////////////////////////////////////////////
//
enum G4RadioactiveDecayMode
{ERROR=-1, IT=0, BetaMinus=1, BetaPlus=2, KshellEC=3, LshellEC=4, MshellEC=5, Alpha=6,
{RDM_ERROR=-1, IT=0, BetaMinus=1, BetaPlus=2, KshellEC=3, LshellEC=4, MshellEC=5, Alpha=6,
SpFission=7};
std::istream &operator >> (std::istream &s, G4RadioactiveDecayMode &q);