Import Geant4 11.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2022-12-09 14:43:28 +01:00
parent c07cea1fe0
commit 9f34590941
3810 changed files with 200490 additions and 182326 deletions
@@ -1,43 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4DynamicParticleFastVector
// Author: G.Cosmo, 2 December 1995
// --------------------------------------------------------------------
#ifndef G4DynamicParticleFastVector_hh
#define G4DynamicParticleFastVector_hh 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4FastVector.hh"
class G4DynamicParticle;
using G4DynamicParticleFastVector = G4FastVector<G4DynamicParticle,512>;
// Contains pointers to G4DynamicParticle objects which are
// generated by either primary or secondary interaction.
#endif
@@ -57,18 +57,21 @@ class G4NuclideTable : public G4VIsotopeTable
virtual ~G4NuclideTable();
G4NuclideTable ( const G4NuclideTable& ) = delete;
G4NuclideTable& operator=( const G4NuclideTable& ) = delete;
G4NuclideTable (const G4NuclideTable&) = delete;
G4NuclideTable& operator = (const G4NuclideTable&) = delete;
static G4NuclideTable* GetInstance();
static G4NuclideTable* GetNuclideTable();
void GenerateNuclide();
void SetThresholdOfHalfLife( G4double );
void SetThresholdOfHalfLife(G4double);
inline G4double GetThresholdOfHalfLife();
inline void SetLevelTolerance( G4double x );
void SetMeanLifeThreshold(G4double);
inline G4double GetMeanLifeThreshold();
inline void SetLevelTolerance(G4double x);
inline G4double GetLevelTolerance();
void AddState(G4int, G4int, G4double, G4double,
@@ -97,9 +100,9 @@ class G4NuclideTable : public G4VIsotopeTable
// utility methods
static G4double GetTruncationError( G4double eex );
static G4double Round( G4double eex );
static G4long Truncate( G4double eex );
static G4double GetTruncationError(G4double eex);
static G4double Round(G4double eex);
static G4long Truncate(G4double eex);
static G4double Tolerance();
private:
@@ -107,23 +110,21 @@ class G4NuclideTable : public G4VIsotopeTable
G4NuclideTable();
G4double StripFloatLevelBase(G4double E, G4int& flbIndex);
G4Ions::G4FloatLevelBase StripFloatLevelBase( const G4String& );
G4Ions::G4FloatLevelBase StripFloatLevelBase(const G4String&);
private:
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
G4double mean_life_threshold = 0.0;
G4double minimum_mean_life_threshold = DBL_MAX;
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
// pre_load_list: contains state data for current run defined
// by mean_life_threshold
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
// full_list: keeps all state data during running application
// defined by minimum_mean_life_threshold
enum { idxZ=0, idxA, idxEnergy, idxLife, idxSpin, idxMu };
// Table of Nuclide Property
@@ -146,11 +147,17 @@ class G4NuclideTable : public G4VIsotopeTable
inline
G4double G4NuclideTable::GetThresholdOfHalfLife()
{
return threshold_of_half_life;
return mean_life_threshold*0.69314718;
}
inline
void G4NuclideTable::SetLevelTolerance( G4double x )
G4double G4NuclideTable::GetMeanLifeThreshold()
{
return mean_life_threshold;
}
inline
void G4NuclideTable::SetLevelTolerance(G4double x)
{
flevelTolerance = x;
}
@@ -164,19 +171,19 @@ G4double G4NuclideTable::GetLevelTolerance()
inline
std::size_t G4NuclideTable::GetSizeOfIsotopeList()
{
return ( fIsotopeList ? fIsotopeList->size() : static_cast<size_t>(0) );
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) );
return (fIsotopeList ? fIsotopeList->size() : std::size_t(0) );
}
inline
G4IsotopeProperty* G4NuclideTable::GetIsotopeByIndex(std::size_t idx) const
{
if ( fIsotopeList && idx<fIsotopeList->size()) return (*fIsotopeList)[idx];
if (fIsotopeList && idx<fIsotopeList->size() ) return (*fIsotopeList)[idx];
else return nullptr;
}
@@ -63,7 +63,8 @@ class G4NuclideTableMessenger : public G4UImessenger
G4NuclideTable* theNuclideTable = nullptr;
G4UIdirectory* thisDirectory = nullptr;
G4UIcmdWithADoubleAndUnit* lifetimeCmd = nullptr;
G4UIcmdWithADoubleAndUnit* halflifeCmd = nullptr;
G4UIcmdWithADoubleAndUnit* meanlifeCmd = nullptr;
G4UIcmdWithADoubleAndUnit* lToleranceCmd = nullptr;
};
@@ -223,9 +223,11 @@ G4bool G4ParticleDefinition::IsHypernucleus() const
inline
G4int G4ParticleDefinition::GetNumberOfLambdasInHypernucleus() const
{
// PDG code of hypernuclei: 10LZZZAAAI
G4int numberOfLambdas = 0;
if ( thePDGEncoding > 0 ) numberOfLambdas = (thePDGEncoding/10000000)%100;
// PDG code of hypernuclei: 10LZZZAAAI
if ( thePDGEncoding > 0 && thePDGEncoding/1000000000 != 0 ) {
numberOfLambdas = (thePDGEncoding/10000000)%100;
}
return numberOfLambdas;
}
@@ -239,8 +241,10 @@ G4bool G4ParticleDefinition::IsAntiHypernucleus() const
inline
G4int G4ParticleDefinition::GetNumberOfAntiLambdasInAntiHypernucleus() const
{
// PDG code of anti-hypernuclei: -10LZZZAAAI
G4int numberOfAntiLambdas = 0;
if ( thePDGEncoding < 0 ) numberOfAntiLambdas = (std::abs(thePDGEncoding)/10000000)%100;
// PDG code of anti-hypernuclei: -10LZZZAAAI
if ( thePDGEncoding < 0 && thePDGEncoding/1000000000 != 0 ) {
numberOfAntiLambdas = (std::abs(thePDGEncoding)/10000000)%100;
}
return numberOfAntiLambdas;
}