Import Geant4 11.0.0 source tree
This commit is contained in:
committed by
Ben Morgan
parent
6399a014b6
commit
80e2389dd8
@@ -88,7 +88,7 @@ private:
|
||||
|
||||
void PrintWarning(G4int idx) const;
|
||||
|
||||
size_t nvectors;
|
||||
G4int nvectors;
|
||||
G4double emin;
|
||||
std::vector<const G4Material*> materials;
|
||||
std::vector<G4PhysicsFreeVector*> sdata;
|
||||
@@ -96,11 +96,11 @@ private:
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4int G4ASTARStopping:: GetIndex (const G4Material* mat) const
|
||||
inline G4int G4ASTARStopping::GetIndex(const G4Material* mat) const
|
||||
{
|
||||
G4int idx = -1;
|
||||
for (size_t i=0; i<nvectors; ++i){
|
||||
if (mat == materials[i]){
|
||||
for (G4int i=0; i<nvectors; ++i) {
|
||||
if (mat == materials[i]) {
|
||||
idx = i;
|
||||
break;
|
||||
}
|
||||
@@ -113,8 +113,8 @@ inline G4int G4ASTARStopping:: GetIndex (const G4Material* mat) const
|
||||
inline G4int G4ASTARStopping::GetIndex(const G4String& nam) const
|
||||
{
|
||||
G4int idx = -1;
|
||||
for (size_t i=0; i<nvectors; ++i){
|
||||
if (nam == materials[i]->GetName()){
|
||||
for (G4int i=0; i<nvectors; ++i) {
|
||||
if (nam == materials[i]->GetName()) {
|
||||
idx = i;
|
||||
break;
|
||||
}
|
||||
@@ -128,7 +128,7 @@ inline G4double
|
||||
G4ASTARStopping::GetElectronicDEDX(G4int idx, G4double energy) const
|
||||
{
|
||||
G4double res = 0.0;
|
||||
if (idx<0 || idx>= G4int(nvectors)) { PrintWarning(idx); }
|
||||
if (idx<0 || idx >= nvectors) { PrintWarning(idx); }
|
||||
if(energy < emin) { res = (*(sdata[idx]))[0]*std::sqrt(energy/emin); }
|
||||
else { res = sdata[idx]->Value(energy); }
|
||||
return res;
|
||||
|
||||
@@ -147,15 +147,14 @@ private:
|
||||
G4NistManager* nist;
|
||||
G4Pow* g4calc;
|
||||
|
||||
G4double mass;
|
||||
G4double tlimit;
|
||||
G4double spin;
|
||||
G4double magMoment2;
|
||||
G4double chargeSquare;
|
||||
G4double ratio;
|
||||
G4double formfact;
|
||||
G4double corrFactor;
|
||||
G4bool isIon;
|
||||
G4double mass = 0.0;
|
||||
G4double tlimit = DBL_MAX;
|
||||
G4double spin = 0.0;
|
||||
G4double magMoment2 = 0.0;
|
||||
G4double chargeSquare = 1.0;
|
||||
G4double ratio = 1.0;
|
||||
G4double formfact = 0.0;
|
||||
G4double corrFactor = 1.0;
|
||||
G4double MLN10;
|
||||
G4double atomic_mass_unit;
|
||||
G4double dedx_constant;
|
||||
@@ -163,6 +162,8 @@ private:
|
||||
G4double fine_structure;
|
||||
G4double domega2dx_constant;
|
||||
|
||||
G4bool isIon = false;
|
||||
|
||||
static G4double stepE;
|
||||
static G4double tableE[200];
|
||||
static const G4double element_atomic_weights[110];
|
||||
|
||||
@@ -67,15 +67,17 @@ public:
|
||||
// Sample fluctuations
|
||||
G4double SampleFluctuations(const G4MaterialCutsCouple*,
|
||||
const G4DynamicParticle*,
|
||||
G4double tmax,
|
||||
G4double length,
|
||||
G4double meanLoss) override;
|
||||
const G4double tcut,
|
||||
const G4double tmax,
|
||||
const G4double length,
|
||||
const G4double meanLoss) override;
|
||||
|
||||
// Compute dispertion
|
||||
G4double Dispersion(const G4Material*,
|
||||
const G4DynamicParticle*,
|
||||
G4double tmax,
|
||||
G4double length) override;
|
||||
const G4double tcut,
|
||||
const G4double tmax,
|
||||
const G4double length) override;
|
||||
|
||||
// Initialisation prerun
|
||||
void InitialiseMe(const G4ParticleDefinition*) override;
|
||||
|
||||
@@ -50,14 +50,12 @@
|
||||
#ifndef G4BetheBlochModel_h
|
||||
#define G4BetheBlochModel_h 1
|
||||
|
||||
#include <CLHEP/Units/SystemOfUnits.h>
|
||||
|
||||
#include "G4VEmModel.hh"
|
||||
#include "G4NistManager.hh"
|
||||
|
||||
class G4EmCorrections;
|
||||
class G4ParticleChangeForLoss;
|
||||
class G4ICRU90StoppingData;
|
||||
class G4NistManager;
|
||||
|
||||
class G4BetheBlochModel : public G4VEmModel
|
||||
{
|
||||
@@ -118,8 +116,8 @@ public:
|
||||
G4double maxEnergy) override;
|
||||
|
||||
// hide assignment operator
|
||||
G4BetheBlochModel & operator=(const G4BetheBlochModel &right) = delete;
|
||||
G4BetheBlochModel(const G4BetheBlochModel&) = delete;
|
||||
G4BetheBlochModel & operator=(const G4BetheBlochModel &right) = delete;
|
||||
G4BetheBlochModel(const G4BetheBlochModel&) = delete;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -132,58 +130,35 @@ protected:
|
||||
|
||||
private:
|
||||
|
||||
void SetupParameters();
|
||||
void SetupParameters(const G4ParticleDefinition* p);
|
||||
|
||||
inline void SetParticle(const G4ParticleDefinition* p);
|
||||
|
||||
inline void SetGenericIon(const G4ParticleDefinition* p);
|
||||
|
||||
const G4ParticleDefinition* particle;
|
||||
const G4ParticleDefinition* particle = nullptr;
|
||||
const G4ParticleDefinition* theElectron;
|
||||
G4EmCorrections* corr;
|
||||
G4ParticleChangeForLoss* fParticleChange;
|
||||
G4ParticleChangeForLoss* fParticleChange = nullptr;
|
||||
G4NistManager* nist;
|
||||
G4ICRU90StoppingData* fICRU90;
|
||||
const G4Material* currentMaterial;
|
||||
const G4Material* baseMaterial;
|
||||
G4ICRU90StoppingData* fICRU90 = nullptr;
|
||||
const G4Material* currentMaterial = nullptr;
|
||||
const G4Material* baseMaterial = nullptr;
|
||||
|
||||
G4double mass;
|
||||
G4double tlimit;
|
||||
G4double spin;
|
||||
G4double magMoment2;
|
||||
G4double chargeSquare;
|
||||
G4double ratio;
|
||||
G4double formfact;
|
||||
G4double mass = 0.0;
|
||||
G4double tlimit = DBL_MAX;
|
||||
G4double spin = 0.0;
|
||||
G4double magMoment2 = 0.0;
|
||||
G4double chargeSquare = 1.0;
|
||||
G4double ratio = 1.0;
|
||||
G4double formfact = 0.0;
|
||||
G4double twoln10;
|
||||
G4double corrFactor;
|
||||
G4double fAlphaTlimit;
|
||||
G4double fProtonTlimit;
|
||||
|
||||
G4int iICRU90;
|
||||
G4bool isIon;
|
||||
G4int iICRU90 = -1;
|
||||
G4bool isIon = false;
|
||||
G4bool isAlpha = false;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4BetheBlochModel::SetParticle(const G4ParticleDefinition* p)
|
||||
{
|
||||
if(particle != p) {
|
||||
particle = p;
|
||||
if(p->GetBaryonNumber() > 3 || p->GetPDGCharge() > CLHEP::eplus)
|
||||
{ isIon = true; }
|
||||
SetupParameters();
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4BetheBlochModel::SetGenericIon(const G4ParticleDefinition* p)
|
||||
{
|
||||
if(p && p->GetParticleName() == "GenericIon") { isIon = true; }
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4BetheBlochModel::GetChargeSquareRatio() const
|
||||
{
|
||||
return chargeSquare;
|
||||
|
||||
@@ -47,8 +47,8 @@
|
||||
// Class Description:
|
||||
//
|
||||
// Implementation of energy loss and delta-electron production
|
||||
// by heavy slow charged particles using ICRU'49 and NIST evaluated data
|
||||
// for He4 ions
|
||||
// by heavy slow charged particles using ICRU'49, NIST, and ICRU90
|
||||
// evaluated data for alpha and protons
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -56,8 +56,6 @@
|
||||
#ifndef G4BraggIonModel_h
|
||||
#define G4BraggIonModel_h 1
|
||||
|
||||
#include <CLHEP/Units/PhysicalConstants.h>
|
||||
|
||||
#include "G4VEmModel.hh"
|
||||
#include "G4ASTARStopping.hh"
|
||||
|
||||
@@ -86,24 +84,24 @@ public:
|
||||
G4double kineticEnergy,
|
||||
G4double cutEnergy,
|
||||
G4double maxEnergy);
|
||||
|
||||
|
||||
G4double ComputeCrossSectionPerAtom(
|
||||
const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
G4double Z, G4double A,
|
||||
G4double cutEnergy,
|
||||
G4double maxEnergy) override;
|
||||
|
||||
|
||||
G4double CrossSectionPerVolume(const G4Material*,
|
||||
const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
G4double cutEnergy,
|
||||
G4double maxEnergy) override;
|
||||
|
||||
|
||||
G4double ComputeDEDXPerVolume(const G4Material*,
|
||||
const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
G4double cutEnergy) override;
|
||||
const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
G4double cutEnergy) override;
|
||||
|
||||
void SampleSecondaries(std::vector<G4DynamicParticle*>*,
|
||||
const G4MaterialCutsCouple*,
|
||||
@@ -111,7 +109,7 @@ public:
|
||||
G4double tmin,
|
||||
G4double maxEnergy) override;
|
||||
|
||||
// Compute ion charge
|
||||
// Compute ion charge not applied to alpha
|
||||
G4double GetChargeSquareRatio(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double kineticEnergy) override;
|
||||
@@ -139,60 +137,49 @@ private:
|
||||
|
||||
void SetParticle(const G4ParticleDefinition* p);
|
||||
|
||||
G4double HeEffChargeSquare(G4double z, G4double kinEnergyInMeV) const;
|
||||
G4double HeEffChargeSquare(const G4double z,
|
||||
const G4double kinEnergyInMeV) const;
|
||||
|
||||
void HasMaterial(const G4Material* material);
|
||||
G4int HasMaterial(const G4Material* material) const;
|
||||
|
||||
G4double StoppingPower(const G4Material* material,
|
||||
G4double kineticEnergy);
|
||||
G4double StoppingPower(const G4Material* material,
|
||||
const G4double kinEnergy) const;
|
||||
|
||||
G4double ElectronicStoppingPower(G4double z,
|
||||
G4double kineticEnergy) const;
|
||||
G4double ElectronicStoppingPower(const G4double z,
|
||||
const G4double kinEnergy) const;
|
||||
|
||||
G4double DEDX(const G4Material* material, G4double kineticEnergy);
|
||||
G4double DEDX(const G4Material* material, const G4double kinEnergy);
|
||||
|
||||
G4EmCorrections* corr = nullptr;
|
||||
const G4ParticleDefinition* particle = nullptr;
|
||||
G4ParticleDefinition* theElectron = nullptr;
|
||||
const G4ParticleDefinition* theElectron;
|
||||
G4ParticleChangeForLoss* fParticleChange = nullptr;
|
||||
G4ICRU90StoppingData* fICRU90 = nullptr;
|
||||
|
||||
const G4Material* currentMaterial = nullptr;
|
||||
const G4Material* baseMaterial = nullptr;
|
||||
const G4Material* currentMaterial = nullptr;
|
||||
const G4Material* baseMaterial = nullptr;
|
||||
|
||||
static G4ASTARStopping* fASTAR;
|
||||
static G4ASTARStopping* fASTAR;
|
||||
|
||||
G4double mass;
|
||||
G4double spin;
|
||||
G4double chargeSquare;
|
||||
G4double massRate;
|
||||
G4double ratio;
|
||||
G4double lowestKinEnergy;
|
||||
G4double mass = 0.0;
|
||||
G4double spin = 0.0;
|
||||
G4double chargeSquare = 1.0;
|
||||
G4double effChargeSquare = 1.0;
|
||||
G4double massRate = 1.0;
|
||||
G4double ratio = 1.0;
|
||||
G4double HeMass;
|
||||
G4double massFactor;
|
||||
G4double corrFactor = 1.0;
|
||||
G4double rateMassHe2p;
|
||||
G4double theZieglerFactor;
|
||||
G4double lowestKinEnergy;
|
||||
|
||||
G4int iMolecula = -1; // index in the molecula's table
|
||||
G4int iASTAR = -1; // index in ASTAR
|
||||
G4int iICRU90 = -1;
|
||||
G4bool isIon = false;
|
||||
G4bool isAlpha = false;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4BraggIonModel::SetParticle(const G4ParticleDefinition* p)
|
||||
{
|
||||
particle = p;
|
||||
mass = particle->GetPDGMass();
|
||||
spin = particle->GetPDGSpin();
|
||||
G4double q = particle->GetPDGCharge()/CLHEP::eplus;
|
||||
chargeSquare = q*q;
|
||||
massRate = mass/CLHEP::proton_mass_c2;
|
||||
ratio = CLHEP::electron_mass_c2/mass;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
@@ -80,6 +80,9 @@ public:
|
||||
|
||||
void Initialise(const G4ParticleDefinition*, const G4DataVector&) override;
|
||||
|
||||
G4double MinEnergyCut(const G4ParticleDefinition*,
|
||||
const G4MaterialCutsCouple* couple) override;
|
||||
|
||||
G4double ComputeCrossSectionPerElectron(
|
||||
const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
|
||||
@@ -80,14 +80,13 @@ private:
|
||||
|
||||
void Initialise();
|
||||
|
||||
void AddData(const G4double* e, const G4double* s, G4int idx);
|
||||
void AddData(const G4double* energy, const G4double* xs, G4int idx);
|
||||
|
||||
char* dirPath;
|
||||
const G4Material* currentMaterial;
|
||||
char* dirPath = nullptr;
|
||||
const G4Material* currentMaterial = nullptr;
|
||||
|
||||
G4int type;
|
||||
G4int matIndex;
|
||||
G4double emin;
|
||||
G4int type = 0;
|
||||
G4int matIndex = -1;
|
||||
std::vector<G4PhysicsFreeVector*> sdata;
|
||||
std::vector<G4String> name;
|
||||
};
|
||||
|
||||
@@ -52,9 +52,9 @@
|
||||
|
||||
#include "G4VEmFluctuationModel.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4UniversalFluctuation.hh"
|
||||
|
||||
class G4Pow;
|
||||
class G4UniversalFluctuation;
|
||||
|
||||
class G4IonFluctuations : public G4VEmFluctuationModel
|
||||
{
|
||||
@@ -68,15 +68,17 @@ public:
|
||||
// Sample fluctuations
|
||||
G4double SampleFluctuations(const G4MaterialCutsCouple*,
|
||||
const G4DynamicParticle*,
|
||||
G4double tmax,
|
||||
G4double length,
|
||||
G4double meanLoss) override;
|
||||
const G4double tcut,
|
||||
const G4double tmax,
|
||||
const G4double length,
|
||||
const G4double meanLoss) override;
|
||||
|
||||
// Compute dispertion
|
||||
G4double Dispersion(const G4Material*,
|
||||
const G4DynamicParticle*,
|
||||
G4double tmax,
|
||||
G4double length) override;
|
||||
const G4double tcut,
|
||||
const G4double tmax,
|
||||
const G4double length) override;
|
||||
|
||||
// Initialisation prerun
|
||||
void InitialiseMe(const G4ParticleDefinition*) override;
|
||||
@@ -94,25 +96,24 @@ private:
|
||||
G4double Factor(const G4Material*, G4double Zeff);
|
||||
G4double RelativisticFactor(const G4Material*, G4double Zeff);
|
||||
|
||||
G4UniversalFluctuation uniFluct;
|
||||
const G4ParticleDefinition* particle;
|
||||
|
||||
G4Pow* g4calc;
|
||||
const G4ParticleDefinition* particle = nullptr;
|
||||
G4UniversalFluctuation* uniFluct;
|
||||
G4Pow* g4calc;
|
||||
|
||||
G4double particleMass;
|
||||
G4double charge;
|
||||
G4double chargeSquare;
|
||||
G4double effChargeSquare;
|
||||
G4double charge = 1.0;
|
||||
G4double chargeSquare = 1.0;
|
||||
G4double effChargeSquare = 1.0;
|
||||
|
||||
// data members to speed up the fluctuation calculation
|
||||
G4double parameter;
|
||||
G4double theBohrBeta2;
|
||||
G4double minFraction;
|
||||
G4double xmin;
|
||||
G4double minFraction = 0.2;
|
||||
G4double xmin = 0.2;
|
||||
G4double minLoss;
|
||||
// cash
|
||||
G4double kineticEnergy;
|
||||
G4double beta2;
|
||||
G4double kineticEnergy = 0.0;
|
||||
G4double beta2 = 0.0;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
+53
-53
@@ -23,84 +23,84 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef G4IonICRU73Data_h
|
||||
#define G4IonICRU73Data_h 1
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// ClassName: G4IonICRU73Data
|
||||
//
|
||||
// GEANT4 Class header file
|
||||
// Description: Data on stopping power
|
||||
//
|
||||
// Author: Vladimir Ivanchenko
|
||||
//
|
||||
// File name: G4alphaIonisation
|
||||
//
|
||||
// Author: Vladimir Ivanchenko
|
||||
//
|
||||
// Creation date: 28.10.2009
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
// Creation date: 23.10.2021
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
// This class manages the ionisation process for He ions. Effective charge,
|
||||
// nuclear stopping power, energy loss corrections are taken into account.
|
||||
// It inherites from G4VEnergyLossLoss.
|
||||
// Container for parameterised data on ion stopping power
|
||||
//
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef G4alphaIonisation_h
|
||||
#define G4alphaIonisation_h 1
|
||||
|
||||
#include "G4VEnergyLossProcess.hh"
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include "globals.hh"
|
||||
|
||||
class G4PhysicsLogVector;
|
||||
class G4PhysicsFreeVector;
|
||||
class G4Material;
|
||||
|
||||
class G4alphaIonisation : public G4VEnergyLossProcess
|
||||
{
|
||||
public:
|
||||
class G4IonICRU73Data
|
||||
{
|
||||
public:
|
||||
|
||||
explicit G4alphaIonisation(const G4String& name = "alphaIoni");
|
||||
explicit G4IonICRU73Data();
|
||||
|
||||
~G4alphaIonisation() override;
|
||||
~G4IonICRU73Data();
|
||||
|
||||
G4bool IsApplicable(const G4ParticleDefinition& p) final;
|
||||
// should be called before each run
|
||||
void Initialise();
|
||||
|
||||
// print documentation in html format
|
||||
void ProcessDescription(std::ostream&) const override;
|
||||
// Z - atomic number of the projectile
|
||||
// e - energy per nucleon, loge = log(e)
|
||||
G4double GetDEDX(const G4Material*, const G4int Z,
|
||||
const G4double e, const G4double loge) const;
|
||||
|
||||
// hide assignment operator
|
||||
G4alphaIonisation & operator=(const G4alphaIonisation &right) = delete;
|
||||
G4alphaIonisation(const G4alphaIonisation&) = delete;
|
||||
|
||||
protected:
|
||||
|
||||
void InitialiseEnergyLossProcess(const G4ParticleDefinition*,
|
||||
const G4ParticleDefinition*) override;
|
||||
|
||||
G4double MinPrimaryEnergy(const G4ParticleDefinition* p,
|
||||
const G4Material*, G4double cut) final;
|
||||
|
||||
inline G4double BetheBlochEnergyThreshold();
|
||||
G4IonICRU73Data & operator = (const G4IonICRU73Data &right) = delete;
|
||||
G4IonICRU73Data(const G4IonICRU73Data&) = delete;
|
||||
|
||||
private:
|
||||
|
||||
const G4ParticleDefinition* theParticle;
|
||||
void ReadMaterialData(const G4String& name, G4bool type);
|
||||
|
||||
G4double mass;
|
||||
G4double ratio;
|
||||
G4double eth;
|
||||
void ReadElementData(const G4Material* mat, G4bool type);
|
||||
|
||||
G4bool isInitialised;
|
||||
G4PhysicsLogVector* FindOrBuildElementData(const G4int Z,
|
||||
const G4int Z1,
|
||||
G4bool useICRU90);
|
||||
|
||||
G4PhysicsLogVector* RetrieveVector(std::ostringstream& in,
|
||||
G4bool warn);
|
||||
|
||||
G4double fEmin;
|
||||
G4double fEmax;
|
||||
|
||||
std::vector<G4int> fMatIndex;
|
||||
std::vector<G4PhysicsLogVector*>* fMatData[81] = {nullptr};
|
||||
G4PhysicsLogVector* fElmData[81][81] = {{nullptr}};
|
||||
G4PhysicsFreeVector* fVector = nullptr;
|
||||
|
||||
G4int fNmat = 0;
|
||||
G4int fNbins = 0;
|
||||
G4int fNbinsPerDecade = 10;
|
||||
G4int fVerbose = 0;
|
||||
G4bool fSpline = false;
|
||||
G4String fDataDirectory = "";
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4alphaIonisation::BetheBlochEnergyThreshold()
|
||||
{
|
||||
return eth;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
@@ -23,7 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// GEANT4 Class header file
|
||||
@@ -48,17 +47,18 @@
|
||||
#ifndef G4LindhardSorensenIonModel_h
|
||||
#define G4LindhardSorensenIonModel_h 1
|
||||
|
||||
#include <CLHEP/Units/SystemOfUnits.h>
|
||||
#include <vector>
|
||||
|
||||
#include "G4VEmModel.hh"
|
||||
#include "G4NistManager.hh"
|
||||
#include "G4Threading.hh"
|
||||
#include <vector>
|
||||
|
||||
class G4EmCorrections;
|
||||
class G4ParticleChangeForLoss;
|
||||
class G4LindhardSorensenData;
|
||||
class G4BraggIonModel;
|
||||
class G4BetheBlochModel;
|
||||
class G4IonICRU73Data;
|
||||
|
||||
class G4LindhardSorensenIonModel : public G4VEmModel
|
||||
{
|
||||
@@ -145,6 +145,7 @@ private:
|
||||
|
||||
static const G4int MAXZION = 93;
|
||||
|
||||
static G4IonICRU73Data* fIonData;
|
||||
static G4LindhardSorensenData* lsdata;
|
||||
static std::vector<G4float>* fact[MAXZION];
|
||||
|
||||
@@ -153,18 +154,21 @@ private:
|
||||
G4EmCorrections* corr;
|
||||
G4ParticleChangeForLoss* fParticleChange;
|
||||
G4NistManager* nist;
|
||||
G4BraggIonModel* fBraggIonModel;
|
||||
G4BraggIonModel* fBraggModel;
|
||||
G4BetheBlochModel* fBBModel;
|
||||
|
||||
G4int Zin;
|
||||
G4double mass;
|
||||
G4double tlimit;
|
||||
G4double spin;
|
||||
G4double magMoment2;
|
||||
G4double chargeSquare;
|
||||
G4double charge;
|
||||
G4double ratio;
|
||||
G4double formfact;
|
||||
G4int Zin = 1;
|
||||
G4double mass = 0.0;
|
||||
G4double tlimit = DBL_MAX;
|
||||
G4double spin = 0.0;
|
||||
G4double magMoment2 = 0.0;
|
||||
G4double chargeSquare = 1.0;
|
||||
G4double charge = 1.0;
|
||||
G4double eRatio = 0.0;
|
||||
G4double pRatio = 1.0;
|
||||
G4double formfact = 0.0;
|
||||
G4double twoln10;
|
||||
G4double fElimit;
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
static G4Mutex theLSMutex;
|
||||
|
||||
@@ -102,10 +102,12 @@ public:
|
||||
|
||||
G4double SampleFluctuations(const G4MaterialCutsCouple*,
|
||||
const G4DynamicParticle*,
|
||||
G4double, G4double, G4double) final;
|
||||
const G4double, const G4double,
|
||||
const G4double, const G4double) final;
|
||||
|
||||
G4double Dispersion(const G4Material*, const G4DynamicParticle*,
|
||||
G4double, G4double) final;
|
||||
const G4double, const G4double,
|
||||
const G4double) final;
|
||||
|
||||
void DefineForRegion(const G4Region* r) final;
|
||||
|
||||
|
||||
@@ -97,10 +97,11 @@ public:
|
||||
|
||||
G4double SampleFluctuations(const G4MaterialCutsCouple*,
|
||||
const G4DynamicParticle*,
|
||||
G4double, G4double, G4double) final;
|
||||
const G4double, const G4double,
|
||||
const G4double, const G4double) final;
|
||||
|
||||
G4double Dispersion(const G4Material*, const G4DynamicParticle*,
|
||||
G4double, G4double) final;
|
||||
const G4double, const G4double, const G4double) final;
|
||||
|
||||
void DefineForRegion(const G4Region* r) final;
|
||||
|
||||
|
||||
@@ -64,12 +64,13 @@ public:
|
||||
|
||||
G4double SampleFluctuations(const G4MaterialCutsCouple*,
|
||||
const G4DynamicParticle*,
|
||||
G4double, G4double,
|
||||
G4double) override;
|
||||
const G4double, const G4double,
|
||||
const G4double, const G4double) override;
|
||||
|
||||
G4double Dispersion(const G4Material*,
|
||||
const G4DynamicParticle*,
|
||||
G4double, G4double) override;
|
||||
const G4double, const G4double,
|
||||
const G4double) override;
|
||||
|
||||
void InitialiseMe(const G4ParticleDefinition*) final;
|
||||
|
||||
@@ -77,6 +78,10 @@ public:
|
||||
void SetParticleAndCharge(const G4ParticleDefinition*,
|
||||
G4double q2) final;
|
||||
|
||||
// hide assignment operator
|
||||
G4UniversalFluctuation & operator=(const G4UniversalFluctuation &right) = delete;
|
||||
G4UniversalFluctuation(const G4UniversalFluctuation&) = delete;
|
||||
|
||||
private:
|
||||
|
||||
inline void AddExcitation(CLHEP::HepRandomEngine* rndm,
|
||||
@@ -87,43 +92,31 @@ private:
|
||||
G4double eav, G4double esig2,
|
||||
G4double& eloss);
|
||||
|
||||
// hide assignment operator
|
||||
G4UniversalFluctuation & operator=(const G4UniversalFluctuation &right) = delete;
|
||||
G4UniversalFluctuation(const G4UniversalFluctuation&) = delete;
|
||||
const G4ParticleDefinition* particle = nullptr;
|
||||
const G4Material* lastMaterial = nullptr;
|
||||
|
||||
const G4ParticleDefinition* particle;
|
||||
const G4Material* lastMaterial;
|
||||
|
||||
G4double particleMass;
|
||||
G4double particleMass = 0.0;
|
||||
|
||||
// Derived quantities
|
||||
G4double m_Inv_particleMass;
|
||||
G4double m_massrate;
|
||||
G4double chargeSquare;
|
||||
G4double m_Inv_particleMass = DBL_MAX;
|
||||
G4double m_massrate = DBL_MAX;
|
||||
G4double chargeSquare = 1.0;
|
||||
|
||||
// data members to speed up the fluctuation calculation
|
||||
G4double ipotFluct;
|
||||
G4double electronDensity;
|
||||
|
||||
G4double f1Fluct;
|
||||
G4double f2Fluct;
|
||||
G4double e1Fluct;
|
||||
G4double e2Fluct;
|
||||
G4double e1LogFluct;
|
||||
G4double e2LogFluct;
|
||||
G4double ipotLogFluct;
|
||||
G4double e0;
|
||||
G4double esmall;
|
||||
G4double ipotFluct = 0.0;
|
||||
G4double ipotLogFluct = 0.0;
|
||||
G4double e0 = 0.0;
|
||||
G4double e1 = 0.0;
|
||||
|
||||
G4double e1,e2;
|
||||
|
||||
G4double minNumberInteractionsBohr;
|
||||
G4double minNumberInteractionsBohr = 10.0;
|
||||
G4double minLoss;
|
||||
G4double nmaxCont;
|
||||
G4double rate,a0,fw;
|
||||
G4double nmaxCont = 8.0;
|
||||
G4double rate = 0.56;
|
||||
G4double fw = 5.0;
|
||||
G4double a0 = 15.0;
|
||||
|
||||
G4int sizearray;
|
||||
G4double* rndmarray;
|
||||
G4int sizearray = 30;
|
||||
G4double* rndmarray = nullptr;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -138,7 +131,7 @@ G4UniversalFluctuation::AddExcitation(CLHEP::HepRandomEngine* rndm,
|
||||
eav += ax*ex;
|
||||
esig2 += ax*ex*ex;
|
||||
} else {
|
||||
G4int p = G4Poisson(ax);
|
||||
const G4int p = G4Poisson(ax);
|
||||
if(p > 0) { eloss += ((p + 1) - 2.*rndm->flat())*ex; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ private:
|
||||
G4LossTableManager* theManager;
|
||||
|
||||
G4double mass;
|
||||
G4double charge,ChargeSquare;
|
||||
G4double charge,chargeSquare;
|
||||
G4double masslimite,fr;
|
||||
|
||||
G4double taubig;
|
||||
@@ -174,6 +174,7 @@ private:
|
||||
|
||||
G4double tlow;
|
||||
G4double invmev;
|
||||
G4double rndmarray[2];
|
||||
|
||||
struct mscData {
|
||||
G4double ecut, Zeff, Z23, sqrtZ;
|
||||
@@ -205,7 +206,7 @@ void G4UrbanMscModel::SetParticle(const G4ParticleDefinition* p)
|
||||
particle = p;
|
||||
mass = p->GetPDGMass();
|
||||
charge = p->GetPDGCharge()/CLHEP::eplus;
|
||||
ChargeSquare = charge*charge;
|
||||
chargeSquare = charge*charge;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,10 +234,9 @@ G4double G4UrbanMscModel::SimpleScattering(G4double xmeanth, G4double x2meanth)
|
||||
G4double prob = (a+2.)*xmeanth/a;
|
||||
|
||||
// sampling
|
||||
G4double rdm = rndmEngineMod->flat();
|
||||
G4double cth = (rndmEngineMod->flat() < prob)
|
||||
? -1.+2.*G4Exp(G4Log(rdm)/(a+1.)) : -1.+2.*rdm;
|
||||
return cth;
|
||||
rndmEngineMod->flatArray(2, rndmarray);
|
||||
return (rndmarray[1] < prob) ?
|
||||
-1.+2.*G4Exp(G4Log(rndmarray[0])/(a+1.)) : -1.+2.*rndmarray[0];
|
||||
}
|
||||
|
||||
inline G4double G4UrbanMscModel::ComputeStepmin()
|
||||
@@ -257,6 +257,5 @@ inline G4double G4UrbanMscModel::ComputeTlimitmin()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ private:
|
||||
G4bool isInitialised = false;
|
||||
const G4ParticleDefinition* theGamma;
|
||||
const G4ParticleDefinition* theElectron;
|
||||
G4int fEntanglementModelIndex;
|
||||
G4int fEntanglementModelID;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
Reference in New Issue
Block a user