Import Geant4 10.4.0 source tree

This commit is contained in:
Gabriele Cosmo
2017-12-08 12:52:30 +01:00
parent 98e455a940
commit fc6af9e721
2166 changed files with 276760 additions and 100873 deletions
@@ -1,4 +1,4 @@
$Id: History 104801 2017-06-19 07:10:39Z gcosmo $
$Id: History 107157 2017-11-03 11:27:29Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,37 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
03.11.1017 V.Ivanchenko, emlowen-V10-03-19
- G4RayleighScattering - added C++11 keywords to fix compilation warning at clang
02.11.2017 V.Ivanchenko, emlowen-V10-03-18
- G4LivermorePhotoElectricModel - fixed messages in the case of G4Exception
01.11.1017 D.Sawkey, emlowen-V10-03-17
- G4RayleighScattering - add ProcessDescription
20.10.2017 V.Ivanchenko, emlowen-V10-03-16
- G4LivermorePhotoElectricModel - (M. Bandieramonte) changed dataset
to G4EMLOW7.2, where parameterisation is in the livermore/phot_epics2014
10.10.2017 L.Pandola, emlowen-V10-03-15
- added protection against (rare) infinite loops in
G4PenelopeOscillatorManager, happening for materials made by >20 elements
14.09.2017 V.Ivanchenko, emlowen-V10-03-14
- G4hICRU49He - fixed Coverity warning
01.09.2017 V.Ivanchenko, emlowen-V10-03-13
- G4LivermorePhotoElectricModel - (M. Bandieramonte) new method of
parameterisations based on epics2014 data (required G4EMLOW7.1)
03.08.2017 V.Ivanchenko, emlowen-V10-03-12
- G4MicroElecElastic, G4MicroElecInelastic - make coherent
initialsation of models
02.08.2017 V.Ivanchenko, emlowen-V10-03-11
- G4LowECapture - added scaling of energy threshold for ions
17.06.2017 S.Incerti, emlowen-V10-03-10
- bugzilla 1980 and C++ nullptr in G4LivermorePhotoElectricModel
@@ -44,8 +75,8 @@ committal in the CVS repository !
10.05.2017 V.Ivanchenko, emlowen-V10-03-03
- G4CrossSectionDataSet, G4MuElecCrossSectionDataSet - fixed gcc 7.1 warnings
30.01.2016 JMC Brow, S. Incerti, emlowen-V10-03-02
- fix of G4LowEPPolarizedComptonModel
30.01.2017 JMC Brow, S. Incerti, emlowen-V10-03-02
- G4LowEPPolarizedComptonModel - fixed FPE in comptation of std::acos
19.12.2016 S. Incerti, emlowen-V10-03-01
- extended coverage of shell ionisation models by M. Reis and A. Taborda
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4LivermorePhotoElectricModel.hh 104410 2017-05-30 07:17:09Z gcosmo $
// $Id: G4LivermorePhotoElectricModel.hh 106173 2017-09-15 13:05:16Z gcosmo $
//
// Author: Sebastien Incerti
// 30 October 2008
@@ -33,7 +33,7 @@
// Main cuts from G4ProductionCutsTable are always used
// 30 May 2011 A Mantero & V Ivanchenko Migration to model design for deexcitation
// 22 Oct 2012 A & V Ivanchenko Migration data structure to G4PhysicsVector
//
// 1 June 2017 M Bandieramonte
#ifndef G4LivermorePhotoElectricModel_h
@@ -49,79 +49,82 @@ class G4LPhysicsFreeVector;
class G4LivermorePhotoElectricModel : public G4VEmModel
{
public:
G4LivermorePhotoElectricModel(const G4String& nam = "LivermorePhElectric");
virtual ~G4LivermorePhotoElectricModel();
virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
virtual G4double CrossSectionPerVolume(const G4Material*,
const G4ParticleDefinition*,
G4double energy,
G4double cutEnergy = 0.0,
G4double maxEnergy = DBL_MAX);
virtual G4double ComputeCrossSectionPerAtom(
const G4ParticleDefinition*,
G4double energy,
G4double Z,
G4double A=0.,
G4double cut=0.,
G4double emax=DBL_MAX);
virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double tmin,
G4double maxEnergy);
virtual void InitialiseForElement(const G4ParticleDefinition*, G4int Z);
inline void SetLimitNumberOfShells(G4int);
G4LivermorePhotoElectricModel(const G4String& nam = "LivermorePhElectric");
virtual ~G4LivermorePhotoElectricModel();
virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
virtual G4double CrossSectionPerVolume(const G4Material*,
const G4ParticleDefinition*,
G4double energy,
G4double cutEnergy = 0.0,
G4double maxEnergy = DBL_MAX);
virtual G4double ComputeCrossSectionPerAtom(
const G4ParticleDefinition*,
G4double energy,
G4double Z,
G4double A=0,
G4double cut=0,
G4double emax=DBL_MAX);
virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double tmin,
G4double maxEnergy);
virtual void InitialiseForElement(const G4ParticleDefinition*, G4int Z);
inline void SetLimitNumberOfShells(G4int);
G4double GetBindingEnergy (G4double ZZ, G4int shell);
G4LivermorePhotoElectricModel & operator=
(const G4LivermorePhotoElectricModel &right) = delete;
G4LivermorePhotoElectricModel(const G4LivermorePhotoElectricModel&) = delete;
protected:
G4ParticleChangeForGamma* fParticleChange;
G4ParticleChangeForGamma* fParticleChange;
private:
void ReadData(G4int Z, const char* path = nullptr);
G4LivermorePhotoElectricModel & operator=(const G4LivermorePhotoElectricModel &right);
G4LivermorePhotoElectricModel(const G4LivermorePhotoElectricModel&);
G4ParticleDefinition* theGamma;
G4ParticleDefinition* theElectron;
G4int verboseLevel;
G4int maxZ;
G4int nShellLimit;
G4bool fDeexcitationActive;
G4bool isInitialised;
static G4LPhysicsFreeVector* fCrossSection[99];
static G4LPhysicsFreeVector* fCrossSectionLE[99];
static std::vector<G4double>* fParam[99];
static G4int fNShells[99];
static G4int fNShellsUsed[99];
static G4ElementData* fShellCrossSection;
static G4Material* fWater;
static G4double fWaterEnergyLimit;
G4VAtomDeexcitation* fAtomDeexcitation;
G4double fCurrSection;
std::vector<G4double> fSandiaCof;
void ReadData(G4int Z, const char* path = nullptr);
G4ParticleDefinition* theGamma;
G4ParticleDefinition* theElectron;
G4int verboseLevel;
G4int maxZ;
G4int nShellLimit;
G4bool fDeexcitationActive;
G4bool isInitialised;
static G4LPhysicsFreeVector* fCrossSection[99];
static G4LPhysicsFreeVector* fCrossSectionLE[99];
static std::vector<G4double>* fParamHigh[99];
static std::vector<G4double>* fParamLow[99];
static G4int fNShells[99];
static G4int fNShellsUsed[99];
static G4ElementData* fShellCrossSection;
static G4Material* fWater;
static G4double fWaterEnergyLimit;
G4VAtomDeexcitation* fAtomDeexcitation;
G4double fCurrSection;
std::vector<G4double> fSandiaCof;
};
inline
void G4LivermorePhotoElectricModel::SetLimitNumberOfShells(G4int n)
{
nShellLimit = n;
nShellLimit = n;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -94,6 +94,7 @@ private:
G4LowECapture& operator = (const G4LowECapture &right);
G4double kinEnergyThreshold;
G4bool isIon;
G4int nRegions;
std::vector<G4String> regionName;
std::vector<const G4Region*> region;
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4RayleighScattering.hh 66241 2012-12-13 18:34:42Z gunter $
// $Id: G4RayleighScattering.hh 107157 2017-11-03 11:27:29Z gcosmo $
//
//------------------ G4RayleighScattering physics process -----------------------
//
@@ -53,24 +53,30 @@ class G4RayleighScattering : public G4VEmProcess
{
public: // with description
G4RayleighScattering(const G4String& processName ="Rayl",
G4ProcessType type = fElectromagnetic);
explicit G4RayleighScattering(const G4String& processName ="Rayl",
G4ProcessType type = fElectromagnetic);
virtual ~G4RayleighScattering();
// true for Gamma only.
G4bool IsApplicable(const G4ParticleDefinition&);
G4bool IsApplicable(const G4ParticleDefinition&) final;
// Print few lines of informations about the process: validity range,
virtual void PrintInfo();
virtual void PrintInfo() override;
// print description in html
virtual void ProcessDescription(std::ostream&) const override;
protected:
virtual void InitialiseProcess(const G4ParticleDefinition*);
virtual void InitialiseProcess(const G4ParticleDefinition*) override;
private:
// hide assignment operator
G4RayleighScattering & operator=(const G4RayleighScattering &right) = delete;
G4RayleighScattering(const G4RayleighScattering&) = delete;
G4bool isInitialised;
};
File diff suppressed because it is too large Load Diff
@@ -49,7 +49,7 @@
G4LowECapture::G4LowECapture(G4double ekinlim)
: G4VDiscreteProcess("Capture", fElectromagnetic),
kinEnergyThreshold(ekinlim),
kinEnergyThreshold(ekinlim), isIon(false),
nRegions(0)
{}
@@ -87,7 +87,7 @@ void G4LowECapture::AddRegion(const G4String& nam)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4LowECapture::BuildPhysicsTable(const G4ParticleDefinition&)
void G4LowECapture::BuildPhysicsTable(const G4ParticleDefinition& part)
{
G4RegionStore* store = G4RegionStore::GetInstance();
for(G4int i=0; i<nRegions; ++i) {
@@ -100,6 +100,15 @@ void G4LowECapture::BuildPhysicsTable(const G4ParticleDefinition&)
if(r) { region.push_back(r); }
}
nRegions = region.size();
// ions reusing G4GenericIon parameters
if(part.GetParticleType() == "nucleus") {
G4String pname = part.GetParticleName();
if(pname != "deuteron" && pname != "triton" &&
pname != "alpha" && pname != "He3" &&
pname != "alpha+" && pname != "helium" &&
pname != "hydrogen") { isIon = true; }
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -114,7 +123,11 @@ G4double G4LowECapture::PostStepGetPhysicalInteractionLength(
{
*condition = NotForced;
G4double limit = DBL_MAX;
if(aTrack.GetKineticEnergy() < kinEnergyThreshold) {
G4double eLimit = kinEnergyThreshold;
if(isIon) {
eLimit *= aTrack.GetDefinition()->GetPDGMass()/CLHEP::proton_mass_c2;
}
if(aTrack.GetKineticEnergy() < eLimit) {
for(G4int i=0; i<nRegions; ++i) {
if(aTrack.GetVolume()->GetLogicalVolume()->GetRegion() == region[i]) {
limit = 0.0;
@@ -1,4 +1,3 @@
//
// ********************************************************************
// * License and Disclaimer *
@@ -69,8 +69,8 @@ void G4MicroElecElastic::InitialiseProcess(const G4ParticleDefinition*)
{
isInitialised = true;
SetBuildTableFlag(false);
if(!EmModel(1)) SetEmModel(new G4DummyModel(), 1);
AddEmModel(2, EmModel(1));
if(!EmModel()) SetEmModel(new G4DummyModel());
AddEmModel(2, EmModel());
}
}
@@ -82,8 +82,8 @@ void G4MicroElecInelastic::InitialiseProcess(const G4ParticleDefinition* p)
SetBuildTableFlag(false);
G4String name = p->GetParticleName();
if(!EmModel(1)) SetEmModel(new G4DummyModel(), 1);
AddEmModel(2, EmModel(1));
if(!EmModel()) SetEmModel(new G4DummyModel());
AddEmModel(2, EmModel());
}
}
@@ -802,7 +802,6 @@ void G4PenelopeOscillatorManager::BuildOscillatorTable(const G4Material* materia
if (verbosityLevel > 1)
G4cout << "Cutoff energy: " << cutEnergy/eV << " eV" << G4endl;
//
//Copy helper in the oscillatorTable for Ionisation
//
@@ -826,12 +825,14 @@ void G4PenelopeOscillatorManager::BuildOscillatorTable(const G4Material* materia
size_t firstIndex = (isAConductor) ? 1 : 0; //for conductors, skip conduction oscillator
G4bool loopAgain = false;
G4int nLoops = 0;
G4int removedLevels = 0;
do
{
loopAgain = false;
nLoops++;
if (Nost>firstIndex+1)
{
{
removedLevels = 0;
for (size_t i=firstIndex;i<theTable->size()-1;i++)
{
@@ -899,6 +900,9 @@ void G4PenelopeOscillatorManager::BuildOscillatorTable(const G4Material* materia
Rgroup = Rgroup*Rgroup;
loopAgain = true;
}
//Add protection against infinite loops here
if (nLoops > 100 && !removedLevels)
loopAgain = false;
}while(loopAgain);
if (verbosityLevel > 1)
@@ -952,6 +956,7 @@ void G4PenelopeOscillatorManager::BuildOscillatorTable(const G4Material* materia
removedLevels = 0;
do
{
nLoops++;
loopAgain = false;
if (Nost>firstIndex+1)
{
@@ -1009,6 +1014,9 @@ void G4PenelopeOscillatorManager::BuildOscillatorTable(const G4Material* materia
Rgroup = Rgroup*Rgroup;
loopAgain = true;
}
//Add protection against infinite loops here
if (nLoops > 100 && !removedLevels)
loopAgain = false;
}while(loopAgain);
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4RayleighScattering.cc 66241 2012-12-13 18:34:42Z gunter $
// $Id: G4RayleighScattering.cc 107118 2017-11-02 15:10:19Z gcosmo $
//
//
// 19-12-2008, first implementation, Luciano Pandola
@@ -78,3 +78,11 @@ void G4RayleighScattering::PrintInfo()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4RayleighScattering::ProcessDescription(std::ostream& out) const
{
out << "<strong>Rayleigh scattering</strong>";
G4VEmProcess::ProcessDescription(out);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -176,7 +176,7 @@ G4double G4hICRU49He::StoppingPower(const G4Material* material,
G4Exp(-c[iMolecula][4]*std::pow(T0,-c[iMolecula][6])) +
c[iMolecula][3]/(T0*T0) ;
ionloss *= std::sqrt(T/T0) ;
ionloss = a1*a2*std::sqrt(T/T0) ;
// Main parametrisation
} else {
@@ -184,13 +184,14 @@ G4double G4hICRU49He::StoppingPower(const G4Material* material,
a2 = (c[iMolecula][0]*std::log(T)/T + c[iMolecula][2]/T) *
G4Exp(-c[iMolecula][4]*std::pow(T,-c[iMolecula][6])) +
c[iMolecula][3]/(T*T) ;
ionloss = a1*a2;
}
// He effective charge
G4double z = (material->GetTotNbOfElectPerVolume()) /
(material->GetTotNbOfAtomsPerVolume()) ;
ionloss = a1*a2 / HeEffChargeSquare(z, kineticEnergy*rateMass) ;
ionloss /= HeEffChargeSquare(z, kineticEnergy*rateMass) ;
if ( ionloss < 0.0) ionloss = 0.0 ;
}