Import Geant4 9.5.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 16:46:55 +02:00
parent 89a9605df1
commit b1eb5424d2
10957 changed files with 888481 additions and 160139 deletions
@@ -7,7 +7,7 @@
#
# Generated on : 24/9/2010
#
# $Id: CMakeLists.txt,v 1.1 2010/09/29 18:53:57 bmorgan Exp $
# $Id: CMakeLists.txt,v 1.1 2010-09-29 18:53:57 bmorgan Exp $
#
#------------------------------------------------------------------------------
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.9 2006/04/05 13:38:58 vnivanch Exp $
# $Id: GNUmakefile,v 1.9 2006-04-05 13:38:58 vnivanch Exp $
# --------------------------------------------------------------------
# GNUmakefile for electromagnetic sub-library. John Allison, 25/6/98.
# --------------------------------------------------------------------
@@ -1,4 +1,4 @@
$Id: History,v 1.523 2010/11/29 15:30:05 vnivanch Exp $
$Id: History,v 1.528 2011-01-04 11:25:24 vnivanch Exp $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,280 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
25 November 11: V.Ivanchenko (emstand-V09-04-55)
- G4UrbanMscModel90, G4UrbanMscModel93, G4UrbanMscModel95 - added
protection against numerical problems of sampling scattering with
small step at high energy to avoid reflection back;
added G4Exception to control reflection back - it issues a warning
18 November 11: V.Ivanchenko (emstand-V09-04-54)
- G4UrbanMscModel95 - optimized "samplez" sampling - applied it
only for for medium step size, not apply to small steps and
on steps equal to electron range
17 November 11: V.Ivanchenko (emstand-V09-04-53)
- G4SeltzerBergerModel - suppress warning printed for low-energy
electrons (E < 1 keV)
14 November 11: V.Ivanchenko (emstand-V09-04-52)
- G4SeltzerBergerModel - fixed cross section for positrons
12 November 11: V.Ivanchenko (emstand-V09-04-51)
- G4SeltzerBergerModel - added correction for cross section for positrons
11 November 11: V.Ivanchenko (emstand-V09-04-50)
- G4eeToTwoGammaModel, G4eSingleCoulombScatteringModel, G4eCoulombScatteringModel,
G4eBremsstrahlungRelModel, G4eBremsstrahlungModel, G4eBremsstrahlung,
G4XrayRayleighModel, G4WentzelVIModel, G4UrbanMscModel95, G4UrbanMscModel93,
G4UrbanMscModel90, G4SeltzerBergerModel, G4ScreeningMottCrossSection,
G4PEEffectModel, G4PEEffectFluoModel, G4PAIPhotonModel, G4PAIModel,
G4MollerBhabhaModel, G4KleinNishinaModel, G4KleinNishinaCompton, G4ICRU73QOModel,
G4BraggModel, G4BetheBlochModel, G4PAIxSection, G4InitXscPAI - fixed trivial
problems (mainly pedantic initialisation) reported by the Coverity tool
- G4alphaIonisation - warning is added saying that the process should not be used
2 November 11: G.Cosmo (emstand-V09-04-49)
- Correction in sources.cmake script.
1 November 11: V.Ivanchenko (emstand-V09-04-48)
- G4eCoulombScatteringModel - fixed compilation problem introduced
in the previous tag
31 October 11: V.Ivanchenko (emstand-V09-04-47)
- G4eCoulombScatteringModel - rename local member and set method
SetLowEnergyThreshold to avoid hidden of the method of the
base class (addressed bug# 1256)
28 October 11: V.Ivanchenko (emstand-V09-04-46)
- G4PAIxSection, G4PAIySection,
- G4GoudsmitSaundersonMscModel, G4GoudsmitSaundersonTable - migration to
the new G4Exception signature
- G4ScreeningMottCrossSection, G4eSingleCoulombScatteringModel - new classes
- G4eBremsstrahlungRelModel - only members used in a derived class are
protected, other moved to be private
- G4UrbanMscModel95 - return back default FacSafety = 0.3
- G4SeltzerBergerModel - G4LEDATA is used as a path to the data structure
- G4eCoulombScatteringModel - low-limit is increased from 10 eV to 1 keV
for the reason of HEP production, may be changed by low-energy user
10 October 11: V.Ivanchenko (emstand-V09-04-45)
- G4UrbanMscModel95 - speadup a bit in the case UseSafety (FacSafety = 0.5)
- G4eeToTwoGammaModel - added polarization
- G4eBremsstrahlungRelModel - make few methods and class members protected
to be used in G4SeltzerBergerModel
- G4SeltzerBergerModel - new model for bremsstrahlung
16 September 11: V.Ivanchenko (emstand-V09-04-44)
- G4BetheBlochModel - added protection for high correction to
energy loss (important if a step length is nearly the range)
14 September 11: V.Ivanchenko (emstand-V09-04-43)
- G4eCoulombScatteringModel - low-limit is increased from 1 eV to
10 eV; particles below this limit are killed - a protection
against low-energy particles doing many steps
4 September 11: V.Ivanchenko (emstand-V09-04-42)
- G4UrbanMscModel95 - L.Urban return back optimisation of step
limitation using FactorSafety parameter for the UseSafety
option of step limitation (important for CPU performance
of default Physics List)
20 August 11: V.Ivanchenko (emstand-V09-04-41)
- G4UrbanMscModel95 - minor change of arithmetic computation
18 August 11: V.Ivanchenko (emstand-V09-04-40)
- G4MollerBhabhaModel - removed limitations on cut value to be
able to combined with LIvermore and
Penelope models
18 August 11: V.Ivanchenko (emstand-V09-04-39)
- G4eMultipleScattering - G4UrbanMscModel95 become default
08 August 11: V.Ivanchenko (emstand-V09-04-38)
- G4UrbanMscModel95 L.Urban provided new of tail parameter "c" and
removed CPU optimisation near boundary dependent
on facsafety, which not allowed to have precise
simulation in vicinity of geometrical boundary;
V.Ivanchenko added minor optimisation into
inline method UpdateCache()
28 July 11: V.Ivanchenko (emstand-V09-04-37)
- G4PAIxSection, G4InitXscPAI - fixed typo in tag 035
28 July 11: V.Ivanchenko (emstand-V09-04-36)
- G4KleinNishinaModel, G4PEEffectFluoModel - initialise deexcitation
flag;
- G4GoudsmitSaundersonMscModel - fixed Coverity warnings
25 July 11: V.Ivanchenko (emstand-V09-04-35)
- G4PAIxSection, G4InitXscPAI - fixed Coverity tool warnings
- G4KleinNishinaCompton, G4KleinNishinaModel - added extra protection
to avoid precision loss in sampling of scattering angle
06 June 11: V.Ivanchenko (emstand-V09-04-34)
- G4UrbanMscModel95 - L.Urban fixed typo in sampling of theta
- V.Ivanchenko optimized UpdateCache computation
reducing number of calls to std functions
29 May 11: V.Ivanchenko (emstand-V09-04-33)
- G4UrbanMscModel95 - fixed FPE problem at low-energy (about 10 eV)
14 May 11: V.Ivanchenko (emstand-V09-04-32)
- G4WentzelOKandVIxSection - tuned screening function
- G4GoudsmitSaundersonMscModel - added protection against infinite loop
for solving equation for the screening parameter (bug#1221)
08 May 11: V.Ivanchenko (emstand-V09-04-31)
- G4UrbanMscModel95 - enable sampling along the step for displacement
- G4PEEffectFluoModel - added protection
- G4KleinNishinaModel - limitFactor is set to 4 (was 10)
27 May 11: V.Ivanchenko (emstand-V09-04-30)
- G4MollerBhabhaModel - more coherent usage of cut at low-energy
for dedx and x-section computation,
important for cuts below 1 keV
- G4eeToTwoGammaModel - added numerical protection in cross section
computation for very small energy
26 May 11: V.Ivanchenko (emstand-V09-04-29)
- Fixed source.cmake
26 May 11: V.Ivanchenko (emstand-V09-04-28)
- Fixed problems in new classes
26 May 11: V.Ivanchenko (emstand-V09-04-27)
- V.Grichine have added two new classes :
G4XrayRayleighModel - simplified Rayleigh scattering
G4DipBustGenerator - bremsstrahlung angular generator
24 May 11: V.Ivanchenko (emstand-V09-04-26)
- G4BraggModel, G4BraggIonModel - fixed bug introduced in the previous tag
24 May 11: V.Ivanchenko (emstand-V09-04-25)
- G4BraggModel, G4BraggIonModel - use ASTAR and PSTAR parameterisations
for moleculas from list of ICRU'49
24 May 11: V.Ivanchenko (emstand-V09-04-24)
- G4KleinNishinaModel - added extra protection against infinite loop
during sampling of final state (very low-energy gamma)
- G4UrbanMscModel95 - disable sampleZ option
- G4BraggModel, G4BraggIonModel - minor cleanup of the code
16 May 11: V.Ivanchenko (emstand-V09-04-23)
- G4InitXscPAI,G4IonCoulombCrossSection,G4PAIModel,G4PAIPhotonModel,
G4PAIxSection, G4PAIySection - fixed gcc-4.6.0 warnings
04 May 2011: V.Ivant (emstand-V09-04-22)
- Removed obsolete unused classes: G4ionGasIonisation,
G4CoulombScatteringModel, G4UniversalFluctuation93,
G4UrbanMscModel92
- Fixed Coverity warnings
- G4NuclearStopping - use new sub-type fNuclearStopping
01 May 2011: V.Ivant (emstand-V09-04-21)
- G4PhotoElectricEffect, G4ComptonScattering, G4CoulombScattering
make constructors in the same style
- G4eplusAnnihilation - disable creation of PhysicsTable - compute
cross section in run time (no visible CPU penalty, reduced memory)
01 May 2011: V.Ivant (emstand-V09-04-20)
- G4KleinNishinaModel - removed parasitice printout
- G4CoulombScattering - removed obsolete unused methods
29 April 2011: V.Ivant (emstand-V09-04-19)
- G4KleinNishinaModel - fixed compillation warning at SLC4
29 April 2011: V.Ivant (emstand-V09-04-18)
- G4KleinNishinaModel - fixed infinite loop in new model for 1 keV gamma
27 April 2011: V.Ivant (emstand-V09-04-17)
- G4UrbanMscModel95 - L.Urban fixed FPE problems in the new model,
now by default samplez=true (complite sampling of the displacement)
- G4ModifiedTsai - V. Grichine clean-up of PolarAngle(Tkin,...) method
18 April 2011: V.Ivant (emstand-V09-04-16)
- Fixed problems of the previous tag
08 April 2011: V.Ivant (emstand-V09-04-15)
- G4eBremParametrizedModel (A.Schaelicke) - new model
07 April 2011: V.Ivant (emstand-V09-04-14)
- G4IonFluctuation, G4UniversalFluctuations - replaced Gauss
sampling by Gamma function sampling
- G4MollerBhabhaModel - modified parameterisation of dedx at
very low energy providing more smooth shape
30 March 2011: V.Ivant (emstand-V09-04-13)
- G4WentzelOKandVIxSection, G4eCoulombScatteringModel - fixed problem
introduced in previous tags for compounds
29 March 2011: V.Ivant (emstand-V09-04-12)
- G4WentzelOKandVIxSection - return back to the version of 9.4
29 March 2011: V.Ivant (emstand-V09-04-11)
- G4UrbanMscModel95 - set samplez=false to avoid numerical problem
28 March 2011: V.Ivant (emstand-V09-04-10)
- G4UrbanMscModel90, G4UrbanMscModel92, G4UrbanMscModel93,
G4UrbanMscModel95, G4GoudsmitSaundersonMscModel,
G4WentzelVIModel - updated G4VMscModel methods signature
25 March 2011: V.Ivant (emstand-V09-04-09)
- G4UrbanMscModel90, G4UrbanMscModel92, G4UrbanMscModel93,
G4UrbanMscModel95, G4GoudsmitSaundersonMscModel,
G4WentzelVIModel - use G4VMscModel methods to compute range
and inverse range
- G4WentzelOKandVIxSection - remove special trietment of e-
- G4ComptonScattering - use by default old G4KleinNishinaCompton
24 March 2011: V.Ivant (emstand-V09-04-08)
- G4UrbanMscModel95 - (L.Urban) new version of msc model which
includes improved sampling of the tail of angular distribution,
sampling of lateral displacement and true step length
- G4WentzelOKandVIxSection - fixed sampling of single scattering
22 March 2011: V.Ivant (emstand-V09-04-07)
- General cleanup - removed MinEnergyCut methods, improved comments
21 March 2011: V.Ivant (emstand-V09-04-06)
- G4PAIySection - added method ComputeLowEnergyCof and usage of
this method allowing extend low energy limit of the model down
to 10 eV (V.Grichine)
- G4MollerBhabhaModel - cleanup
- G4ComptonScattering - use G4KleinNishinaModel as a default
- G4PhotoElectricEffect - use G4PEEffectFluoModel as a default
- G4KleinNishinaModel - use dynamic selection between high energy
sampling and sampling with Doppler broading
- G4GoudsmitSaundersonMscModel - restore version of 9.3ref05
25 February 2011: V.Ivant (emstand-V09-04-05)
- G4UrbanMscModel90, G4UrbanMscModel92, G4UrbanMscModel93 use
simpified computation of geom path length if true path length
is equal to the range (minor CPU improvement and more stable
computation)
17 February 2011: V.Ivant (emstand-V09-04-04)
- G4PEEffectFluoModel - comment out parasitic cout
11 February 2011: V.Ivant (emstand-V09-04-03)
- G4PEEffectFluoModel - fixed K-shell selection (was off by mistake)
01 February 2011: V.Ivant (emstand-V09-04-02)
- G4MollerBhabhaModel - fixed expression for computation of positron dedx
according to PDG formula and original paper
(thanks to Nicola Mori)
04 January 2011: V.Ivant (emstand-V09-04-01)
- G4GoudsmitSaundersonMscModel, G4UrbanMscModel90, G4UrbanMscModel92,
G4UrbanMscModel93 use recommended method Value(e) to access transport
cross section instead of obsolete GetValue
- G4KleinNishinaModel - improved computation of kinematics
23 December 2010: V.Ivant (emstand-V09-04-00)
- G4IonCoulombScatteringModel, G4GoudsmitSaundersonMscModel,
G4GoudsmitSaundersonTable - fixed Coverity warnings making more
pedantic initialisation
29 November 2010: V.Ivant (emstand-V09-03-31)
- G4IonCoulombScatteringModel, G4IonCoulombCrossSection - C.Consolandi
added extra screening factor for low-energy heavy ions.
@@ -34,7 +308,7 @@ committal in the CVS repository !
13 November 2010: V.Ivant (emstand-V09-03-27)
- G4UrbanMscModel90, G4UrbanMscModel92, G4UrbanMscModel93 - added
warning messages;
- G4WentzelOKandVIxSection - fixed computation of nuclear formfactor
- G4WentzelOKandVIxSection - fixed computation of nuclear form-factor
- G4eCoulombScatteringModel - fixed computation of nuclear recoil
12 November 2010: V.Ivant (emstand-V09-03-26)
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ASTARStopping.hh,v 1.8 2010/04/26 17:22:08 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4ASTARStopping.hh,v 1.8 2010-04-26 17:22:08 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
#ifndef G4ASTARStopping_h
#define G4ASTARStopping_h 1
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BetheBlochIonGasModel.hh,v 1.1 2010/05/27 10:34:09 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4BetheBlochIonGasModel.hh,v 1.1 2010-05-27 10:34:09 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BetheBlochModel.hh,v 1.23 2010/05/27 14:26:17 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4BetheBlochModel.hh,v 1.23 2010-05-27 14:26:17 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -80,9 +80,6 @@ public:
virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
virtual G4double MinEnergyCut(const G4ParticleDefinition*,
const G4MaterialCutsCouple*);
virtual G4double ComputeCrossSectionPerElectron(
const G4ParticleDefinition*,
G4double kineticEnergy,
@@ -149,7 +146,6 @@ private:
G4BetheBlochModel(const G4BetheBlochModel&);
const G4ParticleDefinition* particle;
const G4Material* currentMaterial;
G4ParticleDefinition* theElectron;
G4EmCorrections* corr;
G4ParticleChangeForLoss* fParticleChange;
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BetheHeitlerModel.hh,v 1.9 2010/10/26 10:35:22 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4BetheHeitlerModel.hh,v 1.9 2010-10-26 10:35:22 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BohrFluctuations.hh,v 1.4 2009/02/19 19:17:50 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4BohrFluctuations.hh,v 1.4 2009-02-19 19:17:50 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BraggIonGasModel.hh,v 1.1 2010/05/27 10:34:09 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4BraggIonGasModel.hh,v 1.1 2010-05-27 10:34:09 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BraggIonModel.hh,v 1.12 2009/02/20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4BraggIonModel.hh,v 1.12 2009-02-20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -76,9 +76,6 @@ public:
virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
virtual G4double MinEnergyCut(const G4ParticleDefinition*,
const G4MaterialCutsCouple*);
virtual G4double ComputeCrossSectionPerElectron(
const G4ParticleDefinition*,
G4double kineticEnergy,
@@ -148,8 +145,6 @@ private:
G4double ElectronicStoppingPower(G4double z,
G4double kineticEnergy) const;
void SetMoleculaNumber(G4int number) {iMolecula = number;};
G4double DEDX(const G4Material* material, G4double kineticEnergy);
G4EmCorrections* corr;
@@ -160,6 +155,8 @@ private:
G4ASTARStopping astar;
const G4Material* currentMaterial;
G4double mass;
G4double spin;
G4double chargeSquare;
@@ -173,6 +170,7 @@ private:
G4double theZieglerFactor;
G4int iMolecula; // index in the molecula's table
G4int iASTAR; // index in ASTAR
G4bool isIon;
G4bool isInitialised;
};
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BraggModel.hh,v 1.15 2010/05/27 10:08:58 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4BraggModel.hh,v 1.15 2010-05-27 10:08:58 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -79,9 +79,6 @@ public:
virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
virtual G4double MinEnergyCut(const G4ParticleDefinition*,
const G4MaterialCutsCouple*);
virtual G4double ComputeCrossSectionPerElectron(
const G4ParticleDefinition*,
G4double kineticEnergy,
@@ -141,8 +138,6 @@ private:
G4double ElectronicStoppingPower(G4double z,
G4double kineticEnergy) const;
void SetMoleculaNumber(G4int number) {iMolecula = number;};
G4double DEDX(const G4Material* material, G4double kineticEnergy);
@@ -164,6 +159,8 @@ private:
G4ParticleChangeForLoss* fParticleChange;
G4PSTARStopping pstar;
const G4Material* currentMaterial;
G4double mass;
G4double spin;
G4double chargeSquare;
@@ -172,9 +169,10 @@ private:
G4double lowestKinEnergy;
G4double protonMassAMU;
G4double theZieglerFactor;
G4double expStopPower125; // Experimental Stopping power at 125keV
G4double expStopPower125; // Experimental Stopping power at 125keV
G4int iMolecula; // index in the molecula's table
G4int iPSTAR; // index in PSTAR
G4bool isIon;
G4bool isInitialised;
};
@@ -23,9 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4ComptonScattering.hh,v 1.21 2009/02/20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4ComptonScattering.hh,v 1.21 2009-02-20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
//------------------ G4ComptonScattering physics process -----------------------
// by Michel Maire, April 1996
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4CoulombScattering.hh,v 1.15 2010/10/25 19:13:23 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4CoulombScattering.hh,v 1.15 2010-10-25 19:13:23 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -64,15 +64,6 @@ public:
virtual G4bool IsApplicable(const G4ParticleDefinition& p);
inline void SetThetaMin(G4double);
inline void SetThetaMax(G4double);
inline void SetQ2Max(G4double);
// Set energy above which high energy model will be used
inline void SetHEModelLimit(G4double);
// Print out of the class parameters
virtual void PrintInfo();
@@ -86,46 +77,10 @@ private:
G4CoulombScattering & operator=(const G4CoulombScattering &right);
G4CoulombScattering(const G4CoulombScattering&);
G4double thetaMin;
G4double thetaMax;
G4double q2Max;
G4double thEnergy;
G4double thEnergyElec;
G4bool isInitialised;
const G4ParticleDefinition* aParticle;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4CoulombScattering::SetThetaMin(G4double val)
{
thetaMin = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4CoulombScattering::SetThetaMax(G4double val)
{
thetaMax = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4CoulombScattering::SetQ2Max(G4double val)
{
q2Max = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4CoulombScattering::SetHEModelLimit(G4double val)
{
thEnergy = val;
thEnergyElec = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -23,52 +23,60 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ionGasIonisation.hh,v 1.4 2008/09/12 16:26:34 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4DipBustGenerator.hh,v 1.1 2010-10-14 15:17:48 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4ionGasIonisation
// File name: G4DipBustGenerator
//
// Author: Vladimir Ivanchenko
// Author: Vladimir Grichine
// Creation date: 17 May 2011
//
// Creation date: 23.07.2007
// Modifications:
//
//
// Modifications:
// Bremsstrahlung Angular Distribution Generation
// suggested the dipole approximation in the rest frame of electron
// busted in the laboratory frame.
//
//
// Class Description:
//
// This class manages the ionisation process for ions. It inherites
// from G4ionIonisation and sample ion/media charge exchange
//
// -------------------------------------------------------------------
//
#ifndef G4ionGasIonisation_h
#define G4ionGasIonisation_h 1
#ifndef G4DipBustGenerator_h
#define G4DipBustGenerator_h 1
#include "G4ionIonisation.hh"
#include "G4ios.hh"
#include "globals.hh"
#include "G4VBremAngularDistribution.hh"
class G4ionGasIonisation : public G4ionIonisation
class G4DipBustGenerator : public G4VBremAngularDistribution
{
public:
G4ionGasIonisation(const G4String& name = "ionGasIoni");
G4DipBustGenerator(const G4String& name = "");
virtual ~G4ionGasIonisation();
virtual ~G4DipBustGenerator();
G4double PolarAngle(const G4double initial_energy,
const G4double final_energy,
const G4int Z);
void PrintGeneratorInformation() const;
protected:
private:
// hide assignment operator
G4ionGasIonisation & operator=(const G4ionGasIonisation &right);
G4ionGasIonisation(const G4ionGasIonisation&);
// hide assignment operator
G4DipBustGenerator & operator=(const G4DipBustGenerator &right);
G4DipBustGenerator(const G4DipBustGenerator&);
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4GammaConversion.hh,v 1.23 2009/02/20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4GammaConversion.hh,v 1.23 2009-02-20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
//
//------------------ G4GammaConversion physics process------------------------
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4GoudsmitSaundersonMscModel.hh,v 1.5 2010/06/25 09:41:34 gunter Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4GoudsmitSaundersonMscModel.hh,v 1.6 2010-12-29 18:56:04 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -124,7 +124,7 @@ private:
G4double tausmall,taulim,tlimit,tlimitmin,geommin,geombig;
G4double charge,lambdalimit;
G4double tPathLength,stepmin ;
G4double lambda0,lambda1,lambda11,Qn1,Qn12;
G4double lambda0,lambda1,lambda11;
G4double mass;
G4int currentMaterialIndex;
@@ -164,14 +164,13 @@ inline G4double G4GoudsmitSaundersonMscModel::GetLambda(G4double e)
{
G4double x;
if(theLambdaTable) {
G4bool b;
x = ((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b);
x = ((*theLambdaTable)[currentMaterialIndex])->Value(e);
} else {
x = CrossSection(currentCouple,particle,e);
}
if(x > DBL_MIN) x = 1./x;
else x = DBL_MAX;
if(x > DBL_MIN) { x = 1./x; }
else { x = DBL_MAX; }
return x;
}
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4GoudsmitSaundersonTable.hh,v 1.5 2010/06/25 09:41:36 gunter Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4GoudsmitSaundersonTable.hh,v 1.5 2010-06-25 09:41:36 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4HeatedKleinNishinaCompton.hh,v 1.2 2009/04/11 13:05:03 grichine Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4HeatedKleinNishinaCompton.hh,v 1.2 2009-04-11 13:05:03 grichine Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ICRU49NuclearStoppingModel.hh,v 1.2 2009/11/10 19:25:47 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4ICRU49NuclearStoppingModel.hh,v 1.2 2009-11-10 19:25:47 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ICRU73QOModel.hh,v 1.3 2010/06/04 09:09:31 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4ICRU73QOModel.hh,v 1.3 2010-06-04 09:09:31 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -79,9 +79,6 @@ public:
virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
virtual G4double MinEnergyCut(const G4ParticleDefinition*,
const G4MaterialCutsCouple*);
virtual G4double ComputeCrossSectionPerElectron(
const G4ParticleDefinition*,
G4double kineticEnergy,
@@ -220,14 +217,14 @@ inline G4int G4ICRU73QOModel::GetNumberOfShells(G4int Z) const
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4ICRU73QOModel::GetShellEnergy(G4int Z,
G4int nbOfTheShell) const
inline G4double
G4ICRU73QOModel::GetShellEnergy(G4int Z, G4int nbOfTheShell) const
{
G4double shellEnergy = 0.;
G4int idx = indexZ[Z];
if(indexZ[Z] >= 0) { shellEnergy = ShellEnergy[startElemIndex[idx] + nbOfTheShell]*eV;
if(idx >= 0) { shellEnergy = ShellEnergy[startElemIndex[idx] + nbOfTheShell]*eV;
} else { shellEnergy = GetOscillatorEnergy(Z, nbOfTheShell); }
return shellEnergy;
@@ -235,15 +232,15 @@ inline G4double G4ICRU73QOModel::GetShellEnergy(G4int Z,
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4ICRU73QOModel::GetShellStrength(G4int Z,
G4int nbOfTheShell) const
inline G4double
G4ICRU73QOModel::GetShellStrength(G4int Z, G4int nbOfTheShell) const
{
G4double shellStrength = 0.;
G4int idx = indexZ[Z];
if(indexZ[Z] >= 0) { shellStrength = SubShellOccupation[startElemIndex[idx] + nbOfTheShell] / Z;
} else { shellStrength = 1.0 / Z * G4AtomicShells::GetNumberOfElectrons(Z,nbOfTheShell); }
if(idx >= 0) { shellStrength = SubShellOccupation[startElemIndex[idx] + nbOfTheShell] / Z;
} else { shellStrength = G4double(G4AtomicShells::GetNumberOfElectrons(Z,nbOfTheShell))/Z; }
return shellStrength;
}
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4InitXscPAI.hh,v 1.8 2006/06/29 19:50:22 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4InitXscPAI.hh,v 1.8 2006-06-29 19:50:22 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
//
// G4InitXscPAI.hh -- header file
@@ -52,8 +52,6 @@ public:
// Constructors
G4InitXscPAI( const G4MaterialCutsCouple* matCC);
virtual ~G4InitXscPAI() ;
// Methods
@@ -124,6 +122,9 @@ protected :
private :
G4InitXscPAI & operator=(const G4InitXscPAI &right);
G4InitXscPAI(const G4InitXscPAI&);
// Local class constants
static const G4double fDelta ; // energy shift from interval border = 0.001
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4IonFluctuations.hh,v 1.9 2009/02/19 19:17:50 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4IonFluctuations.hh,v 1.9 2009-02-19 19:17:50 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4KleinNishinaCompton.hh,v 1.9 2007/05/22 17:34:36 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4KleinNishinaCompton.hh,v 1.9 2007-05-22 17:34:36 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4KleinNishinaModel.hh,v 1.1 2010/09/03 14:11:58 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4KleinNishinaModel.hh,v 1.1 2010-09-03 14:11:58 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -51,6 +51,7 @@
#define G4KleinNishinaModel_h 1
#include "G4VEmModel.hh"
#include "G4LorentzVector.hh"
#include <vector>
class G4ParticleChangeForGamma;
@@ -93,8 +94,12 @@ private:
// hide assignment operator
G4KleinNishinaModel & operator=(const G4KleinNishinaModel &right);
G4KleinNishinaModel(const G4KleinNishinaModel&);
G4LorentzVector lv1, lv2;
G4ThreeVector bst;
G4VAtomDeexcitation* fAtomDeexcitation;
G4double limitFactor;
G4bool isInitialized;
std::vector<G4double> fProbabilities;
};
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ModifiedTsai.hh,v 1.1 2010/10/14 15:17:48 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4ModifiedTsai.hh,v 1.1 2010-10-14 15:17:48 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MollerBhabhaModel.hh,v 1.20 2009/02/20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4MollerBhabhaModel.hh,v 1.20 2009-02-20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -73,9 +73,6 @@ public:
virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
virtual G4double MinEnergyCut(const G4ParticleDefinition*,
const G4MaterialCutsCouple*);
virtual G4double ComputeCrossSectionPerElectron(
const G4ParticleDefinition*,
G4double kineticEnergy,
@@ -136,7 +133,7 @@ private:
inline void G4MollerBhabhaModel::SetParticle(const G4ParticleDefinition* p)
{
particle = p;
if(p != theElectron) isElectron = false;
if(p != theElectron) { isElectron = false; }
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4NuclearStopping.hh,v 1.2 2009/11/10 19:25:47 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4NuclearStopping.hh,v 1.2 2009-11-10 19:25:47 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -----------------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PAIModel.hh,v 1.22 2009/02/19 19:17:50 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4PAIModel.hh,v 1.22 2009-02-19 19:17:50 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PAIPhotonModel.hh,v 1.12 2009/02/19 19:17:50 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4PAIPhotonModel.hh,v 1.12 2009-02-19 19:17:50 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4PAIxSection.hh,v 1.15 2008/05/30 16:04:40 grichine Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4PAIxSection.hh,v 1.15 2008-05-30 16:04:40 grichine Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
//
// G4PAIxSection.hh -- header file
@@ -42,8 +42,8 @@
//
// History:
//
// 19.10.03, V. Grichine: Integral dEdx was added for G4PAIModel class
//
// 28.10.11, V. Ivanchenko: Migration of exceptions to the new design
// 19.10.03, V. Grichine: Integral dEdx was added for G4PAIModel class
// 13.05.03, V. Grichine: Numerical instability was fixed in SumOverInterval/Border
// functions
// 10.02.02, V. Grichine: New functions and arrays/gets for Cerenkov and
@@ -210,10 +210,13 @@ public:
inline G4double GetIntegralPlasmon(G4int i) const;
inline G4double GetIntegralResonance(G4int i) const;
protected :
private :
void CallError(G4int i, const G4String& methodName) const;
G4PAIxSection & operator=(const G4PAIxSection &right);
G4PAIxSection(const G4PAIxSection&);
// Local class constants
static const G4double fDelta; // energy shift from interval border = 0.001
@@ -283,7 +286,6 @@ G4double fPAItable[500][112]; // Output array
//////////////// Inline methods //////////////////////////////////
//
inline G4double G4PAIxSection::GetPAItable(G4int i, G4int j) const
{
return fPAItable[i][j];
@@ -296,65 +298,44 @@ inline G4double G4PAIxSection::GetLorentzFactor(G4int j) const
inline G4double G4PAIxSection::GetSplineEnergy(G4int i) const
{
if(i < 1 || i > fSplineNumber)
{
G4Exception("Invalid argument in G4PAIxSection::GetSplineEnergy");
}
return fSplineEnergy[i];
if(i < 1 || i > fSplineNumber) { CallError(i, "GetSplineEnergy"); }
return fSplineEnergy[i];
}
inline G4double G4PAIxSection::GetIntegralPAIxSection(G4int i) const
{
if(i < 1 || i > fSplineNumber)
{
G4Exception("Invalid argument in G4PAIxSection::GetIntegralPAIxSection");
}
return fIntegralPAIxSection[i];
if(i < 1 || i > fSplineNumber) { CallError(i, "GetIntegralPAIxSection"); }
return fIntegralPAIxSection[i];
}
inline G4double G4PAIxSection::GetIntegralPAIdEdx(G4int i) const
{
if(i < 1 || i > fSplineNumber)
{
G4Exception("Invalid argument in G4PAIxSection::GetIntegralPAIxSection");
}
return fIntegralPAIdEdx[i];
if(i < 1 || i > fSplineNumber) { CallError(i, "GetIntegralPAIdEdx"); }
return fIntegralPAIdEdx[i];
}
inline G4double G4PAIxSection::GetIntegralCerenkov(G4int i) const
{
if(i < 1 || i > fSplineNumber)
{
G4Exception("Invalid argument in G4PAIxSection::GetIntegralCerenkov");
}
return fIntegralCerenkov[i];
if(i < 1 || i > fSplineNumber) { CallError(i, "GetIntegralCerenkov"); }
return fIntegralCerenkov[i];
}
inline G4double G4PAIxSection::GetIntegralMM(G4int i) const
{
if(i < 1 || i > fSplineNumber)
{
G4Exception("Invalid argument in G4PAIxSection::GetIntegralMM");
}
return fIntegralMM[i];
if(i < 1 || i > fSplineNumber) { CallError(i, "GetIntegralMM"); }
return fIntegralMM[i];
}
inline G4double G4PAIxSection::GetIntegralPlasmon(G4int i) const
{
if(i < 1 || i > fSplineNumber)
{
G4Exception("Invalid argument in G4PAIxSection::GetIntegralPlasmon");
}
return fIntegralPlasmon[i];
if(i < 1 || i > fSplineNumber) { CallError(i, "GetIntegralPlasmon"); }
return fIntegralPlasmon[i];
}
inline G4double G4PAIxSection::GetIntegralResonance(G4int i) const
{
if(i < 1 || i > fSplineNumber)
{
G4Exception("Invalid argument in G4PAIxSection::GetIntegralResonance");
}
return fIntegralResonance[i];
if(i < 1 || i > fSplineNumber) { CallError(i, "GetIntegralResonance"); }
return fIntegralResonance[i];
}
#endif
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4PAIySection.hh,v 1.3 2010/11/21 10:55:44 grichine Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4PAIySection.hh,v 1.3 2010-11-21 10:55:44 grichine Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
//
// G4PAIySection.hh -- header file
@@ -38,7 +38,8 @@
// History:
//
// 01.10.07, V.Ivanchenko create using V.Grichine G4PAIxSection class
// 21.11.10, V.Grichine, fVerbose and SetVerbose added
// 21.11.10, V.Grichine fVerbose and SetVerbose added
// 28.10.11, V.Ivanchenko Migration of exceptions to the new design
#ifndef G4PAIYSECTION_HH
#define G4PAIYSECTION_HH
@@ -61,6 +62,8 @@ public:
G4double maxEnergyTransfer,
G4double betaGammaSq);
void ComputeLowEnergyCof(const G4Material* material);
void InitPAI();
void NormShift( G4double betaGammaSq );
@@ -139,11 +142,13 @@ public:
inline G4double GetIntegralCerenkov(G4int i) const;
inline G4double GetIntegralPlasmon(G4int i) const;
void SetVerbose(G4int v){fVerbose = v;};
inline void SetVerbose(G4int v) { fVerbose = v; };
private :
// Local class constants
void CallError(G4int i, const G4String& methodName) const;
// Local class constants
static const G4double fDelta; // energy shift from interval border = 0.001
static const G4double fError; // error in lin-log approximation = 0.005
@@ -159,6 +164,7 @@ private :
G4double fDensity; // Current density
G4double fElectronDensity; // Current electron (number) density
G4double fLowEnergyCof; // Correction cof for low energy region
G4int fSplineNumber; // Current size of spline
G4int fVerbose; // verbose flag
@@ -206,47 +212,32 @@ inline G4double G4PAIySection::GetLorentzFactor(G4int j) const
inline G4double G4PAIySection::GetSplineEnergy(G4int i) const
{
if(i < 1 || i > fSplineNumber)
{
G4Exception("Invalid argument in G4PAIySection::GetSplineEnergy");
}
return fSplineEnergy[i];
if(i < 1 || i > fSplineNumber) { CallError(i, "GetSplineEnergy"); }
return fSplineEnergy[i];
}
inline G4double G4PAIySection::GetIntegralPAIySection(G4int i) const
{
if(i < 1 || i > fSplineNumber)
{
G4Exception("Invalid argument in G4PAIySection::GetIntegralPAIySection");
}
return fIntegralPAIySection[i];
if(i < 1 || i > fSplineNumber) { CallError(i, "GetIntegralPAIySection"); }
return fIntegralPAIySection[i];
}
inline G4double G4PAIySection::GetIntegralPAIdEdx(G4int i) const
{
if(i < 1 || i > fSplineNumber)
{
G4Exception("Invalid argument in G4PAIySection::GetIntegralPAIySection");
}
return fIntegralPAIdEdx[i];
if(i < 1 || i > fSplineNumber) { CallError(i, "GetIntegralPAIdEdx"); }
return fIntegralPAIdEdx[i];
}
inline G4double G4PAIySection::GetIntegralCerenkov(G4int i) const
{
if(i < 1 || i > fSplineNumber)
{
G4Exception("Invalid argument in G4PAIySection::GetIntegralCerenkov");
}
return fIntegralCerenkov[i];
if(i < 1 || i > fSplineNumber) { CallError(i, "GetIntegralCerenkov"); }
return fIntegralCerenkov[i];
}
inline G4double G4PAIySection::GetIntegralPlasmon(G4int i) const
{
if(i < 1 || i > fSplineNumber)
{
G4Exception("Invalid argument in G4PAIySection::GetIntegralPlasmon");
}
return fIntegralPlasmon[i];
if(i < 1 || i > fSplineNumber) { CallError(i, "GetIntegralPlasmon"); }
return fIntegralPlasmon[i];
}
#endif
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PEEffectFluoModel.hh,v 1.1 2010/09/03 14:11:16 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4PEEffectFluoModel.hh,v 1.1 2010-09-03 14:11:16 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PEEffectModel.hh,v 1.7 2009/02/20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4PEEffectModel.hh,v 1.7 2009-02-20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PSTARStopping.hh,v 1.7 2010/04/26 17:22:08 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4PSTARStopping.hh,v 1.7 2010-04-26 17:22:08 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
#ifndef G4PSTARStopping_h
#define G4PSTARStopping_h 1
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PairProductionRelModel.hh,v 1.9 2010/10/26 10:35:22 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4PairProductionRelModel.hh,v 1.9 2010-10-26 10:35:22 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4PhotoElectricEffect.hh,v 1.25 2009/02/20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// $Id: G4PhotoElectricEffect.hh,v 1.25 2009-02-20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
//------------------ G4PhotoElectricEffect physics process ------------------
// by Michel Maire, 24 May 1996
@@ -85,7 +83,7 @@ class G4PhotoElectricEffect : public G4VEmProcess
public: // with description
G4PhotoElectricEffect(const G4String& processName ="phot",
G4ProcessType type = fElectromagnetic);
G4ProcessType type = fElectromagnetic);
virtual ~G4PhotoElectricEffect();
@@ -0,0 +1,219 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// G4ScreeningMottCrossSection.hh
//-------------------------------------------------------------------
//
// GEANT4 Class header file
//
// File name: G4ScreeningMottCrossSection
//
// Author: Cristina Consolandi
//
// Creation date: 20.10.2011
//
// Class Description:
// Computation of electron Coulomb Scattering Cross Section.
// Suitable for high energy electrons and light target materials.
//
// 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).
//
//
// 1) Mott Differential Cross Section Approximation:
// W. A. McKinley and H. Fashbach, Phys. Rev. 74, (1948) 1759.
// 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.
//
// ----------------------------------------------------------------------------------------
//
#ifndef G4ScreeningMottCrossSection_h
#define G4ScreeningMottCrossSection_h 1
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "globals.hh"
#include "G4Material.hh"
#include "G4Element.hh"
#include "G4ElementVector.hh"
#include "G4NistManager.hh"
#include "G4ThreeVector.hh"
#include "G4Pow.hh"
#include "G4LossTableManager.hh"
class G4ParticleDefinition;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class G4ScreeningMottCrossSection
{
public:
G4ScreeningMottCrossSection();
virtual ~G4ScreeningMottCrossSection();
void Initialise(const G4ParticleDefinition*, G4double cosThetaLim);
G4double GetScreeningAngle();
void SetScreeningCoefficient();
inline void SetupParticle(const G4ParticleDefinition*);
void SetupKinematic(G4double kinEnergy ,G4double Z);
G4double NuclearCrossSection();
G4ThreeVector GetNewDirection();
inline G4double GetMom2CM()const;
inline G4double GetMom2Lab()const;
inline G4double GetTrec() const;
inline G4double GetScreeningCoefficient() const;
inline G4double GetTotalCross() const;
G4double McFcorrection(G4double);
G4double FormFactor2ExpHof(G4double);
G4double GetScatteringAngle();
G4double AngleDistribution(G4double);
private:
G4ScreeningMottCrossSection & operator=(const G4ScreeningMottCrossSection &right);
G4ScreeningMottCrossSection(const G4ScreeningMottCrossSection&);
G4NistManager* fNistManager;
G4double TotalCross;
//cost - min - max
G4double cosThetaMin;// def 1.0
G4double cosThetaMax;// def -1.0
G4double cosTetMinNuc;
G4double cosTetMaxNuc;
//energy cut
G4double ecut;
G4double etag;
// projectile........................
const G4ParticleDefinition* particle;
G4double spin;
G4double mass;
//lab of incedent particle
G4double tkinLab;
G4double momLab2;
G4double invbetaLab2;
//relative system with nucleus
G4double mu_rel;
G4double tkin;
G4double mom2;
G4double invbeta2;
G4double beta;
G4double gamma;
// target nucleus
G4double targetZ;
G4double targetA;
G4double targetMass;
G4double Trec;
G4double As;
//constants
G4double alpha;
G4double htc2;
G4double e2;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
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;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4ScreeningMottCrossSection::GetMom2CM() const
{
return mom2;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4ScreeningMottCrossSection::GetMom2Lab() const
{
return momLab2;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4ScreeningMottCrossSection::GetTrec() const
{
return Trec;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4ScreeningMottCrossSection::GetScreeningCoefficient() const
{
return As;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4ScreeningMottCrossSection::GetTotalCross() const
{
return TotalCross;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -23,80 +23,75 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4CoulombScatteringModel.hh,v 1.17 2010/05/27 14:22:05 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4SeltzerBergerModel.hh,v 1.14 2010-10-26 10:35:22 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4CoulombScatteringModel
// File name: G4SeltzerBergerModel
//
// Author: Vladimir Ivanchenko
// Author: Andreas Schaelicke & Vladimir Ivantchenko
//
// Creation date: 19.02.2006
// Creation date: 25.09.2011
//
// Modifications:
// 01.08.06 V.Ivanchenko extend upper limit of table to TeV and review the
// logic of building - only elements from G4ElementTable
// 08.08.06 V.Ivanchenko build internal table in ekin scale, introduce faclim
// 19.10.06 V.Ivanchenko use inheritance from G4eCoulombScatteringModel
// 09.10.07 V.Ivanchenko reorganized methods, add cut dependence in scattering off e-
// 09.06.08 V.Ivanchenko SelectIsotope is moved to the base class
// 27.05.10 V.Ivanchenko added G4WentzelOKandVIxSection class to
// compute cross sections and sample scattering angle
//
//
// Class Description:
//
// Implementation of CoulombScattering of pointlike charge particle
// on Atomic Nucleus for interval of scattering anles in CM system
// thetaMin - ThetaMax
// The model based on analysis of J.M.Fernandez-Varea et al.
// NIM B73(1993)447 originated from G.Wentzel Z.Phys. 40(1927)590 with
// screening parameter from H.A.Bethe Phys. Rev. 89 (1953) 1256.
//
// Implementation of the bremssrahlung model using
// S.M. Seltzer and M.J. Berger Atomic data and Nuclear Data
// Tables 35 (1986) 345
// -------------------------------------------------------------------
//
#ifndef G4CoulombScatteringModel_h
#define G4CoulombScatteringModel_h 1
#ifndef G4SeltzerBergerModel_h
#define G4SeltzerBergerModel_h 1
#include "G4eCoulombScatteringModel.hh"
#include "G4eBremsstrahlungRelModel.hh"
#include "globals.hh"
class G4CoulombScatteringModel : public G4eCoulombScatteringModel
class G4Physics2DVector;
class G4SeltzerBergerModel : public G4eBremsstrahlungRelModel
{
public:
G4CoulombScatteringModel(const G4String& nam = "CoulombScattering");
virtual ~G4CoulombScatteringModel();
G4SeltzerBergerModel(const G4ParticleDefinition* p = 0,
const G4String& nam = "eBremSB");
virtual G4double ComputeCrossSectionPerAtom(
const G4ParticleDefinition*,
G4double kinEnergy,
G4double Z,
G4double A,
G4double cut,
G4double emax);
virtual ~G4SeltzerBergerModel();
virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double tmin,
G4double cutEnergy,
G4double maxEnergy);
protected:
virtual G4double ComputeDXSectionPerAtom(G4double gammaEnergy);
private:
void ReadData(size_t Z, const char* path = 0);
// hide assignment operator
G4CoulombScatteringModel & operator=(const G4CoulombScatteringModel &right);
G4CoulombScatteringModel(const G4CoulombScatteringModel&);
G4SeltzerBergerModel & operator=(const G4SeltzerBergerModel &right);
G4SeltzerBergerModel(const G4SeltzerBergerModel&);
std::vector<G4Physics2DVector*> dataSB;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4UniversalFluctuation.hh,v 1.12 2010/08/08 08:19:59 urban Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4UniversalFluctuation.hh,v 1.12 2010-08-08 08:19:59 urban Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -1,127 +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. *
// ********************************************************************
//
// $Id: G4UniversalFluctuation93.hh,v 1.2 2010/10/26 10:06:12 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4UniversalFluctuation93
//
// Author: V.Ivanchenko make a class with the Laszlo Urban model
//
// Creation date: 03.01.2002
//
// Modifications:
//
// 09-12-02 remove warnings (V.Ivanchenko)
// 28-12-02 add method Dispersion (V.Ivanchenko)
// 07-02-03 change signature (V.Ivanchenko)
// 13-02-03 Add name (V.Ivanchenko)
// 16-10-03 Changed interface to Initialisation (V.Ivanchenko)
// 07-02-05 define problim = 5.e-3 (mma)
// 14-06-10 saved version of 9.3 model with the name G4UniversalFluctuation93
//
// Class Description:
//
// Implementation of energy loss fluctuations
// -------------------------------------------------------------------
//
#ifndef G4UniversalFluctuation93_h
#define G4UniversalFluctuation93_h 1
#include "G4VEmFluctuationModel.hh"
#include "G4ParticleDefinition.hh"
class G4UniversalFluctuation93 : public G4VEmFluctuationModel
{
public:
G4UniversalFluctuation93(const G4String& nam = "UniFluc93");
virtual ~G4UniversalFluctuation93();
virtual G4double SampleFluctuations(const G4Material*,
const G4DynamicParticle*,
G4double&,
G4double&,
G4double&);
virtual G4double Dispersion( const G4Material*,
const G4DynamicParticle*,
G4double&,
G4double&);
virtual void InitialiseMe(const G4ParticleDefinition*);
// Initialisation prestep
virtual void SetParticleAndCharge(const G4ParticleDefinition*, G4double q2);
private:
// hide assignment operator
G4UniversalFluctuation93 & operator=(const G4UniversalFluctuation93 &right);
G4UniversalFluctuation93(const G4UniversalFluctuation93&);
const G4ParticleDefinition* particle;
const G4Material* lastMaterial;
G4double particleMass;
G4double chargeSquare;
// data members to speed up the fluctuation calculation
G4double ipotFluct;
G4double electronDensity;
G4double f1Fluct;
G4double f2Fluct;
G4double e1Fluct;
G4double e2Fluct;
G4double e1LogFluct;
G4double e2LogFluct;
G4double ipotLogFluct;
G4double e0;
G4double e1,e2;
G4double minNumberInteractionsBohr;
G4double theBohrBeta2;
G4double minLoss;
G4double nmaxCont1;
G4double nmaxCont2;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4UrbanMscModel90.hh,v 1.6 2009/11/01 13:04:12 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4UrbanMscModel90.hh,v 1.7 2010-12-29 18:56:04 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -59,7 +59,6 @@
#include "G4MscStepLimitType.hh"
class G4ParticleChangeForMSC;
class G4SafetyHelper;
class G4LossTableManager;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -121,7 +120,6 @@ private:
const G4ParticleDefinition* particle;
G4ParticleChangeForMSC* fParticleChange;
G4SafetyHelper* safetyHelper;
G4PhysicsTable* theLambdaTable;
const G4MaterialCutsCouple* couple;
G4LossTableManager* theManager;
@@ -178,13 +176,12 @@ G4double G4UrbanMscModel90::GetLambda(G4double e)
{
G4double x;
if(theLambdaTable) {
G4bool b;
x = ((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b);
x = ((*theLambdaTable)[currentMaterialIndex])->Value(e);
} else {
x = CrossSection(couple,particle,e);
}
if(x > DBL_MIN) x = 1./x;
else x = DBL_MAX;
if(x > DBL_MIN) { x = 1./x; }
else { x = DBL_MAX; }
return x;
}
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4UrbanMscModel93.hh,v 1.4 2009/12/14 06:57:12 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4UrbanMscModel93.hh,v 1.5 2010-12-29 18:56:04 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -186,13 +186,12 @@ G4double G4UrbanMscModel93::GetLambda(G4double e)
{
G4double x;
if(theLambdaTable) {
G4bool b;
x = ((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b);
x = ((*theLambdaTable)[currentMaterialIndex])->Value(e);
} else {
x = CrossSection(couple,particle,e);
}
if(x > DBL_MIN) x = 1./x;
else x = DBL_MAX;
if(x > DBL_MIN) { x = 1./x; }
else { x = DBL_MAX; }
return x;
}
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4UrbanMscModel92.hh,v 1.1 2009/11/01 13:04:12 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: $
// GEANT4 tag $Name: $
//
// -------------------------------------------------------------------
//
@@ -32,17 +32,13 @@
// GEANT4 Class header file
//
//
// File name: G4UrbanMscModel92
// File name: G4UrbanMscModel95
//
// Author: Laszlo Urban
//
// Creation date: 06.03.2008
// Creation date: 20.03.2011
//
// Modifications:
//
// 28-10-2009 V.Ivanchenko moved G4UrbanMscModel to G4UrbanMscModel92,
// now it is a frozen version of the Urban model corresponding
// to g4 9.2
// Created from G4UrbanMscModel93
//
// Class Description:
//
@@ -52,8 +48,8 @@
// -------------------------------------------------------------------
//
#ifndef G4UrbanMscModel92_h
#define G4UrbanMscModel92_h 1
#ifndef G4UrbanMscModel95_h
#define G4UrbanMscModel95_h 1
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -67,14 +63,14 @@ class G4LossTableManager;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class G4UrbanMscModel92 : public G4VMscModel
class G4UrbanMscModel95 : public G4VMscModel
{
public:
G4UrbanMscModel92(const G4String& nam = "UrbanMsc92");
G4UrbanMscModel95(const G4String& nam = "UrbanMsc95");
virtual ~G4UrbanMscModel92();
virtual ~G4UrbanMscModel95();
void Initialise(const G4ParticleDefinition*, const G4DataVector&);
@@ -116,8 +112,8 @@ private:
inline void UpdateCache();
// hide assignment operator
G4UrbanMscModel92 & operator=(const G4UrbanMscModel92 &right);
G4UrbanMscModel92(const G4UrbanMscModel92&);
G4UrbanMscModel95 & operator=(const G4UrbanMscModel95 &right);
G4UrbanMscModel95(const G4UrbanMscModel95&);
const G4ParticleDefinition* particle;
G4ParticleChangeForMSC* fParticleChange;
@@ -169,36 +165,36 @@ private:
G4double Zold;
G4double Zeff,Z2,Z23,lnZ;
G4double coeffth1,coeffth2;
G4double coeffc1,coeffc2;
G4double coeffc1,coeffc2,coeffc3,coeffc4;
G4double scr1ini,scr2ini,scr1,scr2;
G4bool isInitialized;
G4bool inside;
G4bool insideskin;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline
G4double G4UrbanMscModel92::GetLambda(G4double e)
G4double G4UrbanMscModel95::GetLambda(G4double e)
{
G4double x;
if(theLambdaTable) {
G4bool b;
x = ((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b);
x = ((*theLambdaTable)[currentMaterialIndex])->Value(e);
} else {
x = CrossSection(couple,particle,e);
}
if(x > DBL_MIN) x = 1./x;
else x = DBL_MAX;
if(x > DBL_MIN) { x = 1./x; }
else { x = DBL_MAX; }
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline
void G4UrbanMscModel92::SetParticle(const G4ParticleDefinition* p)
void G4UrbanMscModel95::SetParticle(const G4ParticleDefinition* p)
{
if (p != particle) {
particle = p;
@@ -211,18 +207,26 @@ void G4UrbanMscModel92::SetParticle(const G4ParticleDefinition* p)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline
void G4UrbanMscModel92::UpdateCache()
void G4UrbanMscModel95::UpdateCache()
{
lnZ = std::log(Zeff);
coeffth1 = 0.885+lnZ*(0.104-0.0170*lnZ);
coeffth2 = 0.028+lnZ*(0.012-0.00125*lnZ);
coeffc1 = 2.134-lnZ*(0.1045-0.00602*lnZ);
coeffc2 = 0.001126-lnZ*(0.0001089+0.0000247*lnZ);
Z2 = Zeff*Zeff;
Z23 = std::exp(2.*lnZ/3.);
scr1 = scr1ini*Z23;
scr2 = scr2ini*Z2*ChargeSquare;
// lastMaterial = couple->GetMaterial();
// correction in theta0 formula
coeffth1 = (1. - 8.7780e-2/Zeff)*(0.87 + 0.03*lnZ);
coeffth2 = (4.0780e-2 + 1.7315e-4*Zeff)*(0.87 + 0.03*lnZ);
// tail parameters
G4double Z13 = std::exp(lnZ/3.);
coeffc1 = 2.3785 - Z13*(4.1981e-1 - Z13*6.3100e-2);
coeffc2 = 4.7526e-1 + Z13*(1.7694 - Z13*3.3885e-1);
coeffc3 = 2.3683e-1 - Z13*(1.8111 - Z13*3.2774e-1);
coeffc4 = 1.7888e-2 + Z13*(1.9659e-2 - Z13*2.6664e-3);
// for single scattering
Z2 = Zeff*Zeff;
Z23 = Z13*Z13;
scr1 = scr1ini*Z23;
scr2 = scr2ini*Z2*ChargeSquare;
Zold = Zeff;
}
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4WaterStopping.hh,v 1.8 2010/04/26 17:22:08 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4WaterStopping.hh,v 1.8 2010-04-26 17:22:08 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
#ifndef G4WaterStopping_h
#define G4WaterStopping_h 1
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4WentzelOKandVIxSection.hh,v 1.6 2010/06/25 09:41:38 gunter Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4WentzelOKandVIxSection.hh,v 1.6 2010-06-25 09:41:38 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -102,6 +102,7 @@ public:
inline void SetTargetMass(G4double value);
//obsolete method
inline void SetRelativisticMass(G4double value);
inline G4double GetMomentumSquare() const;
@@ -150,6 +151,7 @@ private:
G4double mass;
G4double tkin;
G4double mom2;
G4double momCM2;
G4double invbeta2;
G4double kinFactor;
G4double etag;
@@ -163,7 +165,10 @@ private:
G4double formfactA;
G4double factorA2;
G4double factB;
G4double factB1;
G4double factD;
G4double gam0pcmp;
G4double pcmp2;
static G4double ScreenRSquare[100];
static G4double FormFactor[100];
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4WentzelVIModel.hh,v 1.29 2010/05/27 14:22:05 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4WentzelVIModel.hh,v 1.29 2010-05-27 14:22:05 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -65,6 +65,7 @@
class G4ParticleDefinition;
class G4LossTableManager;
class G4NistManager;
class G4Pow;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -112,6 +113,7 @@ private:
G4WentzelVIModel(const G4WentzelVIModel&);
G4LossTableManager* theManager;
G4NistManager* fNistManager;
G4ParticleChangeForMSC* fParticleChange;
G4WentzelOKandVIxSection* wokvi;
G4Pow* fG4pow;
@@ -175,11 +177,9 @@ inline
G4double G4WentzelVIModel::GetLambda(G4double e)
{
G4double x;
if(theLambdaTable) {
x = ((*theLambdaTable)[currentMaterialIndex])->Value(e);
} else {
x = CrossSection(currentCouple,particle,e,
(*currentCuts)[currentMaterialIndex]);
if(theLambdaTable) { x = ((*theLambdaTable)[currentMaterialIndex])->Value(e); }
else { x = CrossSection(currentCouple,particle,e,
(*currentCuts)[currentMaterialIndex]);
}
if(x > DBL_MIN) { x = 1./x; }
else { x = DBL_MAX; }
@@ -0,0 +1,88 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// author: Vladimir Grichine
// 25.05.2011 first implementation
//
// X ray Rayleigh scattering model based on simplified form-factors
// and angular distribution
//
#ifndef G4XrayRayleighModel_h
#define G4XrayRayleighModel_h 1
#include "G4VEmModel.hh"
#include "G4ParticleChangeForGamma.hh"
#include "G4Gamma.hh"
class G4XrayRayleighModel : public G4VEmModel
{
public:
G4XrayRayleighModel(const G4ParticleDefinition* p = 0,
const G4String& nam = "XrayRayleigh");
virtual ~G4XrayRayleighModel();
virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
virtual G4double ComputeCrossSectionPerAtom(
const G4ParticleDefinition*,
G4double kinEnergy,
G4double Z,
G4double A=0,
G4double cut=0,
G4double emax=DBL_MAX);
virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double tmin,
G4double maxEnergy);
protected:
G4ParticleChangeForGamma* fParticleChange;
private:
G4double lowEnergyLimit;
G4double highEnergyLimit;
G4int verboseLevel;
G4bool isInitialised;
static const G4double fCofA;
static const G4double fCofR;
G4XrayRayleighModel & operator=(const G4XrayRayleighModel &right);
G4XrayRayleighModel(const G4XrayRayleighModel&);
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4alphaIonisation.hh,v 1.3 2010/10/26 10:06:12 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4alphaIonisation.hh,v 1.3 2010-10-26 10:06:12 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -0,0 +1,176 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: G4eBremParametrizedModel.hh,v 1.14 2010/10/26 10:35:22 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4eBremParametrizedModel
// extention of standard G4eBremsstrahlungModel
//
// Author: Andreas Schaelicke
//
// Creation date: 28.03.2008
//
// Modifications:
//
//
// Class Description:
//
// Implementation of energy loss for gamma emission by electrons and
// positrons including an improved version of the LPM effect
// -------------------------------------------------------------------
//
#ifndef G4eBremParametrizedModel_h
#define G4eBremParametrizedModel_h 1
#include "G4VEmModel.hh"
#include "G4NistManager.hh"
class G4ParticleChangeForLoss;
class G4PhysicsVector;
class G4eBremParametrizedModel : public G4VEmModel
{
public:
G4eBremParametrizedModel(const G4ParticleDefinition* p = 0,
const G4String& nam = "eBremLPM");
virtual ~G4eBremParametrizedModel();
virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
virtual G4double MinEnergyCut(const G4ParticleDefinition*,
const G4MaterialCutsCouple*);
virtual G4double ComputeDEDXPerVolume(const G4Material*,
const G4ParticleDefinition*,
G4double kineticEnergy,
G4double cutEnergy);
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
G4double tkin,
G4double Z, G4double,
G4double cutEnergy,
G4double maxEnergy = DBL_MAX);
virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double cutEnergy,
G4double maxEnergy);
virtual void SetupForMaterial(const G4ParticleDefinition*,
const G4Material*,G4double);
private:
void InitialiseConstants();
G4double ComputeBremLoss(G4double cutEnergy);
G4double ComputeXSectionPerAtom(G4double cutEnergy);
G4double ComputeDXSectionPerAtom(G4double gammaEnergy);
void SetParticle(const G4ParticleDefinition* p);
// * fast inline functions *
inline void SetCurrentElement(const G4double);
// hide assignment operator
G4eBremParametrizedModel & operator=(const G4eBremParametrizedModel &right);
G4eBremParametrizedModel(const G4eBremParametrizedModel&);
protected:
G4NistManager* nist;
const G4ParticleDefinition* particle;
G4ParticleDefinition* theGamma;
G4ParticleChangeForLoss* fParticleChange;
static const G4double xgi[8], wgi[8];
G4double minThreshold;
// cash
G4double particleMass;
G4double kinEnergy;
G4double totalEnergy;
G4double currentZ;
G4double z13, z23, lnZ;
G4double densityFactor;
G4double densityCorr;
G4double Fel, Finel;
G4double facFel, facFinel;
G4double fMax,fCoulomb;
G4bool isElectron;
private:
// consts
G4double lowKinEnergy;
G4double fMigdalConstant;
G4double bremFactor;
G4bool isInitialised;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline void G4eBremParametrizedModel::SetCurrentElement(const G4double Z)
{
std::cout<<"SetCurrentElement Z="<<Z<<std::endl;
if(Z != currentZ) {
currentZ = Z;
G4int iz = G4int(Z);
z13 = nist->GetZ13(iz);
z23 = z13*z13;
lnZ = nist->GetLOGZ(iz);
Fel = facFel - lnZ/3. ;
Finel = facFinel - 2.*lnZ/3. ;
fCoulomb = GetCurrentElement()->GetfCoulomb();
fMax = Fel-fCoulomb + Finel/currentZ + (1.+1./currentZ)/12.;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4eBremsstrahlung.hh,v 1.37 2009/02/20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4eBremsstrahlung.hh,v 1.37 2009-02-20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -98,7 +98,6 @@ protected:
virtual void InitialiseEnergyLossProcess(const G4ParticleDefinition*,
const G4ParticleDefinition*);
const G4ParticleDefinition* particle;
G4bool isInitialised;
private:
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4eBremsstrahlungModel.hh,v 1.26 2009/02/20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4eBremsstrahlungModel.hh,v 1.26 2009-02-20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -74,9 +74,6 @@ public:
virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
virtual G4double MinEnergyCut(const G4ParticleDefinition*,
const G4MaterialCutsCouple*);
virtual G4double ComputeDEDXPerVolume(const G4Material*,
const G4ParticleDefinition*,
G4double kineticEnergy,
@@ -134,7 +131,6 @@ protected:
G4ParticleDefinition* theGamma;
G4ParticleChangeForLoss* fParticleChange;
G4double minThreshold;
G4bool isElectron;
private:
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4eBremsstrahlungRelModel.hh,v 1.14 2010/10/26 10:35:22 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4eBremsstrahlungRelModel.hh,v 1.14 2010-10-26 10:35:22 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -70,9 +70,6 @@ public:
virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
virtual G4double MinEnergyCut(const G4ParticleDefinition*,
const G4MaterialCutsCouple*);
virtual G4double ComputeDEDXPerVolume(const G4Material*,
const G4ParticleDefinition*,
G4double kineticEnergy,
@@ -96,6 +93,13 @@ public:
inline void SetLPMconstant(G4double val);
inline G4double LPMconstant() const;
protected:
virtual G4double ComputeDXSectionPerAtom(G4double gammaEnergy);
// * fast inline functions *
inline void SetCurrentElement(const G4double);
private:
void InitialiseConstants();
@@ -106,15 +110,10 @@ private:
G4double ComputeXSectionPerAtom(G4double cutEnergy);
G4double ComputeDXSectionPerAtom(G4double gammaEnergy);
G4double ComputeRelDXSectionPerAtom(G4double gammaEnergy);
void SetParticle(const G4ParticleDefinition* p);
// * fast inline functions *
inline void SetCurrentElement(const G4double);
inline G4double Phi1(G4double,G4double);
inline G4double Phi1M2(G4double,G4double);
inline G4double Psi1(G4double,G4double);
@@ -131,22 +130,44 @@ protected:
G4ParticleDefinition* theGamma;
G4ParticleChangeForLoss* fParticleChange;
static const G4double xgi[8], wgi[8];
static const G4double Fel_light[5];
static const G4double Finel_light[5];
G4double minThreshold;
G4double bremFactor;
// cash
G4double particleMass;
G4double kinEnergy;
G4double totalEnergy;
G4double currentZ;
G4double z13, z23, lnZ;
G4double Fel, Finel, fCoulomb, fMax;
//G4double z13, z23, lnZ;
//G4double Fel, Finel, fCoulomb, fMax;
G4double densityFactor;
G4double densityCorr;
G4bool isElectron;
private:
static const G4double xgi[8], wgi[8];
static const G4double Fel_light[5];
static const G4double Finel_light[5];
// consts
G4double lowKinEnergy;
G4double fMigdalConstant;
G4double fLPMconstant;
G4double energyThresholdLPM;
G4double facFel, facFinel;
G4double preS1,logTwo;
// cash
//G4double particleMass;
//G4double kinEnergy;
//G4double totalEnergy;
//G4double currentZ;
G4double z13, z23, lnZ;
G4double Fel, Finel, fCoulomb, fMax;
//G4double densityFactor;
//G4double densityCorr;
// LPM effect
G4double lpmEnergy;
G4PhysicsVector *fXiLPM, *fPhiLPM, *fGLPM;
@@ -155,21 +176,8 @@ protected:
// critical gamma energies
G4double klpm, kp;
G4bool isElectron;
private:
// consts
G4double lowKinEnergy;
G4double fMigdalConstant;
G4double fLPMconstant;
G4double bremFactor;
G4double energyThresholdLPM;
G4double facFel, facFinel;
G4double preS1,logTwo;
// flags
G4bool use_completescreening;
G4bool isInitialised;
};
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4eCoulombScatteringModel.hh,v 1.56 2010/05/27 14:22:05 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4eCoulombScatteringModel.hh,v 1.56 2010-05-27 14:22:05 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -102,9 +102,9 @@ public:
G4double maxEnergy);
// defines low energy limit of the model
inline void SetLowEnergyLimit(G4double val);
inline void SetLowEnergyThreshold(G4double val);
// obsolete method
// user definition of low-energy threshold of recoil
inline void SetRecoilThreshold(G4double eth);
protected:
@@ -130,7 +130,6 @@ protected:
const G4MaterialCutsCouple* currentCouple;
const G4Material* currentMaterial;
const G4Element* currentElement;
G4int currentMaterialIndex;
G4double cosThetaMin;
@@ -145,7 +144,7 @@ protected:
const G4ParticleDefinition* particle;
const G4ParticleDefinition* theProton;
G4double lowEnergyLimit;
G4double lowEnergyThreshold;
private:
@@ -179,9 +178,9 @@ void G4eCoulombScatteringModel::SetupParticle(const G4ParticleDefinition* p)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4eCoulombScatteringModel::SetLowEnergyLimit(G4double val)
inline void G4eCoulombScatteringModel::SetLowEnergyThreshold(G4double val)
{
lowEnergyLimit = val;
lowEnergyThreshold = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4eIonisation.hh,v 1.36 2009/02/20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4eIonisation.hh,v 1.36 2009-02-20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -107,7 +107,6 @@ private:
G4eIonisation(const G4eIonisation&);
const G4ParticleDefinition* theElectron;
const G4ParticleDefinition* particle;
G4bool isElectron;
G4bool isInitialised;
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4eMultipleScattering.hh,v 1.4 2010/10/26 10:39:02 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4eMultipleScattering.hh,v 1.4 2010-10-26 10:39:02 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -----------------------------------------------------------------------------
//
@@ -73,15 +73,6 @@ public: // with description
// Print few lines of informations about the process: validity range,
void PrintInfo();
// geom. step length distribution should be sampled or not
//void Setsamplez(G4bool value) { samplez = value;};
// to reduce the energy/step dependence
//void Setdtrl(G4double value) { dtrl = value;};
// 'soften' step limitation above lambdalimit
//void SetLambdalimit(G4double value) { lambdalimit = value;};
protected:
// This function initialise models
@@ -89,10 +80,6 @@ protected:
private: // data members
// G4double lambdalimit;
//G4double dtrl;
//G4bool samplez;
G4bool isInitialized;
};
@@ -0,0 +1,177 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// G4eSingleCoulombScatteringModel.hh
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
// File name: G4eSingleCoulombScatteringModel
//
// Author: Cristina Consolandi
//
// Creation date: 20.10.2011
//
// Class Description:
// Single Scattering model for electron-nuclei interaction.
// Suitable for high energy electrons and low scattering angles.
//
// 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).
//
//
// -------------------------------------------------------------------
//
#ifndef G4eSingleCoulombScatteringModel_h
#define G4eSingleCoulombScatteringModel_h 1
#include "G4VEmModel.hh"
#include "globals.hh"
#include "G4NistManager.hh"
#include "G4ScreeningMottCrossSection.hh"
#include <vector>
using namespace std;
class G4ParticleChangeForGamma;
class G4ParticleDefinition;
class G4eSingleCoulombScatteringModel : public G4VEmModel
{
public:
G4eSingleCoulombScatteringModel(const G4String& nam = "eSingleCoulombScattering");
virtual ~G4eSingleCoulombScatteringModel();
virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
virtual G4double ComputeCrossSectionPerAtom(
const G4ParticleDefinition*,
G4double kinEnergy,
G4double Z,
G4double A,
G4double cut,
G4double emax);
virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double tmin,
G4double maxEnergy);
inline void SetRecoilThreshold(G4double eth);
protected:
inline void DefineMaterial(const G4MaterialCutsCouple*);
inline void SetupParticle(const G4ParticleDefinition*);
private:
// hide assignment operator
G4eSingleCoulombScatteringModel & operator=(const G4eSingleCoulombScatteringModel &right);
G4eSingleCoulombScatteringModel(const G4eSingleCoulombScatteringModel&);
protected:
G4ParticleTable* theParticleTable;
G4ParticleChangeForGamma* fParticleChange;
G4NistManager* fNistManager;
G4ScreeningMottCrossSection* McFcross;
const std::vector<G4double>* pCuts;
const G4MaterialCutsCouple* currentCouple;
const G4Material* currentMaterial;
const G4Element* currentElement;
G4int currentMaterialIndex;
G4double cosThetaMin;
G4double recoilThreshold;
// projectile
const G4ParticleDefinition* particle;
G4double mass;
G4double lowEnergyLimit;
private:
G4bool isInitialised;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4eSingleCoulombScatteringModel::DefineMaterial(const G4MaterialCutsCouple* cup)
{
if(cup != currentCouple) {
currentCouple = cup;
currentMaterial = cup->GetMaterial();
currentMaterialIndex = currentCouple->GetIndex();
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline
void G4eSingleCoulombScatteringModel::SetupParticle(const G4ParticleDefinition* p)
{
if(p != particle) {
particle = p;
mass = particle->GetPDGMass();
McFcross->SetupParticle(p);
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4eSingleCoulombScatteringModel::SetRecoilThreshold(G4double eth)
{
recoilThreshold = eth;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4eeToTwoGammaModel.hh,v 1.14 2007/05/23 08:47:34 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4eeToTwoGammaModel.hh,v 1.14 2007-05-23 08:47:34 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4eplusAnnihilation.hh,v 1.24 2009/02/20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4eplusAnnihilation.hh,v 1.24 2009-02-20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -63,6 +63,8 @@
#include "G4Positron.hh"
#include "G4VEmModel.hh"
class G4ParticleDefinition;
class G4eplusAnnihilation : public G4VEmProcess
{
@@ -93,6 +95,7 @@ protected:
private:
G4bool isInitialised;
const G4ParticleDefinition* theGamma;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4hIonisation.hh,v 1.44 2010/05/27 10:25:23 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4hIonisation.hh,v 1.44 2010-05-27 10:25:23 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -100,9 +100,6 @@ public:
// Print out of the class parameters
virtual void PrintInfo();
// obsolete method
void ActivateNuclearStopping(G4bool);
protected:
virtual void InitialiseEnergyLossProcess(const G4ParticleDefinition*,
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4hMultipleScattering.hh,v 1.8 2009/11/01 13:04:12 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4hMultipleScattering.hh,v 1.8 2009-11-01 13:04:12 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -----------------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ionIonisation.hh,v 1.58 2010/09/28 15:50:00 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4ionIonisation.hh,v 1.58 2010-09-28 15:50:00 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -11,8 +11,8 @@
#
# Generated on : 24/9/2010
#
# $Id: sources.cmake,v 1.4 2010/11/29 17:35:45 bmorgan Exp $
# GEANT4 Tag $Name: geant4-09-04 $
# $Id: sources.cmake,v 1.4 2010-11-29 17:35:45 bmorgan Exp $
# GEANT4 Tag $Name: not supported by cvs2svn $
#
#------------------------------------------------------------------------------
@@ -56,7 +56,7 @@ GEANT4_DEFINE_MODULE(NAME G4emstandard
G4BraggModel.hh
G4ComptonScattering.hh
G4CoulombScattering.hh
G4CoulombScatteringModel.hh
G4DipBustGenerator.hh
G4GammaConversion.hh
G4GoudsmitSaundersonMscModel.hh
G4GoudsmitSaundersonTable.hh
@@ -81,26 +81,29 @@ GEANT4_DEFINE_MODULE(NAME G4emstandard
G4PSTARStopping.hh
G4PairProductionRelModel.hh
G4PhotoElectricEffect.hh
G4ScreeningMottCrossSection.hh
G4SeltzerBergerModel.hh
G4UniversalFluctuation.hh
G4UniversalFluctuation93.hh
G4UrbanMscModel90.hh
G4UrbanMscModel92.hh
G4UrbanMscModel93.hh
G4UrbanMscModel95.hh
G4WaterStopping.hh
G4WentzelOKandVIxSection.hh
G4WentzelVIModel.hh
G4XrayRayleighModel.hh
G4alphaIonisation.hh
G4eBremsstrahlung.hh
G4eBremParametrizedModel.hh
G4eBremsstrahlungModel.hh
G4eBremsstrahlungRelModel.hh
G4eCoulombScatteringModel.hh
G4eIonisation.hh
G4eMultipleScattering.hh
G4eSingleCoulombScatteringModel.hh
G4eeToTwoGammaModel.hh
G4eplusAnnihilation.hh
G4hIonisation.hh
G4hMultipleScattering.hh
G4ionGasIonisation.hh
G4ionIonisation.hh
SOURCES
G4ASTARStopping.cc
@@ -113,8 +116,8 @@ GEANT4_DEFINE_MODULE(NAME G4emstandard
G4BraggModel.cc
G4ComptonScattering.cc
G4CoulombScattering.cc
G4CoulombScatteringModel.cc
G4GammaConversion.cc
G4DipBustGenerator.cc
G4GoudsmitSaundersonMscModel.cc
G4GoudsmitSaundersonTable.cc
G4HeatedKleinNishinaCompton.cc
@@ -138,26 +141,29 @@ GEANT4_DEFINE_MODULE(NAME G4emstandard
G4PSTARStopping.cc
G4PairProductionRelModel.cc
G4PhotoElectricEffect.cc
G4ScreeningMottCrossSection.cc
G4SeltzerBergerModel.cc
G4UniversalFluctuation.cc
G4UniversalFluctuation93.cc
G4UrbanMscModel90.cc
G4UrbanMscModel92.cc
G4UrbanMscModel93.cc
G4UrbanMscModel95.cc
G4WaterStopping.cc
G4WentzelOKandVIxSection.cc
G4WentzelVIModel.cc
G4XrayRayleighModel.cc
G4alphaIonisation.cc
G4eBremsstrahlung.cc
G4eBremParametrizedModel.cc
G4eBremsstrahlungModel.cc
G4eBremsstrahlungRelModel.cc
G4eCoulombScatteringModel.cc
G4eIonisation.cc
G4eMultipleScattering.cc
G4eSingleCoulombScatteringModel.cc
G4eeToTwoGammaModel.cc
G4eplusAnnihilation.cc
G4hIonisation.cc
G4hMultipleScattering.cc
G4ionGasIonisation.cc
G4ionIonisation.cc
GRANULAR_DEPENDENCIES
G4baryons
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ASTARStopping.cc,v 1.13 2010/04/26 17:22:08 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4ASTARStopping.cc,v 1.13 2010-04-26 17:22:08 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
//---------------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BetheBlochIonGasModel.cc,v 1.1 2010/05/27 10:34:09 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4BetheBlochIonGasModel.cc,v 1.1 2010-05-27 10:34:09 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BetheBlochModel.cc,v 1.41 2010/11/12 18:37:47 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4BetheBlochModel.cc,v 1.41 2010-11-12 18:37:47 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -100,14 +100,6 @@ G4BetheBlochModel::~G4BetheBlochModel()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4BetheBlochModel::MinEnergyCut(const G4ParticleDefinition*,
const G4MaterialCutsCouple* couple)
{
return couple->GetMaterial()->GetIonisation()->GetMeanExcitationEnergy();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4BetheBlochModel::Initialise(const G4ParticleDefinition* p,
const G4DataVector&)
{
@@ -236,7 +228,6 @@ G4double G4BetheBlochModel::CrossSectionPerVolume(
G4double cutEnergy,
G4double maxEnergy)
{
currentMaterial = material;
G4double eDensity = material->GetElectronDensity();
G4double cross = eDensity*ComputeCrossSectionPerElectron
(p,kineticEnergy,cutEnergy,maxEnergy);
@@ -289,6 +280,10 @@ G4double G4BetheBlochModel::ComputeDEDXPerVolume(const G4Material* material,
}
if (dedx < 0.0) { dedx = 0.0; }
//G4cout << "E(MeV)= " << kineticEnergy/MeV << " dedx= " << dedx
// << " " << material->GetName() << G4endl;
return dedx;
}
@@ -305,14 +300,16 @@ void G4BetheBlochModel::CorrectionsAlongStep(const G4MaterialCutsCouple* couple,
const G4Material* mat = couple->GetMaterial();
G4double preKinEnergy = dp->GetKineticEnergy();
G4double e = preKinEnergy - eloss*0.5;
if(e < 0.0) e = preKinEnergy*0.5;
if(e < preKinEnergy*0.75) { e = preKinEnergy*0.75; }
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);
eloss *= qfactor;
eloss += highOrder;
G4double elossnew = eloss*qfactor + highOrder;
if(elossnew > preKinEnergy) { elossnew = preKinEnergy; }
else if(elossnew < eloss*0.5) { elossnew = eloss*0.5; }
eloss = elossnew;
//G4cout << "G4BetheBlochModel::CorrectionsAlongStep: e= " << preKinEnergy
// << " qfactor= " << qfactor
// << " highOrder= " << highOrder << " (" << highOrder/eloss << ")" << G4endl;
@@ -331,7 +328,7 @@ void G4BetheBlochModel::SampleSecondaries(vector<G4DynamicParticle*>* vdp,
G4double tmax = MaxSecondaryEnergy(dp->GetDefinition(),kineticEnergy);
G4double maxKinEnergy = std::min(maxEnergy,tmax);
if(minKinEnergy >= maxKinEnergy) return;
if(minKinEnergy >= maxKinEnergy) { return; }
G4double totEnergy = kineticEnergy + mass;
G4double etot2 = totEnergy*totEnergy;
@@ -340,7 +337,7 @@ void G4BetheBlochModel::SampleSecondaries(vector<G4DynamicParticle*>* vdp,
G4double deltaKinEnergy, f;
G4double f1 = 0.0;
G4double fmax = 1.0;
if( 0.5 == spin ) fmax += 0.5*maxKinEnergy*maxKinEnergy/etot2;
if( 0.5 == spin ) { fmax += 0.5*maxKinEnergy*maxKinEnergy/etot2; }
// sampling without nuclear size effect
do {
@@ -368,9 +365,9 @@ void G4BetheBlochModel::SampleSecondaries(vector<G4DynamicParticle*>* vdp,
G4double x2 = 0.5*electron_mass_c2*deltaKinEnergy/(mass*mass);
g *= (1.0 + magMoment2*(x2 - f1/f)/(1.0 + x2));
}
if(g > 1.0) {
if(g > 1.1) {
G4cout << "### G4BetheBlochModel WARNING: g= " << g
<< dp->GetDefinition()->GetParticleName()
<< " " << dp->GetDefinition()->GetParticleName()
<< " Ekin(MeV)= " << kineticEnergy
<< " delEkin(MeV)= " << deltaKinEnergy
<< G4endl;
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BetheHeitlerModel.cc,v 1.15 2010/10/25 19:02:32 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4BetheHeitlerModel.cc,v 1.15 2010-10-25 19:02:32 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BohrFluctuations.cc,v 1.9 2010/10/25 18:23:36 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4BohrFluctuations.cc,v 1.9 2010-10-25 18:23:36 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BraggIonGasModel.cc,v 1.1 2010/05/27 10:34:09 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4BraggIonGasModel.cc,v 1.1 2010-05-27 10:34:09 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BraggIonModel.cc,v 1.30 2010/11/04 17:30:31 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4BraggIonModel.cc,v 1.30 2010-11-04 17:30:31 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -76,7 +76,9 @@ G4BraggIonModel::G4BraggIonModel(const G4ParticleDefinition* p,
corr(0),
particle(0),
fParticleChange(0),
iMolecula(0),
currentMaterial(0),
iMolecula(-1),
iASTAR(-1),
isIon(false),
isInitialised(false)
{
@@ -100,14 +102,6 @@ G4BraggIonModel::~G4BraggIonModel()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4BraggIonModel::MinEnergyCut(const G4ParticleDefinition*,
const G4MaterialCutsCouple* couple)
{
return couple->GetMaterial()->GetIonisation()->GetMeanExcitationEnergy();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4BraggIonModel::Initialise(const G4ParticleDefinition* p,
const G4DataVector&)
{
@@ -221,8 +215,12 @@ G4double G4BraggIonModel::ComputeDEDXPerVolume(const G4Material* material,
G4double tmin = min(cutEnergy, tmax);
G4double tkin = kineticEnergy/massRate;
G4double dedx = 0.0;
if(tkin > lowestKinEnergy) dedx = DEDX(material, tkin);
else dedx = DEDX(material, lowestKinEnergy)*sqrt(tkin/lowestKinEnergy);
if(tkin < lowestKinEnergy) {
dedx = DEDX(material, lowestKinEnergy)*sqrt(tkin/lowestKinEnergy);
} else {
dedx = DEDX(material, tkin);
}
if (cutEnergy < tmax) {
@@ -262,7 +260,7 @@ void G4BraggIonModel::CorrectionsAlongStep(const G4MaterialCutsCouple* couple,
const G4Material* mat = couple->GetMaterial();
G4double preKinEnergy = dp->GetKineticEnergy();
G4double e = preKinEnergy - eloss*0.5;
if(e < 0.0) e = preKinEnergy*0.5;
if(e < 0.0) { e = preKinEnergy*0.5; }
G4double q2 = corr->EffectiveChargeSquareRatio(p,mat,e);
GetModelOfFluctuations()->SetParticleAndCharge(p, q2);
@@ -283,7 +281,7 @@ void G4BraggIonModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
{
G4double tmax = MaxSecondaryKinEnergy(dp);
G4double xmax = std::min(tmax, maxEnergy);
if(xmin >= xmax) return;
if(xmin >= xmax) { return; }
G4double kineticEnergy = dp->GetKineticEnergy();
G4double energy = kineticEnergy + mass;
@@ -315,7 +313,7 @@ void G4BraggIonModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
G4double totMomentum = energy*sqrt(beta2);
G4double cost = deltaKinEnergy * (energy + electron_mass_c2) /
(deltaMomentum * totMomentum);
if(cost > 1.0) cost = 1.0;
if(cost > 1.0) { cost = 1.0; }
G4double sint = sqrt((1.0 - cost)*(1.0 + cost));
G4double phi = twopi * G4UniformRand() ;
@@ -343,7 +341,7 @@ void G4BraggIonModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
G4double G4BraggIonModel::MaxSecondaryEnergy(const G4ParticleDefinition* pd,
G4double kinEnergy)
{
if(pd != particle) SetParticle(pd);
if(pd != particle) { SetParticle(pd); }
G4double tau = kinEnergy/mass;
G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /
(1. + 2.0*(tau + 1.)*ratio + ratio*ratio);
@@ -354,23 +352,29 @@ G4double G4BraggIonModel::MaxSecondaryEnergy(const G4ParticleDefinition* pd,
G4bool G4BraggIonModel::HasMaterial(const G4Material* material)
{
const size_t numberOfMolecula = 11 ;
SetMoleculaNumber(numberOfMolecula) ;
G4String chFormula = material->GetChemicalFormula() ;
G4String chFormula = material->GetChemicalFormula();
if("" == chFormula) { return false; }
// ICRU Report N49, 1993. Ziegler model for He.
static G4String molName[numberOfMolecula] = {
const size_t numberOfMolecula = 11;
const G4String molName[numberOfMolecula] = {
"CaF_2", "Cellulose_Nitrate", "LiF", "Policarbonate",
"(C_2H_4)_N-Polyethylene", "(C_2H_4)_N-Polymethly_Methacralate",
"Polysterene", "SiO_2", "NaI", "H_2O",
"Graphite" } ;
"Graphite" };
const G4int idxASTAR[numberOfMolecula] = {
17, 19, 33, 51,
52, 54,
56, 62, 43, 71,
13};
// Search for the material in the table
for (size_t i=0; i<numberOfMolecula; i++) {
if (chFormula == molName[i]) {
SetMoleculaNumber(i) ;
return true ;
}
for (size_t i=0; i<numberOfMolecula; ++i) {
if (chFormula == molName[i]) {
iMolecula = -1;
iASTAR = idxASTAR[i];
return true;
}
}
return false ;
}
@@ -382,7 +386,7 @@ G4double G4BraggIonModel::StoppingPower(const G4Material* material,
{
G4double ionloss = 0.0 ;
if (iMolecula < 11) {
if (iMolecula >= 0) {
// The data and the fit from:
// ICRU Report N49, 1993. Ziegler's model for alpha
@@ -589,7 +593,7 @@ G4double G4BraggIonModel::ElectronicStoppingPower(G4double z,
<< G4endl;
*/
}
if ( ionloss < 0.0) ionloss = 0.0 ;
if ( ionloss < 0.0) { ionloss = 0.0; }
// He effective charge
ionloss /= HeEffChargeSquare(z, T);
@@ -603,19 +607,24 @@ G4double G4BraggIonModel::DEDX(const G4Material* material,
G4double kineticEnergy)
{
G4double eloss = 0.0;
// check DB
if(material != currentMaterial) {
currentMaterial = material;
iASTAR = -1;
iMolecula = -1;
if( !HasMaterial(material) ) { iASTAR = astar.GetIndex(material); }
}
const G4int numberOfElements = material->GetNumberOfElements();
const G4double* theAtomicNumDensityVector =
material->GetAtomicNumDensityVector();
// compaund material with parametrisation
G4int iNist = astar.GetIndex(material);
if( iNist >= 0 ) {
if( iASTAR >= 0 ) {
G4double T = kineticEnergy*rateMassHe2p;
return astar.GetElectronicDEDX(iNist, T)*material->GetDensity()/
HeEffChargeSquare(astar.GetEffectiveZ(iNist), T/MeV);
return astar.GetElectronicDEDX(iASTAR, T)*material->GetDensity()/
HeEffChargeSquare(astar.GetEffectiveZ(iASTAR), T/MeV);
} else if( HasMaterial(material) ) {
} else if(iMolecula >= 0) {
eloss = StoppingPower(material, kineticEnergy)*
material->GetDensity()/amu;
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BraggModel.cc,v 1.29 2010/11/05 19:27:26 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4BraggModel.cc,v 1.29 2010-11-05 19:27:26 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -78,11 +78,14 @@ using namespace std;
G4BraggModel::G4BraggModel(const G4ParticleDefinition* p, const G4String& nam)
: G4VEmModel(nam),
particle(0),
currentMaterial(0),
protonMassAMU(1.007276),
iMolecula(0),
iMolecula(-1),
iPSTAR(-1),
isIon(false),
isInitialised(false)
{
fParticleChange = 0;
SetHighEnergyLimit(2.0*MeV);
lowestKinEnergy = 1.0*keV;
@@ -102,15 +105,6 @@ G4BraggModel::~G4BraggModel()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4BraggModel::MinEnergyCut(const G4ParticleDefinition*,
const G4MaterialCutsCouple*)
{
return 0.1*keV;
// return couple->GetMaterial()->GetIonisation()->GetMeanExcitationEnergy();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4BraggModel::Initialise(const G4ParticleDefinition* p,
const G4DataVector&)
{
@@ -217,8 +211,12 @@ G4double G4BraggModel::ComputeDEDXPerVolume(const G4Material* material,
G4double tmax = MaxSecondaryEnergy(p, kineticEnergy);
G4double tkin = kineticEnergy/massRate;
G4double dedx = 0.0;
if(tkin > lowestKinEnergy) { dedx = DEDX(material, tkin); }
else { dedx = DEDX(material, lowestKinEnergy)*sqrt(tkin/lowestKinEnergy); }
if(tkin < lowestKinEnergy) {
dedx = DEDX(material, lowestKinEnergy)*sqrt(tkin/lowestKinEnergy);
} else {
dedx = DEDX(material, tkin);
}
if (cutEnergy < tmax) {
@@ -234,10 +232,13 @@ G4double G4BraggModel::ComputeDEDXPerVolume(const G4Material* material,
// now compute the total ionization loss
if (dedx < 0.0) dedx = 0.0 ;
if (dedx < 0.0) { dedx = 0.0; }
dedx *= chargeSquare;
//G4cout << "E(MeV)= " << tkin/MeV << " dedx= " << dedx
// << " " << material->GetName() << G4endl;
return dedx;
}
@@ -322,16 +323,21 @@ G4double G4BraggModel::MaxSecondaryEnergy(const G4ParticleDefinition* pd,
G4bool G4BraggModel::HasMaterial(const G4Material* material)
{
const size_t numberOfMolecula = 11 ;
SetMoleculaNumber(numberOfMolecula) ;
G4String chFormula = material->GetChemicalFormula() ;
G4String chFormula = material->GetChemicalFormula();
if("" == chFormula) { return false; }
// ICRU Report N49, 1993. Power's model for He.
static G4String molName[numberOfMolecula] = {
const size_t numberOfMolecula = 11;
const G4String molName[numberOfMolecula] = {
"Al_2O_3", "CO_2", "CH_4",
"(C_2H_4)_N-Polyethylene", "(C_2H_4)_N-Polypropylene", "(C_8H_8)_N",
"C_3H_8", "SiO_2", "H_2O",
"H_2O-Gas", "Graphite" } ;
const G4int idxPSTAR[numberOfMolecula] = {
6, 16, 36,
52, 55, 56,
59, 62, 71,
72, 13};
// Special treatment for water in gas state
const G4State theState = material->GetState() ;
@@ -341,13 +347,14 @@ G4bool G4BraggModel::HasMaterial(const G4Material* material)
}
// Search for the material in the table
for (size_t i=0; i<numberOfMolecula; i++) {
if (chFormula == molName[i]) {
SetMoleculaNumber(i) ;
return true ;
}
for (size_t i=0; i<numberOfMolecula; ++i) {
if (chFormula == molName[i]) {
iMolecula = -1;
iPSTAR = idxPSTAR[i];
return true;
}
}
return false ;
return false;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -357,7 +364,7 @@ G4double G4BraggModel::StoppingPower(const G4Material* material,
{
G4double ionloss = 0.0 ;
if (iMolecula < 11) {
if (iMolecula >= 0) {
// The data and the fit from:
// ICRU Report N49, 1993. Ziegler's model for protons.
@@ -565,17 +572,27 @@ G4double G4BraggModel::ElectronicStoppingPower(G4double z,
G4double G4BraggModel::DEDX(const G4Material* material, G4double kineticEnergy)
{
G4double eloss = 0.0;
// check DB
if(material != currentMaterial) {
currentMaterial = material;
iPSTAR = -1;
iMolecula = -1;
if( !HasMaterial(material) ) { iPSTAR = pstar.GetIndex(material); }
//G4cout << "%%% " <<material->GetName() << " iMolecula= "
// << iMolecula << " iPSTAR= " << iPSTAR << G4endl;
}
const G4int numberOfElements = material->GetNumberOfElements();
const G4double* theAtomicNumDensityVector =
material->GetAtomicNumDensityVector();
// compaund material with parametrisation
G4int iNist = pstar.GetIndex(material);
if( iPSTAR >= 0 ) {
return pstar.GetElectronicDEDX(iPSTAR, kineticEnergy)*material->GetDensity();
if( iNist >= 0 && kineticEnergy <= 2.01*MeV) {
return pstar.GetElectronicDEDX(iNist, kineticEnergy)*material->GetDensity();
} else if( HasMaterial(material) ) {
} else if(iMolecula >= 0) {
eloss = StoppingPower(material, kineticEnergy)*
material->GetDensity()/amu;
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ComptonScattering.cc,v 1.31 2009/02/20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4ComptonScattering.cc,v 1.31 2009-02-20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
//
//------------ G4ComptonScattering physics process -----------------------------
@@ -62,6 +62,7 @@
// -----------------------------------------------------------------------------
#include "G4ComptonScattering.hh"
#include "G4KleinNishinaModel.hh"
#include "G4KleinNishinaCompton.hh"
#include "G4Electron.hh"
@@ -73,6 +74,9 @@ G4ComptonScattering::G4ComptonScattering(const G4String& processName,
G4ProcessType type):G4VEmProcess (processName, type),
isInitialised(false)
{
SetStartFromNullFlag(false);
SetBuildTableFlag(true);
SetSecondaryParticle(G4Electron::Electron());
SetProcessSubType(fComptonScattering);
}
@@ -94,12 +98,11 @@ void G4ComptonScattering::InitialiseProcess(const G4ParticleDefinition*)
{
if(!isInitialised) {
isInitialised = true;
SetBuildTableFlag(true);
SetSecondaryParticle(G4Electron::Electron());
if(!Model()) SetModel(new G4KleinNishinaCompton);
Model()->SetLowEnergyLimit(MinKinEnergy());
Model()->SetHighEnergyLimit(MaxKinEnergy());
AddEmModel(1, Model());
// if(!Model(1)) { SetModel(new G4KleinNishinaModel(), 1); }
if(!Model(1)) { SetModel(new G4KleinNishinaCompton(), 1); }
Model(1)->SetLowEnergyLimit(MinKinEnergy());
Model(1)->SetHighEnergyLimit(MaxKinEnergy());
AddEmModel(1, Model(1));
}
}
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4CoulombScattering.cc,v 1.28 2010/05/25 18:41:12 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4CoulombScattering.cc,v 1.28 2010-05-25 18:41:12 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -49,10 +49,7 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "G4CoulombScattering.hh"
#include "G4CoulombScatteringModel.hh"
#include "G4eCoulombScatteringModel.hh"
//#include "G4hCoulombScatteringModel.hh"
#include "G4Electron.hh"
#include "G4Proton.hh"
#include "G4LossTableManager.hh"
@@ -61,20 +58,13 @@
using namespace std;
G4CoulombScattering::G4CoulombScattering(const G4String& name)
: G4VEmProcess(name),thetaMin(0.0),thetaMax(pi),q2Max(TeV*TeV),
isInitialised(false)
: G4VEmProcess(name),q2Max(TeV*TeV),isInitialised(false)
{
// G4cout << "G4CoulombScattering constructor "<< G4endl;
SetBuildTableFlag(true);
SetStartFromNullFlag(false);
SetIntegral(true);
thEnergy = PeV;
thEnergyElec = PeV;
if(name == "CoulombScat") {
thEnergy = 10.*MeV;
thEnergyElec = 10.*GeV;
}
SetSecondaryParticle(G4Electron::Electron());
SetSecondaryParticle(G4Proton::Proton());
SetProcessSubType(fCoulombScattering);
}
@@ -96,8 +86,8 @@ void G4CoulombScattering::InitialiseProcess(const G4ParticleDefinition* p)
{
//G4cout << "### G4CoulombScattering::InitialiseProcess : "
// << p->GetParticleName() << G4endl;
G4double a =
G4LossTableManager::Instance()->FactorForAngleLimit()*CLHEP::hbarc/CLHEP::fermi;
G4double a = G4LossTableManager::Instance()->FactorForAngleLimit()
*CLHEP::hbarc/CLHEP::fermi;
q2Max = 0.5*a*a;
// second initialisation
@@ -110,7 +100,6 @@ void G4CoulombScattering::InitialiseProcess(const G4ParticleDefinition* p)
// first initialisation
} else {
isInitialised = true;
aParticle = p;
G4double mass = p->GetPDGMass();
G4String name = p->GetParticleName();
//G4cout << name << " type: " << p->GetParticleType()
@@ -126,31 +115,11 @@ void G4CoulombScattering::InitialiseProcess(const G4ParticleDefinition* p)
G4double emin = MinKinEnergy();
G4double emax = MaxKinEnergy();
// G4gCoulombScatteringModel* model = new G4hCoulombScatteringModel();
G4eCoulombScatteringModel* model = new G4eCoulombScatteringModel();
model->SetPolarAngleLimit(PolarAngleLimit());
model->SetLowEnergyLimit(emin);
model->SetHighEnergyLimit(emax);
AddEmModel(1, model);
/*
G4double eth = thEnergy;
if(mass < MeV) eth = thEnergyElec;
if(eth > emin) {
G4eCoulombScatteringModel* model = new G4eCoulombScatteringModel();
model->SetPolarAngleLimit(PolarAngleLimit());
model->SetLowEnergyLimit(emin);
model->SetHighEnergyLimit(std::min(eth,emax));
AddEmModel(1, model);
}
if(eth < emax) {
G4CoulombScatteringModel* model = new G4CoulombScatteringModel();
model->SetPolarAngleLimit(PolarAngleLimit());
model->SetLowEnergyLimit(eth);
model->SetHighEnergyLimit(emax);
AddEmModel(2, model);
}
*/
}
}
@@ -159,11 +128,7 @@ void G4CoulombScattering::InitialiseProcess(const G4ParticleDefinition* p)
void G4CoulombScattering::PrintInfo()
{
G4cout << " " << PolarAngleLimit()/degree
<< " < Theta(degree) < 180"
<< ", Eth(MeV)= ";
if(aParticle->GetPDGMass() < MeV) G4cout << thEnergyElec;
else G4cout << thEnergy;
<< " < Theta(degree) < 180";
if(q2Max < DBL_MAX) { G4cout << "; pLimit(GeV^1)= " << sqrt(q2Max)/GeV; }
G4cout << G4endl;
@@ -1,217 +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. *
// ********************************************************************
//
// $Id: G4CoulombScatteringModel.cc,v 1.49 2010/05/27 14:22:05 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class file
//
//
// File name: G4CoulombScatteringModel
//
// Author: Vladimir Ivanchenko
//
// Creation date: 22.08.2005
//
// Modifications:
//
// 01.08.06 V.Ivanchenko extend upper limit of table to TeV and review the
// logic of building - only elements from G4ElementTable
// 08.08.06 V.Ivanchenko build internal table in ekin scale, introduce faclim
// 19.10.06 V.Ivanchenko use inheritance from G4eCoulombScatteringModel
// 09.10.07 V.Ivanchenko reorganized methods, add cut dependence in scattering off e-
// 09.06.08 V.Ivanchenko SelectIsotope is moved to the base class
// 16.06.09 Consolandi rows 109, 111-112, 183, 185-186
// 27.05.10 V.Ivanchenko added G4WentzelOKandVIxSection class to
// compute cross sections and sample scattering angle
//
//
// Class Description:
//
// -------------------------------------------------------------------
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "G4CoulombScatteringModel.hh"
#include "Randomize.hh"
#include "G4ParticleChangeForGamma.hh"
#include "G4ParticleTable.hh"
#include "G4IonTable.hh"
#include "G4Proton.hh"
#include "G4NucleiProperties.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
using namespace std;
G4CoulombScatteringModel::G4CoulombScatteringModel(const G4String& nam)
: G4eCoulombScatteringModel(nam)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4CoulombScatteringModel::~G4CoulombScatteringModel()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4CoulombScatteringModel::ComputeCrossSectionPerAtom(
const G4ParticleDefinition* p,
G4double kinEnergy,
G4double Z,
G4double,
G4double cutEnergy,
G4double)
{
//G4cout << "### G4CoulombScatteringModel::ComputeCrossSectionPerAtom for "
// << p->GetParticleName()<<" Z= "<<Z<<" e(MeV)= "<< kinEnergy/MeV
// <<" cut(MeV)= " << cutEnergy<< G4endl;
G4double xsec = 0.0;
if(p != particle) { SetupParticle(p); }
if(kinEnergy < lowEnergyLimit) { return 0.0; }
DefineMaterial(CurrentCouple());
// Lab system
G4int iz = G4int(Z);
G4double etot = kinEnergy + mass;
G4double m2 = fNistManager->GetAtomicMassAmu(iz)*amu_c2;
// 03.09.2009 C.Consaldi suggested to use relativistic reduced mass
// from publucation
// A.P. Martynenko, R.N. Faustov, Teoret. mat. Fiz. 64 (1985) 179
G4double Ecm = sqrt(mass*mass + m2*m2 + 2.0*etot*m2);
G4double mu_rel = mass*m2/Ecm;
G4double tkin = Ecm - mu_rel;
wokvi->SetRelativisticMass(mu_rel);
cosTetMinNuc = wokvi->SetupKinematic(tkin, currentMaterial);
if(cosThetaMax < cosTetMinNuc) {
cosTetMinNuc = wokvi->SetupTarget(iz, cutEnergy);
cosTetMaxNuc = cosThetaMax;
if(iz == 1 && cosTetMaxNuc < 0.0 && particle == theProton) {
cosTetMaxNuc = 0.0;
}
xsec = wokvi->ComputeNuclearCrossSection(cosTetMinNuc, cosTetMaxNuc);
elecRatio = wokvi->ComputeElectronCrossSection(cosTetMinNuc, cosThetaMax);
xsec += elecRatio;
if(xsec > 0.0) { elecRatio /= xsec; }
}
/*
G4cout << "e(MeV)= " << kinEnergy/MeV << " xsec(b)= " << xsec/barn
<< "cosTetMinNuc= " << cosTetMinNuc
<< " cosTetMaxNuc= " << cosTetMaxNuc
<< " cosTetMaxElec= " << cosTetMaxElec
<< " screenZ= " << screenZ
<< " formfactA= " << formfactA << G4endl;
*/
return xsec;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4CoulombScatteringModel::SampleSecondaries(
std::vector<G4DynamicParticle*>* fvect,
const G4MaterialCutsCouple* couple,
const G4DynamicParticle* dp,
G4double cutEnergy,
G4double)
{
G4double kinEnergy = dp->GetKineticEnergy();
if(kinEnergy < lowEnergyLimit) { return; }
DefineMaterial(couple);
SetupParticle(dp->GetDefinition());
// Choose nucleus
currentElement = SelectRandomAtom(couple,particle,
kinEnergy,cutEnergy,kinEnergy);
G4double Z = currentElement->GetZ();
G4int iz = G4int(Z);
G4int ia = SelectIsotopeNumber(currentElement);
G4double targetMass = G4NucleiProperties::GetNuclearMass(ia, iz);
if(ComputeCrossSectionPerAtom(particle,kinEnergy, Z,
kinEnergy, cutEnergy, kinEnergy) == 0.0)
{ return; }
G4ThreeVector newDirection =
wokvi->SampleSingleScattering(cosTetMinNuc, cosTetMaxNuc, elecRatio);
// kinematics in the Lab system
G4double etot = mass + kinEnergy;
G4double ptot = sqrt(kinEnergy*(etot + mass));
G4double bet = ptot/(etot + targetMass);
G4double gam = 1.0/sqrt((1.0 - bet)*(1.0 + bet));
G4double eCM = sqrt(mass*mass + targetMass*targetMass + 2*targetMass*etot);
G4double pCM = ptot*targetMass/eCM;
G4double e1 = sqrt(mass*mass + pCM*pCM);
newDirection *= pCM;
G4ThreeVector v1(newDirection.x(),newDirection.y(),gam*(newDirection.z() + bet*e1));
G4double finalT = gam*(e1 + bet*newDirection.z()) - mass;
newDirection = v1.unit();
G4ThreeVector dir = dp->GetMomentumDirection();
newDirection.rotateUz(dir);
fParticleChange->ProposeMomentumDirection(newDirection);
// recoil
G4double trec = kinEnergy - finalT;
if(finalT <= lowEnergyLimit) {
trec = kinEnergy;
finalT = 0.0;
}
fParticleChange->SetProposedKineticEnergy(finalT);
// G4cout << "sint= " << sint << " Erec(eV)= " << erec/eV << G4endl;
G4double tcut = recoilThreshold;
if(pCuts) { tcut= std::max(tcut,(*pCuts)[currentMaterialIndex]); }
/*
G4cout << "sint= " << sint << " Erec(eV)= " << erec/eV
<< " tcut(eV)= " << tcut/eV << " th(eV)= " << recoilThreshold/eV
<< " cut(eV)= " << (*pCuts)[currentMaterialIndex]/eV
<< " " << fvect->size()
<< G4endl;
*/
if(trec > tcut) {
G4ParticleDefinition* ion = theParticleTable->FindIon(iz, ia, 0, iz);
G4double plab = sqrt(finalT*(finalT + 2.0*mass));
G4ThreeVector p2 = (ptot*dir - plab*newDirection).unit();
G4DynamicParticle* newdp = new G4DynamicParticle(ion, p2, trec);
fvect->push_back(newdp);
} else if(trec > 0.0) {
fParticleChange->ProposeLocalEnergyDeposit(trec);
fParticleChange->ProposeNonIonizingEnergyDeposit(trec);
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,71 +23,87 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ionGasIonisation.cc,v 1.15 2009/11/10 11:50:30 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4DipBustGenerator.cc,v 1.1 2010-10-14 15:17:48 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
// GEANT4 Class file
//
//
// File name: G4ionGasIonisation
// File name: G4DipBustGenerator
//
// Author: Vladimir Ivanchenko
// Author: Vladimir Grichine
//
// Creation date: 17 May 2011
//
// Creation date: 23.07.2007
// Modifications:
//
//
// Modifications:
// Class Description:
//
// Bremsstrahlung Angular Distribution Generation
// suggested the dipole approximation in the rest frame of electron
// busted in the laboratory frame.
//
// Class Description: End
//
// -------------------------------------------------------------------
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "G4ionGasIonisation.hh"
#include "G4Electron.hh"
#include "G4Proton.hh"
#include "G4GenericIon.hh"
#include "G4DipBustGenerator.hh"
#include "Randomize.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4DipBustGenerator::G4DipBustGenerator(const G4String&)
: G4VBremAngularDistribution("AngularGenUrban")
{}
using namespace std;
G4ionGasIonisation::G4ionGasIonisation(const G4String& name)
: G4ionIonisation(name)
{
G4cout << G4endl;
G4cout << "!!! G4ionGasIonisation class is obsolete and may be removed for the next major Geant4 release !!!" << G4endl;
G4cout << "!!! Please use G4ionIonisation for ions !!!" << G4endl;
G4cout << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4ionGasIonisation::~G4ionGasIonisation()
G4DipBustGenerator::~G4DipBustGenerator()
{}
/*
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4ionGasIonisation::SampleChargeAfterStep(G4double qeff, G4double xeff)
G4double G4DipBustGenerator::PolarAngle(const G4double eTkin,
const G4double, // final_energy
const G4int ) // Z
{
// qeff - equilibrium charge
// xeff - effective number of collisions
// q - current charge
G4double q = G4double(currentIonZ);
if(qeff > q) {
if(G4UniformRand() < qeff - q) currentIonZ++;
} else {
if(G4UniformRand() < q - qeff) currentIonZ--;
}
G4double c, cosTheta, delta, cofA, signc = 1., a, power = 1./3.;
G4double gamma, beta, theta;
q = eplus*currentIonZ;
if(verboseLevel > 1) G4cout << "G4ionGasIonisation: Q1= " << currentIonZ
<< " Qeff= " << qeff/eplus << " Neff= " << xeff
<< G4endl;
return q;
c = 4. - 8.*G4UniformRand();
a = c;
if( c < 0. )
{
signc = -1.;
a = -c;
}
delta = std::sqrt(a*a+4.);
delta += a;
delta *= 0.5;
cofA = -signc*std::pow(delta, power);
cosTheta = cofA - 1./cofA;
gamma = 1. + eTkin/electron_mass_c2;
beta = std::sqrt(1. - 1./gamma/gamma);
cosTheta = (cosTheta + beta)/(1 + cosTheta*beta);
theta = std::acos(cosTheta);
if( theta < 0. ) theta = 0.;
if( theta > pi ) theta = pi;
// G4cout <<"theta = "<<theta<<"; ";
return theta;
}
*/
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4DipBustGenerator::PrintGeneratorInformation() const
{
G4cout << "\n" << G4endl;
G4cout << "Bremsstrahlung Angular Generator is Modified Tsai" << G4endl;
G4cout << "Distribution suggested by L.Urban (Geant3 manual (1993) Phys211)"
<< G4endl;
G4cout << "Derived from Tsai distribution (Rev Mod Phys 49,421(1977)) \n"
<< G4endl;
}
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4GammaConversion.cc,v 1.31 2009/02/20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4GammaConversion.cc,v 1.31 2009-02-20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
//
//------------------ G4GammaConversion physics process -------------------------
@@ -104,7 +104,7 @@ void G4GammaConversion::InitialiseProcess(const G4ParticleDefinition*)
SetSecondaryParticle(G4Electron::Electron());
G4double emin = std::max(MinKinEnergy(), 2.0*electron_mass_c2);
SetMinKinEnergy(emin);
if(!Model()) SetModel(new G4BetheHeitlerModel());
if(!Model()) { SetModel(new G4BetheHeitlerModel()); }
Model()->SetLowEnergyLimit(emin);
Model()->SetHighEnergyLimit(MaxKinEnergy());
AddEmModel(1, Model());
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4GoudsmitSaundersonMscModel.cc,v 1.25 2010/06/25 09:41:40 gunter Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4GoudsmitSaundersonMscModel.cc,v 1.27 2010-12-23 18:31:17 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -95,6 +95,11 @@ G4double G4GoudsmitSaundersonMscModel::FTCSP[103][106] ;
G4GoudsmitSaundersonMscModel::G4GoudsmitSaundersonMscModel(const G4String& nam)
: G4VMscModel(nam),lowKEnergy(0.1*keV),highKEnergy(100.*TeV),isInitialized(false)
{
currentKinEnergy=currentRange=skindepth=par1=par2=par3=zPathLength=truePathLength
=tausmall=taulim=tlimit=charge=lambdalimit=tPathLength=lambda0=lambda1
=lambda11=mass=0.0;
currentMaterialIndex = -1;
fr=0.02,rangeinit=0.,masslimite=0.6*MeV,
particle=0;tausmall=1.e-16;taulim=1.e-6;tlimit=1.e10*mm;
tlimitmin=10.e-6*mm;geombig=1.e50*mm;geommin=1.e-3*mm,tgeom=geombig;
@@ -121,9 +126,9 @@ void G4GoudsmitSaundersonMscModel::Initialise(const G4ParticleDefinition* p,
{
skindepth=skin*stepmin;
SetParticle(p);
if(isInitialized) return;
if(isInitialized) { return; }
fParticleChange = GetParticleChangeForMSC();
InitialiseSafetyHelper();
isInitialized=true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -132,12 +137,11 @@ G4double
G4GoudsmitSaundersonMscModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition* p,
G4double kineticEnergy,G4double Z, G4double, G4double, G4double)
{
G4double cs=0.0;
G4double kinEnergy = kineticEnergy;
if(kinEnergy<lowKEnergy) kinEnergy=lowKEnergy;
if(kinEnergy>highKEnergy)kinEnergy=highKEnergy;
G4double cs0;
G4double cs(0.0), cs0(0.0);
CalculateIntegrals(p,Z,kinEnergy,cs0,cs);
return cs;
@@ -150,30 +154,33 @@ G4GoudsmitSaundersonMscModel::SampleScattering(const G4DynamicParticle* dynParti
{
G4double kineticEnergy = dynParticle->GetKineticEnergy();
if((kineticEnergy <= 0.0) || (tPathLength <= tlimitminfix)||
(tPathLength/tausmall < lambda1)) return ;
(tPathLength/tausmall < lambda1)) { return; }
///////////////////////////////////////////
// Effective energy
G4double eloss = theManager->GetEnergy(particle,tPathLength,currentCouple);
if(eloss>0.5*kineticEnergy)
{if((dynParticle->GetCharge())==-eplus)eloss=kineticEnergy-eloss;//exchange between target and projectile if they are electrons
else eloss=0.5*kineticEnergy;
}
G4double ee = kineticEnergy - 0.5*eloss;
G4double ttau = ee/electron_mass_c2;
G4double ttau2 = ttau*ttau;
G4double epsilonpp= eloss/ee;
G4double cst1=epsilonpp*epsilonpp*(6+10*ttau+5*ttau2)/(24*ttau2+48*ttau+72);
kineticEnergy *= (1 - cst1);
// Effective energy
G4double eloss = kineticEnergy;
G4double rrr = currentRange-tPathLength;
if(rrr > 0.0) {
G4double T1 = GetEnergy(particle,currentRange-tPathLength,currentCouple);
if(T1 < kineticEnergy) { eloss = kineticEnergy - T1; }
else { eloss = 0.0; }
}
if(eloss > 0.0) {
G4double ee = kineticEnergy - 0.5*eloss;
G4double ttau = ee/electron_mass_c2;
G4double ttau2 = ttau*ttau;
G4double epsilonpp= eloss/ee;
G4double cst1=epsilonpp*epsilonpp*(6+10*ttau+5*ttau2)/(24*ttau2+48*ttau+72);
kineticEnergy *= (1 - cst1);
}
///////////////////////////////////////////
// additivity rule for mixture and compound xsection's
const G4Material* mat = currentCouple->GetMaterial();
const G4ElementVector* theElementVector = mat->GetElementVector();
const G4double* theAtomNumDensityVector = mat->GetVecNbOfAtomsPerVolume();
G4int nelm = mat->GetNumberOfElements();
G4double s0,s1;
lambda0=0.;
G4double s0(0.0), s1(0.0);
lambda0 = 0.0;
for(G4int i=0;i<nelm;i++)
{
CalculateIntegrals(particle,(*theElementVector)[i]->GetZ(),kineticEnergy,s0,s1);
@@ -181,46 +188,48 @@ G4GoudsmitSaundersonMscModel::SampleScattering(const G4DynamicParticle* dynParti
}
if(lambda0>DBL_MIN) lambda0 =1./lambda0;
// Newton-Raphson root's finding method of scrA from:
// Sig1(PWA)/Sig0(PWA)=g1=2*scrA*((1+scrA)*log(1+1/scrA)-1)
// Newton-Raphson root's finding method of scrA from:
// Sig1(PWA)/Sig0(PWA)=g1=2*scrA*((1+scrA)*log(1+1/scrA)-1)
G4double g1=0.0;
if(lambda1>DBL_MIN) g1 = lambda0/lambda1;
if(lambda1>DBL_MIN) { g1 = lambda0/lambda1; }
G4double logx0,x1,delta;
G4double x0=g1/2.;
do
G4double x0=g1*0.5;
// V.Ivanchenko added limit of the loop
for(G4int i=0;i<1000;++i)
{
logx0=std::log(1.+1./x0);
x1 = x0-(x0*((1.+x0)*logx0-1.0)-g1/2.)/( (1.+2.*x0)*logx0-2.0);
delta = std::abs( x1 - x0 );
x1 = x0-(x0*((1.+x0)*logx0-1.0)-g1*0.5)/( (1.+2.*x0)*logx0-2.0);
delta = std::fabs( x1 - x0 );
x0 = x1;
} while (delta > 1.0e-12);
if(delta < 1.0e-3*x1) { break;}
}
G4double scrA = x1;
G4double lambdan=0.;
if(lambda0>0.)lambdan=tPathLength/lambda0;
if(lambda0>0.) { lambdan=tPathLength/lambda0; }
if(lambdan<=1.0e-12)return;
G4double lambdan12=0.5*lambdan;
Qn1 = lambdan *g1;//2.* lambdan *scrA*((1.+scrA)*log(1.+1./scrA)-1.);
Qn12 = 0.5*Qn1;
G4double Qn1 = lambdan *g1;//2.* lambdan *scrA*((1.+scrA)*log(1.+1./scrA)-1.);
G4double Qn12 = 0.5*Qn1;
G4double cosTheta1,sinTheta1,cosTheta2,sinTheta2;
G4double cosPhi1=1.0,sinPhi1=0.0,cosPhi2=1.0,sinPhi2=0.0;
G4double us=0.0,vs=0.0,ws=1.0,wss=0.,x_coord=0.0,y_coord=0.0,z_coord=1.0;
G4double epsilon1=G4UniformRand();
G4double expn = std::exp(-lambdan);
if(epsilon1<expn)// no scattering
{return;}
else if((epsilon1<((1.+lambdan)*expn))||(lambdan<1.))//single scattering (Rutherford DCS's)
else if((epsilon1<((1.+lambdan)*expn))||(lambdan<1.))//single or plural scattering (Rutherford DCS's)
{
G4double xi=G4UniformRand();
xi= 2.*scrA*xi/(1.-xi + scrA);
xi= 2.*scrA*xi/(1.-xi + scrA);
if(xi<0.)xi=0.;
else if(xi>2.)xi=2.;
ws=1.-xi;
else if(xi>2.)xi=2.;
ws=(1. - xi);
wss=std::sqrt(xi*(2.-xi));
G4double phi0=CLHEP::twopi*G4UniformRand();
us=wss*cos(phi0);
@@ -230,13 +239,13 @@ G4GoudsmitSaundersonMscModel::SampleScattering(const G4DynamicParticle* dynParti
{
// Ref.2 subsection 4.4 "The best solution found"
// Sample first substep scattering angle
SampleCosineTheta(lambdan12,scrA,cosTheta1,sinTheta1);
SampleCosineTheta(0.5*lambdan,scrA,cosTheta1,sinTheta1);
G4double phi1 = CLHEP::twopi*G4UniformRand();
cosPhi1 = cos(phi1);
sinPhi1 = sin(phi1);
// Sample second substep scattering angle
SampleCosineTheta(lambdan12,scrA,cosTheta2,sinTheta2);
SampleCosineTheta(0.5*lambdan,scrA,cosTheta2,sinTheta2);
G4double phi2 = CLHEP::twopi*G4UniformRand();
cosPhi2 = cos(phi2);
sinPhi2 = sin(phi2);
@@ -248,17 +257,17 @@ G4GoudsmitSaundersonMscModel::SampleScattering(const G4DynamicParticle* dynParti
G4double sqrtA=sqrt(scrA);
if(acos(ws)<sqrtA)//small angle approximation for theta less than screening angle
{
G4int i=0;
do{i++;
ws=1.+Qn12*log(G4UniformRand());
}while((fabs(ws)>1.)&&(i<20));//i<20 to avoid time consuming during the run
if(i>=19)ws=cos(sqrtA);
wss=std::sqrt((1.-ws)*(1.0+ws));
us=wss*cos(phi1);
vs=wss*sin(phi1);
}
G4int i=0;
do{i++;
ws=1.+Qn12*log(G4UniformRand());
}while((fabs(ws)>1.)&&(i<20));//i<20 to avoid time consuming during the run
if(i>=19)ws=cos(sqrtA);
wss=std::sqrt((1.-ws*ws));
us=wss*std::cos(phi1);
vs=wss*std::sin(phi1);
}
}
G4ThreeVector oldDirection = dynParticle->GetMomentumDirection();
G4ThreeVector newDirection(us,vs,ws);
@@ -270,10 +279,10 @@ G4GoudsmitSaundersonMscModel::SampleScattering(const G4DynamicParticle* dynParti
if(Qn1<0.02)// corresponding to error less than 1% in the exact formula of <z>
z_coord = 1.0 - Qn1*(0.5 - Qn1/6.);
else z_coord = (1.-std::exp(-Qn1))/Qn1;
G4double rr=std::sqrt((1.- z_coord*z_coord)/(1.-ws*ws));
x_coord = rr*us;
y_coord = rr*vs;
// displacement is computed relatively to the end point
z_coord -= 1.0;
rr = std::sqrt(x_coord*x_coord+y_coord*y_coord+z_coord*z_coord);
@@ -285,7 +294,7 @@ G4GoudsmitSaundersonMscModel::SampleScattering(const G4DynamicParticle* dynParti
<< " geomStep(mm)= " << zPathLength
<< G4endl;
*/
if(tPathLength<=zPathLength)return;
if(r > tlimitminfix) {
G4ThreeVector Direction(x_coord/rr,y_coord/rr,z_coord/rr);
@@ -302,18 +311,18 @@ void
G4GoudsmitSaundersonMscModel::SampleCosineTheta(G4double lambdan, G4double scrA,
G4double &cost, G4double &sint)
{
G4double xi=0.;
if (Qn12<0.001)
{G4double r1,tet;
G4double r1,tet,xi=0.;
G4double Qn1 = 2.* lambdan *scrA*((1.+scrA)*log(1.+1./scrA)-1.);
if (Qn1<0.001)
{
do{
r1=G4UniformRand();
xi=-Qn12*log(G4UniformRand());
xi=-0.5*Qn1*log(G4UniformRand());
tet=acos(1.-xi);
}while(tet*r1*r1>sin(tet));
}
else if(Qn12>0.5)xi=2.*G4UniformRand();
else xi=2.*(GSTable->SampleTheta(lambdan,scrA,G4UniformRand()));
}
else if(Qn1>0.5) { xi=2.*G4UniformRand(); }//isotropic distribution
else{ xi=2.*(GSTable->SampleTheta(lambdan,scrA,G4UniformRand()));}
if(xi<0.)xi=0.;
@@ -422,7 +431,7 @@ G4GoudsmitSaundersonMscModel::CalculateIntegrals(const G4ParticleDefinition* p,G
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//t->g->t step transformations taken from Ref.6
//t->g->t step transformations taken from Ref.6
G4double
G4GoudsmitSaundersonMscModel::ComputeTruePathLengthLimit(const G4Track& track,
@@ -446,8 +455,8 @@ G4GoudsmitSaundersonMscModel::ComputeTruePathLengthLimit(const G4Track& track,
currentCouple = track.GetMaterialCutsCouple();
currentMaterialIndex = currentCouple->GetIndex();
currentKinEnergy = dp->GetKineticEnergy();
currentRange =
theManager->GetRangeFromRestricteDEDX(particle,currentKinEnergy,currentCouple);
currentRange = GetRange(particle,currentKinEnergy,currentCouple);
lambda1 = GetLambda(currentKinEnergy);
@@ -637,18 +646,18 @@ G4double G4GoudsmitSaundersonMscModel::ComputeGeomPathLength(G4double)
zPathLength = tPathLength;
// z = t for very small tPathLength
if(tPathLength < tlimitminfix) return zPathLength;
if(tPathLength < tlimitminfix) { return zPathLength; }
// this correction needed to run MSC with eIoni and eBrem inactivated
// and makes no harm for a normal run
if(tPathLength > currentRange)
tPathLength = currentRange ;
{ tPathLength = currentRange; }
G4double tau = tPathLength/lambda1 ;
if ((tau <= tausmall) || insideskin) {
zPathLength = tPathLength;
if(zPathLength > lambda1) zPathLength = lambda1;
if(zPathLength > lambda1) { zPathLength = lambda1; }
return zPathLength;
}
@@ -656,7 +665,7 @@ G4double G4GoudsmitSaundersonMscModel::ComputeGeomPathLength(G4double)
if (tPathLength < currentRange*dtrl) {
if(tau < taulim) zmean = tPathLength*(1.-0.5*tau) ;
else zmean = lambda1*(1.-exp(-tau));
} else if(currentKinEnergy < mass) {
} else if(currentKinEnergy < mass || tPathLength == currentRange) {
par1 = 1./currentRange ;
par2 = 1./(par1*lambda1) ;
par3 = 1.+par2 ;
@@ -665,8 +674,8 @@ G4double G4GoudsmitSaundersonMscModel::ComputeGeomPathLength(G4double)
else
zmean = 1./(par1*par3) ;
} else {
G4double T1 = theManager->GetEnergy(particle,currentRange-tPathLength,
currentCouple);
G4double T1 = GetEnergy(particle,currentRange-tPathLength,currentCouple);
lambda11 = GetLambda(T1);
@@ -753,8 +762,10 @@ void G4GoudsmitSaundersonMscModel::LoadELSEPAXSections()
char* path = getenv("G4LEDATA");
if (!path)
{
G4String excep = "G4GoudsmitSaundersonTable: G4LEDATA environment variable not set properly";
G4Exception(excep);
G4Exception("G4GoudsmitSaundersonMscModel::LoadELSEPAXSections()","em0006",
FatalException,
"Environment variable G4LEDATA not defined");
return;
}
G4String pathString(path);
@@ -763,8 +774,11 @@ void G4GoudsmitSaundersonMscModel::LoadELSEPAXSections()
infile = fopen(dirFile,"r");
if (infile == 0)
{
G4String excep = "G4GoudsmitSaunderson - data files: " + dirFile + " not found";
G4Exception(excep);
G4ExceptionDescription ed;
ed << "Data file <" + dirFile + "> is not opened!" << G4endl;
G4Exception("G4GoudsmitSaundersonMscModel::LoadELSEPAXSections()",
"em0003",FatalException,ed);
return;
}
// Read parameters from tables and take logarithms
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4GoudsmitSaundersonTable.cc,v 1.8 2010/06/25 09:41:42 gunter Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4GoudsmitSaundersonTable.cc,v 1.9 2010-12-23 16:57:28 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -258,14 +258,16 @@ void G4GoudsmitSaundersonTable::LoadPDFandCPDFdata()
G4String filename;
for(G4int level = 0; level < 2; level++){
if(level == 0) filename = "PDF.dat";
if(level == 1) filename = "CPDF.dat";
if(level == 0) { filename = "PDF.dat"; }
if(level == 1) { filename = "CPDF.dat"; }
char* path = getenv("G4LEDATA");
if (!path)
{
G4String excep = "G4GoudsmitSaundersonTable: G4LEDATA environment variable not set";
G4Exception(excep);
G4Exception("G4GoudsmitSaundersonTable::LoadPDFandCPDFdata()","em0006",
FatalException,
"Environment variable G4LEDATA not defined");
return;
}
G4String pathString(path);
@@ -273,8 +275,11 @@ void G4GoudsmitSaundersonTable::LoadPDFandCPDFdata()
FILE *infile = fopen(dirFile,"r");
if (infile == 0)
{
G4String excep = "G4GoudsmitSaunderson - data files: " + dirFile + " not found";
G4Exception(excep);
G4ExceptionDescription ed;
ed << "Data file <" + dirFile + "> is not opened!" << G4endl;
G4Exception("G4GoudsmitSaundersonTable::LoadPDFandCPDFdata()",
"em0003",FatalException,ed);
return;
}
// Read parameters into tables.
@@ -284,8 +289,8 @@ void G4GoudsmitSaundersonTable::LoadPDFandCPDFdata()
for(G4int i=0 ; i<320 ;i++){
fscanf(infile,"%f\t",&aRead);
G4int idx = 320*(11*k+j)+i;
if(level == 0) PDF[idx] = aRead;
else if (level == 1) CPDF[idx] = aRead;
if(level == 0) { PDF[idx] = aRead; }
else if (level == 1) { CPDF[idx] = aRead; }
}
}
}
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4HeatedKleinNishinaCompton.cc,v 1.5 2009/04/12 17:09:57 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4HeatedKleinNishinaCompton.cc,v 1.5 2009-04-12 17:09:57 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ICRU49NuclearStoppingModel.cc,v 1.2 2009/11/10 19:25:47 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4ICRU49NuclearStoppingModel.cc,v 1.2 2009-11-10 19:25:47 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -71,7 +71,7 @@ G4ICRU49NuclearStoppingModel::G4ICRU49NuclearStoppingModel(const G4String& nam)
{
theZieglerFactor = eV*cm2*1.0e-15;
g4pow = G4Pow::GetInstance();
if(ad[0] == 0.0) InitialiseNuclearStopping();
if(ad[0] == 0.0) { InitialiseNuclearStopping(); }
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ICRU73QOModel.cc,v 1.5 2010/11/17 10:47:12 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4ICRU73QOModel.cc,v 1.5 2010-11-17 10:47:12 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -65,7 +65,7 @@ G4ICRU73QOModel::G4ICRU73QOModel(const G4ParticleDefinition* p, const G4String&
particle(0),
isInitialised(false)
{
if(p) SetParticle(p);
if(p) { SetParticle(p); }
SetHighEnergyLimit(10.0*MeV);
lowestKinEnergy = 5.0*keV;
@@ -86,6 +86,8 @@ G4ICRU73QOModel::G4ICRU73QOModel(const G4ParticleDefinition* p, const G4String&
indexZ[ZElementAvailable[i]] = i;
}
}
fParticleChange = 0;
denEffData = 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -95,15 +97,6 @@ G4ICRU73QOModel::~G4ICRU73QOModel()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4ICRU73QOModel::MinEnergyCut(const G4ParticleDefinition*,
const G4MaterialCutsCouple* )
{
// return couple->GetMaterial()->GetIonisation()->GetMeanExcitationEnergy();
return 100*keV;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4ICRU73QOModel::Initialise(const G4ParticleDefinition* p,
const G4DataVector&)
{
@@ -236,7 +229,7 @@ G4double G4ICRU73QOModel::DEDXPerElement(G4int AtomicNumber,
G4int Z = AtomicNumber;
if(Z > 97) { Z = 97; }
G4int nbOfShells = GetNumberOfShells(Z);
if(nbOfShells < 1) nbOfShells = 1;
if(nbOfShells < 1) { nbOfShells = 1; }
G4double v = CLHEP::c_light * std::sqrt( 2.0*kineticEnergy/proton_mass_c2 );
@@ -304,8 +297,8 @@ G4double G4ICRU73QOModel::GetL0(G4double normEnergy) const
for(n = 0; n < sizeL0; n++) {
if( normEnergy < L0[n][0] ) break;
}
if(0 == n) n = 1 ;
if(n >= sizeL0) n = sizeL0 - 1 ;
if(0 == n) { n = 1; }
if(n >= sizeL0) { n = sizeL0 - 1; }
G4double l0 = L0[n][1];
G4double l0p = L0[n-1][1];
@@ -373,7 +366,7 @@ void G4ICRU73QOModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
{
G4double tmax = MaxSecondaryKinEnergy(dp);
G4double xmax = std::min(tmax, maxEnergy);
if(xmin >= xmax) return;
if(xmin >= xmax) { return; }
G4double kineticEnergy = dp->GetKineticEnergy();
G4double energy = kineticEnergy + mass;
@@ -405,7 +398,7 @@ void G4ICRU73QOModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
G4double totMomentum = energy*sqrt(beta2);
G4double cost = deltaKinEnergy * (energy + electron_mass_c2) /
(deltaMomentum * totMomentum);
if(cost > 1.0) cost = 1.0;
if(cost > 1.0) { cost = 1.0; }
G4double sint = sqrt((1.0 - cost)*(1.0 + cost));
G4double phi = twopi * G4UniformRand() ;
@@ -433,7 +426,7 @@ void G4ICRU73QOModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
G4double G4ICRU73QOModel::MaxSecondaryEnergy(const G4ParticleDefinition* pd,
G4double kinEnergy)
{
if(pd != particle) SetParticle(pd);
if(pd != particle) { SetParticle(pd); }
G4double tau = kinEnergy/mass;
G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /
(1. + 2.0*(tau + 1.)*ratio + ratio*ratio);
@@ -23,9 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4InitXscPAI.cc,v 1.9 2006/06/29 19:53:00 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4InitXscPAI.cc,v 1.9 2006-06-29 19:53:00 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
//
// G4InitXscPAI.cc -- class implementation file
@@ -90,7 +89,7 @@ G4InitXscPAI::G4InitXscPAI( const G4MaterialCutsCouple* matCC)
{
fMatSandiaMatrix->push_back(new G4DataVector(5,0.));
}
for (G4int i = 0; i < fIntervalNumber; i++)
for (i = 0; i < fIntervalNumber; i++)
{
(*(*fMatSandiaMatrix)[i])[0] = fSandia->GetSandiaMatTable(i,0);
@@ -101,7 +100,8 @@ G4InitXscPAI::G4InitXscPAI( const G4MaterialCutsCouple* matCC)
}
KillCloseIntervals();
Normalisation();
fBetaGammaSq = fTmax = 0.0;
fIntervalTmax = fCurrentInterval = 0;
}
@@ -119,6 +119,8 @@ G4InitXscPAI::~G4InitXscPAI()
if(fPAIelectronVector) delete fPAIelectronVector;
if(fChCosSqVector) delete fChCosSqVector;
if(fChWidthVector) delete fChWidthVector;
delete fSandia;
delete fMatSandiaMatrix;
}
////////////////////////////////////////////////////////////////////////
@@ -159,7 +161,7 @@ void G4InitXscPAI::KillCloseIntervals()
void G4InitXscPAI::Normalisation()
{
G4int i, j;
G4double energy1, energy2, delta, cof; // , shift;
G4double energy1, energy2, /*delta,*/ cof; // , shift;
energy1 = (*(*fMatSandiaMatrix)[fIntervalNumber-1])[0];
energy2 = 2.*(*(*fMatSandiaMatrix)[fIntervalNumber-1])[0];
@@ -177,7 +179,7 @@ void G4InitXscPAI::Normalisation()
}
fNormalizationCof = 2*pi*pi*hbarc*hbarc*fine_structure_const/electron_mass_c2 ;
fNormalizationCof *= fElectronDensity;
delta = fNormalizationCof - cof;
//delta = fNormalizationCof - cof;
fNormalizationCof /= cof;
// G4cout<<"G4InitXscPAI::fNormalizationCof/cof = "<<fNormalizationCof
// <<"; at delta ="<<delta<<G4endl ;
@@ -492,10 +494,10 @@ G4double G4InitXscPAI::PAIdNdxCherenkov( G4double omega )
G4double epsilonRe = RePartDielectricConst(omega);
G4double epsilonIm = ImPartDielectricConst(i,omega);
G4double cof, logarithm, x3, x5, argument, modul2, dNdxC ;
G4double /*cof,*/ logarithm, x3, x5, argument, modul2, dNdxC ;
G4double be2, be4, betaBohr2,betaBohr4,cofBetaBohr ;
cof = 1.0 ;
//cof = 1.0 ;
cofBetaBohr = 4.0 ;
betaBohr2 = fine_structure_const*fine_structure_const ;
betaBohr4 = betaBohr2*betaBohr2*cofBetaBohr ;
@@ -241,10 +241,10 @@ G4double G4IonCoulombCrossSection::SampleCosineTheta()
G4double x1 = 1. - cosTetMinNuc + screenZ;
G4double x2 = 1. - cosTetMaxNuc + screenZ;
G4double dx = cosTetMinNuc - cosTetMaxNuc;
G4double grej, z1;
G4double /*grej,*/ z1;
z1 = x1*x2/(x1 + G4UniformRand()*dx) - screenZ;
grej = 1.0/(1.0 + z1);
//grej = 1.0/(1.0 + z1);
return z1;
@@ -89,6 +89,7 @@ G4IonCoulombScatteringModel::G4IonCoulombScatteringModel(const G4String& nam)
heavycorr =0;
particle = 0;
mass=0;
currentMaterialIndex = -1;
ioncross = new G4IonCoulombCrossSection();
@@ -107,6 +108,7 @@ void G4IonCoulombScatteringModel::Initialise(const G4ParticleDefinition* p,
{
SetupParticle(p);
currentCouple = 0;
currentMaterialIndex = -1;
cosThetaMin = cos(PolarAngleLimit());
ioncross->Initialise(p,cosThetaMin);
@@ -114,9 +116,9 @@ void G4IonCoulombScatteringModel::Initialise(const G4ParticleDefinition* p,
if(!isInitialised) {
isInitialised = true;
fParticleChange = GetParticleChangeForGamma();
}
isInitialised = true;
fParticleChange = GetParticleChangeForGamma();
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -133,7 +135,7 @@ G4double G4IonCoulombScatteringModel::ComputeCrossSectionPerAtom(
SetupParticle(p);
G4double xsec =0.0;
if(kinEnergy < lowEnergyLimit) return xsec;
if(kinEnergy < lowEnergyLimit) return xsec;
DefineMaterial(CurrentCouple());
@@ -145,7 +147,6 @@ G4double G4IonCoulombScatteringModel::ComputeCrossSectionPerAtom(
ioncross->SetupTarget(Z, kinEnergy, heavycorr);
xsec = ioncross->NuclearCrossSection();
//cout<< "..........xsec "<<G4BestUnit(xsec,"Surface") <<endl;
@@ -242,7 +243,7 @@ void G4IonCoulombScatteringModel::SampleSecondaries(
}
if(trec > tcut) {
G4ParticleDefinition* ion = theParticleTable->FindIon(iz, ia, 0, iz);
G4ParticleDefinition* ion = theParticleTable->GetIon(iz, ia, 0.0);
G4double plab = sqrt(finalT*(finalT + 2.0*mass));
G4ThreeVector p2 = (ptot*dir - plab*newDirection).unit();
G4DynamicParticle* newdp = new G4DynamicParticle(ion, p2, trec);
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4IonFluctuations.cc,v 1.27 2010/10/25 19:13:23 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4IonFluctuations.cc,v 1.27 2010-10-25 19:13:23 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -123,33 +123,43 @@ G4double G4IonFluctuations::SampleFluctuations(const G4Material* material,
G4double siga = Dispersion(material,dp,tmax,length);
G4double loss = meanLoss;
G4double navr = minNumberInteractionsBohr;
navr = meanLoss*meanLoss/siga;
//G4cout << "### siga= " << sqrt(siga) << " navr= " << navr << G4endl;
// Gaussian fluctuation
if (navr >= minNumberInteractionsBohr) {
// Increase fluctuations for big fractional energy loss
//G4cout << "siga= " << siga << G4endl;
if ( meanLoss > minFraction*kineticEnergy ) {
G4double gam = (kineticEnergy - meanLoss)/particleMass + 1.0;
G4double b2 = 1.0 - 1.0/(gam*gam);
if(b2 < xmin*beta2) b2 = xmin*beta2;
G4double x = b2/beta2;
G4double x3 = 1.0/(x*x*x);
siga *= 0.25*(1.0 + x)*(x3 + (1.0/b2 - 0.5)/(1.0/beta2 - 0.5) );
}
// G4cout << "siga= " << siga << G4endl;
siga = sqrt(siga);
G4double lossmax = meanLoss+meanLoss;
// Increase fluctuations for big fractional energy loss
//G4cout << "siga= " << siga << G4endl;
if ( meanLoss > minFraction*kineticEnergy ) {
G4double gam = (kineticEnergy - meanLoss)/particleMass + 1.0;
G4double b2 = 1.0 - 1.0/(gam*gam);
if(b2 < xmin*beta2) b2 = xmin*beta2;
G4double x = b2/beta2;
G4double x3 = 1.0/(x*x*x);
siga *= 0.25*(1.0 + x)*(x3 + (1.0/b2 - 0.5)/(1.0/beta2 - 0.5) );
}
// G4cout << "siga= " << siga << G4endl;
G4double sigb = siga/(meanLoss*meanLoss);
G4double lambda = 1.0/sigb;
if (lambda >= 5.0) {
sigb = sqrt(sigb);
do {
loss = G4RandGauss::shoot(1.0,sigb);
} while (0.0 > loss || loss > 2.0);
} else {
loss = CLHEP::RandGamma::shoot(lambda,lambda);
}
loss *= meanLoss;
/*
G4double lossmax = meanLoss+meanLoss;
if(siga > 5.0*meanLoss) {
loss = lossmax*G4UniformRand();
} else {
do {
loss = G4RandGauss::shoot(meanLoss,siga);
} while (0.0 > loss || loss > lossmax);
}
// Poisson fluctuations
} else {
@@ -157,6 +167,7 @@ G4double G4IonFluctuations::SampleFluctuations(const G4Material* material,
G4double n = (G4double)(G4Poisson(navr));
loss = meanLoss*n/navr;
}
*/
//G4cout << "meanLoss= " << meanLoss << " loss= " << loss << G4endl;
return loss;
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4KleinNishinaCompton.cc,v 1.10 2009/05/15 17:12:33 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4KleinNishinaCompton.cc,v 1.10 2009-05-15 17:12:33 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -66,6 +66,7 @@ G4KleinNishinaCompton::G4KleinNishinaCompton(const G4ParticleDefinition*,
theGamma = G4Gamma::Gamma();
theElectron = G4Electron::Electron();
lowestGammaEnergy = 1.0*eV;
fParticleChange = 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -141,6 +142,15 @@ void G4KleinNishinaCompton::SampleSecondaries(std::vector<G4DynamicParticle*>* f
// Note : Effects due to binding of atomic electrons are negliged.
G4double gamEnergy0 = aDynamicGamma->GetKineticEnergy();
// extra protection
if(gamEnergy0 < lowestGammaEnergy) {
fParticleChange->ProposeTrackStatus(fStopAndKill);
fParticleChange->ProposeLocalEnergyDeposit(gamEnergy0);
fParticleChange->SetProposedKineticEnergy(0.0);
return;
}
G4double E0_m = gamEnergy0 / electron_mass_c2 ;
G4ThreeVector gamDirection0 = aDynamicGamma->GetMomentumDirection();
@@ -176,25 +186,25 @@ void G4KleinNishinaCompton::SampleSecondaries(std::vector<G4DynamicParticle*>* f
// scattered gamma angles. ( Z - axis along the parent gamma)
//
if(sint2 < 0.0) { sint2 = 0.0; }
G4double cosTeta = 1. - onecost;
G4double sinTeta = sqrt (sint2);
G4double Phi = twopi * G4UniformRand();
G4double dirx = sinTeta*cos(Phi), diry = sinTeta*sin(Phi), dirz = cosTeta;
//
// update G4VParticleChange for the scattered gamma
//
G4ThreeVector gamDirection1 ( dirx,diry,dirz );
G4ThreeVector gamDirection1(sinTeta*cos(Phi), sinTeta*sin(Phi), cosTeta);
gamDirection1.rotateUz(gamDirection0);
G4double gamEnergy1 = epsilon*gamEnergy0;
fParticleChange->SetProposedKineticEnergy(gamEnergy1);
if(gamEnergy1 > lowestGammaEnergy) {
fParticleChange->ProposeMomentumDirection(gamDirection1);
fParticleChange->SetProposedKineticEnergy(gamEnergy1);
} else {
fParticleChange->ProposeTrackStatus(fStopAndKill);
gamEnergy1 += fParticleChange->GetLocalEnergyDeposit();
fParticleChange->ProposeLocalEnergyDeposit(gamEnergy1);
fParticleChange->SetProposedKineticEnergy(0.0);
}
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4KleinNishinaModel.cc,v 1.4 2010/11/21 16:08:37 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4KleinNishinaModel.cc,v 1.5 2011-01-02 19:58:54 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -54,6 +54,7 @@
#include "G4DataVector.hh"
#include "G4ParticleChangeForGamma.hh"
#include "G4VAtomDeexcitation.hh"
#include "G4AtomicShells.hh"
#include "G4LossTableManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -66,7 +67,11 @@ G4KleinNishinaModel::G4KleinNishinaModel(const G4String& nam)
theGamma = G4Gamma::Gamma();
theElectron = G4Electron::Electron();
lowestGammaEnergy = 1.0*eV;
limitFactor = 4;
fProbabilities.resize(9,0.0);
SetDeexcitationFlag(true);
fParticleChange = 0;
fAtomDeexcitation = 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -127,6 +132,14 @@ G4KleinNishinaModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
G4double y = log(GammaEnergy/T0);
CrossSection *= exp(-y*(c1+c2*y));
}
G4int iz = G4int(Z);
G4int nShells = G4AtomicShells::GetNumberOfShells(iz);
//G4cout << "Z= " << Z << " Nshells=" << nShells << G4endl;
G4double bindingEnergy = G4AtomicShells::GetBindingEnergy(iz,nShells-1);
G4double eth = sqrt(bindingEnergy*(bindingEnergy + electron_mass_c2)) -
0.5*(sqrt(bindingEnergy*(bindingEnergy + 2*electron_mass_c2)) - bindingEnergy);
CrossSection *= (1.0 - eth/GammaEnergy);
if(CrossSection < 0.0) { CrossSection = 0.0; }
// G4cout << "e= " << GammaEnergy << " Z= " << Z
// << " cross= " << CrossSection << G4endl;
return CrossSection;
@@ -141,6 +154,7 @@ void G4KleinNishinaModel::SampleSecondaries(
G4double,
G4double)
{
// primary gamma
G4double energy = aDynamicGamma->GetKineticEnergy();
G4ThreeVector direction = aDynamicGamma->GetMomentumDirection();
@@ -148,55 +162,75 @@ void G4KleinNishinaModel::SampleSecondaries(
const G4Element* elm = SelectRandomAtom(couple, theGamma, energy);
// select shell first
G4int Z = (G4int)elm->GetZ();
G4int nShells = elm->GetNbOfAtomicShells();
if(nShells > (G4int)fProbabilities.size()) { fProbabilities.resize(nShells); }
G4double totprob = 0.0;
G4int i = 0;
for(; i<nShells; ++i) {
G4double prob = 0.0;
if(energy > elm->GetAtomicShell(i)) {
prob = (G4double)elm->GetNbOfShellElectrons(i);
}
totprob += prob;
G4int i;
for(i=0; i<nShells; ++i) {
G4double bindingEnergy = elm->GetAtomicShell(i);
G4double eth = sqrt(bindingEnergy*(bindingEnergy + electron_mass_c2)) -
0.5*(sqrt(bindingEnergy*(bindingEnergy + 2*electron_mass_c2)) - bindingEnergy);
G4double prob = 1.0 - eth/energy;
if(prob > 0.0) { totprob += prob*elm->GetNbOfShellElectrons(i); }
fProbabilities[i] = totprob;
}
if(totprob == 0.0) { return; }
G4LorentzVector lv1, lv2, lv3;
G4LorentzVector lv0(energy*direction.x(),energy*direction.y(),
energy*direction.z(),energy);
G4double eKinEnergy = 0.0;
G4double gamEnergy1 = 0.0;
// Loop on sampling
G4double bindingEnergy;
G4double eKinEnergy;
const G4int nlooplim = 100;
G4int nloop = 0;
do {
++nloop;
G4double xprob = totprob*G4UniformRand();
// select shell
for(i=0; i<nShells; ++i) { if(xprob <= fProbabilities[i]) {break;} }
if( i == nShells ) { return; }
bindingEnergy = elm->GetAtomicShell(i);
G4double tkin = bindingEnergy*0.5;
G4double eEnergy = tkin + electron_mass_c2;
G4double eTotMomentum = sqrt(tkin*(tkin + electron_mass_c2*2));
G4ThreeVector eDir = G4RandomDirection();
lv1 = lv0;
lv2.set(eTotMomentum*eDir.x(),eTotMomentum*eDir.y(),
eTotMomentum*eDir.z(),eEnergy);
G4ThreeVector bst = lv2.boostVector();
lv1.boost(-bst);
G4double bindingEnergy = elm->GetAtomicShell(i);
// In the rest frame of an electron
// shortcut if the loop is too long
if(nloop >= nlooplim) {
lv1.set(0.0,0.0,0.0,0.0);
eKinEnergy = energy - bindingEnergy;
if(eKinEnergy < 0.0) { eKinEnergy = 0.0; }
G4double eTotMomentum = sqrt(eKinEnergy*(eKinEnergy + 2*electron_mass_c2));
G4double phi = G4UniformRand()*twopi;
G4double costet = 2*G4UniformRand() - 1;
G4double sintet = sqrt((1 - costet)*(1 + costet));
lv2.set(eTotMomentum*sintet*cos(phi),eTotMomentum*sintet*sin(phi),
eTotMomentum*costet,eKinEnergy + electron_mass_c2);
break;
}
G4double limitEnergy = limitFactor*bindingEnergy;
G4double gamEnergy0 = energy;
lv1.set(0.0,0.0,energy,energy);
//G4cout << "nShells= " << nShells << " i= " << i
// << " Egamma= " << energy << " Ebind= " << bindingEnergy
// << " Elim= " << limitEnergy
// << G4endl;
// for low energy rest frame of the electron
if(energy < limitEnergy) {
G4double eTotMomentum = sqrt(bindingEnergy*(bindingEnergy + 2*electron_mass_c2));
G4double phi = G4UniformRand()*twopi;
G4double costet = 2*G4UniformRand() - 1;
G4double sintet = sqrt((1 - costet)*(1 + costet));
lv2.set(eTotMomentum*sintet*cos(phi),eTotMomentum*sintet*sin(phi),
eTotMomentum*costet,bindingEnergy + electron_mass_c2);
bst = lv2.boostVector();
lv1.boost(-bst);
gamEnergy0 = lv1.e();
}
// In the rest frame of the electron
// The scattered gamma energy is sampled according to Klein - Nishina formula.
// The random number techniques of Butcher & Messel are used
// (Nuc Phys 20(1960),15).
G4double gamEnergy0 = lv1.e();
G4double E0_m = gamEnergy0 / electron_mass_c2 ;
G4ThreeVector gamDirection0 = (lv1.vect()).unit();
G4double E0_m = gamEnergy0/electron_mass_c2;
//
// sample the energy rate of the scattered gamma
@@ -204,10 +238,10 @@ void G4KleinNishinaModel::SampleSecondaries(
G4double epsilon, epsilonsq, onecost, sint2, greject ;
G4double epsilon0 = 1./(1. + 2.*E0_m);
G4double epsilon0 = 1./(1 + 2*E0_m);
G4double epsilon0sq = epsilon0*epsilon0;
G4double alpha1 = - log(epsilon0);
G4double alpha2 = 0.5*(1.- epsilon0sq);
G4double alpha2 = 0.5*(1 - epsilon0sq);
do {
if ( alpha1/(alpha1+alpha2) > G4UniformRand() ) {
@@ -224,74 +258,93 @@ void G4KleinNishinaModel::SampleSecondaries(
greject = 1. - epsilon*sint2/(1.+ epsilonsq);
} while (greject < G4UniformRand());
G4double gamEnergy1 = epsilon*gamEnergy0;
// before scattering total 4-momentum in e- system
lv2.set(0.0,0.0,0.0,electron_mass_c2);
lv2 += lv1;
//
// scattered gamma angles. ( Z - axis along the parent gamma)
//
if(sint2 < 0.0) { sint2 = 0.0; }
G4double cosTeta = 1. - onecost;
G4double sinTeta = sqrt (sint2);
G4double Phi = twopi * G4UniformRand();
G4double dirx = sinTeta*cos(Phi), diry = sinTeta*sin(Phi), dirz = cosTeta;
G4double sinTeta = sqrt(sint2);
G4double Phi = twopi * G4UniformRand();
// e- recoil
//
// update G4VParticleChange for the scattered gamma
//
// in rest frame of the electron
if(energy < limitEnergy) {
G4ThreeVector gamDir = lv1.vect().unit();
G4ThreeVector v = G4ThreeVector(sinTeta*cos(Phi),sinTeta*sin(Phi),cosTeta);
v.rotateUz(gamDir);
lv1.set(gamEnergy1*v.x(),gamEnergy1*v.y(),gamEnergy1*v.z(),gamEnergy1);
lv2 -= lv1;
//G4cout << "Egam= " << lv1.e() << " Ee= " << lv2.e()-electron_mass_c2 << G4endl;
lv2.boost(bst);
lv1.boost(bst);
eKinEnergy = lv2.e() - electron_mass_c2 - 2*bindingEnergy;
} else {
lv1.set(gamEnergy1*sinTeta*cos(Phi),gamEnergy1*sinTeta*sin(Phi),
gamEnergy1*cosTeta,gamEnergy1);
lv2 -= lv1;
eKinEnergy = lv2.e() - electron_mass_c2 - bindingEnergy;
}
G4ThreeVector gamDirection1 ( dirx,diry,dirz );
gamDirection1.rotateUz(gamDirection0);
gamEnergy1 = epsilon*gamEnergy0;
//G4cout << "eKinEnergy= " << eKinEnergy << G4endl;
// before scattering
lv2.set(0.0,0.0,0.0,electron_mass_c2);
lv2 += lv1;
// after scattering
lv1.set(gamEnergy1*gamDirection1.x(),gamEnergy1*gamDirection1.y(),
gamEnergy1*gamDirection1.z(),gamEnergy1);
lv2 -= lv1;
lv2.boost(bst);
lv1.boost(bst);
eKinEnergy = lv2.e() - electron_mass_c2 - bindingEnergy;
} while ( eKinEnergy < 0.0 );
// gamma kinematics
gamEnergy1 = lv1.e();
G4double edep = bindingEnergy;
//
// update G4VParticleChange for the scattered gamma
//
G4double gamEnergy1 = lv1.e();
if(gamEnergy1 > lowestGammaEnergy) {
fParticleChange->SetProposedKineticEnergy(gamEnergy1);
fParticleChange->ProposeMomentumDirection((lv1.vect()).unit());
G4ThreeVector gamDirection1 = lv1.vect().unit();
gamDirection1.rotateUz(direction);
fParticleChange->ProposeMomentumDirection(gamDirection1);
} else {
fParticleChange->ProposeTrackStatus(fStopAndKill);
fParticleChange->SetProposedKineticEnergy(0.0);
edep += gamEnergy1;
gamEnergy1 = 0.0;
}
fParticleChange->SetProposedKineticEnergy(gamEnergy1);
//
// kinematic of the scattered electron
//
if(eKinEnergy > DBL_MIN) {
G4ThreeVector eDirection = (lv2.vect()).unit();
if(eKinEnergy > lowestGammaEnergy) {
G4ThreeVector eDirection = lv2.vect().unit();
eDirection.rotateUz(direction);
G4DynamicParticle* dp = new G4DynamicParticle(theElectron,eDirection,eKinEnergy);
fvect->push_back(dp);
}
} else { eKinEnergy = 0.0; }
G4double edep = energy - gamEnergy1 - eKinEnergy;
// sample deexcitation
//
if(fAtomDeexcitation) {
G4int index = couple->GetIndex();
if(fAtomDeexcitation->CheckDeexcitationActiveRegion(index)) {
G4int Z = (G4int)elm->GetZ();
G4AtomicShellEnumerator as = G4AtomicShellEnumerator(i);
const G4AtomicShell* shell = fAtomDeexcitation->GetAtomicShell(Z, as);
size_t nbefore = fvect->size();
fAtomDeexcitation->GenerateParticles(fvect, shell, Z, index);
size_t nafter = fvect->size();
if(nafter > nbefore) {
for (size_t i=nbefore; i<nafter; ++i) {
edep -= ((*fvect)[i])->GetKineticEnergy();
for (size_t j=nbefore; j<nafter; ++j) {
edep -= ((*fvect)[j])->GetKineticEnergy();
}
}
}
}
// energy balance
if(edep < 0.0) { edep = 0.0; }
fParticleChange->ProposeLocalEnergyDeposit(edep);
}
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ModifiedTsai.cc,v 1.1 2010/10/14 15:17:48 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4ModifiedTsai.cc,v 1.1 2010-10-14 15:17:48 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -44,6 +44,7 @@
// 24 Mar 2003 A.Trindade Fix in Tsai generator in order to prevent theta
// generation above pi
// 13 Oct 2010 V.Ivanchenko Moved to standard and improved comment
// 26.04.2011 V.Grichine Clean-up of PolarAngle method
//
// Class Description:
//
@@ -74,19 +75,24 @@ G4double G4ModifiedTsai::PolarAngle(const G4double initial_energy,
// Universal distribution suggested by L. Urban (Geant3 manual (1993)
// Phys211) derived from Tsai distribution (Rev Mod Phys 49,421(1977))
G4double totalEnergy = initial_energy + electron_mass_c2;
G4double gamma = 1. + initial_energy/electron_mass_c2;
G4double uMax = gamma*pi;
const G4double a1 = 0.625, a2 = 3.*a1, d = 27.;
G4double u, theta = 0;
const G4double a1 = 0.625;
const G4double a2 = 1.875;
const G4double border = 0.25;
G4double u, theta;
do{
do
{
u = - std::log(G4UniformRand()*G4UniformRand());
if (9./(9.+d) > G4UniformRand()) { u /= a1; }
else { u /= a2; }
if ( border > G4UniformRand() ) u /= a1;
else u /= a2;
theta = u*electron_mass_c2/totalEnergy;
} while(u*electron_mass_c2 > totalEnergy*pi);
} while( u > uMax );
theta = u/gamma;
return theta;
}
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MollerBhabhaModel.cc,v 1.38 2010/04/06 17:10:16 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4MollerBhabhaModel.cc,v 1.38 2010-04-06 17:10:16 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -76,11 +76,12 @@ G4MollerBhabhaModel::G4MollerBhabhaModel(const G4ParticleDefinition* p,
particle(0),
isElectron(true),
twoln10(2.0*log(10.0)),
lowLimit(0.2*keV),
lowLimit(0.02*keV),
isInitialised(false)
{
theElectron = G4Electron::Electron();
if(p) SetParticle(p);
if(p) { SetParticle(p); }
fParticleChange = 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -90,23 +91,11 @@ G4MollerBhabhaModel::~G4MollerBhabhaModel()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4MollerBhabhaModel::MinEnergyCut(const G4ParticleDefinition*,
const G4MaterialCutsCouple* /*couple*/)
{
// G4double electronDensity = couple->GetMaterial()->GetElectronDensity();
//G4double Zeff = electronDensity/couple->GetMaterial()->GetTotNbOfAtomsPerVolume();
//return 0.25*sqrt(Zeff)*keV;
//return couple->GetMaterial()->GetIonisation()->GetMeanExcitationEnergy();
return 0.1*keV;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4MollerBhabhaModel::MaxSecondaryEnergy(const G4ParticleDefinition*,
G4double kinEnergy)
{
G4double tmax = kinEnergy;
if(isElectron) tmax *= 0.5;
if(isElectron) { tmax *= 0.5; }
return tmax;
}
@@ -115,10 +104,9 @@ G4double G4MollerBhabhaModel::MaxSecondaryEnergy(const G4ParticleDefinition*,
void G4MollerBhabhaModel::Initialise(const G4ParticleDefinition* p,
const G4DataVector&)
{
if(!particle) SetParticle(p);
SetDeexcitationFlag(false);
if(!particle) { SetParticle(p); }
if(isInitialised) return;
if(isInitialised) { return; }
isInitialised = true;
fParticleChange = GetParticleChangeForLoss();
@@ -126,25 +114,26 @@ void G4MollerBhabhaModel::Initialise(const G4ParticleDefinition* p,
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4MollerBhabhaModel::ComputeCrossSectionPerElectron(
const G4ParticleDefinition* p,
G4double kineticEnergy,
G4double cutEnergy,
G4double maxEnergy)
G4double
G4MollerBhabhaModel::ComputeCrossSectionPerElectron(const G4ParticleDefinition* p,
G4double kineticEnergy,
G4double cutEnergy,
G4double maxEnergy)
{
if(!particle) SetParticle(p);
if(!particle) { SetParticle(p); }
G4double cross = 0.0;
G4double tmax = MaxSecondaryEnergy(p, kineticEnergy);
tmax = min(maxEnergy, tmax);
tmax = std::min(maxEnergy, tmax);
if(cutEnergy < tmax) {
G4double xmin = cutEnergy/kineticEnergy;
G4double xmax = tmax/kineticEnergy;
G4double gam = kineticEnergy/electron_mass_c2 + 1.0;
G4double tau = kineticEnergy/electron_mass_c2;
G4double gam = tau + 1.0;
G4double gamma2= gam*gam;
G4double beta2 = 1.0 - 1.0/gamma2;
G4double beta2 = tau*(tau + 2)/gamma2;
//Moller (e-e-) scattering
if (isElectron) {
@@ -186,9 +175,7 @@ G4double G4MollerBhabhaModel::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......
@@ -196,14 +183,25 @@ G4double G4MollerBhabhaModel::ComputeCrossSectionPerAtom(
G4double G4MollerBhabhaModel::CrossSectionPerVolume(
const G4Material* material,
const G4ParticleDefinition* p,
G4double kineticEnergy,
G4double kinEnergy,
G4double cutEnergy,
G4double maxEnergy)
{
G4double eDensity = material->GetElectronDensity();
G4double cross = eDensity*ComputeCrossSectionPerElectron
(p,kineticEnergy,cutEnergy,maxEnergy);
return cross;
return eDensity*ComputeCrossSectionPerElectron(p,kinEnergy,cutEnergy,maxEnergy);
/*
G4double Zeff = eDensity/material->GetTotNbOfAtomsPerVolume();
G4double th = 0.25*sqrt(Zeff)*keV;
G4double cut;
if(isElectron) { cut = std::max(th*0.5, cutEnergy); }
else { cut = std::max(th, cutEnergy); }
G4double res = 0.0;
// below this threshold no bremsstrahlung
if (kinEnergy > th) {
res = eDensity*ComputeCrossSectionPerElectron(p,kinEnergy,cut,maxEnergy);
}
return res;
*/
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -212,31 +210,32 @@ G4double G4MollerBhabhaModel::ComputeDEDXPerVolume(
const G4Material* material,
const G4ParticleDefinition* p,
G4double kineticEnergy,
G4double cutEnergy)
G4double cut)
{
if(!particle) SetParticle(p);
if(!particle) { SetParticle(p); }
// calculate the dE/dx due to the ionization by Seltzer-Berger formula
// checl low-energy limit
G4double electronDensity = material->GetElectronDensity();
G4double Zeff = electronDensity/material->GetTotNbOfAtomsPerVolume();
G4double th = 0.25*sqrt(Zeff)*keV;
// G4double cut;
// if(isElectron) { cut = std::max(th*0.5, cutEnergy); }
// else { cut = std::max(th, cutEnergy); }
G4double tkin = kineticEnergy;
G4bool lowEnergy = false;
if (kineticEnergy < th) {
tkin = th;
lowEnergy = true;
}
if (kineticEnergy < th) { tkin = th; }
G4double tau = tkin/electron_mass_c2;
G4double gam = tau + 1.0;
G4double gamma2= gam*gam;
G4double beta2 = 1. - 1./gamma2;
G4double bg2 = beta2*gamma2;
G4double bg2 = tau*(tau + 2);
G4double beta2 = bg2/gamma2;
G4double eexc = material->GetIonisation()->GetMeanExcitationEnergy();
eexc /= electron_mass_c2;
G4double eexc2 = eexc*eexc;
G4double d = min(cutEnergy, MaxSecondaryEnergy(p, tkin))/electron_mass_c2;
G4double d = std::min(cut, MaxSecondaryEnergy(p, tkin))/electron_mass_c2;
G4double dedx;
// electron
@@ -251,7 +250,7 @@ G4double G4MollerBhabhaModel::ComputeDEDXPerVolume(
G4double d2 = d*d*0.5;
G4double d3 = d2*d/1.5;
G4double d4 = d3*d*3.75;
G4double d4 = d3*d*0.75;
G4double y = 1.0/(1.0 + gam);
dedx = log(2.0*(tau + 2.0)/eexc2) + log(tau*d)
- beta2*(tau + 2.0*d - y*(3.0*d2
@@ -259,30 +258,19 @@ G4double G4MollerBhabhaModel::ComputeDEDXPerVolume(
}
//density correction
//G4double cden = material->GetIonisation()->GetCdensity();
//G4double mden = material->GetIonisation()->GetMdensity();
//G4double aden = material->GetIonisation()->GetAdensity();
//G4double x0den = material->GetIonisation()->GetX0density();
//G4double x1den = material->GetIonisation()->GetX1density();
G4double x = log(bg2)/twoln10;
//if (x >= x0den) {
// dedx -= twoln10*x - cden;
// if (x < x1den) dedx -= aden*pow(x1den-x, mden);
//}
G4double x = log(bg2)/twoln10;
dedx -= material->GetIonisation()->DensityCorrection(x);
// now you can compute the total ionization loss
dedx *= twopi_mc2_rcl2*electronDensity/beta2;
if (dedx < 0.0) dedx = 0.0;
if (dedx < 0.0) { dedx = 0.0; }
// lowenergy extrapolation
if (lowEnergy) {
if (kineticEnergy >= lowLimit) dedx *= sqrt(tkin/kineticEnergy);
else dedx *= sqrt(tkin*kineticEnergy)/lowLimit;
if (kineticEnergy < th) {
x = kineticEnergy/th;
if(x > 0.25) { dedx /= sqrt(x); }
else { dedx *= 1.4*sqrt(x)/(0.1 + x); }
}
return dedx;
}
@@ -292,14 +280,22 @@ G4double G4MollerBhabhaModel::ComputeDEDXPerVolume(
void G4MollerBhabhaModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
const G4MaterialCutsCouple*,
const G4DynamicParticle* dp,
G4double tmin,
G4double cutEnergy,
G4double maxEnergy)
{
G4double kineticEnergy = dp->GetKineticEnergy();
G4double tmax = kineticEnergy;
if(isElectron) tmax *= 0.5;
if(maxEnergy < tmax) tmax = maxEnergy;
if(tmin >= tmax) return;
//const G4Material* mat = couple->GetMaterial();
//G4double Zeff = mat->GetElectronDensity()/mat->GetTotNbOfAtomsPerVolume();
// G4double th = 0.25*sqrt(Zeff)*keV;
G4double tmax;
G4double tmin = cutEnergy;
if(isElectron) {
tmax = 0.5*kineticEnergy;
} else {
tmax = kineticEnergy;
}
if(maxEnergy < tmax) { tmax = maxEnergy; }
if(tmin >= tmax) { return; }
G4double energy = kineticEnergy + electron_mass_c2;
G4double totalMomentum = sqrt(kineticEnergy*(energy + electron_mass_c2));
@@ -372,8 +368,9 @@ void G4MollerBhabhaModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp
sqrt(deltaKinEnergy * (deltaKinEnergy + 2.0*electron_mass_c2));
G4double cost = deltaKinEnergy * (energy + electron_mass_c2) /
(deltaMomentum * totalMomentum);
G4double sint = 1.0 - cost*cost;
if(sint > 0.0) sint = sqrt(sint);
G4double sint = (1.0 - cost)*(1. + cost);
if(sint > 0.0) { sint = sqrt(sint); }
else { sint = 0.0; }
G4double phi = twopi * G4UniformRand() ;
@@ -384,11 +381,9 @@ void G4MollerBhabhaModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp
kineticEnergy -= deltaKinEnergy;
fParticleChange->SetProposedKineticEnergy(kineticEnergy);
if(kineticEnergy > DBL_MIN) {
G4ThreeVector dir = totalMomentum*direction - deltaMomentum*deltaDirection;
direction = dir.unit();
fParticleChange->SetProposedMomentumDirection(direction);
}
G4ThreeVector dir = totalMomentum*direction - deltaMomentum*deltaDirection;
direction = dir.unit();
fParticleChange->SetProposedMomentumDirection(direction);
// create G4DynamicParticle object for delta ray
G4DynamicParticle* delta = new G4DynamicParticle(theElectron,
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4NuclearStopping.cc,v 1.2 2009/11/10 19:25:47 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4NuclearStopping.cc,v 1.2 2009-11-10 19:25:47 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -----------------------------------------------------------------------------
//
@@ -54,7 +54,7 @@ G4NuclearStopping::G4NuclearStopping(const G4String& processName)
: G4VEmProcess(processName)
{
isInitialized = false;
SetProcessSubType(fCoulombScattering);
SetProcessSubType(fNuclearStopping);
enableAlongStepDoIt = true;
modelICRU49 = 0;
}
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PAIModel.cc,v 1.55 2010/11/21 10:55:44 grichine Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4PAIModel.cc,v 1.55 2010-11-21 10:55:44 grichine Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -95,6 +95,9 @@ G4PAIModel::G4PAIModel(const G4ParticleDefinition* p, const G4String& nam)
fSandiaIntervalNumber = 0;
fMatIndex = 0;
fDeltaCutInKinEnergy = 0.0;
fParticleChange = 0;
fMaterial = 0;
fCutCouple = 0;
if(p) { SetParticle(p); }
else { SetParticle(fElectron); }
@@ -277,7 +280,7 @@ void G4PAIModel::ComputeSandiaPhotoAbsCof()
void G4PAIModel::BuildPAIonisationTable()
{
G4double LowEdgeEnergy , ionloss ;
G4double tau, Tmax, Tmin, Tkin, deltaLow, gamma, bg2 ;
G4double tau, Tmax, Tmin, Tkin, deltaLow, /*gamma,*/ bg2 ;
fdEdxVector = new G4PhysicsLogVector( fLowestKineticEnergy,
fHighestKineticEnergy,
@@ -291,7 +294,7 @@ void G4PAIModel::BuildPAIonisationTable()
{
LowEdgeEnergy = fParticleEnergyVector->GetLowEdgeEnergy(i) ;
tau = LowEdgeEnergy/fMass ;
gamma = tau +1. ;
//gamma = tau +1. ;
// G4cout<<"gamma = "<<gamma<<endl ;
bg2 = tau*( tau + 2. );
Tmax = MaxSecondaryEnergy(fParticle, LowEdgeEnergy);
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PAIPhotonModel.cc,v 1.25 2010/10/26 09:16:50 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4PAIPhotonModel.cc,v 1.25 2010-10-26 09:16:50 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -105,6 +105,8 @@ G4PAIPhotonModel::G4PAIPhotonModel(const G4ParticleDefinition* p, const G4String
fSandiaIntervalNumber = 0;
fMatIndex = 0;
fParticleChange = 0;
if(p) { SetParticle(p); }
else { SetParticle(fElectron); }
@@ -280,7 +282,7 @@ void
G4PAIPhotonModel::BuildPAIonisationTable()
{
G4double LowEdgeEnergy , ionloss ;
G4double massRatio, tau, Tmax, Tmin, Tkin, deltaLow, gamma, bg2 ;
G4double /*massRatio,*/ tau, Tmax, Tmin, Tkin, deltaLow, /*gamma,*/ bg2 ;
/*
if( fPAItransferTable )
{
@@ -319,10 +321,10 @@ G4PAIPhotonModel::BuildPAIonisationTable()
LowEdgeEnergy = fProtonEnergyVector->GetLowEdgeEnergy(i) ;
tau = LowEdgeEnergy/proton_mass_c2 ;
// if(tau < 0.01) tau = 0.01 ;
gamma = tau +1. ;
//gamma = tau +1. ;
// G4cout<<"gamma = "<<gamma<<endl ;
bg2 = tau*(tau + 2. ) ;
massRatio = electron_mass_c2/proton_mass_c2 ;
//massRatio = electron_mass_c2/proton_mass_c2 ;
Tmax = MaxSecondaryEnergy(fParticle, LowEdgeEnergy);
// G4cout<<"proton Tkin = "<<LowEdgeEnergy/MeV<<" MeV"
// <<" Tmax = "<<Tmax/MeV<<" MeV"<<G4endl;
@@ -25,7 +25,7 @@
//
//
// $Id: G4PAIxSection.cc,v 1.24 2008/05/30 16:04:40 grichine Exp $
// GEANT4 tag $Name: geant4-09-02 $
// GEANT4 tag $Name: geant4-09-03-ref-06 $
//
//
// G4PAIxSection.cc -- class implementation file
@@ -79,8 +79,8 @@ fRefGammaNumber = 29; // The number of gamma for creation of
// Local class constants
const G4double G4PAIxSection::fDelta = 0.005; // energy shift from interval border
const G4double G4PAIxSection::fError = 0.005; // error in lin-log approximation
const G4double G4PAIxSection::fDelta = 0.005; // 0.005 energy shift from interval border
const G4double G4PAIxSection::fError = 0.005; // 0.005 error in lin-log approximation
const G4int G4PAIxSection::fMaxSplineSize = 500; // Max size of output spline
// arrays
@@ -113,6 +113,7 @@ G4PAIxSection::G4PAIxSection(G4MaterialCutsCouple* matCC)
(*(*fMatSandiaMatrix)[i])[j] = fSandia->GetSandiaMatTable(i,j)*fDensity;
}
}
fEnergyInterval = fA1 = fA2 = fA3 = fA4 = 0;
}
////////////////////////////////////////////////////////////////
@@ -120,6 +121,8 @@ G4PAIxSection::G4PAIxSection(G4MaterialCutsCouple* matCC)
G4PAIxSection::G4PAIxSection(G4int materialIndex,
G4double maxEnergyTransfer)
{
fSandia = 0;
fMatSandiaMatrix = 0;
const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
G4int i, j;
@@ -231,6 +234,8 @@ G4PAIxSection::G4PAIxSection( G4int materialIndex,
G4double** photoAbsCof,
G4int intNumber )
{
fSandia = 0;
fMatSandiaMatrix = 0;
const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
G4int i, j;
@@ -343,6 +348,8 @@ G4PAIxSection::G4PAIxSection( G4int materialIndex,
G4double maxEnergyTransfer,
G4double betaGammaSq )
{
fSandia = 0;
fMatSandiaMatrix = 0;
const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
G4int i, j, numberOfElements;
@@ -475,11 +482,12 @@ G4PAIxSection::G4PAIxSection( G4int materialIndex,
IntegralPlasmon();
IntegralResonance();
// delete[] fEnergyInterval;
delete[] fEnergyInterval;
delete[] fA1;
delete[] fA2;
delete[] fA3;
delete[] fA4;
delete[] thisMaterialZ;
}
@@ -497,6 +505,8 @@ G4PAIxSection::~G4PAIxSection()
delete[] fDifPAIxSection ;
delete[] fIntegralPAIxSection ;
*/ ////////////////////////
delete fSandia;
delete fMatSandiaMatrix;
}
/////////////////////////////////////////////////////////////////////////
@@ -898,16 +908,18 @@ G4double G4PAIxSection::RePartDielectricConst(G4double enb)
G4double G4PAIxSection::DifPAIxSection( G4int i ,
G4double betaGammaSq )
{
G4double be2,cof,x1,x2,x3,x4,x5,x6,x7,x8,result;
//G4double beta, be4;
G4double be4;
G4double betaBohr2 = fine_structure_const*fine_structure_const;
G4double betaBohr4 = betaBohr2*betaBohr2*4.0;
be2 = betaGammaSq/(1 + betaGammaSq);
be4 = be2*be2;
// beta = sqrt(be2);
cof = 1;
x1 = log(2*electron_mass_c2/fSplineEnergy[i]);
G4double cof,x1,x2,x3,x4,x5,x6,x7,x8,result;
G4double betaBohr = fine_structure_const;
// G4double betaBohr2 = fine_structure_const*fine_structure_const;
// G4double betaBohr3 = betaBohr*betaBohr2; // *4.0;
G4double be2 = betaGammaSq/(1 + betaGammaSq);
G4double beta = sqrt(be2);
// G4double be3 = beta*be2;
cof = 1.;
x1 = log(2*electron_mass_c2/fSplineEnergy[i]);
if( betaGammaSq < 0.01 ) x2 = log(be2);
else
@@ -918,7 +930,7 @@ G4double G4PAIxSection::DifPAIxSection( G4int i ,
}
if( fImPartDielectricConst[i] == 0.0 ||betaGammaSq < 0.01 )
{
x6=0;
x6 = 0.;
}
else
{
@@ -930,19 +942,33 @@ G4double G4PAIxSection::DifPAIxSection( G4int i ,
x7 = atan2(fImPartDielectricConst[i],x3);
x6 = x5 * x7;
}
// if(fImPartDielectricConst[i] == 0) x6 = 0;
// if(fImPartDielectricConst[i] == 0) x6 = 0.;
x4 = ((x1 + x2)*fImPartDielectricConst[i] + x6)/hbarc;
// if( x4 < 0.0 ) x4 = 0.0;
x8 = (1 + fRePartDielectricConst[i])*(1 + fRePartDielectricConst[i]) +
fImPartDielectricConst[i]*fImPartDielectricConst[i];
result = (x4 + cof*fIntegralTerm[i]/fSplineEnergy[i]/fSplineEnergy[i]);
if(result < 1.0e-8) result = 1.0e-8;
if( result < 1.0e-8 ) result = 1.0e-8;
result *= fine_structure_const/be2/pi;
// result *= (1-exp(-beta/betaBohr))*(1-exp(-beta/betaBohr));
// result *= (1-exp(-be2/betaBohr2));
result *= (1-exp(-be4/betaBohr4));
// low energy correction
G4double lowCof = 4.0 ; // Ar ~ 4.; -> fLowCof as f(Z1,Z2)?
result *= (1 - exp(-beta/betaBohr/lowCof));
// result *= (1 - exp(-be2/betaBohr2/lowCof));
// result *= (1 - exp(-be3/betaBohr3/lowCof)); // ~ be for be<<betaBohr
// result *= (1 - exp(-be4/betaBohr4/lowCof));
if(fDensity >= 0.1)
{
result /= x8;
@@ -1302,8 +1328,8 @@ G4double G4PAIxSection::SumOverInterval( G4int i )
a = log10(yy1/y0)/log10(c);
// b = log10(y0) - a*log10(x0);
b = y0/pow(x0,a);
a += 1;
if(a == 0)
a += 1.;
if( std::fabs(a) < 1.e-6 )
{
result = b*log(x1/x0);
}
@@ -1311,8 +1337,8 @@ G4double G4PAIxSection::SumOverInterval( G4int i )
{
result = y0*(x1*pow(c,a-1) - x0)/a;
}
a++;
if(a == 0)
a += 1.;
if( std::fabs(a) < 1.e-6 )
{
fIntegralPAIxSection[0] += b*log(x1/x0);
}
@@ -1487,7 +1513,7 @@ G4double G4PAIxSection::SumOverInterResonance( G4int i )
G4double G4PAIxSection::SumOverBorder( G4int i ,
G4double en0 )
{
G4double x0,x1,y0,yy1,a,b,c,d,e0,result;
G4double x0,x1,y0,yy1,a,b,/*c,*/d,e0,result;
e0 = en0;
x0 = fSplineEnergy[i];
@@ -1495,14 +1521,14 @@ G4double G4PAIxSection::SumOverBorder( G4int i ,
y0 = fDifPAIxSection[i];
yy1 = fDifPAIxSection[i+1];
c = x1/x0;
//c = x1/x0;
d = e0/x0;
a = log10(yy1/y0)/log10(x1/x0);
// b0 = log10(y0) - a*log10(x0);
b = y0/pow(x0,a); // pow(10.,b);
a += 1;
if(a == 0)
a += 1.;
if( std::fabs(a) < 1.e-6 )
{
result = b*log(x0/e0);
}
@@ -1510,8 +1536,8 @@ G4double G4PAIxSection::SumOverBorder( G4int i ,
{
result = y0*(x0 - e0*pow(d,a-1))/a;
}
a++;
if(a == 0)
a += 1.;
if( std::fabs(a) < 1.e-6 )
{
fIntegralPAIxSection[0] += b*log(x0/e0);
}
@@ -1524,13 +1550,13 @@ G4double G4PAIxSection::SumOverBorder( G4int i ,
y0 = fDifPAIxSection[i - 1];
yy1 = fDifPAIxSection[i - 2];
c = x1/x0;
//c = x1/x0;
d = e0/x0;
a = log10(yy1/y0)/log10(x1/x0);
// b0 = log10(y0) - a*log10(x0);
b = y0/pow(x0,a);
a += 1;
if(a == 0)
a += 1.;
if( std::fabs(a) < 1.e-6 )
{
result += b*log(e0/x0);
}
@@ -1538,8 +1564,8 @@ G4double G4PAIxSection::SumOverBorder( G4int i ,
{
result += y0*(e0*pow(d,a-1) - x0)/a;
}
a++;
if(a == 0)
a += 1.;
if( std::fabs(a) < 1.e-6 )
{
fIntegralPAIxSection[0] += b*log(e0/x0);
}
@@ -1556,7 +1582,7 @@ G4double G4PAIxSection::SumOverBorder( G4int i ,
G4double G4PAIxSection::SumOverBorderdEdx( G4int i ,
G4double en0 )
{
G4double x0,x1,y0,yy1,a,b,c,d,e0,result;
G4double x0,x1,y0,yy1,a,b,/*c,*/d,e0,result;
e0 = en0;
x0 = fSplineEnergy[i];
@@ -1564,7 +1590,7 @@ G4double G4PAIxSection::SumOverBorderdEdx( G4int i ,
y0 = fDifPAIxSection[i];
yy1 = fDifPAIxSection[i+1];
c = x1/x0;
//c = x1/x0;
d = e0/x0;
a = log10(yy1/y0)/log10(x1/x0);
// b0 = log10(y0) - a*log10(x0);
@@ -1584,7 +1610,7 @@ G4double G4PAIxSection::SumOverBorderdEdx( G4int i ,
y0 = fDifPAIxSection[i - 1];
yy1 = fDifPAIxSection[i - 2];
c = x1/x0;
// c = x1/x0;
d = e0/x0;
a = log10(yy1/y0)/log10(x1/x0);
// b0 = log10(y0) - a*log10(x0);
@@ -2130,6 +2156,16 @@ G4double G4PAIxSection::GetRutherfordEnergyTransfer()
return energyTransfer;
}
/////////////////////////////////////////////////////////////////////////////
//
void G4PAIxSection::CallError(G4int i, const G4String& methodName) const
{
G4String head = "G4PAIxSection::" + methodName + "()";
G4ExceptionDescription ed;
ed << "Wrong index " << i << " fSplineNumber= " << fSplineNumber << G4endl;
G4Exception(head,"pai001",FatalException,ed);
}
/////////////////////////////////////////////////////////////////////////////
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PAIySection.cc,v 1.8 2010/11/23 15:31:10 grichine Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4PAIySection.cc,v 1.8 2010-11-23 15:31:10 grichine Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
//
// G4PAIySection.cc -- class implementation file
@@ -72,8 +72,23 @@ const G4int G4PAIySection::fMaxSplineSize = 500; // Max size of output spline
G4PAIySection::G4PAIySection()
{
fSandia = 0;
fDensity = fElectronDensity = fNormalizationCof = 0.0;
fDensity = fElectronDensity = fNormalizationCof = fLowEnergyCof = 0.0;
fIntervalNumber = fSplineNumber = 0;
fVerbose = 0;
for(G4int i=0; i<500; ++i) {
fSplineEnergy[i] = 0.0;
fRePartDielectricConst[i] = 0.0;
fImPartDielectricConst[i] = 0.0;
fIntegralTerm[i] = 0.0;
fDifPAIySection[i] = 0.0;
fdNdxCerenkov[i] = 0.0;
fdNdxPlasmon[i] = 0.0;
fIntegralPAIySection[i] = 0.0;
fIntegralPAIdEdx[i] = 0.0;
fIntegralCerenkov[i] = 0.0;
fIntegralPlasmon[i] = 0.0;
for(G4int j=0; j<112; ++j) { fPAItable[i][j] = 0.0; }
}
}
////////////////////////////////////////////////////////////////////////////
@@ -91,12 +106,12 @@ void G4PAIySection::Initialize( const G4Material* material,
G4double maxEnergyTransfer,
G4double betaGammaSq)
{
G4int i, j, numberOfElements;
G4int i, j;
G4double energy;
// fVerbose = 1;
fDensity = material->GetDensity();
fElectronDensity = material->GetElectronDensity();
numberOfElements = material->GetNumberOfElements();
//G4int numberOfElements = material->GetNumberOfElements();
fSandia = material->GetSandiaTable();
@@ -173,7 +188,8 @@ void G4PAIySection::Initialize( const G4Material* material,
G4double betaGammaSqRef =
fLorentzFactor[fRefGammaNumber]*fLorentzFactor[fRefGammaNumber] - 1;
ComputeLowEnergyCof(material);
NormShift(betaGammaSqRef);
SplainPAI(betaGammaSqRef);
@@ -190,6 +206,42 @@ void G4PAIySection::Initialize( const G4Material* material,
IntegralPlasmon();
}
/////////////////////////////////////////////////////////////////////////
//
// Compute low energy cof. It reduces PAI xsc for Lorentz factors less than 4.
//
void G4PAIySection::ComputeLowEnergyCof(const G4Material* material)
{
G4int i, numberOfElements = material->GetNumberOfElements();
G4double sumZ = 0., sumCof = 0.;
const G4double p0 = 1.20923e+00;
const G4double p1 = 3.53256e-01;
const G4double p2 = -1.45052e-03;
G4double* thisMaterialZ = new G4double[numberOfElements];
G4double* thisMaterialCof = new G4double[numberOfElements];
for( i = 0; i < numberOfElements; i++ )
{
thisMaterialZ[i] = material->GetElement(i)->GetZ();
sumZ += thisMaterialZ[i];
thisMaterialCof[i] = p0+p1*thisMaterialZ[i]+p2*thisMaterialZ[i]*thisMaterialZ[i];
}
for( i = 0; i < numberOfElements; i++ )
{
sumCof += thisMaterialCof[i]*thisMaterialZ[i]/sumZ;
}
fLowEnergyCof = sumCof;
delete [] thisMaterialZ;
delete [] thisMaterialCof;
// G4cout<<"fLowEnergyCof = "<<fLowEnergyCof<<G4endl;
}
/////////////////////////////////////////////////////////////////////////
//
// General control function for class G4PAIySection
@@ -505,14 +557,15 @@ G4double G4PAIySection::RePartDielectricConst(G4double enb)
G4double G4PAIySection::DifPAIySection( G4int i ,
G4double betaGammaSq )
{
G4double be2,cof,x1,x2,x3,x4,x5,x6,x7,x8,result;
G4double beta, be2,cof,x1,x2,x3,x4,x5,x6,x7,x8,result;
//G4double beta, be4;
G4double be4;
G4double betaBohr2 = fine_structure_const*fine_structure_const;
G4double betaBohr4 = betaBohr2*betaBohr2*4.0;
//G4double be4;
G4double betaBohr = fine_structure_const;
// G4double betaBohr2 = fine_structure_const*fine_structure_const;
// G4double betaBohr4 = betaBohr2*betaBohr2*4.0;
be2 = betaGammaSq/(1 + betaGammaSq);
be4 = be2*be2;
// beta = sqrt(be2);
//be4 = be2*be2;
beta = sqrt(be2);
cof = 1;
x1 = log(2*electron_mass_c2/fSplineEnergy[i]);
@@ -547,9 +600,15 @@ G4double G4PAIySection::DifPAIySection( G4int i ,
result = (x4 + cof*fIntegralTerm[i]/fSplineEnergy[i]/fSplineEnergy[i]);
if(result < 1.0e-8) result = 1.0e-8;
result *= fine_structure_const/be2/pi;
// low energy correction
G4double lowCof = fLowEnergyCof; // 6.0 ; // Ar ~ 4.; -> fLowCof as f(Z1,Z2)?
result *= (1 - exp(-beta/betaBohr/lowCof));
// result *= (1-exp(-beta/betaBohr))*(1-exp(-beta/betaBohr));
// result *= (1-exp(-be2/betaBohr2));
result *= (1-exp(-be4/betaBohr4));
// result *= (1-exp(-be4/betaBohr4));
// if(fDensity >= 0.1)
if(x8 > 0.)
{
@@ -566,10 +625,10 @@ G4double G4PAIySection::DifPAIySection( G4int i ,
G4double G4PAIySection::PAIdNdxCerenkov( G4int i ,
G4double betaGammaSq )
{
G4double cof, logarithm, x3, x5, argument, modul2, dNdxC;
G4double logarithm, x3, x5, argument, modul2, dNdxC;
G4double be2, be4, betaBohr2,betaBohr4,cofBetaBohr;
cof = 1.0;
//G4double cof = 1.0;
cofBetaBohr = 4.0;
betaBohr2 = fine_structure_const*fine_structure_const;
betaBohr4 = betaBohr2*betaBohr2*cofBetaBohr;
@@ -860,13 +919,13 @@ G4double G4PAIySection::SumOverInterCerenkov( G4int i )
G4double G4PAIySection::SumOverInterPlasmon( G4int i )
{
G4double x0,x1,y0,yy1,a,c,result;
G4double x0,x1,y0,yy1,a,c,result;
x0 = fSplineEnergy[i];
x1 = fSplineEnergy[i+1];
y0 = fdNdxPlasmon[i];
yy1 = fdNdxPlasmon[i+1];
c =x1/x0;
c = x1/x0;
a = log10(yy1/y0)/log10(c);
G4double b = 0.0;
@@ -892,7 +951,7 @@ G4double G4PAIySection::SumOverInterPlasmon( G4int i )
G4double G4PAIySection::SumOverBorder( G4int i ,
G4double en0 )
{
G4double x0,x1,y0,yy1,a,c,d,e0,result;
G4double x0,x1,y0,yy1,a,/*c,*/d,e0,result;
e0 = en0;
x0 = fSplineEnergy[i];
@@ -900,7 +959,7 @@ G4double G4PAIySection::SumOverBorder( G4int i ,
y0 = fDifPAIySection[i];
yy1 = fDifPAIySection[i+1];
c = x1/x0;
//c = x1/x0;
d = e0/x0;
a = log10(yy1/y0)/log10(x1/x0);
@@ -930,7 +989,7 @@ G4double G4PAIySection::SumOverBorder( G4int i ,
y0 = fDifPAIySection[i - 1];
yy1 = fDifPAIySection[i - 2];
c = x1/x0;
//c = x1/x0;
d = e0/x0;
a = log10(yy1/y0)/log10(x1/x0);
// b0 = log10(y0) - a*log10(x0);
@@ -962,7 +1021,7 @@ G4double G4PAIySection::SumOverBorder( G4int i ,
G4double G4PAIySection::SumOverBorderdEdx( G4int i ,
G4double en0 )
{
G4double x0,x1,y0,yy1,a,c,d,e0,result;
G4double x0,x1,y0,yy1,a,/*c,*/d,e0,result;
e0 = en0;
x0 = fSplineEnergy[i];
@@ -970,7 +1029,7 @@ G4double G4PAIySection::SumOverBorderdEdx( G4int i ,
y0 = fDifPAIySection[i];
yy1 = fDifPAIySection[i+1];
c = x1/x0;
//c = x1/x0;
d = e0/x0;
a = log10(yy1/y0)/log10(x1/x0);
@@ -991,7 +1050,7 @@ G4double G4PAIySection::SumOverBorderdEdx( G4int i ,
y0 = fDifPAIySection[i - 1];
yy1 = fDifPAIySection[i - 2];
c = x1/x0;
//c = x1/x0;
d = e0/x0;
a = log10(yy1/y0)/log10(x1/x0);
@@ -1243,7 +1302,16 @@ G4double G4PAIySection::GetStepPlasmonLoss( G4double step )
return loss;
}
/////////////////////////////////////////////////////////////////////////////
//
void G4PAIySection::CallError(G4int i, const G4String& methodName) const
{
G4String head = "G4PAIySection::" + methodName + "()";
G4ExceptionDescription ed;
ed << "Wrong index " << i << " fSplineNumber= " << fSplineNumber << G4endl;
G4Exception(head,"pai001",FatalException,ed);
}
/////////////////////////////////////////////////////////////////////////////
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PEEffectFluoModel.cc,v 1.4 2010/11/21 16:08:37 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4PEEffectFluoModel.cc,v 1.4 2010-11-21 16:08:37 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -66,6 +66,9 @@ G4PEEffectFluoModel::G4PEEffectFluoModel(const G4String& nam)
theGamma = G4Gamma::Gamma();
theElectron = G4Electron::Electron();
fminimalEnergy = 1.0*eV;
SetDeexcitationFlag(true);
fParticleChange = 0;
fAtomDeexcitation = 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -80,7 +83,7 @@ void G4PEEffectFluoModel::Initialise(const G4ParticleDefinition*,
{
fAtomDeexcitation = G4LossTableManager::Instance()->AtomDeexcitation();
if (isInitialized) return;
if (isInitialized) { return; }
fParticleChange = GetParticleChangeForGamma();
isInitialized = true;
}
@@ -145,14 +148,22 @@ G4PEEffectFluoModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
// Select atomic shell
G4int nShells = anElement->GetNbOfAtomicShells();
G4int i = 0;
while ((i<nShells) && (energy<anElement->GetAtomicShell(i))) { ++i; }
G4int i = 0;
for(; i<nShells; ++i) {
/*
G4cout << "i= " << i << " E(eV)= " << energy/eV
<< " Eb(eV)= " << anElement->GetAtomicShell(i)/eV
<< " " << anElement->GetName()
<< G4endl;
*/
if(energy >= anElement->GetAtomicShell(i)) { break; }
}
// no shell available
if (i == nShells) { return; }
G4double bindingEnergy = anElement->GetAtomicShell(i);
G4double ElecKineEnergy = energy - bindingEnergy;
G4double edep = bindingEnergy;
// create photo electron
//
@@ -167,11 +178,10 @@ G4PEEffectFluoModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
G4DynamicParticle* aParticle = new G4DynamicParticle (
theElectron,ElecDirection, ElecKineEnergy);
fvect->push_back(aParticle);
}
} else { edep = energy; }
// sample deexcitation
//
G4double edep = bindingEnergy;
if(fAtomDeexcitation) {
G4int index = couple->GetIndex();
if(fAtomDeexcitation->CheckDeexcitationActiveRegion(index)) {
@@ -188,6 +198,7 @@ G4PEEffectFluoModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
}
}
}
if(edep < 0.0) { edep = 0.0; }
// kill primary photon
fParticleChange->SetProposedKineticEnergy(0.);
@@ -205,13 +216,13 @@ G4double G4PEEffectFluoModel::ElecCosThetaDistribution(G4double kineEnergy)
//
G4double costeta = 1.;
G4double gamma = 1. + kineEnergy/electron_mass_c2;
if (gamma > 5.) return costeta;
if (gamma > 5.) { return costeta; }
G4double beta = sqrt(gamma*gamma-1.)/gamma;
G4double b = 0.5*gamma*(gamma-1.)*(gamma-2);
G4double rndm,term,greject,grejsup;
if (gamma < 2.) grejsup = gamma*gamma*(1.+b-beta*b);
else grejsup = gamma*gamma*(1.+b+beta*b);
if (gamma < 2.) { grejsup = gamma*gamma*(1.+b-beta*b); }
else { grejsup = gamma*gamma*(1.+b+beta*b); }
do { rndm = 1.-2*G4UniformRand();
costeta = (rndm+beta)/(rndm*beta+1.);
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PEEffectModel.cc,v 1.8 2009/04/09 18:41:18 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4PEEffectModel.cc,v 1.8 2009-04-09 18:41:18 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -68,6 +68,7 @@ G4PEEffectModel::G4PEEffectModel(const G4ParticleDefinition*,
theGamma = G4Gamma::Gamma();
theElectron = G4Electron::Electron();
fminimalEnergy = 1.0*eV;
fParticleChange = 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -83,7 +84,7 @@ void G4PEEffectModel::Initialise(const G4ParticleDefinition*,
// always false before the run
SetDeexcitationFlag(false);
if (isInitialized) return;
if (isInitialized) { return; }
fParticleChange = GetParticleChangeForGamma();
isInitialized = true;
}
@@ -185,13 +186,13 @@ G4double G4PEEffectModel::ElecCosThetaDistribution(G4double kineEnergy)
//
G4double costeta = 1.;
G4double gamma = 1. + kineEnergy/electron_mass_c2;
if (gamma > 5.) return costeta;
if (gamma > 5.) { return costeta; }
G4double beta = sqrt(gamma*gamma-1.)/gamma;
G4double b = 0.5*gamma*(gamma-1.)*(gamma-2);
G4double rndm,term,greject,grejsup;
if (gamma < 2.) grejsup = gamma*gamma*(1.+b-beta*b);
else grejsup = gamma*gamma*(1.+b+beta*b);
if (gamma < 2.) { grejsup = gamma*gamma*(1.+b-beta*b); }
else { grejsup = gamma*gamma*(1.+b+beta*b); }
do { rndm = 1.-2*G4UniformRand();
costeta = (rndm+beta)/(rndm*beta+1.);
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PSTARStopping.cc,v 1.14 2010/04/26 17:40:34 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04-beta-01 $
// $Id: G4PSTARStopping.cc,v 1.14 2010-04-26 17:40:34 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//---------------------------------------------------------------------------
//
@@ -75,7 +75,7 @@ G4PSTARStopping::~G4PSTARStopping()
G4int G4PSTARStopping:: GetIndex (const G4Material* mat)
{
if (mat == currentMaterial) return matIndex;
if (mat == currentMaterial) { return matIndex; }
G4String matName = mat->GetName();
for (G4int i=0; i<74; ++i){
if (matName == name[i]){
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PairProductionRelModel.cc,v 1.4 2010/10/26 09:06:04 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4PairProductionRelModel.cc,v 1.4 2010-10-26 09:06:04 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
@@ -45,7 +45,8 @@
// J.W.Motz et.al., Rev. Mod. Phys. 41 (1969) 581.
// S.Klein, Rev. Mod. Phys. 71 (1999) 1501.
// T.Stanev et.al., Phys. Rev. D25 (1982) 1291.
// M.L.Ter-Mikaelian, High-energy Electromagnetic Processes in Condensed Media, Wiley, 1972.
// M.L.Ter-Mikaelian, High-energy Electromagnetic Processes in Condensed Media,
// Wiley, 1972.
//
// -------------------------------------------------------------------
//
@@ -73,11 +74,11 @@ const G4double G4PairProductionRelModel::preS1 = 1./(184.15*184.15);
const G4double G4PairProductionRelModel::logTwo = log(2.);
const G4double G4PairProductionRelModel::xgi[]={ 0.0199, 0.1017, 0.2372, 0.4083,
0.5917, 0.7628, 0.8983, 0.9801 };
0.5917, 0.7628, 0.8983, 0.9801 };
const G4double G4PairProductionRelModel::wgi[]={ 0.0506, 0.1112, 0.1569, 0.1813,
0.1813, 0.1569, 0.1112, 0.0506 };
const G4double G4PairProductionRelModel::Fel_light[] = {0., 5.31 , 4.79 , 4.74 , 4.71} ;
const G4double G4PairProductionRelModel::Finel_light[] = {0., 6.144 , 5.621 , 5.805 , 5.924} ;
0.1813, 0.1569, 0.1112, 0.0506 };
const G4double G4PairProductionRelModel::Fel_light[] = {0., 5.31 , 4.79 , 4.74 , 4.71};
const G4double G4PairProductionRelModel::Finel_light[] = {0., 6.144 , 5.621 , 5.805 , 5.924};
@@ -331,7 +332,7 @@ G4PairProductionRelModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fve
G4double epsil ;
G4double epsil0 = electron_mass_c2/GammaEnergy ;
if(epsil0 > 1.0) return;
if(epsil0 > 1.0) { return; }
// do it fast if GammaEnergy < 2. MeV
static const G4double Egsmall=2.*MeV;
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PhotoElectricEffect.cc,v 1.42 2009/02/20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4PhotoElectricEffect.cc,v 1.42 2009-02-20 12:06:37 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
//
//------------------ G4PhotoElectricEffect physics process ---------------------
@@ -69,7 +69,7 @@
// -----------------------------------------------------------------------------
#include "G4PhotoElectricEffect.hh"
#include "G4PEEffectModel.hh"
#include "G4PEEffectFluoModel.hh"
#include "G4Electron.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -80,6 +80,8 @@ G4PhotoElectricEffect::G4PhotoElectricEffect(const G4String& processName,
G4ProcessType type):G4VEmProcess (processName, type),
isInitialised(false)
{
SetBuildTableFlag(false);
SetSecondaryParticle(G4Electron::Electron());
SetProcessSubType(fPhotoElectricEffect);
}
@@ -101,9 +103,7 @@ void G4PhotoElectricEffect::InitialiseProcess(const G4ParticleDefinition*)
{
if(!isInitialised) {
isInitialised = true;
SetBuildTableFlag(false);
SetSecondaryParticle(G4Electron::Electron());
if(!Model()) SetModel(new G4PEEffectModel());
if(!Model()) { SetModel(new G4PEEffectFluoModel()); }
Model()->SetLowEnergyLimit(MinKinEnergy());
Model()->SetHighEnergyLimit(MaxKinEnergy());
AddEmModel(1, Model());
@@ -0,0 +1,439 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// G4ScreeningMottCrossSection.cc
//-------------------------------------------------------------------
//
// GEANT4 Class header file
//
// File name: G4ScreeningMottCrossSection
//
// Author: Cristina Consolandi
//
// Creation date: 20.10.2011
//
// Class Description:
// Computation of electron Coulomb Scattering Cross Section.
// Suitable for high energy electrons and light target materials.
//
// 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).
//
//
// 1) Mott Differential Cross Section Approximation:
// W. A. McKinley and H. Fashbach, Phys. Rev. 74, (1948) 1759.
// 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.
//
// -------------------------------------------------------------------------------------
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "G4ScreeningMottCrossSection.hh"
#include "Randomize.hh"
#include "G4Proton.hh"
#include "G4LossTableManager.hh"
#include "G4NucleiProperties.hh"
#include "G4Element.hh"
#include "G4UnitsTable.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
using namespace std;
G4ScreeningMottCrossSection::G4ScreeningMottCrossSection():
cosThetaMin(1.0),
cosThetaMax(-1.0),
alpha(fine_structure_const),
htc2(hbarc_squared),
e2(electron_mass_c2*classic_electr_radius)
{
TotalCross=0;
fNistManager = G4NistManager::Instance();
particle=0;
spin = mass = mu_rel=0;
tkinLab = momLab2 = invbetaLab2=0;
tkin = mom2 = invbeta2=beta=gamma=0;
Trec=targetZ = targetMass = As =0;
etag = ecut = 0.0;
targetA = 0;
cosTetMinNuc=0;
cosTetMaxNuc=0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4ScreeningMottCrossSection::~G4ScreeningMottCrossSection()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4ScreeningMottCrossSection::Initialise(const G4ParticleDefinition* p,
G4double CosThetaLim)
{
SetupParticle(p);
tkin = targetZ = mom2 = DBL_MIN;
ecut = etag = DBL_MAX;
particle = p;
cosThetaMin = CosThetaLim;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4ScreeningMottCrossSection::SetScreeningCoefficient(){
G4double alpha2=alpha*alpha;
//Bohr radius
G4double a0= Bohr_radius ;//0.529e-8*cm;
//Thomas-Fermi screening length
G4double aU=0.88534*a0/pow(targetZ,1./3.);
G4double twoR2=aU*aU;
G4double factor= 1.13 + 3.76*targetZ*targetZ*invbeta2*alpha2;
As=(htc2)/(twoR2*mom2)*factor;
As/=4.;
//cout<<"0k .........................As "<<As<<endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4ScreeningMottCrossSection::GetScreeningAngle(){
SetScreeningCoefficient();
//cout<<" As "<<As<<endl;
G4double screenangle=2.*sqrt(As);
// cout<<" screenangle "<< screenangle <<endl;
if(screenangle>=pi) screenangle=pi;
return screenangle;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4ScreeningMottCrossSection::SetupKinematic(G4double ekin, G4double Z )
{
//...Target
G4int iz = G4int(Z);
G4double A = fNistManager->GetAtomicMassAmu(iz);
G4int ia = G4int(A);
G4double m2 = G4NucleiProperties::GetNuclearMass(ia, iz);
targetZ = Z;
targetA = fNistManager->GetAtomicMassAmu(iz);
targetMass= m2;
//cout<<"......... targetA "<< targetA <<endl;
//cout<<"......... targetMass "<< targetMass/MeV <<endl;
// incident particle lab
tkinLab = ekin;
momLab2 = tkinLab*(tkinLab + 2.0*mass);
invbetaLab2 = 1.0 + mass*mass/momLab2;
G4double etot = tkinLab + mass;
G4double ptot = sqrt(momLab2);
G4double m12 = mass*mass;
// relativistic reduced mass from publucation
// A.P. Martynenko, R.N. Faustov, Teoret. mat. Fiz. 64 (1985) 179
//incident particle & target nucleus
G4double Ecm=sqrt(m12 + m2*m2 + 2.0*etot*m2);
mu_rel=mass*m2/Ecm;
G4double momCM= ptot*m2/Ecm;
// relative system
mom2 = momCM*momCM;
invbeta2 = 1.0 + mu_rel*mu_rel/mom2;
tkin = momCM*sqrt(invbeta2) - mu_rel;//Ekin of mu_rel
G4double beta2=1./invbeta2;
beta=std::sqrt(beta2) ;
G4double gamma2= 1./(1.-beta2);
gamma=std::sqrt(gamma2);
//.........................................................
G4double screenangle=GetScreeningAngle();
//cout<<" screenangle [rad] "<<screenangle/rad <<endl;
cosTetMinNuc =min(cosThetaMin ,std::cos(screenangle)) ;
cosTetMaxNuc = cosThetaMax;
//cout<<"ok..............mu_rel "<<mu_rel<<endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4ScreeningMottCrossSection::FormFactor2ExpHof(G4double angle){
G4double M=targetMass;
G4double E=tkinLab;
G4double Etot=E+mass;
G4double Tmax=2.*M*E*(E+2.*mass)/(mass*mass+M*M+2.*M*Etot);
G4double T=Tmax*pow(sin(angle/2.),2.);
G4double q2=T*(T+2.*M);
q2/=htc2;//1/cm2
G4double RN=1.27e-13*pow(targetA,0.27)*cm;
G4double xN= (RN*RN*q2);
G4double den=(1.+xN/12.);
G4double FN=1./(den*den);
G4double form2=(FN*FN);
return form2;
//cout<<"..................... form2 "<< form2<<endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4ScreeningMottCrossSection::McFcorrection(G4double angle ){
G4double beta2=1./invbeta2;
G4double sintmezzi=std::sin(angle/2.);
G4double sin2tmezzi = sintmezzi*sintmezzi;
G4double R=1.-beta2*sin2tmezzi + targetZ*alpha*beta*pi*sintmezzi*(1.-sintmezzi);
return R;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4ScreeningMottCrossSection::NuclearCrossSection()
{
if(cosTetMaxNuc >= cosTetMinNuc) return 0.0;
TotalCross=0;
G4double anglemin =std::acos(cosTetMinNuc);
G4double anglemax =std::acos(cosTetMaxNuc);
//cout<<" anglemin "<< anglemin <<endl;
G4double loganglemin=log10(anglemin);
G4double loganglemax=log10(anglemax);
G4double logdangle=0.01;
G4int bins=(G4int)((loganglemax-loganglemin)/logdangle);
vector<G4double> angle;
vector<G4double> tet;
vector<G4double> dangle;
vector<G4double> cross;
for(G4int i=0; i<bins; i++ ){
tet.push_back(0);
dangle.push_back(0);
angle.push_back(pow(10.,loganglemin+logdangle*i));
cross.push_back(0);
}
G4int dim = tet.size();
//cout<<"dim--- "<<dim<<endl;
for(G4int i=0; i<dim;i++){
if(i!=dim-1){
dangle[i]=(angle[i+1]-angle[i]);
tet[i]=(angle[i+1]+angle[i])/2.;
}else if(i==dim-1){
break;
}
G4double R=McFcorrection(tet[i]);
G4double F2=FormFactor2ExpHof(tet[i]);
//cout<<"----------------- R "<<R<<" F2 "<<F2<<endl;
// cout<<"angle "<<tet[i] << " F2 "<<F2<<endl;
G4double e4=e2*e2;
G4double den=2.*As+1.-std::cos(angle[i]);
G4double func=1./(den*den);
G4double fatt= targetZ/(mu_rel*gamma*beta*beta);
G4double sigma=e4*fatt*fatt*func;
cross[i]=F2*R*sigma;
G4double pi2sintet=2.*pi*sin(tet[i]);
TotalCross+=pi2sintet*cross[i]*dangle[i];
}//end integral
//cout<< "ok ......... TotalCross "<<TotalCross<<endl;
return TotalCross;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4ScreeningMottCrossSection::AngleDistribution(G4double anglein){
G4double total=TotalCross ;
G4double fatt= e2*targetZ/(mu_rel*gamma*beta*beta);
G4double fatt2=fatt*fatt;
total/=fatt2;
G4double y=2.*pi*sin(anglein)*McFcorrection(anglein)*FormFactor2ExpHof(anglein)/
((2*As+1-cos(anglein))*(2.*As+1-cos(anglein)));
return y/total;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4ScreeningMottCrossSection::GetScatteringAngle()
{
//cout<<" G4ScreeningMottCrossSection::SampleCosineTheta ............."<<endl;
if(cosTetMaxNuc >= cosTetMinNuc) return 0.0;
G4double anglemin= std::acos(cosTetMinNuc);
G4double anglemax= std::acos(cosTetMaxNuc);;
// cout<<"................ tkinLab "<< G4BestUnit(tkinLab,"Energy") << " anglemin= "<<anglemin<<endl;
//cout<<"anglemax= "<<anglemax<<endl;
G4double r =G4UniformRand();
G4double loganglemin=log10(anglemin);
G4double loganglemax=log10(anglemax);
G4double logdangle=0.01;
G4int bins=(G4int)((loganglemax-loganglemin)/logdangle);
std::vector<G4double> angle;
std::vector<G4double> tet;
std::vector<G4double> dangle;
for(G4int i=0; i<bins; i++ ){
tet.push_back(0);
dangle.push_back(0);
angle.push_back(pow(10.,loganglemin+logdangle*i));
}
G4int dim = tet.size();
G4double scattangle=0;
G4double y=0;
G4double dy=0;
G4double area=0;
for(G4int i=0; i<dim;i++){
if(i!=dim-1){
dangle[i]=(angle[i+1]-angle[i]);
tet[i]=(angle[i+1]+angle[i])/2.;
}else if(i==dim-1){
break;
}
y+=AngleDistribution(tet[i])*dangle[i];
dy= y-area ;
area=y;
if(r >=y-dy && r<=y+dy ){
scattangle= angle[i] +G4UniformRand()*dangle[i];
//cout<<"y "<<y <<" r "<< r << " y/r "<<y/r << endl;
break;
}
}
return scattangle;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4ThreeVector G4ScreeningMottCrossSection::GetNewDirection(){
G4ThreeVector dir(0.0,0.0,1.0);
G4double z1=GetScatteringAngle();
G4double cost = cos(z1);
G4double sint = sin(z1);
G4double phi = twopi* G4UniformRand();
G4double dirx = sint*cos(phi);
G4double diry = sint*sin(phi);
G4double dirz = cost;
//.......set Trc
G4double etot=tkinLab+mass;
G4double m2=targetMass;
Trec=(1.0 - cost)* m2*(etot*etot - mass*mass )/
(mass*mass + m2*m2+ 2.*m2*etot);
dir.set(dirx,diry,dirz);
return dir;
}
@@ -0,0 +1,316 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: G4SeltzerBergerModel.cc,v 1.18 2010-11-04 17:30:32 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// -------------------------------------------------------------------
//
// GEANT4 Class file
//
//
// File name: G4SeltzerBergerModel
//
// Author: Andreas Schaelicke
//
// Creation date: 12.08.2008
//
// Modifications:
//
// 13.11.08 add SetLPMflag and SetLPMconstant methods
// 13.11.08 change default LPMconstant value
// 13.10.10 add angular distributon interface (VI)
//
// Main References:
// Y.-S.Tsai, Rev. Mod. Phys. 46 (1974) 815; Rev. Mod. Phys. 49 (1977) 421.
// S.Klein, Rev. Mod. Phys. 71 (1999) 1501.
// T.Stanev et.al., Phys. Rev. D25 (1982) 1291.
// M.L.Ter-Mikaelian, High-energy Electromagnetic Processes in Condensed Media, Wiley, 1972.
//
// -------------------------------------------------------------------
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "G4SeltzerBergerModel.hh"
#include "G4Electron.hh"
#include "G4Positron.hh"
#include "G4Gamma.hh"
#include "Randomize.hh"
#include "G4Material.hh"
#include "G4Element.hh"
#include "G4ElementVector.hh"
#include "G4ProductionCutsTable.hh"
#include "G4ParticleChangeForLoss.hh"
#include "G4LossTableManager.hh"
#include "G4ModifiedTsai.hh"
#include "G4Physics2DVector.hh"
#include "G4ios.hh"
#include <fstream>
#include <iomanip>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
using namespace std;
G4SeltzerBergerModel::G4SeltzerBergerModel(const G4ParticleDefinition* p,
const G4String& name)
: G4eBremsstrahlungRelModel(p,name)
{
SetLowEnergyLimit(0.0);
SetLPMFlag(false);
dataSB.resize(101,0);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4SeltzerBergerModel::~G4SeltzerBergerModel()
{
for(size_t i=0; i<101; ++i) { delete dataSB[i]; }
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4SeltzerBergerModel::Initialise(const G4ParticleDefinition* p,
const G4DataVector& cuts)
{
// check environment variable
// Build the complete string identifying the file with the data set
char* path = getenv("G4LEDATA");
// Access to elements
const G4ElementTable* theElmTable = G4Element::GetElementTable();
size_t numOfElm = G4Element::GetNumberOfElements();
if(numOfElm > 0) {
for(size_t i=0; i<numOfElm; ++i) {
G4int Z = G4int(((*theElmTable)[i])->GetZ());
if(Z < 1) { Z = 1; }
else if(Z > 100) { Z = 100; }
//G4cout << "Z= " << Z << G4endl;
// Initialisation
if(!dataSB[Z]) { ReadData(Z, path); }
}
}
G4eBremsstrahlungRelModel::Initialise(p, cuts);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4SeltzerBergerModel::ReadData(size_t Z, const char* path)
{
// G4cout << "ReadData Z= " << Z << G4endl;
// G4cout << "Status for Z= " << dataSB[Z] << G4endl;
//if(path) { G4cout << path << G4endl; }
if(dataSB[Z]) { return; }
const char* datadir = path;
if(!datadir) {
datadir = getenv("G4LEDATA");
if(!datadir) {
G4Exception("G4SeltzerBergerModel::ReadData()","em0006",FatalException,
"Environment variable G4LEDATA not defined");
return;
}
}
std::ostringstream ost;
ost << datadir << "/brem_SB/br" << Z;
std::ifstream fin(ost.str().c_str());
if( !fin.is_open()) {
G4ExceptionDescription ed;
ed << "Bremsstrahlung data file <" << ost.str().c_str()
<< "> is not opened!" << G4endl;
G4Exception("G4SeltzerBergerModel::ReadData()","em0003",FatalException,
ed,"G4LEDATA version should be G4EMLOW6.23 or later.");
return;
}
//G4cout << "G4SeltzerBergerModel read from <" << ost.str().c_str()
// << ">" << G4endl;
G4Physics2DVector* v = new G4Physics2DVector();
if(v->Retrieve(fin)) { dataSB[Z] = v; }
else {
G4ExceptionDescription ed;
ed << "Bremsstrahlung data file <" << ost.str().c_str()
<< "> is not retrieved!" << G4endl;
G4Exception("G4SeltzerBergerModel::ReadData()","em0005",FatalException,
ed,"G4LEDATA version should be G4EMLOW6.23 or later.");
delete v;
}
// G4cout << dataSB[Z] << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4SeltzerBergerModel::ComputeDXSectionPerAtom(G4double gammaEnergy)
{
if(gammaEnergy < 0.0 || kinEnergy <= 0.0) { return 0.0; }
G4double x = gammaEnergy/kinEnergy;
G4double y = log(kinEnergy/MeV);
G4int Z = G4int(currentZ);
//G4cout << "G4SeltzerBergerModel::ComputeDXSectionPerAtom Z= " << Z
// << " x= " << x << " y= " << y << " " << dataSB[Z] << G4endl;
if(!dataSB[Z]) { ReadData(Z); }
G4double invb2 = totalEnergy*totalEnergy/(kinEnergy*(kinEnergy + 2*particleMass));
G4double cross = dataSB[Z]->Value(x,y)*invb2*millibarn/bremFactor;
if(!isElectron) {
if(1 - x < 1.e-20) { cross = 0.0; }
else {
G4double invbeta1 = sqrt(invb2);
G4double e2 = kinEnergy - gammaEnergy;
G4double invbeta2 = (e2 + particleMass)/sqrt(e2*(e2 + 2*particleMass));
cross *= exp(twopi*fine_structure_const*currentZ*(invbeta1 - invbeta2));
}
}
return cross;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void
G4SeltzerBergerModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
const G4MaterialCutsCouple* couple,
const G4DynamicParticle* dp,
G4double cutEnergy,
G4double maxEnergy)
{
G4double kineticEnergy = dp->GetKineticEnergy();
G4double cut = std::min(cutEnergy, kineticEnergy);
G4double emax = std::min(maxEnergy, kineticEnergy);
if(cut >= emax) { return; }
SetupForMaterial(particle, couple->GetMaterial(), kineticEnergy);
const G4Element* elm =
SelectRandomAtom(couple,particle,kineticEnergy,cut,emax);
SetCurrentElement(elm->GetZ());
G4int Z = G4int(currentZ);
totalEnergy = kineticEnergy + particleMass;
densityCorr = densityFactor*totalEnergy*totalEnergy;
G4double totMomentum = sqrt(kineticEnergy*(totalEnergy + electron_mass_c2));
G4ThreeVector direction = dp->GetMomentumDirection();
/*
G4cout << "G4SeltzerBergerModel::SampleSecondaries E(MeV)= "
<< kineticEnergy/MeV
<< " Z= " << Z << " cut(MeV)= " << cut/MeV
<< " emax(MeV)= " << emax/MeV << " corr= " << densityCorr << G4endl;
*/
G4double xmin = log(cut*cut + densityCorr);
G4double xmax = log(emax*emax + densityCorr);
G4double y = log(kineticEnergy/MeV);
G4double gammaEnergy, v;
// majoranta
G4double vmax = dataSB[Z]->Value(cut/kineticEnergy, y);
if(isElectron && Z > 12 && kineticEnergy < 100*keV) {
if((Z < 41 && kineticEnergy < 10*keV) ||
(Z >= 41 && Z < 61 && kineticEnergy < 50*keV) ||
(Z >= 61) )
{
v = 1.05*dataSB[Z]->Value(emax/kineticEnergy, y);
if(v > vmax) { vmax = v; }
}
}
//G4cout<<"y= "<<y<<" xmin= "<<xmin<<" xmax= "<<xmax<<" vmax= "<<vmax<<G4endl;
do {
G4double x = exp(xmin + G4UniformRand()*(xmax - xmin)) - densityCorr;
if(x < 0.0) { x = 0.0; }
gammaEnergy = sqrt(x);
G4double x1 = gammaEnergy/kineticEnergy;
v = dataSB[Z]->Value(x1, y);
if(!isElectron) {
if(1 - x1 < 1.e-20) { v = 0.0; }
else {
G4double e1 = kineticEnergy - cut;
G4double invbeta1 = (e1 + particleMass)/sqrt(e1*(e1 + 2*particleMass));
G4double e2 = kineticEnergy - gammaEnergy;
G4double invbeta2 = (e2 + particleMass)/sqrt(e2*(e2 + 2*particleMass));
v *= exp(twopi*fine_structure_const*currentZ*(invbeta1 - invbeta2));
}
}
if ( v > 1.5*vmax ) {
G4cout << "### G4SeltzerBergerModel Warning: Majoranta exceeded! "
<< v << " > " << vmax
<< " Egamma(MeV)= " << gammaEnergy
<< " Ee(MeV)= " << kineticEnergy
<< " Z= " << Z << " " << particle->GetParticleName()
<< G4endl;
}
} while (v < vmax*G4UniformRand());
//
// angles of the emitted gamma. ( Z - axis along the parent particle)
// use general interface
//
G4double theta =
GetAngularDistribution()->PolarAngle(totalEnergy,totalEnergy-gammaEnergy,Z);
G4double sint = sin(theta);
G4double phi = twopi * G4UniformRand();
G4ThreeVector gammaDirection(sint*cos(phi),sint*sin(phi), cos(theta));
gammaDirection.rotateUz(direction);
// create G4DynamicParticle object for the Gamma
G4DynamicParticle* g =
new G4DynamicParticle(theGamma,gammaDirection,gammaEnergy);
vdp->push_back(g);
G4ThreeVector dir = totMomentum*direction - gammaEnergy*gammaDirection;
direction = dir.unit();
// energy of primary
G4double finalE = kineticEnergy - gammaEnergy;
// stop tracking and create new secondary instead of primary
if(gammaEnergy > SecondaryThreshold()) {
fParticleChange->ProposeTrackStatus(fStopAndKill);
fParticleChange->SetProposedKineticEnergy(0.0);
G4DynamicParticle* el =
new G4DynamicParticle(const_cast<G4ParticleDefinition*>(particle),
direction, finalE);
vdp->push_back(el);
// continue tracking
} else {
fParticleChange->SetProposedMomentumDirection(direction);
fParticleChange->SetProposedKineticEnergy(finalE);
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

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