Import Geant4 10.5.0 source tree

This commit is contained in:
Gabriele Cosmo
2018-12-07 15:15:39 +01:00
parent 6aa23be517
commit db49709b53
11370 changed files with 187480 additions and 160142 deletions
@@ -7,7 +7,6 @@
#
# Generated on : 24/9/2010
#
# $Id: CMakeLists.txt 66810 2013-01-12 16:01:59Z gcosmo $
#
#------------------------------------------------------------------------------
@@ -1,4 +1,3 @@
# $Id: GNUmakefile 105921 2017-08-28 12:12:53Z gcosmo $
# --------------------------------------------------------------------
# GNUmakefile for electromagnetic sub-library. John Allison, 25/6/98.
# --------------------------------------------------------------------
+169 -52
View File
@@ -1,4 +1,3 @@
$Id: History 110934 2018-06-26 08:11:04Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -18,8 +17,126 @@ committal in the CVS repository !
----------------------------------------------------------
26 November 18: V.Ivanchenko (emstand-V10-04-54)
- G4WentzelOKandVIxSection - fixed destructor
23 November 18: V.Ivanchenko (emstand-V10-04-53)
- G4eplusTo2GammaOKVIModel - fixed trivial Coverity warning
07 November 18: V.Ivanchenko (emstand-V10-04-52)
- G4BetheHeitler5DModel - (I.Semeniouk) added protection to boost
computation responsible for numerical problem
05 November 18: V.Ivanchenko (emstand-V10-04-51)
- G4eplusTo2GammaOKVIModel, G4eplusTo3GammaOKVIModel - make consistent
definition of cross section for 2-gamma and 3-gamma models, use
cuts for gamma in sampling of 3-gamma final state
02 November 18: V.Ivanchenko (emstand-V10-04-50)
- G4SeltzerBergerModel, G4eBremsstrahlungRelModel - use by default
G4ModifiedTsai generator instead of G4DipBustGenerator
26 October 18: V.Ivanchenko (emstand-V10-04-49)
- G4BetheHeitler5DModel - (I.Semeniouk) cleaned up comments
24 October 18: V.Ivanchenko (emstand-V10-04-48)
- G4BetheBlochModel, G4BraggIonModel - fixed usage of ICRU90 data
16 October 18: D.Sawkey (emstand-V10-04-47)
- G4eplusAnnihilation: set weights for directional splitting
10 October 18: V.Ivanchenko (emstand-V10-04-46)
- G4UrbanMscModel - L.Urban added correction to get better
backscattering at low energy
- G4LindhardSorensenData, G4LindhardSorensenIonModel - correction
of dEdx computation
09 October 18: V.Ivanchenko (emstand-V10-04-45)
- G4eplusAnnihilation - back to emstand-V10-04-42
09 October 18: J.L. Rodriguez-Sanchez (emstand-V10-04-44)
- G4AtimaEnergyLossModel, G4AtimaFluctuations - fixed some errors
and added some cosmetic modifications
02 October 18: D.Sawkey (emstand-V10-04-43)
- G4eplusAnnihilation - enable directional splitting
01 October 18: V.Ivanchenko (emstand-V10-04-42)
- G4BraggModel, G4BraggIonModel - minor optimisation
- G4LindhardSorensenData - limit parameterisation to interval
of validity
27 September 18: V.Ivanchenko (emstand-V10-04-41)
- G4BraggModel, G4BraggIonModel, G4BetheBlochModel - added
optional possibility to use ICRU90 data
- G4LindhardSorensenData - fixed interpolation of corrections for
large energies
- G4LindhardSorensenIonModel, G4PSTARStopping - minor cleanup
21 September 18: V.Ivanchenko (emstand-V10-04-40)
- G4GammaConversion, G4eBremsstrahlung, G4hIonisation - use upper
energy limit for low-energy model from PhysicsList instead of
hard-coding values
- G4ionIonisation - apply correction to energy loss only to BetheBloch
ionisation model
- G4ComptonScattering, G4PhotoElectricEffect, G4eIonisation,
G4eplusAnnihilation, G4BetheBlochModel - improved comments
17 September 18: D. Sawkey (emstand-V10-04-39)
- G4CoulombScattering, G4eBremsstrahlung, G4[e,h]MultipleScattering,
G4eplusAnnihilation, G4[e,h,ion,alpha]Ionisation, G4ComptonScattering,
G4NuclearStopping, G4PhotoElectricEffect,
: change auto-generated documentation format to rST
14 September 18: V.Ivanchenko (emstand-V10-04-38)
- G4eSingleCoulombScatteringModel - fixed problem #2090
31 August 18: V.Ivanchenko (emstand-V10-04-37)
- G4LindhardSorensenIonModel - fixed numerical problem in computation
of correction
29 August 18: L.Urban (emstand-V10-04-36)
- G4UrbanMscModel - correction in order to get better backscattering
for low energy
17 August 18: V.Ivanchenko (emstand-V10-04-35)
- G4ScreeningMottCrossSection, G4eSingleCoulombScatteringModel - added
extra protections on argument of std::acos avoiding crash due to
precision lost; clean-up and formats of code; one run time method
is moved inlined; initialisation methods are moved to the source
17 August 18: V.Ivanchenko (emstand-V10-04-34)
17 August 18: V.Ivanchenko (emstand-V10-04-33)
- G4MottCoefficients class is removed because big inefficiency was reported
by Grigory Latyshev
- G4MottData.hh static data file is created instead
- G4ScreeningMottCrossSection - use G4MottData and improved time consuming
computations
12 August 18: M. Novak (emstand-V10-04-32)
- G4SBBremTable - fixed compiler warning
- G4eBremssrahlungRelModel, G4PairProductionRelModel - fixed possible out-of-
bound vector access introduced in the previous tag.
- G4SeltzerBergerModel - added extra protections for data per Z access
10 August 18: M. Novak (emstand-V10-04-31)
- G4DipBustGenerator - optimisation, speedup: using G4Pow::A13
- G4SeltzerBergerModel - extended model with optional sampling tables for fast
run time sampling of the emitted photon energy from the Seltzer-Berger scalled
DCS instead of using the rejection. The sampling tables are hadled by the new
G4SBBremTable class. There is a 40-60 % model speedup with some additional
memory consumption.
- G4eBremsstrahlungRelModel - improved LPM function approximation, code cleanup
and optimization.
27 July 18: V.Ivanchenko (emstand-V10-04-30)
- G4BetheHeitler5DModel - (I.Semeniouk) inverted CDF for X generation,
code cleanup; bug fix: Polarization vector not normalized in coordinate
transformation; removed empty lines
- G4BetheHeitlerModel, G4PairProductionRelModel - removed empty lines
25 June 18: V.Ivanchenko (emstand-V10-04-29)
- G4LindhardSorensenData - fixed Coverity warnings on read beyond
- G4LindhardSorensenData - fixed Coverity warnings on read beyond
the array boundary
15 June 18: V.Ivanchenko (emstand-V10-04-28)
@@ -27,14 +144,14 @@ committal in the CVS repository !
on read/write out of the array boundary
11 June 18: M.Novak (emstand-V10-04-27)
- G4PairProductionRelModel, G4BetheHeitler5DModel - fixed computation of cross
section in the new version of the high energy model. Fixed triplet production
below treshold in the 5D model by I. Semeniouk.
- G4PairProductionRelModel, G4BetheHeitler5DModel - fixed computation of cross
section in the new version of the high energy model. Fixed triplet production
below treshold in the 5D model by I. Semeniouk.
11 June 18: V.Ivanchenko (emstand-V10-04-26)
- G4AtimaEnergyLossModel, G4AtimaFluctuations - fixed data handling in the
new ion ionisation, which were identified by Coverity code analysis
04 June 18: M. Novak (emstand-V10-04-25)
- G4BetheHeitler5DModel - optimization of the final state sampling (M. Novak)
@@ -42,12 +159,12 @@ committal in the CVS repository !
- G4GoudsmitSaundersonTable - fix gcc-8 warnings regarding.
28 May 18: M. Novak (emstand-V10-04-23)
- G4BetheHeitlerModel, G4PairProductionRelModel, G4BetheHeitler5DModel - new
versions of G4BetheHeitlerModel, G4PairProductionRelModel with improved
screening function approximation, improved LPM function apporximation,
efficiency, documentation and cleanup. Corrected call to selecting target
atom in final state sampling. Follow up changes in the derived
G4BetheHeitler5DModel.
- G4BetheHeitlerModel, G4PairProductionRelModel, G4BetheHeitler5DModel - new
versions of G4BetheHeitlerModel, G4PairProductionRelModel with improved
screening function approximation, improved LPM function apporximation,
efficiency, documentation and cleanup. Corrected call to selecting target
atom in final state sampling. Follow up changes in the derived
G4BetheHeitler5DModel.
23 May 18: V.Ivanchenko (emstand-V10-04-22)
- G4BetheHeitlerModel - use G4ModifiedTsai angular generator
@@ -66,13 +183,13 @@ committal in the CVS repository !
- G4LindhardSorensenData - fixed Coverity warning
02 May 18: V.Ivanchenko (emstand-V10-04-17)
- G4ScreeningMottCrossSection - added extra method for more effective
computation of the Mott correction
- G4ScreeningMottCrossSection - added extra method for more effective
computation of the Mott correction
- G4WentzelOKandVIxSection - added Mott corrections to e+-
- G4NISTStoppingData - cleanup header
24 April 18: V.Ivanchenko (emstand-V10-04-16)
- G4LindhardSorensenIonModel,G4LindhardSorensenData - new relativistic ion
- G4LindhardSorensenIonModel,G4LindhardSorensenData - new relativistic ion
ionisation model
- G4BetheBlochModel - minor cleanup
@@ -106,24 +223,24 @@ committal in the CVS repository !
09 February 18: V.Ivanchenko (emstand-V10-04-04)
- G4eBremsstrahlungRelModel, G4PairProductionRelModel, G4PAIySection,
G4PAIxSection, G4ICRU73QOModel - inline method which use static constants
are moved to source, improved formatting of the code
are moved to source, improved formatting of the code
02 February 18: M.Novak (emstand-V10-04-03)
- G4GoudsmitSaundersonMscModel - implemented interface method for macroscopic
- G4GoudsmitSaundersonMscModel - implemented interface method for macroscopic
1st trans. x-section computation CrossSectionPerVolume (used only for testing)
- G4GSMottCorrection, G4GSPWACorrections - fixed initialization of 1st moment
- G4GSMottCorrection, G4GSPWACorrections - fixed initialization of 1st moment
correction factor
21 December 17: V.Ivanchenko (emstand-V10-04-02)
21 December 17: V.Ivanchenko (emstand-V10-04-02)
- G4WentzelOKandVIxSection - fixed formfactor for proton
- G4BetheBlochModel - use formfactor for projectile ion in
formulation of NIM A 488 (2002) 282; this is needed further
- G4BetheBlochModel - use formfactor for projectile ion in
formulation of NIM A 488 (2002) 282; this is needed further
evalution, so the tag is not proposed
09 December 17: V.Ivanchenko (emstand-V10-04-01)
- G4PairProductionRelModel - fixed misuse of G4Pow (A13(..) should
be used instead of Z13(..)), add initialisation of an element
cache before sampling of final state (partly fix problem #2017)
cache before sampling of final state (partly fix problem #2017)
08 November 17: D.Sawkey (emstand-V10-03-51)
- G4CoulombScattering, G4eMultipleScattering, G4hMultipleScattering
@@ -135,7 +252,7 @@ committal in the CVS repository !
03 November 17: V.Ivanchenko (emstand-V10-03-49)
- G4UrbanMscModel - renamed displacementFlag to dispAlg96, if its
value "true" then the old lateral displacment algorithm is used,
else a new one is applied. This change was needed to avoid
else a new one is applied. This change was needed to avoid
missunderstanding of the flag effect
02 November 17: V.Ivanchenko (emstand-V10-03-48)
@@ -152,14 +269,14 @@ committal in the CVS repository !
- G4GSPWACorrections - fix data read problem
30 October 17: M.Novak (emstand-V10-03-45)
- G4GoudsmitSaundersonMscModel, G4GoudsmitSaundersonTable,
- G4GoudsmitSaundersonMscModel, G4GoudsmitSaundersonTable,
G4GSMottCorrection, G4GSPWACorrections, G4PWATotalXsecTable
- new form of PWA corrections in the GS MSC model that is
active now both for e- and e+ (the G4PWATotalXsecTable
- new form of PWA corrections in the GS MSC model that is
active now both for e- and e+ (the G4PWATotalXsecTable
class is replaced with G4GSPWACorrections)
- improved scattering power correction computation in case
- improved scattering power correction computation in case
Mott-correction
- changed MSC step limit flag conventions in the GS model
- changed MSC step limit flag conventions in the GS model
25 October 17: V.Ivanchenko (emstand-V10-03-44)
- G4NuclearStopping - use activation limit for energy per nucleon
@@ -167,12 +284,12 @@ committal in the CVS repository !
19 October 17: D.Sawkey (emstand-V10-03-43)
- G4alphaIonisation, G4ComptonScattering, G4CoulombScattering,
G4eBremsstrahlung, G4eIonisation, G4eMultipleScattering,
G4ePlusAnnihilation, G4GammaConversion, G4hIonisation,
G4ePlusAnnihilation, G4GammaConversion, G4hIonisation,
G4hMultipleScattering, G4ionIonisation, G4NuclearStopping,
G4PhotoElectricEffect: add dummy ProcessDescription
16 October 17: V.Ivanchenko (emstand-V10-03-42)
- G4BetheHeitlerModel, G4PairProductionRelModel - use G4Pow in both
- G4BetheHeitlerModel, G4PairProductionRelModel - use G4Pow in both
classes instead of G4NistManager for fast math computations
12 October 17: V.Ivanchenko (emstand-V10-03-41)
@@ -197,11 +314,11 @@ committal in the CVS repository !
- G4UniversalFluctuation - added correction for small cuts
22 September 17: M.Novak (emstand-V10-03-35)
- G4GoudsmitSaundersonMscModel, G4GoudsmitSaundersonTable,
- G4GoudsmitSaundersonMscModel, G4GoudsmitSaundersonTable,
G4GSMottCorrection - further improvments to GS Mott-correction.
20 September 17: V.Ivanchenko (emstand-V10-03-34)
- G4UniversalFluctuation2017 - removed temporary class
- G4UniversalFluctuation2017 - removed temporary class
- G4PAIModel. G4PAIPhotModel - MinEnergyCut() is set to 12.5 eV, because
of results of D. Pfeiffer study of gaseous detector simulations
@@ -223,14 +340,14 @@ committal in the CVS repository !
25 August 17: M.Novak (emstand-V10-03-26)
- G4GoudsmitSaundersonMscModel, G4GoudsmitSaundersonTable - added
option to apply Mott-correction to the default GS model. The
new class G4GSMottCorrection handles the Mott-correction to the
angular distributions as well as correction factors to elastic,
option to apply Mott-correction to the default GS model. The
new class G4GSMottCorrection handles the Mott-correction to the
angular distributions as well as correction factors to elastic,
mfp, first and second moments.
24 August 17: V.Ivanchenko (emstand-V10-03-25)
- G4PAIModel. G4PAIPhotModel - added implementation of virtual
method MinEnergyCut(..), always return 25 eV, because PAI models
- G4PAIModel. G4PAIPhotModel - added implementation of virtual
method MinEnergyCut(..), always return 25 eV, because PAI models
does not applicable for smaller energy transfers
10 August 17: V.Ivanchenko (emstand-V10-03-24)
@@ -238,17 +355,17 @@ committal in the CVS repository !
particles
03 August 17: V.Ivanchenko (emstand-V10-03-23)
- G4MottCoefficients, G4ScreeningMottCrossSection,
- G4MottCoefficients, G4ScreeningMottCrossSection,
G4eSingleCoulombScatteringModel - Mauro Tacconi updated the model
making as fast as the default single scattering
- G4ComptonScattering, G4CoulombScattering, G4GammaConversion,
G4PhotoElectricEffect, G4WentzelOKandVIxSection, G4WentzelVIModel,
G4alphaIonisation, G4eIonisation, G4hIonisation, G4ionIonisation,
G4eBremsstrahlung, G4eMultipleScattering, G4hMultipleScattering
make coherent model initialisation
make coherent model initialisation
16 June 17: V.Ivanchenko (emstand-V10-03-22)
- G4eCoulombScatteringModel, G4WentzelVIModel,
- G4eCoulombScatteringModel, G4WentzelVIModel,
G4hCoulombScatteringModel - fixed problem of computation
of cross section introduced in emstand-V10-03-11
@@ -269,17 +386,17 @@ committal in the CVS repository !
in angular sampling
01 June 17: V.Ivanchenko (emstand-V10-03-17)
- G4WentzelVIRelModel - fixed typo responsible for numerical crash
- G4WentzelVIRelModel - fixed typo responsible for numerical crash
31 May 17: V.Ivanchenko (emstand-V10-03-16)
- G4BetheHeitlerModel, G4PairProductionRelModel - code cleanup and
- G4BetheHeitlerModel, G4PairProductionRelModel - code cleanup and
speedup, replaced remain log,exp by G4Log and G4Exp
31 May 17: V.Ivanchenko (emstand-V10-03-15)
- G4eBremsstrahlungRelModel - use new interface to triplet model
- G4eBremsstrahlungRelModel - use new interface to triplet model
29 May 17: V.Ivanchenko (emstand-V10-03-14)
- G4UniversalFluctuation, G4UniversalFluctuation2017 - L.Urban fixed
- G4UniversalFluctuation, G4UniversalFluctuation2017 - L.Urban fixed
numerical problem for very small steps for all particle types
26 May 17: V.Ivanchenko (emstand-V10-03-13)
@@ -294,8 +411,8 @@ committal in the CVS repository !
cloned from recent G4UniversalFluctuation (ref-04)
23 May 17: V.Ivanchenko (emstand-V10-03-11)
- G4WentzelOKandVIxSection, G4eCoulombScatteringModel,
G4WentzelVIModel, G4hCoulombScatteringModel - code and interface cleanup
- G4WentzelOKandVIxSection, G4eCoulombScatteringModel,
G4WentzelVIModel, G4hCoulombScatteringModel - code and interface cleanup
G4WentzelVIRelModel - use inheritance from G4WentzelVIModel
G4WentzelVIRelXSection - use inheritance from G4WentzelOKandVIxSection
@@ -304,9 +421,9 @@ committal in the CVS repository !
better FWHM values
4 May 17: V.Ivanchenko (emstand-V10-03-09)
- G4SauterGavrilaAngularDistribution - Marilena Bandieramonte
- G4SauterGavrilaAngularDistribution - Marilena Bandieramonte
introduced more efficient algorithm of sampling using
Penelope-2014 prescription; expected that simulation will be
Penelope-2014 prescription; expected that simulation will be
faster
3 May 17: V.Ivanchenko (emstand-V10-03-08)
@@ -320,16 +437,16 @@ committal in the CVS repository !
28 April 17: M.Novak (emstand-V10-03-06)
- G4GoudsmitSaundersonTable new representation of the GS angular
distributions (data size reduced from 16MB down to 5 MB)
22 April 17: L.Urban (emstand-V10-03-05)
- G4UniversalFluctuation correction to get results closer to data
27 March 17: L.Urban (emstand-V10-03-04)
- G4UniversalFluctuation correction in order to get better E_mp and
- G4UniversalFluctuation correction in order to get better E_mp and
FWHM in the case of small steps
24 March 17: V.Ivanchenko (emstand-V10-03-03)
- G4WentzelOKandVIxSection, G4WentzelVIRelXSection - added
- G4WentzelOKandVIxSection, G4WentzelVIRelXSection - added
"ScreeningFactor" parameter to study accuracy of scattering models
20 March 17: F.Hariri (emstand-V10-03-02)
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ASTARStopping.hh 96934 2016-05-18 09:10:41Z gcosmo $
#ifndef G4ASTARStopping_h
#define G4ASTARStopping_h 1
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4AtimaFluctuations.hh $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BetheBlochIonGasModel.hh 96934 2016-05-18 09:10:41Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BetheBlochModel.hh 108810 2018-03-08 15:04:30Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -38,17 +37,7 @@
//
// Modifications:
//
// 23-12-02 V.Ivanchenko change interface in order to moveto cut per region
// 24-01-03 Make models region aware (V.Ivanchenko)
// 13-02-03 Add name (V.Ivanchenko)
// 12-11-03 Fix for GenericIons (V.Ivanchenko)
// 24-03-05 Add G4EmCorrections (V.Ivanchenko)
// 11-04-05 Major optimisation of internal interfaces (V.Ivanchenko)
// 11-04-04 Move MaxSecondaryEnergy to models (V.Ivanchenko)
// 11-02-06 ComputeCrossSectionPerElectron, ComputeCrossSectionPerAtom (mma)
// 12-08-08 Added methods GetParticleCharge, GetChargeSquareRatio,
// CorrectionsAlongStep needed for ions(V.Ivanchenko)
// Modified by Michel Maire and Vladimir Ivanchenko
//
// Class Description:
//
@@ -68,6 +57,7 @@
class G4EmCorrections;
class G4ParticleChangeForLoss;
class G4ICRU90StoppingData;
class G4BetheBlochModel : public G4VEmModel
{
@@ -155,6 +145,9 @@ private:
G4EmCorrections* corr;
G4ParticleChangeForLoss* fParticleChange;
G4NistManager* nist;
G4ICRU90StoppingData* fICRU90;
const G4Material* currentMaterial;
const G4Material* baseMaterial;
G4double mass;
G4double tlimit;
@@ -165,6 +158,10 @@ private:
G4double formfact;
G4double twoln10;
G4double corrFactor;
G4double fAlphaTlimit;
G4double fProtonTlimit;
G4int iICRU90;
G4bool isIon;
};
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BetheHeitlerModel.hh 110527 2018-05-29 06:09:58Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -36,15 +35,12 @@
//
// Creation date: 19.04.2005
//
// Modifications:
// 02-02-06 Remove InitialiseCrossSectionPerAtom();
// 28-05-18 New version with improved screening function approximation, improved
// efficiency, documentation and cleanup (M. Novak)
// Modifications by Vladimir Ivanchenko, Michel Maire, Mihaly Novak
//
// Class Description:
//
// Implementation of gamma convertion to e+e- in the field of a nucleus
//
// For details see Physics Reference Manual
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BohrFluctuations.hh 96934 2016-05-18 09:10:41Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BraggIonGasModel.hh 96934 2016-05-18 09:10:41Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BraggIonModel.hh 96934 2016-05-18 09:10:41Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -64,6 +63,7 @@
class G4ParticleChangeForLoss;
class G4EmCorrections;
class G4ICRU90StoppingData;
class G4BraggIonModel : public G4VEmModel
{
@@ -142,7 +142,7 @@ private:
G4BraggIonModel & operator=(const G4BraggIonModel &right) = delete;
G4BraggIonModel(const G4BraggIonModel&) = delete;
G4bool HasMaterial(const G4Material* material);
void HasMaterial(const G4Material* material);
G4double StoppingPower(const G4Material* material,
G4double kineticEnergy);
@@ -159,8 +159,10 @@ private:
G4ParticleChangeForLoss* fParticleChange;
static G4ASTARStopping* fASTAR;
G4ICRU90StoppingData* fICRU90;
const G4Material* currentMaterial;
const G4Material* baseMaterial;
G4double mass;
G4double spin;
@@ -176,6 +178,7 @@ private:
G4int iMolecula; // index in the molecula's table
G4int iASTAR; // index in ASTAR
G4int iICRU90;
G4bool isIon;
};
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BraggModel.hh 96934 2016-05-18 09:10:41Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -67,6 +66,7 @@
class G4ParticleChangeForLoss;
class G4EmCorrections;
class G4ICRU90StoppingData;
class G4BraggModel : public G4VEmModel
{
@@ -133,7 +133,7 @@ private:
inline void SetParticle(const G4ParticleDefinition* p);
G4bool HasMaterial(const G4Material* material);
void HasMaterial(const G4Material* material);
G4double StoppingPower(const G4Material* material,
G4double kineticEnergy);
@@ -157,8 +157,10 @@ private:
G4ParticleDefinition* theElectron;
G4ParticleChangeForLoss* fParticleChange;
static G4PSTARStopping* fPSTAR;
G4ICRU90StoppingData* fICRU90;
const G4Material* currentMaterial;
const G4Material* baseMaterial;
G4double mass;
G4double spin;
@@ -172,6 +174,7 @@ private:
G4int iMolecula; // index in the molecula's table
G4int iPSTAR; // index in PSTAR
G4int iICRU90;
G4bool isIon;
};
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ComptonScattering.hh 106717 2017-10-20 09:41:27Z gcosmo $
//
//------------------ G4ComptonScattering physics process -----------------------
// by Michel Maire, April 1996
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4CoulombScattering.hh 106717 2017-10-20 09:41:27Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -69,8 +68,7 @@ public:
protected:
// Print out of the class parameters
virtual void StreamProcessInfo(std::ostream& outFile,
G4String endOfLine=G4String("\n")) const override;
virtual void StreamProcessInfo(std::ostream& outFile) const override;
virtual void InitialiseProcess(const G4ParticleDefinition*) override;
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4DeltaAngle.hh 66241 2012-12-13 18:34:42Z gunter $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4DeltaAngle.hh 66241 2012-12-13 18:34:42Z gunter $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4DipBustGenerator.hh 110415 2018-05-23 06:44:31Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -32,14 +31,14 @@
//
// File name: G4DipBustGenerator
//
// Author: Vladimir Grichine
// Author: Vladimir Grichine
// Creation date: 17 May 2011
//
// Modifications:
//
// Modifications:
//
// Bremsstrahlung Angular Distribution Generation
// suggested the dipole approximation in the rest frame of electron
//
// Bremsstrahlung Angular Distribution Generation
// suggested the dipole approximation in the rest frame of electron
// busted in the laboratory frame.
//
// -------------------------------------------------------------------
@@ -83,7 +82,7 @@ private:
G4double SampleCosTheta(G4double kinEnergy);
// hide assignment operator
// hide assignment operator
G4DipBustGenerator & operator=(const G4DipBustGenerator &right) = delete;
G4DipBustGenerator(const G4DipBustGenerator&) = delete;
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ESTARStopping.hh 66241 2012-12-13 18:34:42Z gunter $
#ifndef G4ESTARStopping_h
#define G4ESTARStopping_h 1
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: $
//
// ----------------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: $
//
// ----------------------------------------------------------------------------
//
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4GammaConversion.hh 106717 2017-10-20 09:41:27Z gcosmo $
//
//
//------------------ G4GammaConversion physics process------------------------
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4GoudsmitSaundersonMscModel.hh 108305 2018-02-02 13:08:43Z gcosmo $
//
// ----------------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4GoudsmitSaundersonTable.hh 107824 2017-12-05 15:47:44Z gunter $
//
// -----------------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4HeatedKleinNishinaCompton.hh 96934 2016-05-18 09:10:41Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ICRU49NuclearStoppingModel.hh 103955 2017-05-04 11:29:54Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ICRU73QOModel.hh 108737 2018-03-02 13:49:56Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4InitXscPAI.hh 96934 2016-05-18 09:10:41Z gcosmo $
//
//
// G4InitXscPAI.hh -- header file
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4IonFluctuations.hh 100399 2016-10-20 07:38:12Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4KleinNishinaCompton.hh 96934 2016-05-18 09:10:41Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4KleinNishinaModel.hh 96934 2016-05-18 09:10:41Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4LindhardSorensenData.hh 96909 2016-05-17 10:16:09Z vnivanch $
#ifndef G4LindhardSorensenData_h
#define G4LindhardSorensenData_h 1
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4LindhardSorensenIonModel.hh 108808 2018-03-08 09:45:40Z vnivanch $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ModifiedTsai.hh 110415 2018-05-23 06:44:31Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MollerBhabhaModel.hh 96934 2016-05-18 09:10:41Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -1,94 +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. *
// ********************************************************************
//
// G4MottCoefficients.hh
//-------------------------------------------------------------------
//
// GEANT4 Class header file
//
// File name: G4MottCoefficients
//
// Author: Cristina Consolandi
//
// Creation date: 27.05.2012
//
// Class Description:
//
// Mott Coulomb Cross section coefficients:
//
// Reference:
// M.J. Boschini et al.
// "Non Ionizing Energy Loss induced by Electrons in the Space Environment"
// Proc. of the 13th International Conference on Particle Physics and Advanced Technology
// (13th ICPPAT, Como 3-7/10/2011), World Scientific (Singapore).
//
// Available at: http://arxiv.org/abs/1111.4042v4
// coeffb of par. 2.1 , eq. (17) were recalculated by M. Tacconi
// following the same procedur as:
//
// T. Lijian et al. "Analytic Fitting to the Mott Cross Section of Electrons"
// Radiat. Phys. Chem. 45 (1995), 235245.
//
//
// ----------------------------------------------------------------------------------------
//
#ifndef G4MottCoefficients_h
#define G4MottCoefficients_h 1
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class G4Pow;
class G4MottCoefficients
{
public:
explicit G4MottCoefficients();
virtual ~G4MottCoefficients();
void SetMottCoeff( G4double targetZ, G4double coeff[5][6] );
G4double GetTransitionRandom(G4double targetZ, G4double energy);
private:
G4MottCoefficients & operator=(const G4MottCoefficients &right) = delete;
G4MottCoefficients(const G4MottCoefficients&) = delete;
G4Pow* fG4pow;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PSTARStopping.hh 82967 2014-07-21 15:54:41Z vnivanch $
#ifndef G4NISTStoppingData_h
#define G4NISTStoppingData_h 1
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4NuclearStopping.hh 106717 2017-10-20 09:41:27Z gcosmo $
//
// -----------------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PAIModel.hh 105869 2017-08-24 13:37:59Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PAIModelData.hh 72008 2013-07-03 08:46:39Z vnivanch $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PAIModelData.hh 72008 2013-07-03 08:46:39Z vnivanch $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PAIPhotonModel.hh 73607 2013-09-02 10:04:03Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4PAIxSection.hh 108737 2018-03-02 13:49:56Z gcosmo $
//
//
// G4PAIxSection.hh -- header file
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4PAIySection.hh 108737 2018-03-02 13:49:56Z gcosmo $
//
//
// G4PAIySection.hh -- header file
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PEEffectFluoModel.hh 96934 2016-05-18 09:10:41Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PSTARStopping.hh 96934 2016-05-18 09:10:41Z gcosmo $
#ifndef G4PSTARStopping_h
#define G4PSTARStopping_h 1
@@ -98,7 +97,7 @@ private:
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4int G4PSTARStopping:: GetIndex (const G4Material* mat) const
inline G4int G4PSTARStopping::GetIndex (const G4Material* mat) const
{
G4int idx = -1;
for (G4int i=0; i<nvectors; ++i){
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PairProductionRelModel.hh 110527 2018-05-29 06:09:58Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PhotoElectricEffect.hh 106717 2017-10-20 09:41:27Z gcosmo $
//
//------------------ G4PhotoElectricEffect physics process ------------------
// by Michel Maire, 24 May 1996
@@ -0,0 +1,162 @@
//
// ********************************************************************
// * 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: G4SBBremTable
//
// Author: Mihaly Novak
//
// Creation date: 15.07.2018
//
// Modifications:
//
// Class description:
//
// Utility class to handle sampling tables for the Seltzer-Berger scalled brems-
// strahlung differential cross sections. It makes possible fast (significantly
// faster than the rejection) sampling of the emitted photon energy in case of
// interactions. An object from this class is supposed to be a member of the
// Seltzer-Berger model for e-/e+ bremsstrahlung photon emission model. Note,
// that one object from this class can handle both e- and e+ cases (containes
// e+ correction in the SampleEnergyTransfer method only).
//
// ----------------------------------------------------------------------------
#ifndef G4SBBremTable_h
#define G4SBBremTable_h 1
#include "globals.hh"
#include "G4String.hh"
#include <vector>
// forward declar
class G4MaterialCutsCouple;
class G4SBBremTable {
public:
// CTR/DTR
G4SBBremTable();
~G4SBBremTable();
// loads and init sampling tables: lowe/highe are the low/high energy usage
// limits of the corresponding Seltzerberger-model.
void Initialize(const G4double lowe, const G4double highe);
// clean away all sampling tables and makes ready for re-initialisation
void ClearSamplingTables();
// run-time method to sample energy transferred to the emitted photon
double SampleEnergyTransfer(const G4double eekin, const G4double leekin,
const G4double gcut , const G4double dielSupConst,
const G4int izet , const G4int matCutIndx,
const bool iselectron);
// used only for development: print out table related information
// void Dump();
private:
void BuildSamplingTables();
void InitSamplingTables();
void LoadSTGrid();
void LoadSamplingTables(G4int iz);
void ReadCompressedFile(const G4String &fname, std::istringstream &iss);
private:
// Sampling-Table point: describes one [E_i],[kappa_j] point
struct STPoint {
G4double fCum; // value of the cumulative function
G4double fParA; // rational function approximation based interp. parameter
G4double fParB; // rational function approximation based interp. parameter
};
// Sampling-Table: describes one [E_j] e- energy point i.e. one Table
struct STable {
// cumulative values for the kappa-cuts: kappa_cut_i=E_gamma_cut_i/E_el_j
std::vector<G4double> fCumCutValues;
// as many STPoint-s as kappa values
std::vector<STPoint> fSTable;
};
// Sampling-Tables for a given Z:
// describes all tables (i.e. for all e- energies) for a given element (Z)
struct SamplingTablePerZ {
SamplingTablePerZ() : fNumGammaCuts(0), fMinElEnergyIndx(-1), fMaxElEnergyIndx(-1) {}
size_t fNumGammaCuts; // number of gamma-cut for this
G4int fMinElEnergyIndx; // max(i) such E_i <= E for all E
G4int fMaxElEnergyIndx; // min(i) such E_i >= E for all E
std::vector<STable*> fTablesPerEnergy; // as many table as e-ekin grid point
//the different gamma-cut values that are defined for this element(Z) and ln
std::vector<G4double> fGammaECuts;
std::vector<G4double> fLogGammaECuts;
// the couple index element stores the corresponding (sorted) gamma-cut index
std::vector<size_t> fMatCutIndxToGamCutIndx;
// temporary vector to store some indecis during initialisation
std::vector< std::vector<size_t> > fGamCutIndxToMatCutIndx;
};
// simple linear search: most of the time faster than anything in our case
G4int LinSearch(const std::vector<STPoint>& vect,
const G4int size,
const G4double val);
private:
// pre-prepared sampling tables are available:
G4int fMaxZet; // max Z number
G4int fNumElEnergy; // # e- kine (E_k) per Z
G4int fNumKappa; // # red. photon eners per E_k
// min/max electron kinetic energy usage limits
G4double fUsedLowEenergy;
G4double fUsedHighEenergy;
G4double fLogMinElEnergy;
G4double fILDeltaElEnergy;
// e- kinetic energy and reduced photon energy grids and tehir logarithms
std::vector<G4double> fElEnergyVect;
std::vector<G4double> fLElEnergyVect;
std::vector<G4double> fKappaVect;
std::vector<G4double> fLKappaVect;
// container to store samplingtables per Z (size is fMaxZet+1)
std::vector<SamplingTablePerZ*> fSBSamplingTables;
};
#endif
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4SauterGavrilaAngularDistribution.hh 96934 2016-05-18 09:10:41Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -35,8 +35,6 @@
// Creation date: 20.10.2011
//
// Modifications:
// 27-05-2012 Added Analytic Fitting to the Mott Cross Section by means of G4MottCoefficients class.
//
//
// Class Description:
// Computation of electron Coulomb Scattering Cross Section.
@@ -45,7 +43,7 @@
// Reference:
// M.J. Boschini et al.
// "Non Ionizing Energy Loss induced by Electrons in the Space Environment"
// Proc. of the 13th International Conference on Particle Physics and Advanced Technology
// Proc. of the 13th Int. Conf. on Particle Physics and Advanced Technology
// (13th ICPPAT, Como 3-7/10/2011), World Scientific (Singapore).
// Available at: http://arxiv.org/abs/1111.4042v4
//
@@ -58,9 +56,9 @@
// 2) Screening coefficient:
// vomn G. Moliere, Z. Naturforsh A2 (1947), 133-145; A3 (1948), 78.
// 3) Nuclear Form Factor:
// A.V. Butkevich et al. Nucl. Instr. and Meth. in Phys. Res. A 488 (2002), 282-294.
// A.V. Butkevich et al. Nucl. Instr. Meth. A488 (2002), 282-294.
//
// ----------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------
//
#ifndef G4ScreeningMottCrossSection_h
@@ -68,162 +66,165 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4MottCoefficients.hh"
#include "globals.hh"
#include "G4Material.hh"
#include "G4Element.hh"
#include "G4ElementVector.hh"
#include "G4NistManager.hh"
#include "G4ThreeVector.hh"
#include "G4Pow.hh"
#include "G4LossTableManager.hh"
#include "G4ParticleDefinition.hh"
#include "G4ThreeVector.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
static const G4int DIM = 750;
class G4ParticleDefinition;
class G4NistManager;
class G4Pow;
class G4ScreeningMottCrossSection
{
public:
explicit G4ScreeningMottCrossSection();
explicit G4ScreeningMottCrossSection();
virtual ~G4ScreeningMottCrossSection();
virtual ~G4ScreeningMottCrossSection();
void Initialise(const G4ParticleDefinition*, G4double cosThetaLim);
void Initialise(const G4ParticleDefinition*, G4double cosThetaLim);
G4double GetScreeningAngle();
void SetScreeningCoefficient();
inline void SetupParticle(const G4ParticleDefinition*);
void SetupKinematic(G4double kinEnergy ,G4double Z);
inline void SetupParticle(const G4ParticleDefinition*);
void SetupKinematic(G4double kinEnergy ,G4double Z);
G4double NuclearCrossSection(G4int, G4int);
G4ThreeVector GetNewDirection();
G4double NuclearCrossSection(G4int, G4int);
G4ThreeVector GetNewDirection();
inline G4double GetMom2CM()const;
inline G4double GetMom2Lab()const;
inline G4double GetTrec() const;
inline G4double GetScreeningCoefficient() const;
inline G4double GetTotalCross() const;
inline G4double GetMom2CM()const;
inline G4double GetMom2Lab()const;
inline G4double GetTrec() const;
inline G4double GetScreeningCoefficient() const;
inline G4double GetTotalCross() const;
G4double McFcorrection(G4double);
G4double RatioMottRutherford(G4double);
G4double RatioMottRutherfordCosT(G4double);
G4double FormFactor2ExpHof(G4double);
G4double FormFactor2Gauss(G4double);
G4double FormFactor2UniformHelm(G4double);
G4double GetScatteringAngle(G4int, G4int);
G4double SetDifferentialXSection(G4double, G4double, G4int);
G4double McFcorrection(G4double);
G4double RatioMottRutherford(G4double);
G4double RatioMottRutherfordCosT(G4double);
G4double FormFactor2ExpHof(G4double);
G4double FormFactor2Gauss(G4double);
G4double FormFactor2UniformHelm(G4double);
G4double GetScatteringAngle(G4int, G4int);
G4double SetDifferentialXSection(G4double, G4double, G4int);
private:
G4ScreeningMottCrossSection & operator=(const G4ScreeningMottCrossSection &right) = delete;
G4ScreeningMottCrossSection(const G4ScreeningMottCrossSection&) = delete;
inline G4double GetScreeningAngle();
void SetScreeningCoefficient();
G4NistManager* fNistManager;
G4Pow* fG4pow;
G4MottCoefficients * mottcoeff;
G4double GetTransitionRandom();
G4double TotalCross;
//cost - min - max
G4double cosThetaMin;// def 1.0
G4double cosThetaMax;// def -1.0
G4ScreeningMottCrossSection & operator=
(const G4ScreeningMottCrossSection &right) = delete;
G4ScreeningMottCrossSection(const G4ScreeningMottCrossSection&) = delete;
G4double cosTetMinNuc;
G4double cosTetMaxNuc;
G4NistManager* fNistManager;
G4Pow* fG4pow;
//energy cut
G4double ecut;
G4double etag;
G4double fTotalCross;
//cost - min - max
G4double cosThetaMin;// def 1.0
G4double cosThetaMax;// def -1.0
// projectile........................
const G4ParticleDefinition* particle;
G4double cosTetMinNuc;
G4double cosTetMaxNuc;
G4double spin;
G4double mass;
//energy cut
G4double ecut;
G4double etag;
//lab of incedent particle
G4double tkinLab;
G4double momLab2;
G4double invbetaLab2;
// projectile........................
const G4ParticleDefinition* particle;
//relative system with nucleus
G4double mu_rel;
G4double tkin;
G4double mom2;
G4double invbeta2;
G4double beta;
G4double gamma;
G4double spin;
G4double mass;
// target nucleus
G4double targetZ;
G4double targetA;
G4double targetMass;
G4double Trec;
G4double As;
G4double coeffb[5][6];
//lab of incedent particle
G4double tkinLab;
G4double momLab2;
G4double invbetaLab2;
//constants
G4double alpha;
G4double htc2;
G4double e2;
//relative system with nucleus
G4double mu_rel;
G4double tkin;
G4double mom2;
G4double invbeta2;
G4double beta;
G4double gamma;
//angle
G4double cross[DIM];
// target nucleus
G4int targetZ;
G4int targetA;
G4double targetMass;
G4double Trec;
G4double As;
//constants
G4double alpha;
G4double htc2;
G4double e2;
//angle
G4double cross[DIM];
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4ScreeningMottCrossSection::SetupParticle(const G4ParticleDefinition* p)
inline
void G4ScreeningMottCrossSection::SetupParticle(const G4ParticleDefinition* p)
{
particle = p;
mass = particle->GetPDGMass();
spin = particle->GetPDGSpin();
if(0.0 != spin) { spin = 0.5; }
tkin = 0.0;
particle = p;
mass = particle->GetPDGMass();
spin = particle->GetPDGSpin();
if(0.0 != spin) { spin = 0.5; }
tkin = 0.0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4ScreeningMottCrossSection::GetMom2CM() const
{
return mom2;
return mom2;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4ScreeningMottCrossSection::GetMom2Lab() const
{
return momLab2;
return momLab2;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4ScreeningMottCrossSection::GetTrec() const
{
return Trec;
return Trec;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4ScreeningMottCrossSection::GetScreeningCoefficient() const
{
return As;
return As;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4ScreeningMottCrossSection::GetTotalCross() const
{
return TotalCross;
return fTotalCross;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4ScreeningMottCrossSection::GetScreeningAngle()
{
G4double screenangle=2.*std::asin(std::sqrt(As));
return std::min(screenangle, CLHEP::pi);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4SeltzerBergerModel.hh 98737 2016-08-09 12:51:38Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -38,12 +37,18 @@
//
// Modifications:
//
// 24.07.2018 Introduced possibility to use sampling tables to sample the
// emitted photon energy (instead of using rejectio) from the Seltzer-
// Berger scalled DCS for bremsstrahlung photon emission. Using these
// sampling tables option gives faster(30-70%) final state generation
// than the original rejection but takes some extra memory (+ ~6MB in
// the case of the full CMS detector). (M Novak)
//
// Class Description:
//
// Implementation of the bremssrahlung energy spectrum using
// 1. S.M. Seltzer and M.J. Berger Nucl. Instr. Meth. B12 (1985) 95
// 2. S.M. Seltzer and M.J. Berger Atomic data and Nuclear Data
// 2. S.M. Seltzer and M.J. Berger Atomic data and Nuclear Data
// Tables 35 (1986) 345
// Cross section computation in the base class G4eBremsstrahlungRelModel
@@ -57,28 +62,34 @@
#include "globals.hh"
class G4Physics2DVector;
class G4SBBremTable;
class G4SeltzerBergerModel : public G4eBremsstrahlungRelModel
{
public:
explicit G4SeltzerBergerModel(const G4ParticleDefinition* p = nullptr,
const G4String& nam = "eBremSB");
explicit G4SeltzerBergerModel(const G4ParticleDefinition* p = nullptr,
const G4String& nam = "eBremSB");
virtual ~G4SeltzerBergerModel();
virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&) override;
virtual void Initialise(const G4ParticleDefinition*,
const G4DataVector&) override;
virtual void InitialiseForElement(const G4ParticleDefinition*, G4int Z) override;
virtual void InitialiseForElement(const G4ParticleDefinition*,
G4int Z) override;
virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double cutEnergy,
G4double maxEnergy) override;
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double cutEnergy,
G4double maxEnergy) override;
inline void SetBicubicInterpolationFlag(G4bool);
virtual void SetupForMaterial(const G4ParticleDefinition*,
const G4Material*,G4double) override;
inline void SetBicubicInterpolationFlag(G4bool val) { fIsUseBicubicInterpolation = val; }
protected:
@@ -88,27 +99,30 @@ protected:
private:
void ReadData(G4int Z, const char* path = 0);
void ReadData(G4int izet, const char* path = nullptr);
// hide assignment operator
G4double SampleEnergyTransfer(const G4double kineticEnergy, const G4double cut,
const G4double emax);
// hide assignment operator and cctr
G4SeltzerBergerModel & operator=(const G4SeltzerBergerModel &right) = delete;
G4SeltzerBergerModel(const G4SeltzerBergerModel&) = delete;
static G4Physics2DVector* dataSB[101];
static G4double ylimit[101];
static G4double expnumlim;
G4int nwarn;
size_t idx;
size_t idy;
G4bool useBicubicInterpolation;
private:
static constexpr G4int gMaxZet = 101;
static constexpr G4double gExpNumLimit = -12.;
static G4double gYLimitData[gMaxZet];
static G4Physics2DVector* gSBDCSData[gMaxZet];
static G4SBBremTable* gSBSamplingTable;
G4bool fIsUseBicubicInterpolation;
G4bool fIsUseSamplingTables;
G4int fNumWarnings;
size_t fIndx;
size_t fIndy;
};
inline void G4SeltzerBergerModel::SetBicubicInterpolationFlag(G4bool val)
{
useBicubicInterpolation = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4UniversalFluctuation.hh 106204 2017-09-19 10:37:49Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: $
// GEANT4 tag $Name: $
//
// -------------------------------------------------------------------
//
@@ -161,6 +159,7 @@ private:
G4double par1,par2,par3;
G4double stepmin;
G4double stepmina,stepminb;
G4double currentKinEnergy;
G4double currentRange;
@@ -232,6 +231,9 @@ inline void G4UrbanMscModel::UpdateCache()
Z2 = Zeff*Zeff;
Z23 = Z13*Z13;
stepmina = 15.99/(1.+0.119*Zeff);
stepminb = 4.39/(1.+0.079*Zeff);
Zold = Zeff;
}
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4WaterStopping.hh 96934 2016-05-18 09:10:41Z gcosmo $
#ifndef G4WaterStopping_h
#define G4WaterStopping_h 1
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4WentzelOKandVIxSection.hh 109683 2018-05-08 10:36:32Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4WentzelVIModel.hh 104307 2017-05-24 09:01:45Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4WentzelVIRelModel.hh 104307 2017-05-24 09:01:45Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4WentzelVIRelXSection.hh 104307 2017-05-24 09:01:45Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4alphaIonisation.hh 106717 2017-10-20 09:41:27Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4eBremParametrizedModel.hh 98737 2016-08-09 12:51:38Z gcosmo $
// GEANT4 tag $Name: geant4-09-04 $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4eBremsstrahlung.hh 106717 2017-10-20 09:41:27Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -95,8 +94,7 @@ public:
protected:
// Print out of the class parameters
virtual void StreamProcessInfo(std::ostream& outFile,
G4String endOfLine=G4String("\n")) const override;
virtual void StreamProcessInfo(std::ostream& outFile) const override;
virtual void
InitialiseEnergyLossProcess(const G4ParticleDefinition*,
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4eBremsstrahlungRelModel.hh 108737 2018-03-02 13:49:56Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -33,12 +32,14 @@
// File name: G4eBremsstrahlungRelModel
// extention of standard G4eBremsstrahlungModel
//
// Author: Andreas Schaelicke
// Author: Andreas Schaelicke
//
// Creation date: 28.03.2008
//
// Modifications:
//
// 15.07.18 introduced data structures to store LPM functions and element depen
// dent data for faster run-time computation (see more in .cc M.Novak)
//
// Class Description:
//
@@ -52,202 +53,166 @@
#define G4eBremsstrahlungRelModel_h 1
#include "G4VEmModel.hh"
#include "G4NistManager.hh"
#include "G4Exp.hh"
#include "G4Log.hh"
class G4ParticleChangeForLoss;
class G4PhysicsVector;
class G4eBremsstrahlungRelModel : public G4VEmModel
{
class G4eBremsstrahlungRelModel : public G4VEmModel {
public:
explicit G4eBremsstrahlungRelModel(const G4ParticleDefinition* p = 0,
const G4String& nam = "eBremLPM");
explicit G4eBremsstrahlungRelModel(const G4ParticleDefinition* p=0,
const G4String& nam="eBremLPM");
~G4eBremsstrahlungRelModel() = default;
virtual ~G4eBremsstrahlungRelModel();
virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&) override;
virtual void Initialise(const G4ParticleDefinition*,
const G4DataVector&) override;
virtual void InitialiseLocal(const G4ParticleDefinition*,
G4VEmModel* masterModel) override;
virtual void InitialiseLocal(const G4ParticleDefinition*,
G4VEmModel* masterModel) override;
virtual G4double ComputeDEDXPerVolume(const G4Material*,
const G4ParticleDefinition*,
G4double kineticEnergy,
G4double ekin,
G4double cutEnergy) override;
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
G4double tkin,
G4double Z, G4double,
G4double ekin,
G4double zet,
G4double,
G4double cutEnergy,
G4double maxEnergy = DBL_MAX) override;
virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double cutEnergy,
G4double maxEnergy) override;
virtual void SetupForMaterial(const G4ParticleDefinition*,
const G4Material*,G4double) override;
virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double cutEnergy,
G4double maxEnergy) override;
virtual void SetupForMaterial(const G4ParticleDefinition*,
const G4Material*,
G4double) override;
virtual G4double MinPrimaryEnergy(const G4Material*,
const G4ParticleDefinition*,
G4double cut) override;
inline void SetLPMconstant(G4double val);
inline G4double LPMconstant() const;
inline void SetLowestKinEnergy(G4double);
inline G4double LowestKinEnergy() const;
G4double cutEnergy) override;
protected:
virtual G4double ComputeDXSectionPerAtom(G4double gammaEnergy);
void SetCurrentElement(G4int);
void SetParticle(const G4ParticleDefinition* p);
private:
void InitialiseConstants();
void CalcLPMFunctions(G4double gammaEnergy);
G4double ComputeBremLoss(G4double cutEnergy);
G4double ComputeXSectionPerAtom(G4double cutEnergy);
G4double ComputeRelDXSectionPerAtom(G4double gammaEnergy);
void SetParticle(const G4ParticleDefinition* p);
// init special data per element i.e. per Z
void InitialiseElementData();
inline G4double Phi1(G4double,G4double);
inline G4double Phi1M2(G4double,G4double);
inline G4double Psi1(G4double,G4double);
inline G4double Psi1M2(G4double,G4double);
// methods for initialisation and run-time evaluation of LPM functions:
void InitLPMFunctions();
// hide assignment operator
G4eBremsstrahlungRelModel & operator=(const G4eBremsstrahlungRelModel &right) = delete;
void ComputeLPMfunctions(G4double& funcXiS,
G4double& funcGS,
G4double& funcPhiS,
const G4double egamma);
void GetLPMFunctions(G4double& lpmGs,
G4double& lpmPhis,
const G4double s);
void ComputeLPMGsPhis(G4double& funcGS,
G4double& funcPhiS,
const G4double varShat);
//
// for evaluating screening related functions
void ComputeScreeningFunctions(G4double& phi1,
G4double& phi1m2,
G4double& psi1,
G4double& psi1m2,
const G4double gam,
const G4double eps);
// hide assignment operator and cctr
G4eBremsstrahlungRelModel& operator=(const G4eBremsstrahlungRelModel& right) = delete;
G4eBremsstrahlungRelModel(const G4eBremsstrahlungRelModel&) = delete;
protected:
G4NistManager* nist;
const G4ParticleDefinition* particle;
G4ParticleDefinition* theGamma;
G4bool fIsElectron;
G4bool fIsScatOffElectron;
G4bool fIsLPMActive;
//
G4int fCurrentIZ;
// cash
G4double fPrimaryParticleMass;
G4double fPrimaryKinEnergy;
G4double fPrimaryTotalEnergy;
G4double fDensityFactor;
G4double fDensityCorr;
G4double fLowestKinEnergy;
// scattering off electrons
G4double fNucTerm;
G4double fSumTerm;
//
static const G4double gBremFactor;
static const G4double gMigdalConstant;
//
const G4ParticleDefinition* fPrimaryParticle;
G4ParticleDefinition* fGammaParticle;
G4ParticleChangeForLoss* fParticleChange;
G4double bremFactor;
// cash
G4double particleMass;
G4double kinEnergy;
G4double totalEnergy;
G4double densityFactor;
G4double densityCorr;
// scattering off electrons
G4double nucTerm;
G4double sumTerm;
G4bool scatOffElectron;
G4bool isElectron;
G4int currentZ;
private:
static const G4double xgi[8], wgi[8];
static const G4double Fel_light[5];
static const G4double Finel_light[5];
// consts
G4double lowestKinEnergy;
G4double fMigdalConstant;
G4double fLPMconstant;
G4double energyThresholdLPM;
G4double facFel, facFinel;
G4double preS1,logTwo;
// cash
G4double z13, z23, lnZ;
G4double Fel, Finel, fCoulomb, fMax;
// LPM effect
G4double lpmEnergy;
G4double xiLPM, phiLPM, gLPM;
// critical gamma energies
G4double klpm, kp;
// flags
G4bool use_completescreening;
static const G4int gMaxZet;
//
static const G4double gLPMconstant;
//
static const G4double gXGL[8];
static const G4double gWGL[8];
static const G4double gFelLowZet[8];
static const G4double gFinelLowZet[8];
//
struct ElementData {
/** @brief \f$ \ln(Z) \f$ */
G4double fLogZ;
/** @brief \f$ \ln(Z)/3 + f_c \f$ */
G4double fFz;
/** @brief \f$ ((Fel-fc)+Finel*invZ)\f$ */
G4double fZFactor1;
/** @brief \f$ (Fel-fc)\f$ */
G4double fZFactor11;
/** @brief \f$ (1.0+invZ)/12 \f$ */
G4double fZFactor2;
// LPM variables
G4double fVarS1;
G4double fILVarS1;
G4double fILVarS1Cond;
// constant factors to the screening function evaluations
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;
//
G4bool fIsUseCompleteScreening;
// LPM related members
G4double fLPMEnergyThreshold;
G4double fLPMEnergy;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4eBremsstrahlungRelModel::Phi1(G4double gg, G4double)
{
// Thomas-Fermi FF from Tsai, eq.(3.38) for Z>=5
return 20.863 - 2.*G4Log(1. + sqr(0.55846*gg) )
- 4.*( 1. - 0.6*G4Exp(-0.9*gg) - 0.4*G4Exp(-1.5*gg) );
}
inline G4double G4eBremsstrahlungRelModel::Phi1M2(G4double gg, G4double)
{
// Thomas-Fermi FF from Tsai, eq. (3.39) for Z>=5
// return Phi1(gg,Z) -
return 2./(3.*(1. + 6.5*gg +6.*gg*gg) );
}
inline G4double G4eBremsstrahlungRelModel::Psi1(G4double eps, G4double)
{
// Thomas-Fermi FF from Tsai, eq.(3.40) for Z>=5
return 28.340 - 2.*G4Log(1. + sqr(3.621*eps) )
- 4.*( 1. - 0.7*G4Exp(-8*eps) - 0.3*G4Exp(-29.*eps) );
}
inline G4double G4eBremsstrahlungRelModel::Psi1M2(G4double eps, G4double)
{
// Thomas-Fermi FF from Tsai, eq. (3.41) for Z>=5
return 2./(3.*(1. + 40.*eps +400.*eps*eps) );
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline
void G4eBremsstrahlungRelModel::SetLPMconstant(G4double val)
{
fLPMconstant = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline
G4double G4eBremsstrahlungRelModel::LPMconstant() const
{
return fLPMconstant;
}
inline void G4eBremsstrahlungRelModel::SetLowestKinEnergy(G4double val)
{
lowestKinEnergy = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4eBremsstrahlungRelModel::LowestKinEnergy() const
{
return lowestKinEnergy;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4eCoulombScatteringModel.hh 104307 2017-05-24 09:01:45Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4eIonisation.hh 106717 2017-10-20 09:41:27Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4eMultipleScattering.hh 106717 2017-10-20 09:41:27Z gcosmo $
//
// -----------------------------------------------------------------------------
//
@@ -75,8 +74,7 @@ public: // with description
protected:
// Print out of the class parameters
virtual void StreamProcessInfo(std::ostream& outFile,
G4String endOfLine=G4String("\n")) const override;
virtual void StreamProcessInfo(std::ostream& outFile) const override;
// This function initialise models
void InitialiseProcess(const G4ParticleDefinition*) override;
@@ -93,7 +93,8 @@ public:
G4double maxEnergy) final;
inline void SetRecoilThreshold(G4double eth);
inline void SetXSectionModel(const G4String& model);
void SetXSectionModel(const G4String& model);
private:
@@ -160,14 +161,4 @@ inline void G4eSingleCoulombScatteringModel::SetRecoilThreshold(G4double eth)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4eSingleCoulombScatteringModel::SetXSectionModel(const G4String& model)
{
if(model == "fast") { XSectionModel=1; }
else if(model == "precise") { XSectionModel=0; }
else { G4cout<<"G4eSingleCoulombScatteringModel WARNING: "<<model
<<" : G4eSingleScatteringModel x-section model is not valid"<<G4endl;}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4eeToTwoGammaModel.hh 109177 2018-04-03 06:55:14Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4eplusAnnihilation.hh 106717 2017-10-20 09:41:27Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -88,8 +87,7 @@ public:
protected:
// Print out of the class parameters
virtual void StreamProcessInfo(std::ostream& outFile,
G4String endOfLine=G4String("\n")) const override;
virtual void StreamProcessInfo(std::ostream& outFile) const override;
virtual void InitialiseProcess(const G4ParticleDefinition*) override;
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4eplusTo2GammaOKVIModel.hh 96909 2016-05-17 10:16:09Z vnivanch $
//
// -------------------------------------------------------------------
//
@@ -52,6 +51,7 @@
class G4eplusTo3GammaOKVIModel;
class G4ParticleChangeForGamma;
class G4PhysicsVector;
class G4DataVector;
class G4eplusTo2GammaOKVIModel : public G4VEmModel
{
@@ -88,6 +88,8 @@ public:
G4double tmin = 0.0,
G4double maxEnergy = DBL_MAX) final;
inline void SetDelta(G4double val) { if(val > 0.0) { fDelta = val; } };
private:
// hide assignment operator
@@ -95,13 +97,16 @@ private:
(const G4eplusTo2GammaOKVIModel &right) = delete;
G4eplusTo2GammaOKVIModel(const G4eplusTo2GammaOKVIModel&) = delete;
G4double pi_rcl2;
G4double energyTh;
G4ParticleDefinition* theGamma;
G4double fDelta;
G4double fGammaTh;
const G4ParticleDefinition* theGamma;
G4ParticleChangeForGamma* fParticleChange;
G4eplusTo3GammaOKVIModel* f3GModel;
const G4DataVector* fCuts;
static G4PhysicsVector* fCrossSection;
static G4PhysicsVector* fCrossSection3G;
static G4PhysicsVector* f3GProbability;
};
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4eplusTo3GammaOKVIModel.hh 96909 2016-05-17 10:16:09Z vnivanch $
//
// -------------------------------------------------------------------
//
@@ -32,14 +31,14 @@
//
// File name: G4eplusTo3GammaOKVIModel
//
// Author: Vladimir Ivanchenko and Omrane Kadri
// Authors: Andrei Alkin, Vladimir Ivanchenko, Omrame Kadri
//
// Creation date: 29.03.2018
//
//
// Class Description:
//
// Implementation of e+ annihilation into 2 gamma
// Implementation of e+ annihilation into 3 gamma
// -------------------------------------------------------------------
//
@@ -65,6 +64,8 @@ public:
const G4DataVector&) final;
G4double ComputeCrossSectionPerElectron(G4double kinEnergy);
virtual G4double ComputeCrossSectionPerAtom(
const G4ParticleDefinition*,
@@ -85,6 +86,14 @@ public:
const G4DynamicParticle*,
G4double tmin = 0.0,
G4double maxEnergy = DBL_MAX) final;
G4double ComputeF(G4double fr1, G4double fr2, G4double fr3, G4double kinEnergy);
G4double ComputeF0(G4double fr1, G4double fr2, G4double fr3);
G4double ComputeFS(G4double fr1, G4double fr2, G4double fr3, G4double kinEnergy);
inline void SetDelta(G4double val) { if(val > 0.0) { fDelta = val; } };
private:
@@ -93,12 +102,12 @@ private:
(const G4eplusTo3GammaOKVIModel &right) = delete;
G4eplusTo3GammaOKVIModel(const G4eplusTo3GammaOKVIModel&) = delete;
G4double pi_rcl2;
G4double energyTh;
G4ParticleDefinition* theGamma;
G4double fDelta;
const G4ParticleDefinition* theGamma;
G4ParticleChangeForGamma* fParticleChange;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4hCoulombScatteringModel.hh 104307 2017-05-24 09:01:45Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4hIonisation.hh 106717 2017-10-20 09:41:27Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4hMultipleScattering.hh 106717 2017-10-20 09:41:27Z gcosmo $
//
// -----------------------------------------------------------------------------
//
@@ -77,8 +76,7 @@ public: // with description
protected:
// Print out of the class parameters
virtual void StreamProcessInfo(std::ostream& outFile,
G4String endOfLine=G4String("\n")) const override;
virtual void StreamProcessInfo(std::ostream& outFile) const override;
// This function initialise models
virtual void InitialiseProcess(const G4ParticleDefinition*) override;
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ionIonisation.hh 106717 2017-10-20 09:41:27Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -96,8 +95,7 @@ public:
protected:
// Print out of the class parameters
virtual void StreamProcessInfo(std::ostream& outFile,
G4String endOfLine=G4String("\n")) const override;
virtual void StreamProcessInfo(std::ostream& outFile) const override;
virtual void
InitialiseEnergyLossProcess(const G4ParticleDefinition*,
@@ -11,7 +11,6 @@
#
# Generated on : 24/9/2010
#
# $Id: sources.cmake 109620 2018-05-03 13:01:04Z gcosmo $
#
#------------------------------------------------------------------------------
@@ -80,7 +79,7 @@ GEANT4_DEFINE_MODULE(NAME G4emstandard
G4LindhardSorensenIonModel.hh
G4ModifiedTsai.hh
G4MollerBhabhaModel.hh
G4MottCoefficients.hh
G4MottData.hh
G4NISTStoppingData.hh
G4NuclearStopping.hh
G4PAIModel.hh
@@ -93,6 +92,7 @@ GEANT4_DEFINE_MODULE(NAME G4emstandard
G4PSTARStopping.hh
G4PairProductionRelModel.hh
G4PhotoElectricEffect.hh
G4SBBremTable.hh
G4SauterGavrilaAngularDistribution.hh
G4ScreeningMottCrossSection.hh
G4SeltzerBergerModel.hh
@@ -156,7 +156,6 @@ GEANT4_DEFINE_MODULE(NAME G4emstandard
G4LindhardSorensenIonModel.cc
G4ModifiedTsai.cc
G4MollerBhabhaModel.cc
G4MottCoefficients.cc
G4NuclearStopping.cc
G4PAIModel.cc
G4PAIModelData.cc
@@ -168,6 +167,7 @@ GEANT4_DEFINE_MODULE(NAME G4emstandard
G4PSTARStopping.cc
G4PairProductionRelModel.cc
G4PhotoElectricEffect.cc
G4SBBremTable.cc
G4SauterGavrilaAngularDistribution.cc
G4ScreeningMottCrossSection.cc
G4SeltzerBergerModel.cc
@@ -181,7 +181,7 @@ GEANT4_DEFINE_MODULE(NAME G4emstandard
G4XrayRayleighModel.cc
G4alphaIonisation.cc
G4eBremsstrahlung.cc
G4eBremParametrizedModel.cc
G4eBremParametrizedModel.cc
G4eBremsstrahlungRelModel.cc
G4eCoulombScatteringModel.cc
G4eIonisation.cc
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ASTARStopping.cc 95445 2016-02-11 08:18:10Z gcosmo $
//
//---------------------------------------------------------------------------
//
@@ -33,13 +33,17 @@
// Creation date: 16.01.2018
//
// Modifications:
//
// 09/10/2018: Solved bug in the determination of the material atomic number
//
// Class Description:
//
// This model calculates the stopping power of heavy ions (Z>2) according
// This model calculates the stopping power of ions according
// to the ATIMA code developed at GSI, Darmstadt, Germany.
// http://web-docs.gsi.de/~weick/atima/
// For details: http://web-docs.gsi.de/~weick/atima/
//
// Helmut Weick, GSI (responsible for fortran version)
// Andrej Prochazka, GSI (responsible for C version)
// Christoph Scheidenberger, GSI (project coordination)
//
// -------------------------------------------------------------------
//
@@ -255,7 +259,7 @@ G4double G4AtimaEnergyLossModel::ComputeDEDXPerVolume(const G4Material* material
{
//Call to ATIMA Stopping Power function
G4double zt = material->GetIonisation()->GetZeffective();
zt = std::max(zt,93.);
zt = std::min(zt,93.);
G4double at = nist->GetAtomicMassAmu(G4lrint(zt));
G4double dedx = StoppingPower(p->GetPDGMass(), p->GetPDGCharge(),
kineticEnergy/(MeV), at, zt) *material->GetDensity()/(g/cm3);
@@ -33,14 +33,18 @@
// Creation date: 16.01.2018
//
// Modifications:
//
// 09/10/2018: Deleted Titeica's correction at high energies
//
//
// Class Description:
//
// This model calculates the energy-loss fluctuations according to ATIMA code
// This model calculates the energy-loss fluctuations according to the ATIMA code
// developed at GSI, Darmstadt, Germany.
// http://web-docs.gsi.de/~weick/atima/
// For details: http://web-docs.gsi.de/~weick/atima/
//
// Helmut Weick, GSI (responsible for fortran version)
// Andrej Prochazka, GSI (responsible for C version)
// Christoph Scheidenberger, GSI (project coordination)
//
// -------------------------------------------------------------------
//
@@ -185,7 +189,8 @@ G4double G4AtimaFluctuations::Dispersion(const G4Material* mat,
G4double factor = 4.8184e-3*g4calc->powA(zp+zt,8.0/3.0)/at;
sse = std::min(f*(X+cor), factor*beta2/fine_structure/fine_structure);
}else{
sse = f*(X+cor);
// sse = f*(X+cor);
sse = f*X;//09/10/2018
}
//
return sse*length/(cm)*mat->GetDensity()/(g/cm3);
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BetheBlochIonGasModel.cc 66241 2012-12-13 18:34:42Z gunter $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BetheBlochModel.cc 109480 2018-04-24 14:46:36Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -65,6 +64,7 @@
#include "G4LossTableManager.hh"
#include "G4EmCorrections.hh"
#include "G4ParticleChangeForLoss.hh"
#include "G4ICRU90StoppingData.hh"
#include "G4Log.hh"
#include "G4DeltaAngle.hh"
@@ -76,8 +76,14 @@ G4BetheBlochModel::G4BetheBlochModel(const G4ParticleDefinition*,
const G4String& nam)
: G4VEmModel(nam),
particle(nullptr),
fICRU90(nullptr),
currentMaterial(nullptr),
baseMaterial(nullptr),
tlimit(DBL_MAX),
twoln10(2.0*G4Log(10.0)),
fAlphaTlimit(CLHEP::GeV),
fProtonTlimit(10*CLHEP::GeV),
iICRU90(-1),
isIon(false)
{
fParticleChange = nullptr;
@@ -108,6 +114,11 @@ void G4BetheBlochModel::Initialise(const G4ParticleDefinition* p,
// always false before the run
SetDeexcitationFlag(false);
if(IsMaster() && G4EmParameters::Instance()->UseICRU90Data()) {
if(!fICRU90) { fICRU90 = nist->GetICRU90StoppingData(); }
else if(particle->GetPDGMass() < GeV) { fICRU90->Initialise(); }
}
if(nullptr == fParticleChange) {
fParticleChange = GetParticleChangeForLoss();
if(UseAngularGeneratorFlag() && !GetAngularDistribution()) {
@@ -217,9 +228,8 @@ G4double G4BetheBlochModel::ComputeCrossSectionPerAtom(
G4double cutEnergy,
G4double maxEnergy)
{
G4double cross = Z*ComputeCrossSectionPerElectron
(p,kineticEnergy,cutEnergy,maxEnergy);
return cross;
return
Z*ComputeCrossSectionPerElectron(p,kineticEnergy,cutEnergy,maxEnergy);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -231,10 +241,8 @@ G4double G4BetheBlochModel::CrossSectionPerVolume(
G4double cutEnergy,
G4double maxEnergy)
{
G4double eDensity = material->GetElectronDensity();
G4double cross = eDensity*ComputeCrossSectionPerElectron
(p,kineticEnergy,cutEnergy,maxEnergy);
return cross;
return material->GetElectronDensity()
*ComputeCrossSectionPerElectron(p,kineticEnergy,cutEnergy,maxEnergy);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -251,14 +259,41 @@ G4double G4BetheBlochModel::ComputeDEDXPerVolume(const G4Material* material,
G4double gam = tau + 1.0;
G4double bg2 = tau * (tau+2.0);
G4double beta2 = bg2/(gam*gam);
G4double xc = cutEnergy/tmax;
G4double eexc = material->GetIonisation()->GetMeanExcitationEnergy();
G4double eexc2 = eexc*eexc;
G4double eDensity = material->GetElectronDensity();
// added ICRU90 stopping data for limited list of materials
if(fICRU90) {
if(material != currentMaterial) {
currentMaterial = material;
baseMaterial = material->GetBaseMaterial()
? material->GetBaseMaterial() : material;
iICRU90 = fICRU90->GetIndex(baseMaterial);
}
if(iICRU90 >= 0) {
G4double e = kineticEnergy*proton_mass_c2/mass;
G4double dedx = 0.0;
if(chargeSquare > 1.1 && e < fAlphaTlimit) {
dedx = fICRU90->GetElectronicDEDXforAlpha(iICRU90, e)
*material->GetDensity()*0.25;
} else if(chargeSquare < 1.1 && e < fProtonTlimit) {
dedx = fICRU90->GetElectronicDEDXforProton(iICRU90, e)
*material->GetDensity();
}
if(dedx > 0.0) {
dedx += (G4Log(xc) + (1.0 - xc)*beta2)*twopi_mc2_rcl2
*eDensity/beta2;
return std::max(chargeSquare*dedx, 0.0);
}
}
}
// general Bethe-Bloch formula
G4double dedx = G4Log(2.0*electron_mass_c2*bg2*cutEnergy/eexc2)
- (1.0 + cutEnergy/tmax)*beta2;
- (1.0 + xc)*beta2;
if(0.0 < spin) {
G4double del = 0.5*cutEnergy/(kineticEnergy + mass);
@@ -299,8 +334,8 @@ void G4BetheBlochModel::CorrectionsAlongStep(const G4MaterialCutsCouple* couple,
G4double length)
{
if(isIon) {
const G4ParticleDefinition* p = dp->GetDefinition();
const G4Material* mat = couple->GetMaterial();
const G4ParticleDefinition* p = dp->GetDefinition();
G4double preKinEnergy = dp->GetKineticEnergy();
G4double e = preKinEnergy - eloss*0.5;
if(e < preKinEnergy*0.75) { e = preKinEnergy*0.75; }
@@ -308,11 +343,15 @@ void G4BetheBlochModel::CorrectionsAlongStep(const G4MaterialCutsCouple* couple,
G4double q2 = corr->EffectiveChargeSquareRatio(p,mat,e);
GetModelOfFluctuations()->SetParticleAndCharge(p, q2);
G4double qfactor = q2*corr->EffectiveChargeCorrection(p,mat,e)/corrFactor;
G4double highOrder = length*corr->IonHighOrderCorrections(p,couple,e);
// no high order correction for ICRU90 data
baseMaterial = mat->GetBaseMaterial() ? mat->GetBaseMaterial() : mat;
G4double highOrder = 0.0;
if(!fICRU90 || fICRU90->GetIndex(baseMaterial) < 0) {
highOrder = length*corr->IonHighOrderCorrections(p,couple,e);
}
G4double elossnew = eloss*qfactor + highOrder;
if(elossnew > preKinEnergy) { elossnew = preKinEnergy; }
else if(elossnew < eloss*0.5) { elossnew = eloss*0.5; }
eloss = elossnew;
eloss = std::max(std::min(elossnew,preKinEnergy),eloss*0.5);
//G4cout << "G4BetheBlochModel::CorrectionsAlongStep: e= " << preKinEnergy
// << " qfactor= " << qfactor
// << " highOrder= " << highOrder << " ("
@@ -23,14 +23,13 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BetheHeitler5DModel.cc $
//
// -------------------------------------------------------------------
//
// GEANT4 Class file
//
//
// File name: G4BetheHeitler5DModel
// File name: G4BetheHeitler5DModel.cc
//
// Authors:
// Igor Semeniouk and Denis Bernard,
@@ -39,7 +38,7 @@
// Acknowledgement of the support of the French National Research Agency
// (ANR-13-BS05-0002).
//
// Reference: arXiv:1802.08253 [hep-ph]
// Reference: Nucl. Instrum. Meth. A 899 (2018) 85 (arXiv:1802.08253 [hep-ph])
//
// Class Description:
//
@@ -78,8 +77,8 @@
// cross section at small q2 and, at high-energy, at small polar angle, make it break down at
// some point that depends on machine precision.
//
// Very-high-energy LPM suppression effects in the normalized differential cross-section
// are not considered.
// Very-high-energy (above a few tens of TeV) LPM suppression effects in the normalized differential
// cross-section are not considered.
//
// The 5D differential cross section is sampled without any high-energy nor small
// angle approximation(s).
@@ -123,10 +122,12 @@ G4BetheHeitler5DModel::G4BetheHeitler5DModel(const G4ParticleDefinition* pd,
const G4String& nam)
: G4BetheHeitlerModel(pd, nam), fVerbose(1), fConversionType(0), iraw(false)
{
SetLowEnergyLimit(2*CLHEP::electron_mass_c2);
theIonTable = G4IonTable::GetIonTable();
// Verbosity levels: ( Can redefine as needed, but some consideration )
// 0 = nothing
// > 2 print results
// > 3 print rejection warning from transformation (fix bug from gammaray .. )
// > 4 print photon direction & polarisation
}
@@ -157,7 +158,11 @@ void G4BetheHeitler5DModel::Initialise(const G4ParticleDefinition* part,
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void
//
// Converting from pair coordinate
//
void
G4BetheHeitler5DModel::BoostG4LorentzVector(const G4LorentzVector& p,
const G4LorentzVector& q,
G4LorentzVector& res) const
@@ -166,15 +171,22 @@ G4BetheHeitler5DModel::BoostG4LorentzVector(const G4LorentzVector& p,
// q : 4-vector of new origin in the old coordinates
const G4double pq = p.x()*q.x() + p.y()*q.y() + p.z()*q.z();
const G4double qq = q.x()*q.x() + q.y()*q.y() + q.z()*q.z();
const G4double mass = std::sqrt(q.t()*q.t()-qq);
const G4double lf = ((q.t()-mass)*pq/qq+p.t())/mass;
res.setX(p.x()+q.x()*lf);
res.setY(p.y()+q.y()*lf);
res.setZ(p.z()+q.z()*lf);
res.setT((p.t()*q.t()+pq)/mass);
const G4double mass2 = q.t()*q.t()-qq;
if ( mass2 > 0.0 ) {
const G4double mass = std::sqrt(q.t()*q.t()-qq);
const G4double lf = ((q.t()-mass)*pq/qq+p.t())/mass;
res.set( (p.x()+q.x()*lf), (p.y()+q.y()*lf), (p.z()+q.z()*lf),
((p.t()*q.t()+pq)/mass) );
} else {
res = p;
if ( fVerbose > 3 ) {
G4cout << "G4BetheHeitler5DModel::BoostG4LorentzVector Warning point not converted"
<< G4endl << "secondary in " << p
<< G4endl << "Pair1 " << q << G4endl;
}
}
}
// assuming that q.x=q.y=0.0
void
G4BetheHeitler5DModel::BoostG4LorentzVector(const G4LorentzVector& p,
@@ -192,7 +204,6 @@ G4BetheHeitler5DModel::BoostG4LorentzVector(const G4LorentzVector& p,
res.setT((p.t()*qt+pq)*imass);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4BetheHeitler5DModel::MaxDiffCrossSection(const G4double* par,
@@ -207,8 +218,8 @@ G4double G4BetheHeitler5DModel::MaxDiffCrossSection(const G4double* par,
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void
void
G4BetheHeitler5DModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
const G4MaterialCutsCouple* couple,
const G4DynamicParticle* aDynamicGamma,
@@ -224,6 +235,7 @@ G4BetheHeitler5DModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
static const G4double r02 = r0*r0*1.e+25;
static const G4double twoPi = CLHEP::twopi;
static const G4double factor = alpha0 * r02 / (twoPi*twoPi);
// static const G4double factor1 = pow((6.0 * pi),(1.0/3.0))/(8.*alpha0*ElectronMass);
static const G4double factor1 = 2.66134007899/(8.*alpha0*ElectronMass);
//
static const G4double PairInvMassMin = 2.*ElectronMass;
@@ -241,13 +253,12 @@ G4BetheHeitler5DModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
//
const G4double GammaEnergy = aDynamicGamma->GetKineticEnergy();
const G4double GammaEnergy2 = GammaEnergy*GammaEnergy;
// do nothing below the threshold
if ( GammaEnergy <= LowEnergyLimit()) { return; }
// Will not be true tot cross section = 0
if ( GammaEnergy <= 2.0*ElectronMass) { return; }
//
const G4ParticleMomentum GammaDirection = aDynamicGamma->GetMomentumDirection();
G4ThreeVector GammaPolarization = aDynamicGamma->GetPolarization();
// The protection polarization perpendicular to the direction vector,
// as it done in G4LivermorePolarizedGammaConversionModel,
// assuming Direction is unitary vector
@@ -267,9 +278,9 @@ G4BetheHeitler5DModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
const G4int A = SelectIsotopeNumber(anElement);
const G4double iZ13 = 1./anElement->GetIonisation()->GetZ3();
const G4double targetMass = G4NucleiProperties::GetNuclearMass(A, Z);
//
CLHEP::HepRandomEngine* rndmEngine = G4Random::getTheEngine();
//
// itriplet : true -- triplet, false -- nuclear.
G4bool itriplet = false;
if (fConversionType == 1) {
@@ -295,8 +306,8 @@ G4BetheHeitler5DModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
//
const G4double PairInvMassMax = sqrts-RecoilMass;
const G4double PairInvMassRange = PairInvMassMax/PairInvMassMin;
// use exact expression:
const G4double lnPairInvMassRange = G4Log(PairInvMassRange);
// initial state. Defines z axis of "0" frame as along photon propagation.
// create 4-vectors: gamma0 + target0 and CMS=gamma0+target0
// Since CMS(0., 0., GammaEnergy, GammaEnergy+RecoilMass) set some constants
@@ -328,23 +339,16 @@ G4BetheHeitler5DModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
G4LorentzVector Recoil0;
G4LorentzVector Positron0;
G4LorentzVector Electron0;
G4LorentzVector Recoil1;
G4LorentzVector Positron1;
G4LorentzVector Electron1;
G4LorentzVector Positron2;
G4LorentzVector Electron2;
G4LorentzVector Pair1;
G4double pdf = 0.;
// START Sampling
do {
G4double X1;
G4double rndmv2[2];
G4double cond1;
do {
rndmEngine->flatArray(2, rndmv2);
X1 = rndmv2[0];
cond1 = G4Exp(correctionIndex*G4Log(X1));
} while (cond1 < rndmv2[1]);
//////////////////////////////////////////////////
// pdf pow(x,c) with c = 1.4
// integral y = pow(x,(c+1))/(c+1) @ x = 1 => y = 1 /(1+c)
// invCdf exp( log(y /* *( c + 1.0 )/ (c + 1.0 ) */ ) /( c + 1.0) )
//////////////////////////////////////////////////
const G4double X1 =
G4Exp(G4Log(rndmEngine->flat())/(correctionIndex + 1.0));
const G4double x0 = G4Exp(xl1 + (xu1 - xl1)*rndmEngine->flat());
const G4double dum0 = 1./(1.+x0);
@@ -374,14 +378,12 @@ G4BetheHeitler5DModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
const G4double sinThetaLept = std::sqrt((1.-cosThetaLept)*(1.+cosThetaLept));
// cos and sin phi-lepton
const G4double cosPhiLept = std::cos(twoPi*rndmv3[1]-pi);
const G4double dumx0 = std::sqrt((1.-cosPhiLept)*(1.+cosPhiLept));
// sin(PhiLept) is in [-1,0] if PhiLept in [-pi,0) and
// is in [0,+1] if PhiLept in [0,+pi]
const G4double sinPhiLept = (rndmv3[1]<0.5) ? -1.*dumx0 : dumx0;
// cos and sin phi
// sin(PhiLept) is in [-1,0] if PhiLept in [-pi,0) and
// is in [0,+1] if PhiLept in [0,+pi]
const G4double sinPhiLept = std::copysign(std::sqrt((1.-cosPhiLept)*(1.+cosPhiLept)),rndmv3[1]-0.5);
// cos and sin phi
const G4double cosPhi = std::cos(twoPi*rndmv3[2]-pi);
const G4double dumx1 = std::sqrt((1.-cosPhi)*(1.+cosPhi));
const G4double sinPhi = (rndmv3[2]<0.5) ? -1.*dumx1 : dumx1;
const G4double sinPhi = std::copysign(std::sqrt((1.-cosPhi)*(1.+cosPhi)),rndmv3[2]-0.5);
// frames:
// 0 : the laboratory Lorentz frame, axes along photon direction and polarisation
@@ -392,59 +394,81 @@ G4BetheHeitler5DModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
// in the center-of-mass frame
const G4double RecEnergyCMS = (sCMSPlusRM2-PairInvMass*PairInvMass)*isqrts2;
const G4double LeptonEnergy2 = PairInvMass*0.5;
const G4double thePRecoil = std::sqrt( (RecEnergyCMS-RecoilMass)
*(RecEnergyCMS+RecoilMass));
Recoil1.setX( thePRecoil*sinTheta*cosPhi);
Recoil1.setY( thePRecoil*sinTheta*sinPhi);
Recoil1.setZ( thePRecoil*cosTheta);
Recoil1.setT( RecEnergyCMS);
Pair1.setX (-Recoil1.x());
Pair1.setY (-Recoil1.y());
Pair1.setZ (-Recoil1.z());
Pair1.setT ( RecEnergyCMS);
// Denis ** correction
// const G4double thePRecoil = std::sqrt( (RecEnergyCMS-RecoilMass)
// *(RecEnergyCMS+RecoilMass));
const G4double ap1 = 2.0*GammaEnergy*RecoilMass -
PairInvMass*PairInvMass + 2.0*PairInvMass*RecoilMass;
const G4double bp1 = 2.0*GammaEnergy*RecoilMass -
PairInvMass*PairInvMass - 2.0*PairInvMass*RecoilMass;
if (bp1 <= 0.0 ) {
if ( fVerbose > 3 ) {
G4cout
<< "G4BetheHeitler5DModel::SampleSecondaries Warning bp1 "
<< bp1 << "point rejected" << G4endl
<< "GammaEnergy " << GammaEnergy << G4endl
<< "PairInvMass " << PairInvMass << G4endl;
}
pdf = -1.0; // force next iteration
continue;
}
const G4double thePRecoil = std::sqrt(ap1 * bp1) * isqrts2;
// Denis ** correction
// back to the center-of-mass frame
const G4LorentzVector Recoil1( thePRecoil*sinTheta*cosPhi,
thePRecoil*sinTheta*sinPhi,
thePRecoil*cosTheta,
RecEnergyCMS);
const G4LorentzVector Pair1(-Recoil1.x(),
-Recoil1.y(),
-Recoil1.z(),
sqrts-RecEnergyCMS);
// in the pair frame
const G4double thePLepton = std::sqrt( (LeptonEnergy2-ElectronMass)
*(LeptonEnergy2+ElectronMass));
Positron2.setX( thePLepton*sinThetaLept*cosPhiLept);
Positron2.setY( thePLepton*sinThetaLept*sinPhiLept);
Positron2.setZ( thePLepton*cosThetaLept);
Positron2.setT( LeptonEnergy2);
Electron2.setX(-Positron2.x());
Electron2.setY(-Positron2.y());
Electron2.setZ(-Positron2.z());
Electron2.setT( LeptonEnergy2);
// back to the center-of-mass frame
Pair1.setT(sqrts-RecEnergyCMS);
const G4LorentzVector Positron2( thePLepton*sinThetaLept*cosPhiLept,
thePLepton*sinThetaLept*sinPhiLept,
thePLepton*cosThetaLept,
LeptonEnergy2);
const G4LorentzVector Electron2(-Positron2.x(),
-Positron2.y(),
-Positron2.z(),
LeptonEnergy2);
// Normalisation of final state phase space:
// Section 47 of Particle Data Group, Chin. Phys. C, 40, 100001 (2016)
const G4double Norme = Recoil1.vect().mag() * Positron2.vect().mag();
//
G4LorentzVector Positron1;
G4LorentzVector Electron1;
BoostG4LorentzVector(Positron2, Pair1, Positron1);
BoostG4LorentzVector(Electron2, Pair1, Electron1);
//
// back to the laboratory frame (make use of the CMS(0,0,Eg,Eg+RM)) form
Recoil0.setX(Recoil1.x());
Recoil0.setY(Recoil1.y());
BoostG4LorentzVector(Recoil1 , CMSqz, CMSt, CMSfact, iCMSmass, Recoil0);
//
Positron0.setX(Positron1.x());
Positron0.setY(Positron1.y());
BoostG4LorentzVector(Positron1, CMSqz, CMSt, CMSfact, iCMSmass, Positron0);
//
Electron0.setX(Electron1.x());
Electron0.setY(Electron1.y());
BoostG4LorentzVector(Electron1, CMSqz, CMSt, CMSfact, iCMSmass, Electron0);
//
// Jacobian factors
const G4double Jacob0 = x0*dum0*dum0;
const G4double Jacob1 = 2.*X1*lnPairInvMassRange*PairInvMass;
const G4double Jacob2 = std::abs(sinThetaLept);
// Normalisation of final state phase space:
// Section 47 of Particle Data Group, Chin. Phys. C, 40, 100001 (2016)
// G4double Norme = Recoil1.vect().mag() * Positron2.vect().mag();
const G4double EPlus = Positron0.t();
const G4double PPlus = Positron0.vect().mag();
const G4double sinThetaPlus = Positron0.vect().perp()/PPlus;
@@ -500,7 +524,7 @@ G4BetheHeitler5DModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
FormFactor = (1.-AFF)*(1-AFF);
}
} // else FormFactor = 1 by default
//
G4double betheheitler;
if (GammaPolarizationMag==0.) {
const G4double pPlusSTP = PPlus*sinThetaPlus;
@@ -529,10 +553,10 @@ G4BetheHeitler5DModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
//
const G4double cross = Norme * Jacob0 * Jacob1 * Jacob2 * betheheitler
* FormFactor * RecoilMass / sqrts;
pdf = cross * (xu1 - xl1) / cond1;
pdf = cross * (xu1 - xl1) / G4Exp(correctionIndex*G4Log(X1)); // cond1;
} while ( pdf < ymax * rndmEngine->flat() );
// END of Sampling
//
if ( fVerbose > 2 ) {
G4double recul = std::sqrt(Recoil0.x()*Recoil0.x()+Recoil0.y()*Recoil0.y()
+Recoil0.z()*Recoil0.z());
@@ -540,46 +564,37 @@ G4BetheHeitler5DModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
<< " PDF= " << pdf << " ymax= " << ymax
<< " recul= " << recul << G4endl;
}
// back to Geant4 system
if ( fVerbose > 4 ) {
G4cout << "BetheHeitler5DModel GammaDirection " << GammaDirection << G4endl;
G4cout << "BetheHeitler5DModel GammaPolarization " << GammaPolarization << G4endl;
G4cout << "BetheHeitler5DModel GammaEnergy " << GammaEnergy << G4endl;
G4cout << "BetheHeitler5DModel Conv "
<< (itriplet ? "triplet" : "nucl") << G4endl;
}
//
if (GammaPolarizationMag == 0.0) {
G4ThreeVector axis(1.,0.,0.);
G4ThreeVector perp = GammaDirection.cross(axis);
if (perp.mag() == 0) {
axis.set(0.,1.,0.);
perp = GammaDirection.cross(axis);
}
perp = perp / perp.mag();
G4ThreeVector perperp = GammaDirection.cross(perp);
perperp = perperp / perperp.mag();
// rotation
G4ThreeVector Rot = Recoil0.x()*perp + Recoil0.y()*perperp
+ Recoil0.z()*GammaDirection;
Recoil0.setVect(Rot);
Rot = Positron0.x()*perp + Positron0.y()*perperp
+ Positron0.z()*GammaDirection;
Positron0.setVect(Rot);
Rot = Electron0.x()*perp + Electron0.y()*perperp
+ Electron0.z()*GammaDirection;
Electron0.setVect(Rot);
// set polarization axis orthohonal to direction
GammaPolarization = GammaDirection.orthogonal().unit();
} else {
// The unit norm vector that is orthogonal to the two others
G4ThreeVector yGrec = GammaDirection.cross(GammaPolarization);
// rotation
G4ThreeVector Rot = Recoil0.x()*GammaPolarization + Recoil0.y()*yGrec
+ Recoil0.z()*GammaDirection;
Recoil0.setVect(Rot);
Rot = Positron0.x()*GammaPolarization + Positron0.y()*yGrec
+ Positron0.z()*GammaDirection;
Positron0.setVect(Rot);
Rot = Electron0.x()*GammaPolarization + Electron0.y()*yGrec
+ Electron0.z()*GammaDirection;
Electron0.setVect(Rot);
// GammaPolarization not a unit vector
GammaPolarization /= GammaPolarizationMag;
}
// The unit norm vector that is orthogonal to the two others
G4ThreeVector yGrec = GammaDirection.cross(GammaPolarization);
// rotation
G4ThreeVector Rot = Recoil0.x()*GammaPolarization + Recoil0.y()*yGrec
+ Recoil0.z()*GammaDirection;
Recoil0.setVect(Rot);
Rot = Positron0.x()*GammaPolarization + Positron0.y()*yGrec
+ Positron0.z()*GammaDirection;
Positron0.setVect(Rot);
Rot = Electron0.x()*GammaPolarization + Electron0.y()*yGrec
+ Electron0.z()*GammaDirection;
Electron0.setVect(Rot);
//
if ( fVerbose > 2 ) {
G4cout << "BetheHeitler5DModel Recoil0 " << Recoil0.x() << " " << Recoil0.y() << " " << Recoil0.z()
@@ -589,13 +604,14 @@ G4BetheHeitler5DModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
G4cout << "BetheHeitler5DModel Electron0 " << Electron0.x() << " " << Electron0.y() << " "
<< Electron0.z() << " " << Electron0.t() << " " << G4endl;
}
//
// create G4DynamicParticle object for the particle1 (electron)
// Create secondaries
// electron
G4DynamicParticle* aParticle1 = new G4DynamicParticle(fTheElectron,Electron0);
// create G4DynamicParticle object for the particle2 (positron)
// positron
G4DynamicParticle* aParticle2 = new G4DynamicParticle(fThePositron,Positron0);
// create G4DynamicParticle object for the particle3 ( recoil )
G4DynamicParticle* aParticle3;
G4ParticleDefinition* RecoilPart;
if (itriplet) {
// triplet
@@ -603,11 +619,13 @@ G4BetheHeitler5DModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
} else{
RecoilPart = theIonTable->GetIon(Z, A, 0);
}
aParticle3 = new G4DynamicParticle(RecoilPart,Recoil0);
G4DynamicParticle* aParticle3 = new G4DynamicParticle(RecoilPart,Recoil0);
// Fill output vector
fvect->push_back(aParticle1);
fvect->push_back(aParticle2);
fvect->push_back(aParticle3);
// kill incident photon
fParticleChange->SetProposedKineticEnergy(0.);
fParticleChange->ProposeTrackStatus(fStopAndKill);
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BetheHeitlerModel.cc 110939 2018-06-27 12:02:21Z gunter $
//
// -------------------------------------------------------------------
//
@@ -36,17 +35,7 @@
//
// Creation date: 15.03.2005
//
// Modifications:
// 18-04-05 Use G4ParticleChangeForGamma (V.Ivantchenko)
// 24-06-05 Increase number of bins to 200 (V.Ivantchenko)
// 16-11-05 replace shootBit() by G4UniformRand() mma
// 04-12-05 SetProposedKineticEnergy(0.) for the killed photon (mma)
// 20-02-07 SelectRandomElement is called for any initial gamma energy
// in order to have selected element for polarized model (VI)
// 25-10-10 Removed unused table, added element selector (VI)
// 28-05-18 New version with improved screening function approximation, improved
// efficiency, documentation and cleanup. Corrected call to selecting
// target atom in the final state sampling. (M. Novak)
// Modifications by Vladimir Ivanchenko, Michel Maire, Mihaly Novak
//
// Class Description:
//
@@ -65,12 +54,9 @@
#include "G4Exp.hh"
#include "G4ModifiedTsai.hh"
const G4int G4BetheHeitlerModel::gMaxZet = 120;
std::vector<G4BetheHeitlerModel::ElementData*> G4BetheHeitlerModel::gElementData;
G4BetheHeitlerModel::G4BetheHeitlerModel(const G4ParticleDefinition*,
const G4String& nam)
: G4VEmModel(nam),
@@ -81,8 +67,6 @@ G4BetheHeitlerModel::G4BetheHeitlerModel(const G4ParticleDefinition*,
SetAngularDistribution(new G4ModifiedTsai());
}
G4BetheHeitlerModel::~G4BetheHeitlerModel()
{
if (IsMaster()) {
@@ -94,8 +78,6 @@ G4BetheHeitlerModel::~G4BetheHeitlerModel()
}
}
void G4BetheHeitlerModel::Initialise(const G4ParticleDefinition* p,
const G4DataVector& cuts)
{
@@ -108,16 +90,12 @@ void G4BetheHeitlerModel::Initialise(const G4ParticleDefinition* p,
}
}
void G4BetheHeitlerModel::InitialiseLocal(const G4ParticleDefinition*,
G4VEmModel* masterModel)
{
SetElementSelectors(masterModel->GetElementSelectors());
}
// Calculates the microscopic cross section in GEANT4 internal units.
// A parametrized formula from L. Urban is used to estimate
// the total cross section.
@@ -182,8 +160,6 @@ G4BetheHeitlerModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
return xSection;
}
// The secondaries e+e- energies are sampled using the Bethe - Heitler
// cross sections with Coulomb correction.
// A modified version of the random number techniques of Butcher & Messel
@@ -316,8 +292,6 @@ void G4BetheHeitlerModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fve
fParticleChange->ProposeTrackStatus(fStopAndKill);
}
// should be called only by the master and at initialisation
void G4BetheHeitlerModel::InitialiseElementData()
{
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BohrFluctuations.cc 91726 2015-08-03 15:41:36Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BraggIonGasModel.cc 66241 2012-12-13 18:34:42Z gunter $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BraggIonModel.cc 95832 2016-02-26 11:12:31Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -66,6 +65,8 @@
#include "G4LossTableManager.hh"
#include "G4EmCorrections.hh"
#include "G4DeltaAngle.hh"
#include "G4ICRU90StoppingData.hh"
#include "G4NistManager.hh"
#include "G4Log.hh"
#include "G4Exp.hh"
@@ -81,9 +82,12 @@ G4BraggIonModel::G4BraggIonModel(const G4ParticleDefinition* p,
corr(nullptr),
particle(nullptr),
fParticleChange(nullptr),
fICRU90(nullptr),
currentMaterial(nullptr),
baseMaterial(nullptr),
iMolecula(-1),
iASTAR(-1),
iICRU90(-1),
isIon(false)
{
SetHighEnergyLimit(2.0*MeV);
@@ -121,6 +125,11 @@ void G4BraggIonModel::Initialise(const G4ParticleDefinition* p,
if(IsMaster()) {
if(nullptr == fASTAR) { fASTAR = new G4ASTARStopping(); }
if(particle->GetPDGMass() < GeV) { fASTAR->Initialise(); }
if(G4EmParameters::Instance()->UseICRU90Data()) {
if(!fICRU90) {
fICRU90 = G4NistManager::Instance()->GetICRU90StoppingData();
} else if(particle->GetPDGMass() < GeV) { fICRU90->Initialise(); }
}
}
if(nullptr == fParticleChange) {
@@ -211,9 +220,8 @@ G4double G4BraggIonModel::ComputeCrossSectionPerAtom(
G4double cutEnergy,
G4double maxEnergy)
{
G4double cross = Z*ComputeCrossSectionPerElectron
(p,kineticEnergy,cutEnergy,maxEnergy);
return cross;
return
Z*ComputeCrossSectionPerElectron(p,kineticEnergy,cutEnergy,maxEnergy);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -225,10 +233,8 @@ G4double G4BraggIonModel::CrossSectionPerVolume(
G4double cutEnergy,
G4double maxEnergy)
{
G4double eDensity = material->GetElectronDensity();
G4double cross = eDensity*ComputeCrossSectionPerElectron
(p,kineticEnergy,cutEnergy,maxEnergy);
return cross;
return material->GetElectronDensity()
*ComputeCrossSectionPerElectron(p,kineticEnergy,cutEnergy,maxEnergy);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -389,12 +395,10 @@ G4double G4BraggIonModel::MaxSecondaryEnergy(const G4ParticleDefinition* pd,
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4bool G4BraggIonModel::HasMaterial(const G4Material*)
void G4BraggIonModel::HasMaterial(const G4Material* mat)
{
return false;
/*
G4String chFormula = material->GetChemicalFormula();
if("" == chFormula) { return false; }
const G4String& chFormula = mat->GetChemicalFormula();
if(chFormula.empty()) { return; }
// ICRU Report N49, 1993. Ziegler model for He.
@@ -408,12 +412,11 @@ G4bool G4BraggIonModel::HasMaterial(const G4Material*)
// Search for the material in the table
for (size_t i=0; i<numberOfMolecula; ++i) {
if (chFormula == molName[i]) {
iASTAR = fASTAR->GetIndex(matName[i]);
break;
iMolecula = i;
return;
}
}
return (iASTAR >= 0);
*/
return;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -497,9 +500,7 @@ G4double G4BraggIonModel::ElectronicStoppingPower(G4double z,
G4double kineticEnergy) const
{
G4double ionloss ;
G4int i = G4lrint(z)-1 ; // index of atom
if(i < 0) i = 0 ;
if(i > 91) i = 91 ;
G4int i = std::min(std::max(G4lrint(z)-1,0),91); // index of atom
// The data and the fit from:
// ICRU Report 49, 1993. Ziegler's type of parametrisations.
@@ -651,34 +652,48 @@ G4double G4BraggIonModel::ElectronicStoppingPower(G4double z,
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4BraggIonModel::DEDX(const G4Material* material,
G4double kineticEnergy)
G4double kineticEnergy)
{
G4double eloss = 0.0;
// check DB
if(material != currentMaterial) {
currentMaterial = material;
baseMaterial = material->GetBaseMaterial()
? material->GetBaseMaterial() : material;
iASTAR = -1;
iMolecula = -1;
if( !HasMaterial(material) ) { iASTAR = fASTAR->GetIndex(material); }
iICRU90 = fICRU90 ? fICRU90->GetIndex(baseMaterial) : -1;
if(iICRU90 < 0) {
iASTAR = fASTAR->GetIndex(baseMaterial);
if(iASTAR < 0) { HasMaterial(baseMaterial); }
}
//G4cout << "%%% " <<material->GetName() << " iMolecula= "
// << iMolecula << " iPSTAR= " << iPSTAR
// << " iICRU90= " << iICRU90<< G4endl;
}
if(iICRU90 >= 0) {
return fICRU90->GetElectronicDEDXforAlpha(iICRU90, kineticEnergy)
*material->GetDensity()/chargeSquare;
}
const G4int numberOfElements = material->GetNumberOfElements();
const G4double* theAtomicNumDensityVector =
material->GetAtomicNumDensityVector();
if( iASTAR >= 0 ) {
G4double T = kineticEnergy*rateMassHe2p;
G4int zeff = G4lrint(material->GetTotNbOfElectPerVolume()/
material->GetTotNbOfAtomsPerVolume());
return fASTAR->GetElectronicDEDX(iASTAR, T)*material->GetDensity()/
HeEffChargeSquare(zeff, T/MeV);
}
} else if(iMolecula >= 0) {
const G4int numberOfElements = material->GetNumberOfElements();
const G4double* theAtomicNumDensityVector =
material->GetAtomicNumDensityVector();
eloss = StoppingPower(material, kineticEnergy)*
if(iMolecula >= 0) {
eloss = StoppingPower(baseMaterial, kineticEnergy)*
material->GetDensity()/amu;
// pure material
// pure material
} else if(1 == numberOfElements) {
G4double z = material->GetZ();
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BraggModel.cc 96934 2016-05-18 09:10:41Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -72,6 +71,8 @@
#include "G4LossTableManager.hh"
#include "G4EmCorrections.hh"
#include "G4DeltaAngle.hh"
#include "G4ICRU90StoppingData.hh"
#include "G4NistManager.hh"
#include "G4Log.hh"
#include "G4Exp.hh"
@@ -83,11 +84,14 @@ G4PSTARStopping* G4BraggModel::fPSTAR = nullptr;
G4BraggModel::G4BraggModel(const G4ParticleDefinition* p, const G4String& nam)
: G4VEmModel(nam),
particle(0),
currentMaterial(0),
particle(nullptr),
fICRU90(nullptr),
currentMaterial(nullptr),
baseMaterial(nullptr),
protonMassAMU(1.007276),
iMolecula(-1),
iPSTAR(-1),
iICRU90(-1),
isIon(false)
{
fParticleChange = nullptr;
@@ -123,6 +127,11 @@ void G4BraggModel::Initialise(const G4ParticleDefinition* p,
if(IsMaster()) {
if(nullptr == fPSTAR) { fPSTAR = new G4PSTARStopping(); }
if(particle->GetPDGMass() < GeV) { fPSTAR->Initialise(); }
if(G4EmParameters::Instance()->UseICRU90Data()) {
if(!fICRU90) {
fICRU90 = G4NistManager::Instance()->GetICRU90StoppingData();
} else if(particle->GetPDGMass() < GeV) { fICRU90->Initialise(); }
}
}
if(nullptr == fParticleChange) {
@@ -193,31 +202,27 @@ G4double G4BraggModel::ComputeCrossSectionPerElectron(
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4BraggModel::ComputeCrossSectionPerAtom(
const G4ParticleDefinition* p,
G4double kineticEnergy,
G4double Z, G4double,
G4double cutEnergy,
G4double maxEnergy)
G4double
G4BraggModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition* p,
G4double kineticEnergy,
G4double Z, G4double,
G4double cutEnergy,
G4double maxEnergy)
{
G4double cross = Z*ComputeCrossSectionPerElectron
(p,kineticEnergy,cutEnergy,maxEnergy);
return cross;
return
Z*ComputeCrossSectionPerElectron(p,kineticEnergy,cutEnergy,maxEnergy);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4BraggModel::CrossSectionPerVolume(
const G4Material* material,
const G4ParticleDefinition* p,
G4double kineticEnergy,
G4double cutEnergy,
G4double maxEnergy)
G4double G4BraggModel::CrossSectionPerVolume(const G4Material* material,
const G4ParticleDefinition* p,
G4double kineticEnergy,
G4double cutEnergy,
G4double maxEnergy)
{
G4double eDensity = material->GetElectronDensity();
G4double cross = eDensity*ComputeCrossSectionPerElectron
(p,kineticEnergy,cutEnergy,maxEnergy);
return cross;
return material->GetElectronDensity()
*ComputeCrossSectionPerElectron(p,kineticEnergy,cutEnergy,maxEnergy);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -351,12 +356,10 @@ G4double G4BraggModel::MaxSecondaryEnergy(const G4ParticleDefinition* pd,
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4bool G4BraggModel::HasMaterial(const G4Material*)
void G4BraggModel::HasMaterial(const G4Material* mat)
{
return false;
/*
G4String chFormula = material->GetChemicalFormula();
if("" == chFormula) { return false; }
const G4String& chFormula = mat->GetChemicalFormula();
if(chFormula.empty()) { return; }
// ICRU Report N49, 1993. Power's model for H
static const size_t numberOfMolecula = 11;
@@ -369,18 +372,17 @@ G4bool G4BraggModel::HasMaterial(const G4Material*)
// Search for the material in the table
for (size_t i=0; i<numberOfMolecula; ++i) {
if (chFormula == molName[i]) {
iPSTAR = fPSTAR->GetIndex(matName[i]);
break;
iMolecula = i;
return;
}
}
return (iPSTAR >= 0);
*/
return;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4BraggModel::StoppingPower(const G4Material* material,
G4double kineticEnergy)
G4double kineticEnergy)
{
G4double ionloss = 0.0 ;
@@ -453,10 +455,8 @@ G4double G4BraggModel::ElectronicStoppingPower(G4double z,
G4double kineticEnergy) const
{
G4double ionloss ;
G4int i = G4lrint(z)-1 ; // index of atom
if(i < 0) i = 0 ;
if(i > 91) i = 91 ;
G4int i = std::min(std::max(G4lrint(z)-1,0),91); // index of atom
// The data and the fit from:
// ICRU Report 49, 1993. Ziegler's type of parametrisations.
// Proton kinetic energy for parametrisation (keV/amu)
@@ -605,29 +605,42 @@ G4double G4BraggModel::DEDX(const G4Material* material, G4double kineticEnergy)
// check DB
if(material != currentMaterial) {
currentMaterial = material;
baseMaterial = material->GetBaseMaterial()
? material->GetBaseMaterial() : material;
iPSTAR = -1;
iMolecula = -1;
if( !HasMaterial(material) ) { iPSTAR = fPSTAR->GetIndex(material); }
iICRU90 = fICRU90 ? fICRU90->GetIndex(baseMaterial) : -1;
if(iICRU90 < 0) {
iPSTAR = fPSTAR->GetIndex(baseMaterial);
if(iPSTAR < 0) { HasMaterial(baseMaterial); }
}
//G4cout << "%%% " <<material->GetName() << " iMolecula= "
// << iMolecula << " iPSTAR= " << iPSTAR << G4endl;
// << iMolecula << " iPSTAR= " << iPSTAR
// << " iICRU90= " << iICRU90<< G4endl;
}
// ICRU90 parameterisation
if(iICRU90 >= 0) {
return fICRU90->GetElectronicDEDXforProton(iICRU90, kineticEnergy)
*material->GetDensity();
}
// PSTAR parameterisation
if( iPSTAR >= 0 ) {
return fPSTAR->GetElectronicDEDX(iPSTAR, kineticEnergy)
*material->GetDensity();
}
const G4int numberOfElements = material->GetNumberOfElements();
const G4double* theAtomicNumDensityVector =
material->GetAtomicNumDensityVector();
if( iPSTAR >= 0 ) {
return
fPSTAR->GetElectronicDEDX(iPSTAR, kineticEnergy)*material->GetDensity();
} else if(iMolecula >= 0) {
eloss = StoppingPower(material, kineticEnergy)*
if(iMolecula >= 0) {
eloss = StoppingPower(baseMaterial, kineticEnergy)*
material->GetDensity()/amu;
// Pure material ICRU49 paralmeterisation
// Pure material ICRU49 paralmeterisation
} else if(1 == numberOfElements) {
G4double z = material->GetZ();
@@ -23,40 +23,12 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ComptonScattering.cc 107058 2017-11-01 14:54:12Z gcosmo $
//
//
//------------ G4ComptonScattering physics process -----------------------------
// by Michel Maire, April 1996
//
// 28-05-96, DoIt() small change in ElecDirection, by M.Maire
// 10-06-96, simplification in ComputeMicroscopicCrossSection(), by M.Maire
// 21-06-96, SetCuts implementation, M.Maire
// 13-09-96, small changes in DoIt for better efficiency. Thanks to P.Urban
// 06-01-97, crossection table + meanfreepath table, M.Maire
// 05-03-97, new Physics scheme, M.Maire
// 28-03-97, protection in BuildPhysicsTable, M.Maire
// 07-04-98, remove 'tracking cut' of the scattered gamma, MMa
// 04-06-98, in DoIt, secondary production condition:
// range>std::min(threshold,safety)
// 13-08-98, new methods SetBining() PrintInfo()
// 15-12-98, cross section=0 below 10 keV
// 28-05-01, V.Ivanchenko minor changes to provide ANSI -wall compilation
// 13-07-01, DoIt: suppression of production cut for the electron (mma)
// 03-08-01, new methods Store/Retrieve PhysicsTable (mma)
// 06-08-01, BuildThePhysicsTable() called from constructor (mma)
// 17-09-01, migration of Materials to pure STL (mma)
// 20-09-01, DoIt: fminimalEnergy = 1*eV (mma)
// 01-10-01, come back to BuildPhysicsTable(const G4ParticleDefinition&)
// 17-04-02, LowestEnergyLimit = 1*keV
// 26-05-04, cross section parametrization improved for low energy :
// Egamma <~ 15 keV (Laszlo)
// 08-11-04, Remove Store/Retrieve tables (V.Ivanchenko)
// 09-03-05 Migrate to model interface
// and inherit from G4VEmProcess (V.Ivanchenko)
// 04-05-05, Make class to be default (V.Ivanchenko)
// 09-09-06, modify SetModel(G4VEmModel*) (mma)
// 12-09-06, move SetModel(G4VEmModel*) in G4VEmProcess (mma)
// Modified: Michel Maire and Vladimir Ivanchenko
//
// -----------------------------------------------------------------------------
@@ -118,7 +90,7 @@ void G4ComptonScattering::PrintInfo()
void G4ComptonScattering::ProcessDescription(std::ostream& out) const
{
out << "<strong>Compton scattering</strong>";
out << " Compton scattering";
G4VEmProcess::ProcessDescription(out);
}
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4CoulombScattering.cc 107365 2017-11-09 10:54:29Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -160,8 +159,7 @@ G4double G4CoulombScattering::MinPrimaryEnergy(const G4ParticleDefinition* part,
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4CoulombScattering::StreamProcessInfo(std::ostream& outFile,
G4String endOfLine) const
void G4CoulombScattering::StreamProcessInfo(std::ostream& outFile) const
{
G4double tetmin = G4EmParameters::Instance()->MscThetaLimit()/degree;
outFile << " ";
@@ -170,7 +168,7 @@ void G4CoulombScattering::StreamProcessInfo(std::ostream& outFile,
outFile << " < Theta(degree) < 180";
if(q2Max < DBL_MAX) { outFile << "; pLimit(GeV^1)= " << sqrt(q2Max)/GeV; }
outFile << endOfLine;
outFile << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -178,10 +176,10 @@ void G4CoulombScattering::StreamProcessInfo(std::ostream& outFile,
void G4CoulombScattering::ProcessDescription(std::ostream& out) const
{
out <<
"<strong>Coulomb scattering</strong>. Simulation of elastic scattering <br>"
"events individually. May be used in combination with multiple<br>"
"scattering, where Coulomb scattering is used for hard (large angle)<br>"
"collisions and multiple scattering for soft collisions.";
" Coulomb scattering. Simulation of elastic scattering\n" <<
" events individually. May be used in combination with multiple\n" <<
" scattering, where Coulomb scattering is used for hard (large angle)\n" <<
" collisions and multiple scattering for soft collisions.";
G4VEmProcess::ProcessDescription(out);
}
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4DeltaAngle.cc 68380 2013-03-22 18:39:29Z vnivanch $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4DeltaAngleFreeScat.cc 68380 2013-03-22 18:39:29Z vnivanch $
//
// -------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4DipBustGenerator.cc 110415 2018-05-23 06:44:31Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -32,66 +31,69 @@
//
// File name: G4DipBustGenerator
//
// Author: Vladimir Grichine
//
// Author: Vladimir Grichine
//
// Creation date: 17 May 2011
//
// Modifications:
//
// Modifications:
//
// Class Description:
// 17.07.2018 optimisations, using G4Pow in SampleCosTheta() method M.Novak
//
// Bremsstrahlung Angular Distribution Generation
// suggested the dipole approximation in the rest frame of electron
// Class Description:
//
// Bremsstrahlung Angular Distribution Generation
// suggested the dipole approximation in the rest frame of electron
// busted in the laboratory frame.
//
// Class Description: End
// Class Description: End
//
// -------------------------------------------------------------------
//
#include "G4DipBustGenerator.hh"
#include "Randomize.hh"
#include "G4Log.hh"
#include "G4Exp.hh"
// #include "G4Log.hh"
// #include "G4Exp.hh"
#include "G4Pow.hh"
#include <CLHEP/Units/PhysicalConstants.h>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4DipBustGenerator::G4DipBustGenerator(const G4String&)
: G4VEmAngularDistribution("DipBustGen")
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4DipBustGenerator::~G4DipBustGenerator()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4DipBustGenerator::SampleCosTheta(G4double kinEnergy)
{
G4double c = 4. - 8.*G4UniformRand();
G4double delta = 0.5*(std::sqrt(c*c+4.) + std::abs(c));
G4double signc = (c < 0.) ? -1.0 : 1.0;
G4double cofA = -signc*G4Exp(G4Log(delta)/3.0);
G4double cosTheta = cofA - 1./cofA;
G4double tau = kinEnergy/CLHEP::electron_mass_c2;
G4double beta = std::sqrt(tau*(tau + 2.))/(tau + 1.);
G4DipBustGenerator::~G4DipBustGenerator()
{}
return (cosTheta + beta)/(1 + cosTheta*beta);
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4DipBustGenerator::SampleCosTheta(const G4double kinEnergy)
{
const G4double c = 4. - 8.*G4UniformRand();
const G4double delta = 0.5*(std::sqrt(c*c+4.) + std::abs(c));
const G4double signc = (c < 0.) ? -1.0 : 1.0;
// const G4double cofA = -signc*G4Exp(G4Log(delta)/3.0);
const G4double cofA = -signc*G4Pow::GetInstance()->A13(delta);
const G4double cosTheta = std::min(1.,std::max(-1.,cofA - 1./cofA));
const G4double tau = kinEnergy/CLHEP::electron_mass_c2;
const G4double beta = std::sqrt(tau*(tau + 2.))/(tau + 1.);
return (cosTheta + beta)/(1. + cosTheta*beta);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4ThreeVector&
G4DipBustGenerator::SampleDirection(const G4DynamicParticle* dp,
G4double, G4int, const G4Material*)
G4ThreeVector&
G4DipBustGenerator::SampleDirection(const G4DynamicParticle* dp, G4double,
G4int, const G4Material*)
{
G4double cosTheta = SampleCosTheta(dp->GetKineticEnergy());
const G4double cosTheta = SampleCosTheta(dp->GetKineticEnergy());
G4double sinTheta = std::sqrt((1 - cosTheta)*(1 + cosTheta));
G4double phi = CLHEP::twopi*G4UniformRand();
const G4double sinTheta = std::sqrt((1. - cosTheta)*(1. + cosTheta));
const G4double phi = CLHEP::twopi*G4UniformRand();
fLocalDirection.set(sinTheta*std::cos(phi), sinTheta*std::sin(phi),cosTheta);
fLocalDirection.rotateUz(dp->GetMomentumDirection());
@@ -102,12 +104,11 @@ G4DipBustGenerator::SampleDirection(const G4DynamicParticle* dp,
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4DipBustGenerator::PolarAngle(G4double eTkin,
G4double, // final_energy
G4int ) // Z
G4double, // final_energy
G4int ) // Z
{
G4double cosTheta = SampleCosTheta(eTkin);
const G4double cosTheta = SampleCosTheta(eTkin);
G4double theta = std::acos(cosTheta);
theta = std::min(std::max(theta, 0.), CLHEP::pi);
return theta;
}
@@ -115,15 +116,15 @@ G4double G4DipBustGenerator::PolarAngle(G4double eTkin,
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4DipBustGenerator::SamplePairDirections(const G4DynamicParticle* dp,
G4double elecKinEnergy,
G4double posiKinEnergy,
G4ThreeVector& dirElectron,
G4ThreeVector& dirPositron,
G4int, const G4Material*)
G4double elecKinEnergy,
G4double posiKinEnergy,
G4ThreeVector& dirElectron,
G4ThreeVector& dirPositron,
G4int, const G4Material*)
{
G4double phi = CLHEP::twopi * G4UniformRand();
G4double sinp = std::sin(phi);
G4double cosp = std::cos(phi);
const G4double phi = CLHEP::twopi * G4UniformRand();
const G4double sinp = std::sin(phi);
const G4double cosp = std::cos(phi);
G4double cost = SampleCosTheta(elecKinEnergy);
G4double sint = std::sqrt((1. - cost)*(1. + cost));
@@ -144,8 +145,8 @@ void G4DipBustGenerator::PrintGeneratorInformation() const
{
G4cout << "\n" << G4endl;
G4cout << "Angular Generator based on classical formula from" << G4endl;
G4cout << "J.D. Jackson, Classical Electrodynamics, Wiley, New York 1975"
G4cout << "J.D. Jackson, Classical Electrodynamics, Wiley, New York 1975"
<< G4endl;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ESTARStopping.cc 68797 2013-08-07 13:27:11Z $
//
//---------------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: $
//
// ----------------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: $
//
// ----------------------------------------------------------------------------
//
@@ -23,46 +23,13 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4GammaConversion.cc 107058 2017-11-01 14:54:12Z gcosmo $
//
//
//------------------ G4GammaConversion physics process -------------------------
// by Michel Maire, 24 May 1996
//
// 11-06-96 Added SelectRandomAtom() method, M.Maire
// 21-06-96 SetCuts implementation, M.Maire
// 24-06-96 simplification in ComputeCrossSectionPerAtom, M.Maire
// 24-06-96 in DoIt : change the particleType stuff, M.Maire
// 25-06-96 modification in the generation of the teta angle, M.Maire
// 16-09-96 minors optimisations in DoIt. Thanks to P.Urban
// dynamical array PartialSumSigma
// 13-12-96 fast sampling of epsil below 2 MeV, L.Urban
// 14-01-97 crossection table + meanfreepath table.
// PartialSumSigma removed, M.Maire
// 14-01-97 in DoIt the positron is always created, even with Ekine=0,
// for further annihilation, M.Maire
// 14-03-97 new Physics scheme for geant4alpha, M.Maire
// 28-03-97 protection in BuildPhysicsTable, M.Maire
// 19-06-97 correction in ComputeCrossSectionPerAtom, L.Urban
// 04-06-98 in DoIt, secondary production condition:
// range>std::min(threshold,safety)
// 13-08-98 new methods SetBining() PrintInfo()
// 28-05-01 V.Ivanchenko minor changes to provide ANSI -wall compilation
// 11-07-01 PostStepDoIt - sampling epsil: power(rndm,0.333333)
// 13-07-01 DoIt: suppression of production cut for the (e-,e+) (mma)
// 06-08-01 new methods Store/Retrieve PhysicsTable (mma)
// 06-08-01 BuildThePhysicsTable() called from constructor (mma)
// 17-09-01 migration of Materials to pure STL (mma)
// 20-09-01 DoIt: fminimalEnergy = 1*eV (mma)
// 01-10-01 come back to BuildPhysicsTable(const G4ParticleDefinition&)
// 11-01-02 ComputeCrossSection: correction of extrapolation below EnergyLimit
// 21-03-02 DoIt: correction of the e+e- angular distribution (bug 363) mma
// 08-11-04 Remove of Store/Retrieve tables (V.Ivantchenko)
// 19-04-05 Migrate to model interface and inherit
// from G4VEmProcess (V.Ivanchenko)
// 04-05-05, Make class to be default (V.Ivanchenko)
// 09-08-06, add SetModel(G4VEmModel*) (mma)
// 12-09-06, move SetModel(G4VEmModel*) in G4VEmProcess (mma)
// Modified by Michel Maire and Vladimir Ivanchenko
//
// -----------------------------------------------------------------------------
#include "G4GammaConversion.hh"
@@ -110,12 +77,12 @@ void G4GammaConversion::InitialiseProcess(const G4ParticleDefinition*)
G4EmParameters* param = G4EmParameters::Instance();
G4double emin = std::max(param->MinKinEnergy(), 2*electron_mass_c2);
G4double emax = param->MaxKinEnergy();
G4double energyLimit = std::min(emax, 80*GeV);
SetMinKinEnergy(emin);
if(!EmModel(0)) { SetEmModel(new G4BetheHeitlerModel()); }
EmModel(0)->SetLowEnergyLimit(emin);
G4double energyLimit = std::min(EmModel(0)->HighEnergyLimit(), 80*GeV);
EmModel(0)->SetHighEnergyLimit(energyLimit);
AddEmModel(1, EmModel(0));
@@ -145,7 +112,7 @@ void G4GammaConversion::PrintInfo()
void G4GammaConversion::ProcessDescription(std::ostream& out) const
{
out << "<strong>Gamma conversion</strong>";
out << " Gamma conversion";
G4VEmProcess::ProcessDescription(out);
}
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4GoudsmitSaundersonMscModel.cc 108305 2018-02-02 13:08:43Z gcosmo $
//
// ----------------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4GoudsmitSaundersonTable.cc 110527 2018-05-29 06:09:58Z gcosmo $
//
// -----------------------------------------------------------------------------
//
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4HeatedKleinNishinaCompton.cc 91726 2015-08-03 15:41:36Z gcosmo $
//
// -------------------------------------------------------------------
//

Some files were not shown because too many files have changed in this diff Show More