Import Geant4 10.7.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2020-06-26 10:23:25 +02:00
parent c02c370437
commit 67ba86d073
1871 changed files with 174422 additions and 131884 deletions
@@ -23,23 +23,22 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
#ifndef G4NuclideTable_h
#define G4NuclideTable_h 1
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// G4NuclideTable
//
// MODULE: G4NuclideTable.hh
// Class description:
//
// Date: 10/10/13
// Author: T.Koi
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// HISTORY
// Based on G4IsomerTable
//
///////////////////////////////////////////////////////////////////////////////
// Table of pointers to G4IsotopeProperty, which has magnetic moment
// and spin. Data File name is given by G4ENSDFSTATEDATA.
// Table based on G4IsomerTable.
// Author: T.Koi, SLAC - 10 October 2013
// --------------------------------------------------------------------
#ifndef G4NuclideTable_hh
#define G4NuclideTable_hh 1
#include <vector>
#include <cmath>
//
#include "globals.hh"
#include "G4IsotopeProperty.hh"
#include "G4VIsotopeTable.hh"
@@ -48,138 +47,137 @@
#include "G4IonTable.hh"
#include "G4DecayTable.hh"
#include <vector>
#include <cmath>
class G4NuclideTableMessenger;
////////////////////////////////////////////////////////////////////////////////
//
class G4NuclideTable : public G4VIsotopeTable
{
// class description
// G4NuclideTable is the table of pointers to G4IsotopeProperty,
// which has magnetic moment and spin.
// Data File name is given by G4ENSDFSTATEDATA
//
//
private:
G4NuclideTable();
//G4NuclideTable ( const G4NuclideTable& p ){};
//G4NuclideTable& operator=( const G4NuclideTable& p ){};
public:
public:
static G4NuclideTable* GetInstance();
static G4NuclideTable* GetNuclideTable() { return GetInstance(); };
public:
typedef std::vector<G4IsotopeProperty*> G4IsotopeList;
using G4IsotopeList = std::vector<G4IsotopeProperty*>;
protected:
void FillHardCodeList();
virtual ~G4NuclideTable();
public:
// destructor
virtual ~G4NuclideTable();
G4NuclideTable ( const G4NuclideTable& ) = delete;
G4NuclideTable& operator=( const G4NuclideTable& ) = delete;
public:
static G4NuclideTable* GetInstance();
static G4NuclideTable* GetNuclideTable();
//
void GenerateNuclide();
void GenerateNuclide();
void SetThresholdOfHalfLife( G4double );
G4double GetThresholdOfHalfLife() { return threshold_of_half_life; };
void SetThresholdOfHalfLife( G4double );
inline G4double GetThresholdOfHalfLife();
void SetLevelTolerance( G4double x ) { flevelTolerance=x;};
G4double GetLevelTolerance() { return flevelTolerance; };
inline void SetLevelTolerance( G4double x );
inline G4double GetLevelTolerance();
void AddState(G4int,G4int,G4double,G4double,G4int ionJ=0,G4double ionMu=0.0);
void AddState(G4int,G4int,G4double,G4int,G4double,G4int ionJ=0,G4double ionMu=0.0);
void AddState(G4int,G4int,G4double,G4Ions::G4FloatLevelBase,G4double,G4int ionJ=0,G4double ionMu=0.0);
//G4bool Exists(G4double,G4double,G4double);
void AddState(G4int, G4int, G4double, G4double,
G4int ionJ=0, G4double ionMu=0.0);
void AddState(G4int, G4int, G4double, G4int, G4double,
G4int ionJ=0, G4double ionMu=0.0);
void AddState(G4int, G4int, G4double, G4Ions::G4FloatLevelBase, G4double,
G4int ionJ=0, G4double ionMu=0.0);
inline std::size_t GetSizeOfIsotopeList();
//Use GetIsotope(G4int Z, G4int A, G4double E)
//void FillProperty(G4ParticleDefinition*);
size_t GetSizeOfIsotopeList()
{ return ( fIsotopeList ? fIsotopeList->size() : static_cast<size_t>(0)) ; };
//
// with description
//
virtual G4IsotopeProperty* GetIsotope(G4int Z, G4int A, G4double E,
virtual G4IsotopeProperty* GetIsotope(G4int Z, G4int A, G4double E,
G4Ions::G4FloatLevelBase flb=G4Ions::G4FloatLevelBase::no_Float);
virtual G4IsotopeProperty* GetIsotopeByIsoLvl(G4int Z, G4int A, G4int lvl=0);
//
// again it will replace the pure virtual one in the abstract base class.
//
// Z: Atomic Number
// A: Atomic Mass
// E: Excitaion energy
// flb: floating level base (enum defined in G4Ions.hh)
// or
// lvl: isomer level
//
virtual G4IsotopeProperty* GetIsotopeByIsoLvl(G4int Z, G4int A,
G4int lvl=0);
// It will replace the pure virtual one in the abstract base class.
// Z: Atomic Number
// A: Atomic Mass
// E: Excitaion energy
// flb: floating level base (enum defined in G4Ions.hh)
// or
// lvl: isomer level
size_t entries() const;
G4IsotopeProperty* GetIsotopeByIndex(size_t idx) const;
inline std::size_t entries() const;
inline G4IsotopeProperty* GetIsotopeByIndex(std::size_t idx) const;
public:
// utility methods
static inline G4double GetTrancationError( G4double eex )
{ G4double tolerance= G4NuclideTable::GetInstance()->GetLevelTolerance();
return eex - (G4long)(eex/tolerance)*tolerance; }
static inline G4double Round( G4double eex )
{ G4double tolerance= G4NuclideTable::GetInstance()->GetLevelTolerance();
return round(eex/tolerance)*tolerance; }
static inline G4long Trancate( G4double eex )
{ G4double tolerance= G4NuclideTable::GetInstance()->GetLevelTolerance();
return (G4long)(eex/tolerance); }
static inline G4double Tolerance()
{ return G4NuclideTable::GetInstance()->GetLevelTolerance(); }
// utility methods
private:
static G4double GetTruncationError( G4double eex );
static G4double Round( G4double eex );
static G4long Truncate( G4double eex );
static G4double Tolerance();
G4double threshold_of_half_life; //threshold values of half-life of current run
G4double minimum_threshold_of_half_life; //The minimum value of threshold values of half-life during entire runs
G4IsotopeList* fUserDefinedList;
private:
//Design Change on v10.02
//pre_load_list: Having state data for current run defined by threshold_of_half_life
//full_list:Keeping all state data during running application defined by minimum_threshold_of_half_life
// ionCode Ex. Energy
std::map< G4int , std::multimap< G4double , G4IsotopeProperty* > > map_pre_load_list;
std::map< G4int , std::multimap< G4double , G4IsotopeProperty* > > map_full_list;
G4NuclideTable();
// Table of Nuclide Property
// 0: Z
// 1: A
// 2: Energy [keV]
// 3: Life Time [ns]
// 4: Spin [h_bar/2]
// 5: Magnetic Moment [joule/tesla]
enum {idxZ=0, idxA,idxEnergy, idxLife, idxSpin, idxMu };
G4double StripFloatLevelBase(G4double E, G4int& flbIndex);
G4Ions::G4FloatLevelBase StripFloatLevelBase( const G4String& );
G4IsotopeList* fIsotopeList;
G4double flevelTolerance;
G4NuclideTableMessenger* fMessenger;
private:
private:
G4double StripFloatLevelBase(G4double E, G4int& flbIndex);
G4Ions::G4FloatLevelBase StripFloatLevelBase( G4String );
G4double threshold_of_half_life = 0.0;
// threshold values of half-life of current run
G4double minimum_threshold_of_half_life = DBL_MAX;
// The minimum value of threshold values of half-life during entire runs
G4IsotopeList* fUserDefinedList = nullptr;
std::map<G4int, std::multimap<G4double, G4IsotopeProperty*> > map_pre_load_list;
// pre_load_list: having state data for current run defined
// by threshold_of_half_life
std::map<G4int, std::multimap<G4double, G4IsotopeProperty*> > map_full_list;
// full_list: keeping all state data during running application
// defined by minimum_threshold_of_half_life
enum { idxZ=0, idxA, idxEnergy, idxLife, idxSpin, idxMu };
// Table of Nuclide Property
// 0: Z
// 1: A
// 2: Energy [keV]
// 3: Life Time [ns]
// 4: Spin [h_bar/2]
// 5: Magnetic Moment [joule/tesla]
G4IsotopeList* fIsotopeList = nullptr;
G4double flevelTolerance = 0.0;
G4NuclideTableMessenger* fMessenger = nullptr;
};
// ------------------------
// Inline methods
// ------------------------
inline
size_t G4NuclideTable::entries() const
G4double G4NuclideTable::GetThresholdOfHalfLife()
{
return (fIsotopeList ? fIsotopeList->size() : static_cast<size_t>(0) );
return threshold_of_half_life;
}
inline
G4IsotopeProperty* G4NuclideTable::GetIsotopeByIndex(size_t idx) const
void G4NuclideTable::SetLevelTolerance( G4double x )
{
flevelTolerance = x;
}
inline
G4double G4NuclideTable::GetLevelTolerance()
{
return flevelTolerance;
}
inline
std::size_t G4NuclideTable::GetSizeOfIsotopeList()
{
return ( fIsotopeList ? fIsotopeList->size() : static_cast<size_t>(0) );
}
inline
std::size_t G4NuclideTable::entries() const
{
return ( fIsotopeList ? fIsotopeList->size() : static_cast<size_t>(0) );
}
inline
G4IsotopeProperty* G4NuclideTable::GetIsotopeByIndex(std::size_t idx) const
{
if ( fIsotopeList && idx<fIsotopeList->size()) return (*fIsotopeList)[idx];
else return 0;
else return nullptr;
}
#endif