Import Geant4 11.4.0 source tree

This commit is contained in:
Gabriele Cosmo
2025-12-05 08:54:02 +01:00
parent a499fb82e9
commit b4a16de652
6484 changed files with 232674 additions and 221097 deletions
@@ -101,9 +101,11 @@ public:
const G4Material* mat,
G4double kineticEnergy) override;
void CorrectionsAlongStep(const G4MaterialCutsCouple*,
const G4DynamicParticle*,
const G4double&,
void CorrectionsAlongStep(const G4Material*,
const G4ParticleDefinition*,
const G4double kinEnergy,
const G4double cutEnergy,
const G4double& length,
G4double&) override;
void SampleSecondaries(std::vector<G4DynamicParticle*>*,
@@ -59,10 +59,17 @@ public:
explicit G4BetheBlochIonGasModel(const G4ParticleDefinition* p = nullptr,
const G4String& nam = "BetheBlochGasIon");
~G4BetheBlochIonGasModel() override;
~G4BetheBlochIonGasModel() override = default;
// access dynamic charge
G4double ChargeSquareRatio(const G4Track& track) final;
// access current dynamic charge
G4double GetChargeSquareRatio(const G4ParticleDefinition* p,
const G4Material* mat,
G4double kineticEnergy) final;
// return dynamic charge
G4double GetParticleCharge(const G4ParticleDefinition* p,
const G4Material* mat,
G4double kineticEnergy) final;
@@ -104,8 +104,10 @@ public:
const G4Material* mat,
G4double kineticEnergy) override;
void CorrectionsAlongStep(const G4MaterialCutsCouple* couple,
const G4DynamicParticle* dp,
void CorrectionsAlongStep(const G4Material*,
const G4ParticleDefinition*,
const G4double kinEnergy,
const G4double cutEnergy,
const G4double& length,
G4double& eloss) override;
@@ -115,6 +117,8 @@ public:
G4double tmin,
G4double maxEnergy) override;
inline void SetChargeSquareRatio(G4double val);
// hide assignment operator
G4BetheBlochModel & operator=(const G4BetheBlochModel &right) = delete;
G4BetheBlochModel(const G4BetheBlochModel&) = delete;
@@ -124,10 +128,6 @@ protected:
G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
G4double kinEnergy) override;
inline G4double GetChargeSquareRatio() const;
inline void SetChargeSquareRatio(G4double val);
private:
void SetupParameters(const G4ParticleDefinition* p);
@@ -145,7 +145,7 @@ private:
G4double tlimit = DBL_MAX;
G4double spin = 0.0;
G4double magMoment2 = 0.0;
G4double chargeSquare = 1.0;
G4double chargeSquareRatio = 1.0;
G4double ratio = 1.0;
G4double formfact = 0.0;
G4double twoln10;
@@ -159,16 +159,9 @@ private:
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4BetheBlochModel::GetChargeSquareRatio() const
{
return chargeSquare;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4BetheBlochModel::SetChargeSquareRatio(G4double val)
{
chargeSquare = val;
chargeSquareRatio = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -61,12 +61,17 @@ public:
explicit G4BraggIonGasModel(const G4ParticleDefinition* p = nullptr,
const G4String& nam = "BraggIonGas");
~G4BraggIonGasModel() override;
~G4BraggIonGasModel() override = default;
// Access ion effective charge square ratio to unit charge
// define current dynamic
G4double ChargeSquareRatio(const G4Track&) final;
// Access ion effective charge
// access current dynamic charge
G4double GetChargeSquareRatio(const G4ParticleDefinition* p,
const G4Material* mat,
G4double kineticEnergy) final;
// Access dynamic charge
G4double GetParticleCharge(const G4ParticleDefinition*,
const G4Material* mat,
G4double kineticEnergy) final;
@@ -97,8 +97,10 @@ public:
G4double kineticEnergy) override;
// add correction to energy loss and ompute non-ionizing energy loss
void CorrectionsAlongStep(const G4MaterialCutsCouple*,
const G4DynamicParticle*,
void CorrectionsAlongStep(const G4Material*,
const G4ParticleDefinition*,
const G4double kinEnergy,
const G4double cutEnergy,
const G4double& length,
G4double& eloss) override;
@@ -121,6 +121,8 @@ public:
const G4Material* mat,
G4double kineticEnergy) override;
inline void SetChargeSquareRatio(G4double val);
// hide assignment operator
G4BraggModel & operator=(const G4BraggModel &right) = delete;
G4BraggModel(const G4BraggModel&) = delete;
@@ -132,8 +134,6 @@ protected:
G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
G4double kinEnergy) final;
inline void SetChargeSquareRatio(G4double val);
private:
void HasMaterial(const G4Material* material);
@@ -166,7 +166,7 @@ protected:
G4double mass = 0.0;
G4double spin = 0.0;
G4double chargeSquare = 1.0;
G4double chargeSquareRatio = 1.0;
G4double massRate = 1.0;
G4double ratio = 1.0;
G4double protonMassAMU = 1.007276;
@@ -186,7 +186,7 @@ private:
inline void G4BraggModel::SetChargeSquareRatio(G4double val)
{
chargeSquare = val;
chargeSquareRatio = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -35,6 +35,7 @@
// Creation date: 23.08.2017
//
// Modifications:
// 26.10.2025 M. Novak: added the related technical note as the proper reference.
//
// Class description:
// An object of this calss is used in the G4GoudsmitSaundersonTable when Mott-correction
@@ -60,12 +61,13 @@
// Unlike the default GS, the Mott-corrected angular distributions are particle type
// (different for e- and e+ <= the DCS_{Mott} and the screening correction) and target
// (Z and material) dependent.
// [1] I.Kawrakow, E.Mainegra-Hing, D.W.O.Rogers, F.Tessier,B.R.B.Walters, NRCC
// Report PIRS-701 (2013)
// [2] N.F. Mott, Proc. Roy. Soc. (London) A 124 (1929) 425.
// [3] F.Salvat, A.Jablonski, C.J. Powell, CPC 165(2005) 157-190
//
// References:
// [2] I.Kawrakow, E.Mainegra-Hing, D.W.O.Rogers, F.Tessier,B.R.B.Walters, NRCC
// Report PIRS-701 (2013)
// [2] N.F. Mott, Proc. Roy. Soc. (London) A 124 (1929) 425.
// [3] F.Salvat, A.Jablonski, C.J. Powell, CPC 165(2005) 157-190
// M. Novak: https://arxiv.org/abs/2410.13361
//
// -----------------------------------------------------------------------------
@@ -41,6 +41,9 @@
// first and second moments) derived by using accurate Dirac-PWA based
// integrated quantities.
//
// References:
// M. Novak: https://arxiv.org/abs/2410.13361
//
// ----------------------------------------------------------------------------
#ifndef G4GSPWACorrections_h
@@ -67,6 +67,11 @@
// robust and accurate compared to the earlier version.
// Spin effects as well as a more accurate energy loss correction and
// computations of Lewis moments will be implemented later on.
// [1] A.F.Bielajew, NIMB 111 (1996) 195-208
// [2] I.Kawrakow, A.F.Bielajew, NIMB 134(1998) 325-336
// [3] I.Kawrakow, E.Mainegra-Hing, D.W.O.Rogers, F.Tessier,B.R.B.Walters,
// NRCC Report PIRS-701 (2013)
// [4] F.Salvat, A.Jablonski, C.J. Powell, CPC 165(2005) 157-190
// 02.09.2015 M. Novak: first version of new step limit is provided.
// fUseSafetyPlus corresponds to Urban fUseSafety (default)
// fUseDistanceToBoundary corresponds to Urban fUseDistanceToBoundary
@@ -98,23 +103,24 @@
// (different for e- and e+ <= the DCS_{Mott} and the screening correction) and target
// (Z and material) dependent.
// 02.02.2018 M. Novak: implemented CrossSectionPerVolume interface method (used only for testing)
// 26.10.2025 M. Novak: the model has only its accurate stepping and boundary crossing algorithms
// left as the only option that ensures the expected precision, especially when activating
// its Mott correction option (that also activates the screeing and scattering power
// corrections). The model has been used for describing e-/e+ MSC (below 100 MeV kinetic)
// energy in the option4, Penelope and Livermore EM physics constructors since Geant4 10.6.
//
//
// Class description:
// Kawrakow-Bielajew Goudsmit-Saunderson MSC model based on the screened Rutherford DCS
// for elastic scattering of e-/e+. Option, to include (Mott) correction (see above), is
// also available now (SetOptionMottCorrection(true)). An EGSnrc like error-free stepping
// algorithm (UseSafety) is available beyond the usual Geant4 step limitation algorithms
// and true to geomerty and geometry to true step length computations that were adopted
// from the Urban model[5]. The most accurate setting: error-free stepping (UseSafety)
// with Mott-correction (SetOptionMottCorrection(true)).
// for elastic scattering of e-/e+. Option, to include Mott correction, is also available
// that also activates the screening and scattering power corrections leading to the most
// precise settings of the model. With the accurate electron stepping and boundary crossing
// algorithm the model provides very precise e-/e+ simulation and tracking independently
// from the target material and geometrical configurations similarly to EGSnrc. All details
// are available in the corresponding technical note (M. Novak: https://arxiv.org/abs/2410.13361).
//
// References:
// [1] A.F.Bielajew, NIMB 111 (1996) 195-208
// [2] I.Kawrakow, A.F.Bielajew, NIMB 134(1998) 325-336
// [3] I.Kawrakow, E.Mainegra-Hing, D.W.O.Rogers, F.Tessier,B.R.B.Walters, NRCC
// Report PIRS-701 (2013)
// [4] F.Salvat, A.Jablonski, C.J. Powell, CPC 165(2005) 157-190
// [5] L.Urban, Preprint CERN-OPEN-2006-077 (2006)
// M. Novak: https://arxiv.org/abs/2410.13361
//
// -----------------------------------------------------------------------------
@@ -155,8 +161,8 @@ public:
G4double ComputeTrueStepLength(G4double geomStepLength) override;
// method to compute first transport cross section per Volume (i.e. macroscropic first transport cross section; this
// method is used only for testing and not during a normal simulation)
// method to compute first transport cross section per Volume (i.e. macroscropic first transport cross section; this
// method is used only for testing and not during a normal simulation)
G4double CrossSectionPerVolume(const G4Material*, const G4ParticleDefinition*, G4double kineticEnergy, G4double cutEnergy = 0.0, G4double maxEnergy = DBL_MAX) override;
void StartTracking(G4Track*) override;
@@ -173,6 +179,10 @@ public:
G4bool GetOptionMottCorrection() const { return fIsUseMottCorrection; }
void SetOptionOptimisation(G4bool opt) { fIsUseOptimisation = opt; }
G4bool GetOptionOptimisation() const { return fIsUseOptimisation; }
G4GoudsmitSaundersonTable* GetGSTable() { return fGSTable; }
G4GSPWACorrections* GetPWACorrection() { return fPWACorrection; }
@@ -188,39 +198,13 @@ private:
G4double GetTransportMeanFreePathOnly(const G4ParticleDefinition*,G4double);
inline G4double Randomizetlimit();
private:
CLHEP::HepRandomEngine* rndmEngineMod;
//
G4double currentKinEnergy;
G4double currentRange;
//
G4double fr;
G4double rangeinit;
G4double geombig;
G4double geomlimit;
G4double tlimit;
G4double tgeom;
//
G4double par1;
G4double par2;
G4double par3;
G4double tlimitminfix2;
G4double tausmall;
G4double mass;
G4double taulim;
//
//
G4double presafety;
G4double fZeff;
//
G4int charge;
G4int currentMaterialIndex;
//
G4bool firstStep;
//
G4LossTableManager* theManager;
const G4ParticleDefinition* particle;
G4ParticleChangeForMSC* fParticleChange;
const G4MaterialCutsCouple* currentCouple;
@@ -230,6 +214,7 @@ private:
G4bool fIsUsePWACorrection;
G4bool fIsUseMottCorrection;
G4bool fIsUseOptimisation;
//
G4double fLambda0; // elastic mean free path
G4double fLambda1; // first transport mean free path
@@ -241,24 +226,16 @@ private:
G4double fMCtoG2PerG1;
//
G4double fTheTrueStepLenght;
G4double fTheTransportDistance;
G4double fTheZPathLenght;
//
G4ThreeVector fTheDisplacementVector;
G4ThreeVector fTheNewDirection;
//
G4bool fIsEndedUpOnBoundary; // step ended up on boundary i.e. transportation is the winer
G4bool fIsMultipleSacettring;
G4bool fIsEndedUpOnBoundary;
G4bool fIsMultipleScattering;
G4bool fIsSingleScattering;
G4bool fIsEverythingWasDone;
G4bool fIsNoScatteringInMSC;
G4bool fIsNoDisplace;
G4bool fIsInsideSkin;
G4bool fIsWasOnBoundary;
G4bool fIsFirstRealStep;
//
static G4bool gIsUseAccurate;
static G4bool gIsOptimizationOn;
G4bool fIsSimplified;
};
////////////////////////////////////////////////////////////////////////////////
@@ -267,24 +244,7 @@ void G4GoudsmitSaundersonMscModel::SetParticle(const G4ParticleDefinition* p)
{
if (p != particle) {
particle = p;
charge = (G4int)(p->GetPDGCharge()/CLHEP::eplus);
mass = p->GetPDGMass();
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline
G4double G4GoudsmitSaundersonMscModel::Randomizetlimit()
{
G4double temptlimit;
do {
temptlimit = G4RandGauss::shoot(rndmEngineMod,tlimit,0.1*tlimit);
} while ( (temptlimit<0.) || (temptlimit>2.*tlimit));
return temptlimit;
}
#endif
@@ -54,6 +54,8 @@
// The new version is several times faster, more robust and accurate
// compared to the earlier version (G4GoudsmitSaundersonMscModel class
// that use these data has been also completely replaced)
// [1] A.F.Bielajew, NIMB, 111 (1996) 195-208
// [2] I.Kawrakow, A.F.Bielajew, NIMB 134(1998) 325-336
// 28.04.2017 M. Novak: the GS angular distributions has been recomputed, the
// data size has been reduced from 16 MB down to 5 MB by using a new
// representation, the class has been modified significantly due to
@@ -62,10 +64,10 @@
// base GS angular distributions and some other factors (screening
// parameter, first and second moments) when Mott-correction is
// activated in the GS-MSC model.
// 26.10.2025 M. Novak: added the related technical note as the proper reference.
//
// References:
// [1] A.F.Bielajew, NIMB, 111 (1996) 195-208
// [2] I.Kawrakow, A.F.Bielajew, NIMB 134(1998) 325-336
// M. Novak: https://arxiv.org/abs/2410.13361
//
// -----------------------------------------------------------------------------
@@ -109,12 +109,6 @@ public:
G4double tmin,
G4double maxEnergy) override;
// add correction to energy loss and compute non-ionizing energy loss
void CorrectionsAlongStep(const G4MaterialCutsCouple*,
const G4DynamicParticle*,
const G4double& length,
G4double& eloss) override;
// hide assignment operator
G4ICRU73QOModel & operator=(const G4ICRU73QOModel &right) = delete;
G4ICRU73QOModel(const G4ICRU73QOModel&) = delete;
@@ -0,0 +1,111 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4LPMFunction
//
// Author: Mihaly Novak
//
// Creation date: 08 October 2025
//
// Modifications:
//
// Class Description:
//
// The `G(s)` and `\phi(s)` Landau Pomeranchuk Migdal (LPM) suppression
// functions, utilised both in some bremsstrahlung and pair-production models
// when computing the actual LPM suppression effect, are factored in this util.
// The functions are pre-computed and interpolated over the `s \in [0,2)`
// intervall while approximated at `s > 2` values when they converge to unity.
//
// `G(s)` and `\phi(s)` are the spin flip and no flip suppression functions of
// Migdal (Migdal PR,1956) including some slowly converging series to which
// approximate expressions were derived by Stanev (Stanev at al. PRD,1982).
// (See e.g. `G4eBremsstrahlungRelModel::ComputeLPMGsPhis` at Geant4-v.11.3.0
// on the details of the computation.)
//
// -------------------------------------------------------------------
//
#ifndef G4LPMFunction_h
#define G4LPMFunction_h 1
#include "G4Types.hh"
namespace G4LPMFunction {
// Precomputed G(s) and Phi(s) LPM functions.
// Grid: s \in [0, 2.0], ds = 0.05 -> N = 41 points, interleaved (G(s),Phi(s))
inline constexpr G4double kFuncLPM[] = {
0.0000E+00, 0.0000E+00, 6.9163E-02, 2.5747E-01, 2.0597E-01, 4.4573E-01,
3.5098E-01, 5.8373E-01, 4.8095E-01, 6.8530E-01, 5.8926E-01, 7.6040E-01,
6.7626E-01, 8.1626E-01, 7.4479E-01, 8.5805E-01, 7.9826E-01, 8.8952E-01,
8.4003E-01, 9.1338E-01, 8.7258E-01, 9.3159E-01, 8.9794E-01, 9.4558E-01,
9.1776E-01, 9.5640E-01, 9.3332E-01, 9.6483E-01, 9.4560E-01, 9.7143E-01,
9.5535E-01, 9.7664E-01, 9.6313E-01, 9.8078E-01, 9.6939E-01, 9.8408E-01,
9.7444E-01, 9.8673E-01, 9.7855E-01, 9.8888E-01, 9.8191E-01, 9.9062E-01,
9.8467E-01, 9.9204E-01, 9.8695E-01, 9.9321E-01, 9.8884E-01, 9.9417E-01,
9.9042E-01, 9.9497E-01, 9.9174E-01, 9.9564E-01, 9.9285E-01, 9.9619E-01,
9.9379E-01, 9.9666E-01, 9.9458E-01, 9.9706E-01, 9.9526E-01, 9.9739E-01,
9.9583E-01, 9.9768E-01, 9.9632E-01, 9.9794E-01, 9.9674E-01, 9.9818E-01,
9.9710E-01, 9.9839E-01, 9.9741E-01, 9.9857E-01, 9.9767E-01, 9.9873E-01,
9.9790E-01, 9.9887E-01, 9.9809E-01, 9.9898E-01, 9.9826E-01, 9.9909E-01,
9.9840E-01, 9.9918E-01, 9.9856E-01, 9.9926E-01
};
// Obtain the `G(s)` and `\phi(s)` LPM suppression functions at any `s >= 0`.
inline void GetLPMFunctions(G4double& lpmFuncG, G4double& lpmFuncPhi, G4double sVar) {
// sanity check (s should be >= 0)
if (sVar < 0.0) {
lpmFuncG = 0.0;
lpmFuncPhi = 0.0;
return;
}
// case of `s in [0, 2)` use the precomputed functions and interpolate
const G4double lpmSLimit = 2.0; // max_s:=2
const G4double lpmISDelt = 20.0; // deta_s:=0.05, 1/delta_s=20
if (sVar < lpmSLimit) {
G4double val = sVar*lpmISDelt;
G4int ilow = static_cast<G4int>(val);
val -= ilow;
ilow *= 2;
lpmFuncG = (kFuncLPM[ilow+2] - kFuncLPM[ilow] )*val + kFuncLPM[ilow];
lpmFuncPhi = (kFuncLPM[ilow+3] - kFuncLPM[ilow+1])*val + kFuncLPM[ilow+1];
return;
}
// asymptotic case: G(s), Phi(s) goes to 1.0
G4double ss = 1.0/(sVar*sVar);
ss *= ss;
lpmFuncG = 1.0 - 0.0230655*ss;
lpmFuncPhi = 1.0 - 0.01190476*ss;
}
};
#endif // G4LPMFunction_h
@@ -105,9 +105,11 @@ public:
const G4Material* mat,
G4double kineticEnergy) override;
void CorrectionsAlongStep(const G4MaterialCutsCouple* couple,
const G4DynamicParticle* dp,
const G4double& length,
void CorrectionsAlongStep(const G4Material*,
const G4ParticleDefinition*,
const G4double kinEnergy,
const G4double cutEnergy,
const G4double& length,
G4double& eloss) override;
void SampleSecondaries(std::vector<G4DynamicParticle*>*,
@@ -126,8 +128,6 @@ protected:
G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
G4double kinEnergy) override;
inline void SetChargeSquareRatio(G4double val);
private:
void SetupParameters();
@@ -158,7 +158,7 @@ private:
G4double tlimit = DBL_MAX;
G4double spin = 0.0;
G4double magMoment2 = 0.0;
G4double chargeSquare = 1.0;
G4double chargeSquareRatio = 1.0;
G4double charge = 1.0;
G4double eRatio = 0.0;
G4double pRatio = 1.0;
@@ -181,11 +181,4 @@ G4LindhardSorensenIonModel::SetParticle(const G4ParticleDefinition* p)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4LindhardSorensenIonModel::SetChargeSquareRatio(G4double val)
{
chargeSquare = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -114,11 +114,12 @@ public:
const G4double tmax,
const G4double length,
const G4double meanLoss) override;
void CorrectionsAlongStep(const G4MaterialCutsCouple*,
const G4DynamicParticle*,
const G4double& length,
G4double& eloss) override;
void CorrectionsAlongStep(const G4Material*,
const G4ParticleDefinition*,
const G4double kinEnergy,
const G4double cutEnergy,
const G4double& length,
G4double& eloss) override;
G4double Dispersion(const G4Material*, const G4DynamicParticle*,
const G4double, const G4double, const G4double) override {return 0.;};
@@ -37,15 +37,15 @@
//
// Modifications:
// 28-05-18 New version with improved screening function approximation, improved
// LPM function approximation, efficiency, documentation and cleanup.
// Corrected call to selecting target atom in the final state sampling.
// LPM function approximation, efficiency, documentation and cleanup.
// Corrected call to selecting target atom in the final state sampling.
// (M. Novak)
//
// Class Description:
//
// Implementation of gamma conversion to e+e- in the field of a nucleus
// Implementation of gamma conversion to e+e- in the field of a nucleus
// relativistic approximation
//
//
// -------------------------------------------------------------------
//
@@ -67,20 +67,20 @@ class G4PairProductionRelModel : public G4VEmModel
public:
explicit G4PairProductionRelModel(const G4ParticleDefinition* p = nullptr,
explicit G4PairProductionRelModel(const G4ParticleDefinition* p = nullptr,
const G4String& nam = "BetheHeitlerLPM");
~G4PairProductionRelModel() override;
void Initialise(const G4ParticleDefinition*, const G4DataVector&) override;
void InitialiseLocal(const G4ParticleDefinition*,
void InitialiseLocal(const G4ParticleDefinition*,
G4VEmModel* masterModel) override;
G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
G4double kinEnergy,
G4double Z,
G4double A=0.,
G4double kinEnergy,
G4double Z,
G4double A=0.,
G4double cut=0.,
G4double emax=DBL_MAX) override;
@@ -103,23 +103,23 @@ public:
protected:
// for evaluating screening related functions
inline void ComputePhi12(const G4double delta,
inline void ComputePhi12(const G4double delta,
G4double &phi1, G4double &phi2);
inline G4double ScreenFunction1(const G4double delta);
inline G4double ScreenFunction2(const G4double delta);
inline void ScreenFunction12(const G4double delta,
inline void ScreenFunction12(const G4double delta,
G4double &f1, G4double &f2);
// helper methods for cross-section computation under different approximations
G4double ComputeParametrizedXSectionPerAtom(G4double gammaEnergy, G4double Z);
G4double ComputeXSectionPerAtom(G4double gammaEnergy, G4double Z);
G4double ComputeDXSectionPerAtom(G4double eplusEnergy, G4double gammaEnergy,
G4double ComputeDXSectionPerAtom(G4double eplusEnergy, G4double gammaEnergy,
G4double Z);
G4double ComputeRelDXSectionPerAtom(G4double eplusEnergy,
G4double ComputeRelDXSectionPerAtom(G4double eplusEnergy,
G4double gammaEnergy, G4double Z);
private:
// for creating some data structure per Z
// for creating some data structure per Z
void InitialiseElementData();
struct ElementData {
G4double fLogZ13;
@@ -132,40 +132,25 @@ private:
G4double fLPMVarS1Cond;
G4double fLPMILVarS1Cond;
};
// for precomputing comp. intensive parts of LPM suppression functions and
// using them at run-time
void InitLPMFunctions();
void ComputeLPMGsPhis(G4double &funcGS, G4double &funcPhiS,
const G4double varShat);
void GetLPMFunctions(G4double &lpmGs, G4double &lpmPhis, const G4double sval);
void ComputeLPMfunctions(G4double &fXiS, G4double &fGS, G4double &fPhiS,
const G4double eps, const G4double egamma,
void ComputeLPMfunctions(G4double &fXiS, G4double &fGS, G4double &fPhiS,
const G4double eps, const G4double egamma,
const G4int izet);
struct LPMFuncs {
LPMFuncs() : fIsInitialized(false), fISDelta(100.), fSLimit(2.) {}
G4bool fIsInitialized;
G4double fISDelta;
G4double fSLimit;
std::vector<G4double> fLPMFuncG;
std::vector<G4double> fLPMFuncPhi;
};
protected:
static const G4int gMaxZet;
//
static const G4double gLPMconstant;
//
static const G4double gXGL[8];
static const G4double gXGL[8];
static const G4double gWGL[8];
static const G4double gFelLowZet[8];
static const G4double gFinelLowZet[8];
//
static const G4double gXSecFactor;
static const G4double gEgLPMActivation;
//
static std::vector<ElementData*> gElementData;
static LPMFuncs gLPMFuncs;
//
//
static std::vector<ElementData*> gElementData;
//
G4bool isFirstInstance{false};
G4bool fIsUseLPMCorrection;
G4bool fIsUseCompleteScreening;
@@ -183,23 +168,23 @@ protected:
};
//
// Bethe screening functions for the elastic (coherent) scattering:
// Bethe's phi1, phi2 coherent screening functions were computed numerically
// Bethe's phi1, phi2 coherent screening functions were computed numerically
// by using (the universal) atomic form factors computed based on the Thomas-
// Fermi model of the atom (using numerical solution of the Thomas-Fermi
// screening function instead of Moliere's analytical approximation). The
// numerical results can be well approximated (better than Butcher & Messel
// Fermi model of the atom (using numerical solution of the Thomas-Fermi
// screening function instead of Moliere's analytical approximation). The
// numerical results can be well approximated (better than Butcher & Messel
// especially near the delta=1 limit) by:
// ## if delta <= 1.4
// phi1(delta) = 20.806 - delta*(3.190 - 0.5710*delta)
// ## if delta <= 1.4
// phi1(delta) = 20.806 - delta*(3.190 - 0.5710*delta)
// phi2(delta) = 20.234 - delta*(2.126 - 0.0903*delta)
// ## if delta > 1.4
// phi1(delta) = phi2(delta) = 21.0190 - 4.145*ln(delta + 0.958)
// with delta = 136mc^2kZ^{-1/3}/[E(Eg-E)] = 136Z^{-1/3}eps0/[eps(1-eps)] where
// Eg is the initial photon energy, E is the total energy transferred to one of
// with delta = 136mc^2kZ^{-1/3}/[E(Eg-E)] = 136Z^{-1/3}eps0/[eps(1-eps)] where
// Eg is the initial photon energy, E is the total energy transferred to one of
// the e-/e+ pair, eps0 = mc^2/Eg and eps = E/Eg.
inline void G4PairProductionRelModel::ComputePhi12(const G4double delta,
G4double &phi1,
G4double &phi1,
G4double &phi2)
{
if (delta > 1.4) {
@@ -214,7 +199,7 @@ inline void G4PairProductionRelModel::ComputePhi12(const G4double delta,
// Compute the value of the screening function 3*PHI1(delta) - PHI2(delta):
inline G4double G4PairProductionRelModel::ScreenFunction1(const G4double delta)
{
return (delta > 1.4) ? 42.038 - 8.29*G4Log(delta + 0.958)
return (delta > 1.4) ? 42.038 - 8.29*G4Log(delta + 0.958)
: 42.184 - delta*(7.444 - 1.623*delta);
}
@@ -226,7 +211,7 @@ inline G4double G4PairProductionRelModel::ScreenFunction2(const G4double delta)
}
// Same as ScreenFunction1 and ScreenFunction2 but computes them at once
inline void G4PairProductionRelModel::ScreenFunction12(const G4double delta,
inline void G4PairProductionRelModel::ScreenFunction12(const G4double delta,
G4double &f1, G4double &f2)
{
if (delta > 1.4) {
@@ -234,7 +219,7 @@ inline void G4PairProductionRelModel::ScreenFunction12(const G4double delta,
f2 = f1;
} else {
f1 = 42.184 - delta*(7.444 - 1.623*delta);
f2 = 41.326 - delta*(5.848 - 0.902*delta);
f2 = 41.326 - delta*(5.848 - 0.902*delta);
}
}
@@ -112,22 +112,11 @@ private:
// init special data per element i.e. per Z
void InitialiseElementData();
// methods for initialisation and run-time evaluation of LPM functions:
void InitLPMFunctions();
void ComputeLPMfunctions(G4double& funcXiS,
G4double& funcGS,
G4double& funcPhiS,
const G4double egamma);
void GetLPMFunctions(G4double& lpmGs,
G4double& lpmPhis,
const G4double ss);
void ComputeLPMGsPhis(G4double& funcGS,
G4double& funcPhiS,
const G4double varShat);
// for evaluating screening related functions
void ComputeScreeningFunctions(G4double& phi1,
G4double& phi1m2,
@@ -208,17 +197,6 @@ private:
G4double fGammaFactor;
G4double fEpsilonFactor;
};
//
struct LPMFuncs {
LPMFuncs() : fIsInitialized(false), fISDelta(100.), fSLimit(2.) {}
G4bool fIsInitialized;
G4double fISDelta;
G4double fSLimit;
std::vector<G4double> fLPMFuncG;
std::vector<G4double> fLPMFuncPhi;
};
//
static LPMFuncs gLPMFuncs;
static std::vector<ElementData*> gElementData;
};
@@ -77,23 +77,14 @@ public:
* pared for sampling polar angle of Coulomb scattering
* for mixed and for pure single scattering models: cosine
* of the polar scattering angle can be sampled in a
* restriced inteval (see mumin input parameter below).
* restriced inteval (see fMuMin parameter).
* @param[in] isscpcor Indicates if scattering power correction should be used.
* Note, scattering power correction accounts the effects
* angular deflections due to sub-threshold ionisations
* when ionisation is described by using condensed history
* model (should be active only in this case).
* @param[in] mumin When the model is used for mixed simulation, Coulomb
* scatterings, resulting in a minimum t_c polar angular
* deflection, modelled explicitly. Therefore, cross
* sections are computed, and angular deflections are
* sampled ina resricted [\theta_c,\pi] interval. The
* minimum of this interval is determined by the mumin
* parameter as:
* \mu_{min} = \mu(\theta_c)=0.5[1-\cos(\theta_c)]
*/
G4eDPWACoulombScatteringModel(G4bool ismixed=false, G4bool isscpcor=true,
G4double mumin=0.0);
G4eDPWACoulombScatteringModel(G4bool ismixed=false, G4bool isscpcor=true);
~G4eDPWACoulombScatteringModel() override;
@@ -114,8 +105,8 @@ public:
G4double tmin,
G4double maxEnergy) override;
G4double MinPrimaryEnergy(const G4Material*, const G4ParticleDefinition*,
G4double) override { return 10.0*CLHEP::eV; }
G4double MinPrimaryEnergy(const G4Material*, const G4ParticleDefinition*,
G4double) override;
void SetTheDCS(G4eDPWAElasticDCS* theDCS) { fTheDCS = theDCS; }
@@ -135,6 +126,7 @@ private:
// case of condensed history simulation of inonisation!
G4bool fIsScpCorrection;
// mu(theta)=0.5[1-cos(theta)]: the model porvides final states \in [fMuMin,1]
// NOTE: `theta` for this limit can be set in `G4EmParameters::SetMscThetaLimit`
G4double fMuMin;
// the object that provides cross sections and polar angle of scattering
G4eDPWAElasticDCS* fTheDCS;