Import Geant4 3.1.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.14 2000/11/17 15:03:16 maire Exp $
|
||||
$Id: History,v 1.21 2001/03/27 15:10:51 maire Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -16,6 +16,37 @@ committal in the CVS repository !
|
||||
----------------------------------------------------------
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
27 mar 01 mma (stand-V03-00-05)
|
||||
- commented out the printing of subcutoff energies at initialization
|
||||
|
||||
05 mar 01 mma (stand-V03-00-04)
|
||||
- new subdirectory: integral
|
||||
migration of all G4I.. processes from muons, standard, utils into integral
|
||||
|
||||
22 feb 01: mma (stand-V03-00-03)
|
||||
- G4PhotoElectricEffect. DoIt: removed protection against low energy gamma,
|
||||
after correction in SandiaTable (materials-V03-00-05)
|
||||
- G4EplusAnnihilation. PostStepDoIt: check with fStopButAlive instead of
|
||||
energy == 0.
|
||||
|
||||
05 feb 01: G.Cosmo (stand-V03-00-02)
|
||||
- Migration to STL for G4DataVector and G4OrderedTable.
|
||||
Modified files: G4SynchrotronRadiation.hh, G4IeBremsstrahlung.cc,
|
||||
G4eBremsstrahlung.cc.
|
||||
|
||||
23 jan 01: mma (stand-V03-00-01)
|
||||
- corrections in e/hEnergyLoss.cc: AlongStepDoIt L.Urban 23-01-01
|
||||
PostStep information is not used any more in AlongStepDoIt
|
||||
when generating sub-cutoff delta rays. (bug found by Babar)
|
||||
|
||||
16 jan 01: mma (stand-V03-00-00)
|
||||
- small corrections in e/hEnergyLoss.cc L.Urban 11-01-01
|
||||
to ensure consistency between cut in range and step limitation
|
||||
due to energy loss (finalRange data member <-> cut in range)
|
||||
- change in energy loss computation in eBrems.hh and .cc L.Urban 11-01-01
|
||||
parametrization of energy loss due to soft brems has been corrected,
|
||||
it was too big for big cut values.
|
||||
|
||||
17 Nov 00 mma : stand-V02-00-04
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4ComptonScattering.hh,v 1.4 1999/12/17 16:20:49 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
// ------------ G4ComptonScattering physics process ------
|
||||
// by Michel Maire, April 1996
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4ComptonScattering.icc,v 1.2 1999/12/15 14:51:45 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4GammaConversion.hh,v 1.4 1999/12/17 18:26:11 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
// ------------ G4GammaConversion physics process ------
|
||||
// by Michel Maire, 24 May 1996
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4GammaConversion.icc,v 1.2 1999/12/15 14:51:45 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
@@ -1,180 +0,0 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4IeBremsstrahlung.hh,v 1.4 2000/04/25 14:33:00 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// $Id:
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
// CERN Geneva Switzerland
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ------------ G4IeBremsstrahlung physics process ------
|
||||
// by Michel Maire, 24 July 1996
|
||||
// ************************************************************
|
||||
// 1-10-96 : new type G4OrderedTable; ComputePartialSumSigma()
|
||||
// 20/03/97: new energy loss+ionisation+brems scheme, L.Urban
|
||||
// ------------------------------------------------------------
|
||||
// ************************************************************
|
||||
// It is the first implementation of the BREMSSTRAHLUNG
|
||||
// PROCESS. ( photons + continuous energy loss)
|
||||
// using an INTEGRAL APPROACH instead of the differential
|
||||
// one used in the standard implementation .
|
||||
// ************************************************************
|
||||
// by Laszlo Urban, 23 June 1998
|
||||
// ------------------------------------------------------------
|
||||
// 28/10/98: small changes, cleanup L.Urban
|
||||
|
||||
#ifndef G4IeBremsstrahlung_h
|
||||
#define G4IeBremsstrahlung_h 1
|
||||
|
||||
#include "G4ios.hh"
|
||||
#include "globals.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4VIeEnergyLoss.hh"
|
||||
#include "G4EnergyLossTables.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4Gamma.hh"
|
||||
#include "G4Electron.hh"
|
||||
#include "G4Positron.hh"
|
||||
#include "G4OrderedTable.hh"
|
||||
#include "G4PhysicsTable.hh"
|
||||
#include "G4PhysicsLogVector.hh"
|
||||
|
||||
class G4IeBremsstrahlung : public G4VIeEnergyLoss
|
||||
|
||||
{
|
||||
public:
|
||||
|
||||
G4IeBremsstrahlung(const G4String& processName = "IeBrems");
|
||||
|
||||
~G4IeBremsstrahlung();
|
||||
|
||||
G4bool IsApplicable(const G4ParticleDefinition&);
|
||||
|
||||
void SetPhysicsTableBining(G4double lowE, G4double highE, G4int nBins);
|
||||
|
||||
void PrintInfoDefinition();
|
||||
|
||||
void BuildPhysicsTable(const G4ParticleDefinition& ParticleType);
|
||||
|
||||
void BuildLossTable(const G4ParticleDefinition& ParticleType);
|
||||
|
||||
void BuildLambdaTable(const G4ParticleDefinition& ParticleType);
|
||||
|
||||
G4double GetMeanFreePath(const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition );
|
||||
|
||||
G4VParticleChange *PostStepDoIt(const G4Track& track,
|
||||
const G4Step& step);
|
||||
|
||||
|
||||
G4double PostStepGetPhysicalInteractionLength( const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition);
|
||||
G4double GetNlambda(
|
||||
G4double KineticEnergy,G4Material* material);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
inline G4double ComputeMeanFreePath(
|
||||
const G4ParticleDefinition* ParticleType,
|
||||
G4double KineticEnergy,
|
||||
const G4Material* aMaterial);
|
||||
|
||||
void ComputePartialSumSigma( const G4ParticleDefinition* ParticleType,
|
||||
G4double KineticEnergy,
|
||||
const G4Material* aMaterial);
|
||||
|
||||
virtual G4double ComputeMicroscopicCrossSection(
|
||||
const G4ParticleDefinition* ParticleType,
|
||||
G4double KineticEnergy,
|
||||
G4double AtomicNumber,
|
||||
G4double GammaEnergyCut);
|
||||
|
||||
private:
|
||||
|
||||
G4IeBremsstrahlung & operator=(const G4IeBremsstrahlung &right);
|
||||
G4IeBremsstrahlung(const G4IeBremsstrahlung&);
|
||||
|
||||
G4double ComputeBremLoss(G4double Z,G4double natom,G4double T,
|
||||
G4double Cut,G4double x);
|
||||
|
||||
G4double ComputeXYPolynomial(G4double x,G4double y,G4int xSize,
|
||||
G4int ySize,const G4double coeff[]);
|
||||
|
||||
G4double ComputePositronCorrFactorLoss( G4double AtomicNumber,
|
||||
G4double KineticEnergy, G4double GammaEnergyCut);
|
||||
|
||||
G4double ComputePositronCorrFactorSigma( G4double AtomicNumber,
|
||||
G4double KineticEnergy, G4double GammaEnergyCut);
|
||||
|
||||
G4Element* SelectRandomAtom(G4Material* aMaterial) const;
|
||||
|
||||
G4double ScreenFunction1(G4double ScreenVariable);
|
||||
|
||||
G4double ScreenFunction2(G4double ScreenVariable);
|
||||
|
||||
void BuildNlambdaTable(const G4ParticleDefinition& aParticleType) ;
|
||||
void BuildNlambdaVector(const G4ParticleDefinition& aParticleType,
|
||||
G4int materialIndex,
|
||||
G4PhysicsLogVector* nlambdaVector) ;
|
||||
void BuildInverseNlambdaTable(
|
||||
const G4ParticleDefinition& aParticleType) ;
|
||||
void InvertNlambdaVector(const G4ParticleDefinition& aParticleType,
|
||||
G4int materialIndex,
|
||||
G4PhysicsLogVector* nlambdaVector) ;
|
||||
|
||||
void BuildCoeffATable(const G4ParticleDefinition& aParticleType) ;
|
||||
void BuildCoeffBTable(const G4ParticleDefinition& aParticleType) ;
|
||||
void BuildCoeffCTable(const G4ParticleDefinition& aParticleType) ;
|
||||
|
||||
void TestOfInversion(const G4ParticleDefinition& aParticleType,
|
||||
G4int printflag) ;
|
||||
|
||||
private:
|
||||
|
||||
G4PhysicsTable* theMeanFreePathTable ;
|
||||
|
||||
G4PhysicsTable* theNlambdaTable;
|
||||
G4PhysicsTable* theInverseNlambdaTable;
|
||||
|
||||
G4PhysicsTable* theCoeffATable;
|
||||
G4PhysicsTable* theCoeffBTable;
|
||||
G4PhysicsTable* theCoeffCTable;
|
||||
|
||||
G4OrderedTable PartialSumSigma;
|
||||
|
||||
G4double LowestKineticEnergy;
|
||||
G4double HighestKineticEnergy;
|
||||
G4int TotBin;
|
||||
|
||||
G4double RTable ;
|
||||
G4double CutInRange;
|
||||
|
||||
const G4Gamma* theGamma;
|
||||
const G4Electron* theElectron;
|
||||
const G4Positron* thePositron;
|
||||
|
||||
const G4double* GammaCutInKineticEnergy;
|
||||
|
||||
G4double GammaCutInKineticEnergyNow;
|
||||
|
||||
G4int NumberOfBuildPhysicsTableCalls ;
|
||||
};
|
||||
|
||||
#include "G4IeBremsstrahlung.icc"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,214 +0,0 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4IeBremsstrahlung.icc,v 1.3 1999/12/15 14:51:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// $Id:
|
||||
// ---------------------------------------------------------------
|
||||
// GEANT 4 class inlined methods file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ------------ G4IeBremsstrahlung physics process ---------
|
||||
// by Michel Maire, 27 July 1996
|
||||
// ***************************************************************
|
||||
// It is the first implementation of the BREMSSTRAHLUNG
|
||||
// PROCESS. ( photons + continuous energy loss)
|
||||
// using an INTEGRAL APPROACH instead of the differential
|
||||
// one used in the standard implementation .
|
||||
// ************************************************************
|
||||
// by Laszlo Urban, 23 June 1998
|
||||
// ----------------------------------------------------------------
|
||||
// 28/10/98: small changes, cleanup L.Urban
|
||||
|
||||
inline G4double G4IeBremsstrahlung::PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
)
|
||||
{
|
||||
const G4double Tfac=0.95,Tfac1=1.-Tfac,eps=1.e-2 ;
|
||||
|
||||
G4double nl,nll,nlold,range,rangeold,rangenext,
|
||||
dEdx,KineticEnergyOld,KineticEnergyNext,value;
|
||||
G4bool isOut;
|
||||
|
||||
const G4DynamicParticle* particle = track.GetDynamicParticle();
|
||||
const G4ParticleDefinition* particletype = particle->GetDefinition() ;
|
||||
G4double KineticEnergy = particle->GetKineticEnergy();
|
||||
G4Material* material = track.GetMaterial();
|
||||
const G4MaterialTable* theMaterialTable =
|
||||
G4Material::GetMaterialTable();
|
||||
G4int materialindex = material->GetIndex();
|
||||
|
||||
nl = (*theNlambdaTable)[materialindex]->
|
||||
GetValue(KineticEnergy,isOut);
|
||||
range = G4EnergyLossTables::GetPreciseRangeFromEnergy(particletype,
|
||||
KineticEnergy,material) ;
|
||||
|
||||
|
||||
if ( (previousStepSize <=0.0) || (theNumberOfInteractionLengthLeft<=0.0)) {
|
||||
ResetNumberOfInteractionLengthLeft();
|
||||
} else {
|
||||
if(previousStepSize/range < eps)
|
||||
{
|
||||
nll = (*theNlambdaTable)[materialindex]->
|
||||
GetValue(Tfac*KineticEnergy,isOut) ;
|
||||
dEdx = G4EnergyLossTables::GetPreciseDEDX(particletype,
|
||||
KineticEnergy,
|
||||
material) ;
|
||||
nlold = nl + dEdx*previousStepSize*(nl-nll)/
|
||||
(Tfac1*KineticEnergy) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
rangeold = range + previousStepSize ;
|
||||
KineticEnergyOld = G4EnergyLossTables::GetPreciseEnergyFromRange(
|
||||
particletype,
|
||||
rangeold,material);
|
||||
nlold = (*theNlambdaTable)[materialindex]->
|
||||
GetValue(KineticEnergyOld,isOut);
|
||||
|
||||
if(nlold < nl)
|
||||
{
|
||||
if(verboseLevel>2)
|
||||
{
|
||||
G4cout << "G4IeBremsstrahlung PostStepGPIL : Nlambda has been" <<
|
||||
" increased at update.Nlambda old/new :" << nlold <<
|
||||
" " << nl << G4endl;
|
||||
G4cout << "(theNumberOfInteractionLengthLeft has been increased!)"
|
||||
<< G4endl;
|
||||
G4cout << " correction : Nlambda old=new ........." << G4endl;
|
||||
}
|
||||
nlold = nl ;
|
||||
}
|
||||
}
|
||||
|
||||
theNumberOfInteractionLengthLeft -= nlold-nl ;
|
||||
|
||||
if(theNumberOfInteractionLengthLeft<perMillion)
|
||||
theNumberOfInteractionLengthLeft=0.;
|
||||
}
|
||||
|
||||
*condition = NotForced;
|
||||
if(nl <= theNumberOfInteractionLengthLeft)
|
||||
{
|
||||
value = DBL_MAX ;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(theNumberOfInteractionLengthLeft/nl < eps)
|
||||
{
|
||||
nll = (*theNlambdaTable)[materialindex]->
|
||||
GetValue(Tfac*KineticEnergy,isOut) ;
|
||||
dEdx = G4EnergyLossTables::GetPreciseDEDX(particletype,
|
||||
KineticEnergy,
|
||||
material) ;
|
||||
|
||||
value = theNumberOfInteractionLengthLeft*Tfac1
|
||||
*KineticEnergy/(dEdx*(nl-nll)) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
KineticEnergyNext = (*theInverseNlambdaTable)[materialindex]->
|
||||
GetValue(nl-theNumberOfInteractionLengthLeft,isOut);
|
||||
rangenext = G4EnergyLossTables::GetPreciseRangeFromEnergy(particletype,
|
||||
KineticEnergyNext,material);
|
||||
value = range - rangenext ;
|
||||
|
||||
if(range<rangenext)
|
||||
{
|
||||
if(verboseLevel>2)
|
||||
{
|
||||
G4cout << "G4IeBremsstrahlung PostStepGPIL: Step < 0.!, Step=" <<
|
||||
value << G4endl;
|
||||
G4cout << "range,rangenext:" << range << " " << rangenext << G4endl ;
|
||||
G4cout << "correction : rangenext=range ....." << G4endl;
|
||||
}
|
||||
rangenext = range ;
|
||||
value = range - rangenext ;
|
||||
}
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
inline G4double G4IeBremsstrahlung::ScreenFunction1(G4double ScreenVariable)
|
||||
// compute the value of the screening function 3*PHI1 - PHI2
|
||||
{
|
||||
G4double screenVal;
|
||||
|
||||
if (ScreenVariable > 1.)
|
||||
screenVal = 42.24 - 8.368*log(ScreenVariable+0.952);
|
||||
else
|
||||
screenVal = 42.392 - ScreenVariable* (7.796 - 1.961*ScreenVariable);
|
||||
|
||||
return screenVal;
|
||||
}
|
||||
|
||||
inline G4double G4IeBremsstrahlung::ScreenFunction2(G4double ScreenVariable)
|
||||
|
||||
// compute the value of the screening function 1.5*PHI1 - 0.5*PHI2
|
||||
{
|
||||
G4double screenVal;
|
||||
|
||||
if (ScreenVariable > 1.)
|
||||
screenVal = 42.24 - 8.368*log(ScreenVariable+0.952);
|
||||
else
|
||||
screenVal = 41.734 - ScreenVariable* (6.484 - 1.250*ScreenVariable);
|
||||
|
||||
return screenVal;
|
||||
}
|
||||
|
||||
inline G4double G4IeBremsstrahlung::ComputeMeanFreePath(
|
||||
const G4ParticleDefinition* ParticleType,
|
||||
G4double KineticEnergy,
|
||||
const G4Material* aMaterial)
|
||||
{
|
||||
const G4ElementVector* theElementVector = aMaterial->GetElementVector() ;
|
||||
const G4double* theAtomNumDensityVector =
|
||||
aMaterial->GetAtomicNumDensityVector();
|
||||
G4double GammaEnergyCut = (G4Gamma::GetCutsInEnergy())[aMaterial->GetIndex()];
|
||||
|
||||
G4double SIGMA = 0 ;
|
||||
|
||||
for ( G4int i=0 ; i < aMaterial->GetNumberOfElements() ; i++ )
|
||||
{
|
||||
SIGMA += theAtomNumDensityVector[i] *
|
||||
ComputeMicroscopicCrossSection( ParticleType, KineticEnergy,
|
||||
(*theElementVector)(i)->GetZ(),
|
||||
GammaEnergyCut );
|
||||
}
|
||||
return SIGMA<=0.0 ? DBL_MAX : 1./SIGMA ;
|
||||
}
|
||||
|
||||
inline G4bool G4IeBremsstrahlung::IsApplicable(
|
||||
const G4ParticleDefinition& particle)
|
||||
{
|
||||
return( (&particle == (const G4ParticleDefinition *)theElectron)
|
||||
||(&particle == (const G4ParticleDefinition *)thePositron)
|
||||
) ;
|
||||
}
|
||||
|
||||
inline G4double G4IeBremsstrahlung::GetNlambda(
|
||||
G4double KineticEnergy,
|
||||
G4Material* material)
|
||||
{
|
||||
G4bool isOut;
|
||||
const G4MaterialTable* theMaterialTable =
|
||||
G4Material::GetMaterialTable() ;
|
||||
|
||||
G4double lambda = (*theNlambdaTable)
|
||||
[material->GetIndex()]->
|
||||
GetValue(KineticEnergy,isOut);
|
||||
return lambda;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,144 +0,0 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4IeIonisation.hh,v 1.4 2000/04/25 14:33:00 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// $Id:
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD group
|
||||
// History: based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ---------- G4IeIonisation physics process -----------
|
||||
// by Laszlo Urban, 23 June 1998
|
||||
// ************************************************************
|
||||
// It is the first implementation of the IONISATION
|
||||
// PROCESS. ( delta rays + continuous energy loss)
|
||||
// using an INTEGRAL APPROACH instead of the differential
|
||||
// one used in the standard implementation .
|
||||
// ************************************************************
|
||||
// 27/10/98 : minor changes+cleanup , L.Urban
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#ifndef G4IeIonisation_h
|
||||
#define G4IeIonisation_h 1
|
||||
|
||||
#include "G4ios.hh"
|
||||
#include "g4std/iomanip"
|
||||
#include "globals.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4VIeEnergyLoss.hh"
|
||||
#include "G4EnergyLossTables.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4Electron.hh"
|
||||
#include "G4Positron.hh"
|
||||
#include "G4Gamma.hh"
|
||||
#include "G4PhysicsLogVector.hh"
|
||||
#include "G4PhysicsLinearVector.hh"
|
||||
|
||||
class G4IeIonisation : public G4VIeEnergyLoss
|
||||
{
|
||||
public:
|
||||
|
||||
G4IeIonisation(const G4String& processName = "IeIoni");
|
||||
|
||||
~G4IeIonisation();
|
||||
|
||||
G4bool IsApplicable(const G4ParticleDefinition&);
|
||||
|
||||
void SetPhysicsTableBining(G4double lowE, G4double highE, G4int nBins);
|
||||
|
||||
void BuildPhysicsTable(const G4ParticleDefinition& aParticleType);
|
||||
|
||||
void BuildLossTable(const G4ParticleDefinition& aParticleType);
|
||||
|
||||
void BuildLambdaTable(const G4ParticleDefinition& aParticleType);
|
||||
|
||||
void PrintInfoDefinition();
|
||||
|
||||
G4double PostStepGetPhysicalInteractionLength( const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition);
|
||||
|
||||
G4VParticleChange *PostStepDoIt(const G4Track& track,
|
||||
const G4Step& Step ) ;
|
||||
|
||||
G4double GetNlambda(
|
||||
G4double KineticEnergy,G4Material* material);
|
||||
|
||||
protected:
|
||||
|
||||
virtual G4double ComputeMicroscopicCrossSection(
|
||||
const G4ParticleDefinition& aParticleType,
|
||||
G4double KineticEnergy,
|
||||
G4double AtomicNumber);
|
||||
|
||||
private:
|
||||
|
||||
// hide assignment operator
|
||||
G4IeIonisation & operator=(const G4IeIonisation &right);
|
||||
G4IeIonisation(const G4IeIonisation&);
|
||||
|
||||
void BuildNlambdaTable(const G4ParticleDefinition& aParticleType) ;
|
||||
void BuildNlambdaVector(const G4ParticleDefinition& aParticleType,
|
||||
G4int materialIndex,
|
||||
G4PhysicsLogVector* nlambdaVector) ;
|
||||
void BuildInverseNlambdaTable(
|
||||
const G4ParticleDefinition& aParticleType) ;
|
||||
void InvertNlambdaVector(const G4ParticleDefinition& aParticleType,
|
||||
G4int materialIndex,
|
||||
G4PhysicsLogVector* nlambdaVector) ;
|
||||
|
||||
void BuildCoeffATable(const G4ParticleDefinition& aParticleType) ;
|
||||
void BuildCoeffBTable(const G4ParticleDefinition& aParticleType) ;
|
||||
void BuildCoeffCTable(const G4ParticleDefinition& aParticleType) ;
|
||||
|
||||
void TestOfInversion(const G4ParticleDefinition& aParticleType,
|
||||
G4int printflag) ;
|
||||
|
||||
private:
|
||||
// private data members ...............................
|
||||
|
||||
G4PhysicsTable* theMeanFreePathTable;
|
||||
|
||||
G4PhysicsTable* theNlambdaTable;
|
||||
G4PhysicsTable* theInverseNlambdaTable;
|
||||
|
||||
G4PhysicsTable* theCoeffATable;
|
||||
G4PhysicsTable* theCoeffBTable;
|
||||
G4PhysicsTable* theCoeffCTable;
|
||||
|
||||
G4double LowestKineticEnergy;
|
||||
G4double HighestKineticEnergy;
|
||||
G4int TotBin;
|
||||
G4double RTable ;
|
||||
|
||||
// cut in range
|
||||
G4double CutInRange ;
|
||||
|
||||
// particles , cuts in kinetic energy ........
|
||||
const G4Electron* theElectron;
|
||||
const G4Positron* thePositron;
|
||||
|
||||
const G4double* ParticleCutInKineticEnergy;
|
||||
const G4double* DeltaCutInKineticEnergy ;
|
||||
|
||||
G4double ParticleCutInKineticEnergyNow ;
|
||||
G4double DeltaKineticEnergyCutNow ;
|
||||
|
||||
G4int NumberOfBuildPhysicsTableCalls ;
|
||||
};
|
||||
|
||||
#include "G4IeIonisation.icc"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4IeIonisation.icc,v 1.3 1999/12/15 14:51:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// $Id:
|
||||
// ---------------------------------------------------------------
|
||||
// GEANT 4 class inlined methods file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD group
|
||||
// ------------ G4IeIonisation physics process ------------
|
||||
// by Laszlo Urban, 23 June 1998
|
||||
// ************************************************************
|
||||
// It is the first implementation of the IONISATION
|
||||
// PROCESS. ( delta rays + continuous energy loss)
|
||||
// using an INTEGRAL APPROACH instead of the differential
|
||||
// one used in the standard implementation .
|
||||
// ************************************************************
|
||||
// 27/10/98: minor changes , cleanup , L.Urban
|
||||
// ------------------------------------------------------------
|
||||
|
||||
inline G4double G4IeIonisation::PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition)
|
||||
{
|
||||
const G4double eps=1.e-2,Tfac=0.95,Tfac1=1.-Tfac ;
|
||||
|
||||
G4double nl,nll,nlold,range,rangeold,rangenext,
|
||||
dEdx,KineticEnergyOld,KineticEnergyNext,value;
|
||||
G4bool isOut;
|
||||
|
||||
const G4DynamicParticle* particle = track.GetDynamicParticle();
|
||||
const G4ParticleDefinition* particletype = particle->GetDefinition() ;
|
||||
G4double KineticEnergy = particle->GetKineticEnergy();
|
||||
G4Material* material = track.GetMaterial();
|
||||
const G4MaterialTable* theMaterialTable =
|
||||
G4Material::GetMaterialTable();
|
||||
G4int materialindex = material->GetIndex();
|
||||
|
||||
nl = (*theNlambdaTable)[materialindex]->
|
||||
GetValue(KineticEnergy,isOut);
|
||||
range = G4EnergyLossTables::GetPreciseRangeFromEnergy(particletype,
|
||||
KineticEnergy,material) ;
|
||||
|
||||
if ( (previousStepSize <=0.0) || (theNumberOfInteractionLengthLeft<=0.0)) {
|
||||
// beggining of tracking (or just after DoIt of this process)
|
||||
ResetNumberOfInteractionLengthLeft();
|
||||
} else {
|
||||
if(previousStepSize/range < eps)
|
||||
{
|
||||
nll = (*theNlambdaTable)[materialindex]->
|
||||
GetValue(Tfac*KineticEnergy,isOut) ;
|
||||
dEdx = G4EnergyLossTables::GetPreciseDEDX(particletype,
|
||||
KineticEnergy,
|
||||
material) ;
|
||||
nlold = nl + dEdx*previousStepSize*(nl-nll)/
|
||||
(Tfac1*KineticEnergy) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
rangeold = range + previousStepSize ;
|
||||
KineticEnergyOld = G4EnergyLossTables::GetPreciseEnergyFromRange(
|
||||
particletype,
|
||||
rangeold,material);
|
||||
nlold = (*theNlambdaTable)[materialindex]->
|
||||
GetValue(KineticEnergyOld,isOut);
|
||||
|
||||
if(nlold < nl)
|
||||
{
|
||||
if(verboseLevel>2)
|
||||
{
|
||||
G4cout << "G4IeIonisation PostStepGPIL : Nlambda has been" <<
|
||||
" increased at update.Nlambda old/new :" << nlold <<
|
||||
" " << nl << G4endl;
|
||||
G4cout << "(theNumberOfInteractionLengthLeft has been increased!)"
|
||||
<< G4endl;
|
||||
G4cout << " correction : Nlambda old=new ........." << G4endl;
|
||||
}
|
||||
nlold = nl ;
|
||||
}
|
||||
}
|
||||
|
||||
theNumberOfInteractionLengthLeft -= nlold-nl ;
|
||||
|
||||
if(theNumberOfInteractionLengthLeft<perMillion)
|
||||
theNumberOfInteractionLengthLeft=0.;
|
||||
}
|
||||
|
||||
|
||||
// condition is set to "Not Forced"
|
||||
*condition = NotForced;
|
||||
if(nl <= theNumberOfInteractionLengthLeft)
|
||||
{
|
||||
value = DBL_MAX ;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(theNumberOfInteractionLengthLeft/nl < eps)
|
||||
{
|
||||
nll = (*theNlambdaTable)[materialindex]->
|
||||
GetValue(Tfac*KineticEnergy,isOut) ;
|
||||
dEdx = G4EnergyLossTables::GetPreciseDEDX(particletype,
|
||||
KineticEnergy,
|
||||
material) ;
|
||||
|
||||
value = theNumberOfInteractionLengthLeft*Tfac1*
|
||||
KineticEnergy/(dEdx*(nl-nll)) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
KineticEnergyNext = (*theInverseNlambdaTable)[materialindex]->
|
||||
GetValue(nl-theNumberOfInteractionLengthLeft,isOut);
|
||||
rangenext = G4EnergyLossTables::GetPreciseRangeFromEnergy(particletype,
|
||||
KineticEnergyNext,material);
|
||||
value = range - rangenext ;
|
||||
if(range<rangenext)
|
||||
{
|
||||
if(verboseLevel>2)
|
||||
{
|
||||
G4cout << "G4IeIonisation PostStepGPIL: Step < 0.!, Step="
|
||||
<< value << G4endl;
|
||||
G4cout << "range,rangenext:" << range << " " << rangenext << G4endl ;
|
||||
G4cout << "correction : rangenext=range ....." << G4endl;
|
||||
}
|
||||
rangenext = range ;
|
||||
value = range - rangenext ;
|
||||
}
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
inline G4bool G4IeIonisation::IsApplicable(
|
||||
const G4ParticleDefinition& particle)
|
||||
{
|
||||
return( (&particle == (const G4ParticleDefinition *)theElectron)
|
||||
||(&particle == (const G4ParticleDefinition *)thePositron)
|
||||
) ;
|
||||
}
|
||||
|
||||
inline G4double G4IeIonisation::GetNlambda(
|
||||
G4double KineticEnergy,
|
||||
G4Material* material)
|
||||
{
|
||||
G4bool isOut;
|
||||
const G4MaterialTable* theMaterialTable =
|
||||
G4Material::GetMaterialTable() ;
|
||||
|
||||
G4double lambda = (*theNlambdaTable)
|
||||
[material->GetIndex()]->
|
||||
GetValue(KineticEnergy,isOut);
|
||||
return lambda;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,144 +0,0 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4IeplusAnnihilation.hh,v 1.2 1999/12/15 14:51:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// $Id:
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
// CERN Geneva Switzerland
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ------------ G4IeplusAnnihilation process ------
|
||||
// by Michel Maire, 7 july 1996
|
||||
// ************************************************************
|
||||
// ************************************************************
|
||||
// It is the first implementation of the
|
||||
// eplusANNIHILATION PROCESS
|
||||
// using an INTEGRAL APPROACH instead of the differential
|
||||
// one used in the standard implementation .
|
||||
// ************************************************************
|
||||
// by Laszlo Urban, 23 June 1998
|
||||
// ----------------------------------------------------------
|
||||
// 28/10/98: cleanup L. Urban
|
||||
|
||||
|
||||
#ifndef G4IeplusAnnihilation_h
|
||||
#define G4IeplusAnnihilation_h 1
|
||||
|
||||
#include "G4ios.hh"
|
||||
#include "globals.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4IVRestDiscreteProcess.hh"
|
||||
#include "G4EnergyLossTables.hh"
|
||||
#include "G4PhysicsTable.hh"
|
||||
#include "G4PhysicsLogVector.hh"
|
||||
#include "G4PhysicsLinearVector.hh"
|
||||
#include "G4ElementTable.hh"
|
||||
#include "G4Gamma.hh"
|
||||
#include "G4Positron.hh"
|
||||
#include "G4Step.hh"
|
||||
|
||||
class G4IeplusAnnihilation : public G4IVRestDiscreteProcess
|
||||
|
||||
{
|
||||
public:
|
||||
|
||||
G4IeplusAnnihilation(const G4String& processName ="Iannihil");
|
||||
|
||||
~G4IeplusAnnihilation();
|
||||
|
||||
G4bool IsApplicable(const G4ParticleDefinition&);
|
||||
|
||||
void SetPhysicsTableBining(G4double lowE, G4double highE, G4int nBins);
|
||||
|
||||
void PrintInfoDefinition();
|
||||
|
||||
void BuildPhysicsTable(const G4ParticleDefinition& PositronType);
|
||||
|
||||
G4double PostStepGetPhysicalInteractionLength(const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition) ;
|
||||
|
||||
G4double GetMicroscopicCrossSection(G4DynamicParticle* aDynamicPositron,
|
||||
G4Element* anElement);
|
||||
|
||||
G4VParticleChange* PostStepDoIt(const G4Track& aTrack,
|
||||
const G4Step& aStep);
|
||||
|
||||
G4double GetMeanLifeTime(const G4Track& aTrack,
|
||||
G4ForceCondition* condition);
|
||||
|
||||
G4VParticleChange* AtRestDoIt(const G4Track& aTrack,
|
||||
const G4Step& aStep);
|
||||
|
||||
protected:
|
||||
|
||||
virtual G4double ComputeMicroscopicCrossSection(G4double PositKinEnergy,
|
||||
G4double AtomicNumber);
|
||||
|
||||
virtual G4double ComputeMeanFreePath(G4double PositKinEnergy,
|
||||
G4Material* aMaterial);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// hide assignment operator as private
|
||||
G4IeplusAnnihilation& operator=(const G4IeplusAnnihilation &right);
|
||||
G4IeplusAnnihilation(const G4IeplusAnnihilation& );
|
||||
|
||||
void BuildNlambdaTable(const G4ParticleDefinition& aParticleType) ;
|
||||
void BuildNlambdaVector(const G4ParticleDefinition& aParticleType,
|
||||
G4int materialIndex,
|
||||
G4PhysicsLogVector* nlambdaVector) ;
|
||||
void BuildInverseNlambdaTable(
|
||||
const G4ParticleDefinition& aParticleType) ;
|
||||
void InvertNlambdaVector(const G4ParticleDefinition& aParticleType,
|
||||
G4int materialIndex,
|
||||
G4PhysicsLogVector* nlambdaVector) ;
|
||||
|
||||
void BuildCoeffATable(const G4ParticleDefinition& aParticleType) ;
|
||||
void BuildCoeffBTable(const G4ParticleDefinition& aParticleType) ;
|
||||
void BuildCoeffCTable(const G4ParticleDefinition& aParticleType) ;
|
||||
|
||||
void TestOfInversion(const G4ParticleDefinition& aParticleType,
|
||||
G4int printflag) ;
|
||||
|
||||
private:
|
||||
|
||||
G4PhysicsTable* theCrossSectionTable; // table for crossection
|
||||
|
||||
G4PhysicsTable* theMeanFreePathTable ;
|
||||
|
||||
G4PhysicsTable* theNlambdaTable;
|
||||
G4PhysicsTable* theInverseNlambdaTable;
|
||||
|
||||
G4PhysicsTable* theCoeffATable;
|
||||
G4PhysicsTable* theCoeffBTable;
|
||||
G4PhysicsTable* theCoeffCTable;
|
||||
|
||||
G4double LowestEnergyLimit ; // low energy limit of the crossection formula
|
||||
G4double HighestEnergyLimit ; // high energy limit of the crossection formula
|
||||
G4int NumbBinTable ; // number of bins in the crossection table
|
||||
G4int NumberOfBuildPhysicsTableCalls ;
|
||||
|
||||
G4double LowestKineticEnergy ;
|
||||
G4double HighestKineticEnergy;
|
||||
G4int TotBin ;
|
||||
|
||||
G4double RTable ;
|
||||
|
||||
};
|
||||
|
||||
#include "G4IeplusAnnihilation.icc"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,197 +0,0 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4IeplusAnnihilation.icc,v 1.2 1999/12/15 14:51:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// $Id:
|
||||
// ---------------------------------------------------------------
|
||||
// GEANT 4 class inlined methods file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ------------ G4IeplusAnnihilation process ---------
|
||||
// by Michel Maire, 7 July 1996
|
||||
// ***************************************************************
|
||||
// ************************************************************
|
||||
// It is the first implementation of the
|
||||
// eplusANNIHILATION PROCESS
|
||||
// using an INTEGRAL APPROACH instead of the differential
|
||||
// one used in the standard implementation .
|
||||
// ************************************************************
|
||||
// by Laszlo Urban, 23 June 1998
|
||||
// ---------------------------------------------------------
|
||||
// 28/10/98: some cleanup , L.Urban
|
||||
|
||||
inline G4bool G4IeplusAnnihilation::IsApplicable(const G4ParticleDefinition& particle)
|
||||
{
|
||||
return ( &particle == G4Positron::Positron() );
|
||||
}
|
||||
inline G4double G4IeplusAnnihilation::GetMicroscopicCrossSection(
|
||||
G4DynamicParticle* aDynamicPositron,
|
||||
G4Element* anElement)
|
||||
|
||||
// gives the microscopic total cross section in GEANT4 internal units
|
||||
|
||||
{
|
||||
G4double crossSection;
|
||||
G4double PositronEnergy = aDynamicPositron->GetKineticEnergy();
|
||||
G4bool isOutRange ;
|
||||
|
||||
if (PositronEnergy > HighestEnergyLimit)
|
||||
crossSection = 0. ;
|
||||
else {
|
||||
if (PositronEnergy < LowestEnergyLimit) PositronEnergy = 1.01*LowestEnergyLimit;
|
||||
crossSection = (*theCrossSectionTable)(anElement->GetIndex())->
|
||||
GetValue( PositronEnergy, isOutRange );
|
||||
}
|
||||
|
||||
return crossSection;
|
||||
}
|
||||
|
||||
|
||||
inline G4double G4IeplusAnnihilation::PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
)
|
||||
{// get particle,particle type,kin.energy,material,mat.index
|
||||
const G4double Tfac=0.95,Tfac1=1.-Tfac,eps=1.e-2 ;
|
||||
G4double nl,nll,nlold,range,rangeold,rangenext,
|
||||
dEdx,KineticEnergyOld,KineticEnergyNext,value;
|
||||
G4bool isOut;
|
||||
const G4DynamicParticle* particle = track.GetDynamicParticle();
|
||||
const G4ParticleDefinition* particletype = particle->GetDefinition() ;
|
||||
G4double KineticEnergy = particle->GetKineticEnergy();
|
||||
G4Material* material = track.GetMaterial();
|
||||
const G4MaterialTable* theMaterialTable =
|
||||
G4Material::GetMaterialTable();
|
||||
G4int materialindex = material->GetIndex();
|
||||
|
||||
nl = (*theNlambdaTable)[materialindex]->
|
||||
GetValue(KineticEnergy,isOut);
|
||||
range = G4EnergyLossTables::GetPreciseRangeFromEnergy(particletype,
|
||||
KineticEnergy,material) ;
|
||||
|
||||
if ( (previousStepSize <=0.0) || (theNumberOfInteractionLengthLeft<=0.0)) {
|
||||
ResetNumberOfInteractionLengthLeft();
|
||||
} else {
|
||||
if(previousStepSize/range < eps)
|
||||
{
|
||||
nll = (*theNlambdaTable)[materialindex]->
|
||||
GetValue(Tfac*KineticEnergy,isOut) ;
|
||||
dEdx = G4EnergyLossTables::GetPreciseDEDX(particletype,
|
||||
KineticEnergy,
|
||||
material) ;
|
||||
nlold = nl + dEdx*previousStepSize*(nl-nll)/
|
||||
(Tfac1*KineticEnergy) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
rangeold = range + previousStepSize ;
|
||||
KineticEnergyOld = G4EnergyLossTables::GetPreciseEnergyFromRange(
|
||||
particletype,
|
||||
rangeold,material);
|
||||
nlold = (*theNlambdaTable)[materialindex]->
|
||||
GetValue(KineticEnergyOld,isOut);
|
||||
|
||||
if(nlold < nl)
|
||||
{
|
||||
if(verboseLevel>2)
|
||||
{
|
||||
G4cout << "G4IeplusAnnihilation PostStepGPIL : Nlambda has been" <<
|
||||
" increased at update.Nlambda old/new :" << nlold <<
|
||||
" " << nl << G4endl;
|
||||
G4cout << "(theNumberOfInteractionLengthLeft has been increased!)" << G4endl;
|
||||
G4cout << " correction : Nlambda old=new ........." << G4endl;
|
||||
}
|
||||
nlold = nl ;
|
||||
}
|
||||
}
|
||||
|
||||
theNumberOfInteractionLengthLeft -= nlold-nl ;
|
||||
|
||||
if(theNumberOfInteractionLengthLeft<perMillion)
|
||||
theNumberOfInteractionLengthLeft=0.;
|
||||
}
|
||||
|
||||
|
||||
// condition is set to "Not Forced"
|
||||
*condition = NotForced;
|
||||
if(nl <= theNumberOfInteractionLengthLeft)
|
||||
{
|
||||
value = DBL_MAX ;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(theNumberOfInteractionLengthLeft/nl < eps)
|
||||
{
|
||||
nll = (*theNlambdaTable)[materialindex]->
|
||||
GetValue(Tfac*KineticEnergy,isOut) ;
|
||||
dEdx = G4EnergyLossTables::GetPreciseDEDX(particletype,
|
||||
KineticEnergy,
|
||||
material) ;
|
||||
|
||||
value = theNumberOfInteractionLengthLeft*Tfac1*KineticEnergy/(dEdx*(nl-nll)) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
KineticEnergyNext = (*theInverseNlambdaTable)[materialindex]->
|
||||
GetValue(nl-theNumberOfInteractionLengthLeft,isOut);
|
||||
rangenext = G4EnergyLossTables::GetPreciseRangeFromEnergy(particletype,
|
||||
KineticEnergyNext,material);
|
||||
|
||||
value = range - rangenext ;
|
||||
|
||||
if(range<rangenext)
|
||||
{
|
||||
if(verboseLevel>2)
|
||||
{
|
||||
G4cout << "G4IeplusAnnihilation PostStepGPIL: Step < 0.!, Step=" <<
|
||||
value << G4endl;
|
||||
G4cout << "range,rangenext:" << range << " " << rangenext << G4endl ;
|
||||
G4cout << "correction : rangenext=range ....." << G4endl;
|
||||
}
|
||||
rangenext = range ;
|
||||
value = range - rangenext ;
|
||||
}
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
inline G4double G4IeplusAnnihilation::ComputeMeanFreePath(G4double PositKinEnergy,
|
||||
G4Material* aMaterial)
|
||||
|
||||
// returns the positron mean free path in GEANT4 internal units
|
||||
|
||||
{
|
||||
const G4ElementVector* theElementVector = aMaterial->GetElementVector() ;
|
||||
const G4double* theAtomNumDensityVector = aMaterial->GetAtomicNumDensityVector();
|
||||
|
||||
G4double SIGMA = 0 ;
|
||||
|
||||
for ( G4int i=0 ; i < aMaterial->GetNumberOfElements() ; i++ )
|
||||
{
|
||||
SIGMA += theAtomNumDensityVector[i] *
|
||||
ComputeMicroscopicCrossSection( PositKinEnergy,
|
||||
(*theElementVector)(i)->GetZ() );
|
||||
}
|
||||
|
||||
return SIGMA<=0.0 ? DBL_MAX : 1./SIGMA ;
|
||||
}
|
||||
|
||||
inline G4double G4IeplusAnnihilation::GetMeanLifeTime(const G4Track&,
|
||||
G4ForceCondition*)
|
||||
// returns the annihilation mean life time in GEANT4 internal units
|
||||
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
@@ -1,144 +0,0 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4IhIonisation.hh,v 1.4 2000/04/25 14:33:01 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD group
|
||||
// History: based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ---------- G4IhIonisation physics process -----------
|
||||
// by Laszlo Urban, 30 May 1997
|
||||
// ************************************************************
|
||||
// It is the first implementation of the NEW IONISATION
|
||||
// PROCESS. ( delta rays + continuous energy loss)
|
||||
// It calculates the ionisation for charged hadrons.
|
||||
// ************************************************************
|
||||
// corrected by L.Urban on 24/09/97
|
||||
// corrected by L.Urban on 13/01/98
|
||||
// 28/10/98: some cleanup , L.Urban
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#ifndef G4IhIonisation_h
|
||||
#define G4IhIonisation_h 1
|
||||
|
||||
#include "G4ios.hh"
|
||||
#include "globals.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4VIhEnergyLoss.hh"
|
||||
#include "G4EnergyLossTables.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4Electron.hh"
|
||||
#include "G4Proton.hh"
|
||||
#include "G4AntiProton.hh"
|
||||
#include "G4PhysicsLogVector.hh"
|
||||
#include "G4PhysicsLinearVector.hh"
|
||||
|
||||
|
||||
class G4IhIonisation : public G4VIhEnergyLoss
|
||||
|
||||
{
|
||||
public:
|
||||
|
||||
G4IhIonisation(const G4String& processName = "IhIoni");
|
||||
|
||||
~G4IhIonisation();
|
||||
|
||||
G4bool IsApplicable(const G4ParticleDefinition&);
|
||||
|
||||
void SetPhysicsTableBining(G4double lowE, G4double highE, G4int nBins);
|
||||
|
||||
void BuildPhysicsTable(const G4ParticleDefinition& aParticleType);
|
||||
|
||||
void BuildLossTable(const G4ParticleDefinition& aParticleType);
|
||||
|
||||
void BuildLambdaTable(const G4ParticleDefinition& aParticleType);
|
||||
|
||||
void PrintInfoDefinition();
|
||||
|
||||
G4double PostStepGetPhysicalInteractionLength(const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition);
|
||||
|
||||
G4VParticleChange *PostStepDoIt(const G4Track& track,
|
||||
const G4Step& Step ) ;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
virtual G4double ComputeMicroscopicCrossSection(
|
||||
const G4ParticleDefinition& aParticleType,
|
||||
G4double KineticEnergy,
|
||||
G4double AtomicNumber);
|
||||
|
||||
private:
|
||||
|
||||
// hide assignment operator
|
||||
G4IhIonisation & operator=(const G4IhIonisation &right);
|
||||
G4IhIonisation(const G4IhIonisation&);
|
||||
|
||||
void BuildNlambdaTable(const G4ParticleDefinition& aParticleType) ;
|
||||
void BuildNlambdaVector(const G4ParticleDefinition& aParticleType,
|
||||
G4int materialIndex,
|
||||
G4PhysicsLogVector* nlambdaVector) ;
|
||||
void BuildInverseNlambdaTable(
|
||||
const G4ParticleDefinition& aParticleType) ;
|
||||
void InvertNlambdaVector(const G4ParticleDefinition& aParticleType,
|
||||
G4int materialIndex,
|
||||
G4PhysicsLogVector* nlambdaVector) ;
|
||||
|
||||
void BuildCoeffATable(const G4ParticleDefinition& aParticleType) ;
|
||||
void BuildCoeffBTable(const G4ParticleDefinition& aParticleType) ;
|
||||
void BuildCoeffCTable(const G4ParticleDefinition& aParticleType) ;
|
||||
|
||||
void TestOfInversion(const G4ParticleDefinition& aParticleType,
|
||||
G4int printflag) ;
|
||||
|
||||
private:
|
||||
// private data members ...............................
|
||||
|
||||
G4PhysicsTable* theMeanFreePathTable;
|
||||
|
||||
G4PhysicsTable* theNlambdaTable;
|
||||
G4PhysicsTable* theInverseNlambdaTable;
|
||||
|
||||
G4PhysicsTable* theCoeffATable;
|
||||
G4PhysicsTable* theCoeffBTable;
|
||||
G4PhysicsTable* theCoeffCTable;
|
||||
|
||||
const G4Electron* theElectron;
|
||||
const G4Proton* theProton;
|
||||
const G4AntiProton* theAntiProton;
|
||||
|
||||
const G4double* ParticleCutInKineticEnergy;
|
||||
const G4double* DeltaCutInKineticEnergy ;
|
||||
|
||||
G4double ParticleCutInKineticEnergyNow ;
|
||||
G4double DeltaCutInKineticEnergyNow ;
|
||||
|
||||
G4int NumberOfBuildPhysicsTableCalls ;
|
||||
|
||||
};
|
||||
|
||||
#include "G4IhIonisation.icc"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,145 +0,0 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4IhIonisation.icc,v 1.2 1999/12/15 14:51:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
// GEANT 4 class inlined methods file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD group
|
||||
// ------------ G4IhIonisation physics process ------------
|
||||
// by Laszlo Urban, 30 May 1997
|
||||
// ***************************************************************
|
||||
// It is the first implementation of the NEW IONISATION PROCESS.
|
||||
// It calculates the ionisation of charged hadrons.
|
||||
// ***************************************************************
|
||||
// 24/09/97: corrected by L.Urban
|
||||
// 20/11/97: correction on MeanFreePath for KineticEnergy > HighestLimit
|
||||
// 29/10/98: some cleanup + small changes , L.Urban
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
inline G4double G4IhIonisation::PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition)
|
||||
{// get particle,particle type,kin.energy,material,mat.index
|
||||
const G4double Tfac=0.95,Tfac1=1.-Tfac,eps=1.e-2 ;
|
||||
|
||||
G4double nl,nll,nlold,range,rangeold,rangenext,
|
||||
dEdx,KineticEnergyOld,KineticEnergyNext,value;
|
||||
G4bool isOut;
|
||||
|
||||
const G4DynamicParticle* particle = track.GetDynamicParticle();
|
||||
const G4ParticleDefinition* particletype = particle->GetDefinition() ;
|
||||
G4double KineticEnergy = particle->GetKineticEnergy();
|
||||
G4Material* material = track.GetMaterial();
|
||||
const G4MaterialTable* theMaterialTable =
|
||||
G4Material::GetMaterialTable();
|
||||
G4int materialindex = material->GetIndex();
|
||||
|
||||
nl = (*theNlambdaTable)[materialindex]->
|
||||
GetValue(KineticEnergy,isOut);
|
||||
range = G4EnergyLossTables::GetPreciseRangeFromEnergy(particletype,
|
||||
KineticEnergy,material) ;
|
||||
|
||||
if ( (previousStepSize <=0.0) || (theNumberOfInteractionLengthLeft<=0.0)) {
|
||||
ResetNumberOfInteractionLengthLeft();
|
||||
} else {
|
||||
if(previousStepSize/range < eps)
|
||||
{
|
||||
nll = (*theNlambdaTable)[materialindex]->
|
||||
GetValue(Tfac*KineticEnergy,isOut) ;
|
||||
dEdx = G4EnergyLossTables::GetPreciseDEDX(particletype,
|
||||
KineticEnergy,
|
||||
material) ;
|
||||
nlold = nl + dEdx*previousStepSize*(nl-nll)/
|
||||
(Tfac1*KineticEnergy) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
rangeold = range + previousStepSize ;
|
||||
KineticEnergyOld = G4EnergyLossTables::GetPreciseEnergyFromRange(
|
||||
particletype,
|
||||
rangeold,material);
|
||||
nlold = (*theNlambdaTable)[materialindex]->
|
||||
GetValue(KineticEnergyOld,isOut);
|
||||
if(nlold < nl)
|
||||
{
|
||||
if(verboseLevel>2)
|
||||
{
|
||||
G4cout << "G4IhIonisation PostStepGPIL : Nlambda has been" <<
|
||||
" increased at update.Nlambda old/new :" << nlold <<
|
||||
" " << nl << G4endl;
|
||||
G4cout << "(theNumberOfInteractionLengthLeft has been increased!)"
|
||||
<< G4endl;
|
||||
G4cout << " correction : Nlambda old=new ........." << G4endl;
|
||||
}
|
||||
nlold = nl ;
|
||||
}
|
||||
}
|
||||
|
||||
theNumberOfInteractionLengthLeft -= nlold-nl ;
|
||||
|
||||
if(theNumberOfInteractionLengthLeft<perMillion)
|
||||
theNumberOfInteractionLengthLeft=0.;
|
||||
}
|
||||
|
||||
|
||||
// condition is set to "Not Forced"
|
||||
*condition = NotForced;
|
||||
if(nl <= theNumberOfInteractionLengthLeft)
|
||||
{
|
||||
value = DBL_MAX ;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(theNumberOfInteractionLengthLeft/nl < eps)
|
||||
{
|
||||
nll = (*theNlambdaTable)[materialindex]->
|
||||
GetValue(Tfac*KineticEnergy,isOut) ;
|
||||
dEdx = G4EnergyLossTables::GetPreciseDEDX(particletype,
|
||||
KineticEnergy,
|
||||
material) ;
|
||||
|
||||
value = theNumberOfInteractionLengthLeft*Tfac1*KineticEnergy/
|
||||
(dEdx*(nl-nll));
|
||||
}
|
||||
else
|
||||
{
|
||||
KineticEnergyNext = (*theInverseNlambdaTable)[materialindex]->
|
||||
GetValue(nl-theNumberOfInteractionLengthLeft,isOut);
|
||||
rangenext = G4EnergyLossTables::GetPreciseRangeFromEnergy(particletype,
|
||||
KineticEnergyNext,material);
|
||||
|
||||
value = range - rangenext ;
|
||||
|
||||
if(range<rangenext)
|
||||
{
|
||||
if(verboseLevel>2)
|
||||
{
|
||||
G4cout << "G4IhIonisation PostStepGPIL: Step < 0.!, Step="
|
||||
<< value << G4endl;
|
||||
G4cout << "range,rangenext:" << range << " " << rangenext << G4endl ;
|
||||
G4cout << "correction : rangenext=range ....." << G4endl;
|
||||
}
|
||||
rangenext = range ;
|
||||
value = range - rangenext ;
|
||||
}
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
inline G4bool G4IhIonisation::IsApplicable(
|
||||
const G4ParticleDefinition& particle)
|
||||
{
|
||||
return(particle.GetPDGCharge() != 0.);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4PAIonisation.hh,v 1.7 2000/09/22 14:44:07 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -86,7 +86,7 @@ GetMeanFreePath( const G4Track& trackData,
|
||||
// G4cout<<"G4PAIonisation::GetMeanFreePath is called"<<G4endl ;
|
||||
|
||||
G4int iTkin, iPlace ;
|
||||
G4double charge, charge2, massRatio, kinE, scaledE, meanFreePath ;
|
||||
G4double charge, charge2, mass, massRatio, kinE, gamma, scaledE, meanFreePath ;
|
||||
G4double E1, E2, W, W1, W2, primaryIon ;
|
||||
|
||||
*condition = NotForced ;
|
||||
@@ -98,9 +98,14 @@ GetMeanFreePath( const G4Track& trackData,
|
||||
{
|
||||
const G4DynamicParticle* aParticle = trackData.GetDynamicParticle() ;
|
||||
kinE = aParticle->GetKineticEnergy() ;
|
||||
mass = aParticle->GetDefinition()->GetPDGMass() ;
|
||||
gamma = 1.0 + kinE/mass ;
|
||||
|
||||
if(gamma < 1.2) return meanFreePath = DBL_MAX ;
|
||||
|
||||
charge = aParticle->GetDefinition()->GetPDGCharge() ;
|
||||
charge2 = charge*charge ;
|
||||
massRatio = proton_mass_c2/aParticle->GetDefinition()->GetPDGMass() ;
|
||||
massRatio = proton_mass_c2/mass ;
|
||||
scaledE = kinE*massRatio ;
|
||||
|
||||
for(iTkin=0;iTkin<G4PAIonisation::GetBinNumber();iTkin++)
|
||||
@@ -235,7 +240,8 @@ GetdEdx( G4double scaledTkin, G4double charge2 )
|
||||
inline G4bool G4PAIonisation::IsApplicable(
|
||||
const G4ParticleDefinition& particle)
|
||||
{
|
||||
return(particle.GetPDGCharge() != 0.);
|
||||
return( particle.GetPDGCharge() != 0. &&
|
||||
particle.GetPDGMass() > 0. );
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4PAIxSection.hh,v 1.4 1999/12/15 14:51:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
//
|
||||
// G4PAIxSection.hh -- header file
|
||||
|
||||
@@ -5,11 +5,10 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4PhotoElectricEffect.hh,v 1.5 1999/12/17 18:26:12 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// $Id: G4PhotoElectricEffect.hh,v 1.6 2001/02/22 16:05:42 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
// ------------ G4PhotoElectricEffect physics process ------
|
||||
// by Michel Maire, April 1996
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//
|
||||
// 12-06-96, Added SelectRandomAtom() method and new data member
|
||||
// for cumulative total cross section, by M.Maire
|
||||
@@ -21,7 +20,8 @@
|
||||
// 13-08-98, new methods SetBining() PrintInfo()
|
||||
// 17-11-98, use table of atomic shells in PostStepDoIt, mma
|
||||
// 06-01-99, Sandia crossSection below 50 keV, V.Grichine mma
|
||||
// ------------------------------------------------------------
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
// class description
|
||||
//
|
||||
|
||||
@@ -5,20 +5,11 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4PhotoElectricEffect.icc,v 1.3 1999/12/15 14:51:48 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// $Id: G4PhotoElectricEffect.icc,v 1.4 2001/02/22 16:05:43 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
// GEANT 4 class inlined methods file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ------------ G4PhotoElectricEffect physics process ---------
|
||||
// by Michel Maire, April 1996
|
||||
// ***************************************************************
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
// 12-06-96, update by M.Maire
|
||||
// 17-09-96, PartialSumSigma(i)
|
||||
// split ComputeBinbingEnergy(), M.Maire
|
||||
@@ -27,8 +18,8 @@
|
||||
// 20-11-97, change for lowest energy limit default action
|
||||
// 17-11-98, use table of atomic shells in PostStepDoIt, mma
|
||||
// 06-01-99, use Sandia crossSection, V.Grichine mma
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4bool G4PhotoElectricEffect::IsApplicable(const G4ParticleDefinition& particle)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4PolarizedComptonScattering.hh,v 1.4 2000/11/17 15:03:16 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
// --------- G4PolarizedComptonScattering physics process -----
|
||||
// by Vicente Lara, March 1998
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4SynchrotronRadiation.hh,v 1.3 2000/11/01 15:30:46 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// $Id: G4SynchrotronRadiation.hh,v 1.4 2001/02/05 17:53:51 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
@@ -43,7 +43,6 @@
|
||||
#include "G4Positron.hh"
|
||||
|
||||
|
||||
#include "G4OrderedTable.hh"
|
||||
#include "G4PhysicsTable.hh"
|
||||
#include "G4PhysicsLogVector.hh"
|
||||
|
||||
|
||||
@@ -1,243 +0,0 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VIeEnergyLoss.hh,v 1.3 2000/08/15 09:42:14 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// $Id:
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ---------- G4VIeEnergyLoss physics process -----------
|
||||
// by Laszlo Urban, 20 March 1997
|
||||
// ************************************************************
|
||||
// It is the first implementation of the new unified Energy Loss process.
|
||||
// It calculates the continuous energy loss for e+/e-.
|
||||
// Processes giving contribution to the continuous loss :
|
||||
// ionisation (= cont.ion.loss + delta ray production)
|
||||
// bremsstrahlung (= cont.loss due to sooft brems+discrete bremsstrahlung)
|
||||
// can be added more easily ..........
|
||||
// This class creates static dE/dx and range tables for e+ and e-,
|
||||
// which tables can be used by other processes.
|
||||
// ------------------------------------------------------------
|
||||
//
|
||||
// 27.05.98 OldGetRange removed + other corrs , L.Urban
|
||||
// 26.10.98 revision , L.Urban
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#ifndef G4VIeEnergyLoss_h
|
||||
#define G4VIeEnergyLoss_h 1
|
||||
|
||||
#include "G4ios.hh"
|
||||
#include "globals.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4IVContinuousDiscreteProcess.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4Element.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4Electron.hh"
|
||||
#include "G4Positron.hh"
|
||||
#include "G4PhysicsLogVector.hh"
|
||||
#include "G4PhysicsLinearVector.hh"
|
||||
|
||||
class G4EnergyLossMessenger;
|
||||
|
||||
|
||||
class G4VIeEnergyLoss : public G4IVContinuousDiscreteProcess
|
||||
|
||||
{
|
||||
public:
|
||||
|
||||
G4VIeEnergyLoss(const G4String& );
|
||||
|
||||
virtual ~G4VIeEnergyLoss();
|
||||
|
||||
G4bool IsApplicable(const G4ParticleDefinition&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
void BuildDEDXTable(const G4ParticleDefinition& aParticleType);
|
||||
|
||||
G4double GetContinuousStepLimit(const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& currentSafety);
|
||||
|
||||
G4VParticleChange* AlongStepDoIt(const G4Track& track,
|
||||
const G4Step& Step) ;
|
||||
|
||||
virtual G4VParticleChange* PostStepDoIt(const G4Track& track,
|
||||
const G4Step& Step) = 0;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
void BuildRangeTable(const G4ParticleDefinition& aParticleType);
|
||||
|
||||
void BuildInverseRangeTable(const G4ParticleDefinition& aParticleType);
|
||||
|
||||
void BuildTimeTables(const G4ParticleDefinition& aParticleType);
|
||||
|
||||
void BuildRangeVector(G4int materialIndex,
|
||||
G4PhysicsLogVector* rangeVector);
|
||||
|
||||
void BuildLabTimeVector(G4int materialIndex,
|
||||
G4PhysicsLogVector* rangeVector);
|
||||
|
||||
void BuildProperTimeVector(G4int materialIndex,
|
||||
G4PhysicsLogVector* rangeVector);
|
||||
|
||||
void InvertRangeVector(G4int materialIndex,
|
||||
G4PhysicsLogVector* rangeVector);
|
||||
|
||||
G4double RangeIntLin(G4PhysicsVector* physicsVector,G4int nbin);
|
||||
|
||||
G4double RangeIntLog(G4PhysicsVector* physicsVector,G4int nbin);
|
||||
G4double LabTimeIntLog(G4PhysicsVector* physicsVector,G4int nbin);
|
||||
G4double ProperTimeIntLog(G4PhysicsVector* physicsVector,G4int nbin);
|
||||
|
||||
void BuildRangeCoeffATable(const G4ParticleDefinition& aParticleType);
|
||||
void BuildRangeCoeffBTable(const G4ParticleDefinition& aParticleType);
|
||||
void BuildRangeCoeffCTable(const G4ParticleDefinition& aParticleType);
|
||||
|
||||
G4double GetConstraints(const G4DynamicParticle* aParticle,
|
||||
G4Material* aMaterial);
|
||||
|
||||
G4double GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
G4Material* aMaterial,
|
||||
G4double ChargeSquare,
|
||||
G4double MeanLoss,
|
||||
G4double step) ;
|
||||
|
||||
// hide assignment operator
|
||||
G4VIeEnergyLoss (G4VIeEnergyLoss &);
|
||||
G4VIeEnergyLoss & operator=(const G4VIeEnergyLoss &right);
|
||||
|
||||
protected:
|
||||
|
||||
G4PhysicsTable* theLossTable;
|
||||
|
||||
G4double ParticleMass; // heavily used
|
||||
|
||||
private:
|
||||
|
||||
G4PhysicsTable* theDEDXTable;
|
||||
|
||||
G4PhysicsTable* theRangeTable;
|
||||
G4PhysicsTable* theInverseRangeTable;
|
||||
|
||||
G4PhysicsTable* theLabTimeTable ;
|
||||
G4PhysicsTable* theProperTimeTable ;
|
||||
|
||||
G4int CounterOfProcess;
|
||||
G4PhysicsTable** RecorderOfProcess;
|
||||
|
||||
G4double fdEdx; // computed in GetConstraints
|
||||
G4double fRangeNow; // computed in GetConstraints
|
||||
|
||||
G4int EnergyBinNumber; // computed in GetConstraints
|
||||
// (needed to compute range)
|
||||
G4int TotBin; // number of bins in table,
|
||||
// calculated in BuildPhysicTable
|
||||
G4double LowestKineticEnergy;
|
||||
G4double HighestKineticEnergy;
|
||||
G4double RTable,LOGRTable; // LOGRTable=log(HighestKineticEnergy-
|
||||
// LowestKineticEnergy)/TotBin
|
||||
// RTable = exp(LOGRTable)
|
||||
|
||||
G4PhysicsTable* theRangeCoeffATable;
|
||||
G4PhysicsTable* theRangeCoeffBTable;
|
||||
G4PhysicsTable* theRangeCoeffCTable;
|
||||
|
||||
// variables for the integration routines
|
||||
G4double taulow,tauhigh,ltaulow,ltauhigh;
|
||||
|
||||
// data members to speed up the fluctuation calculation
|
||||
G4Material* lastMaterial;
|
||||
G4int imat;
|
||||
G4double f1Fluct,f2Fluct,e1Fluct,e2Fluct,rateFluct,ipotFluct;
|
||||
G4double e1LogFluct,e2LogFluct,ipotLogFluct;
|
||||
const G4double MaxExcitationNumber ;
|
||||
const G4double probLimFluct ;
|
||||
const long nmaxDirectFluct,nmaxCont1,nmaxCont2 ;
|
||||
|
||||
//
|
||||
// static part of the class
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
//basic DEDX and Range tables
|
||||
static G4PhysicsTable* theDEDXElectronTable ;
|
||||
static G4PhysicsTable* theDEDXPositronTable ;
|
||||
static G4PhysicsTable* theRangeElectronTable ;
|
||||
static G4PhysicsTable* theRangePositronTable ;
|
||||
|
||||
//inverse tables of the range tables
|
||||
static G4PhysicsTable* theInverseRangeElectronTable;
|
||||
static G4PhysicsTable* theInverseRangePositronTable;
|
||||
|
||||
// lab and proper time tables
|
||||
static G4PhysicsTable* theLabTimeElectronTable ;
|
||||
static G4PhysicsTable* theLabTimePositronTable ;
|
||||
static G4PhysicsTable* theProperTimeElectronTable ;
|
||||
static G4PhysicsTable* theProperTimePositronTable ;
|
||||
|
||||
//processes inherited from G4VIeEnergyLoss
|
||||
//register themselves in the static array Recorder
|
||||
//for electrons/positrons separately
|
||||
//nb of contributing processes = NbOfProcesses
|
||||
static G4int NbOfProcesses;
|
||||
static G4int CounterOfElectronProcess;
|
||||
static G4int CounterOfPositronProcess ;
|
||||
static G4PhysicsTable** RecorderOfElectronProcess;
|
||||
static G4PhysicsTable** RecorderOfPositronProcess;
|
||||
|
||||
private:
|
||||
|
||||
//for interpolation within the tables
|
||||
static G4PhysicsTable* theeRangeCoeffATable;
|
||||
static G4PhysicsTable* theeRangeCoeffBTable;
|
||||
static G4PhysicsTable* theeRangeCoeffCTable;
|
||||
static G4PhysicsTable* thepRangeCoeffATable;
|
||||
static G4PhysicsTable* thepRangeCoeffBTable;
|
||||
static G4PhysicsTable* thepRangeCoeffCTable;
|
||||
|
||||
static G4double dRoverRange; // dRoverRange is the maximum allowed
|
||||
// deltarange/range in one Step
|
||||
static G4double finalRange; // final step before stopping
|
||||
|
||||
static G4bool rndmStepFlag; // control the randomization of the step
|
||||
static G4bool EnlossFlucFlag; // control the energy loss fluctuation
|
||||
|
||||
static G4EnergyLossMessenger* eLossMessenger;
|
||||
|
||||
public:
|
||||
|
||||
static void SetNbOfProcesses(G4int nb) {NbOfProcesses=nb;};
|
||||
static void PlusNbOfProcesses() {NbOfProcesses++ ;};
|
||||
static void MinusNbOfProcesses() {NbOfProcesses-- ;};
|
||||
static G4int GetNbOfProcesses() {return NbOfProcesses;};
|
||||
|
||||
static void SetRndmStep (G4bool value) {rndmStepFlag = value;}
|
||||
static void SetEnlossFluc (G4bool value) {EnlossFlucFlag = value;}
|
||||
static void SetStepFunction (G4double c1, G4double c2)
|
||||
{dRoverRange = c1; finalRange = c2;}
|
||||
};
|
||||
|
||||
#include "G4VIeEnergyLoss.icc"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VIeEnergyLoss.icc,v 1.1 2000/04/25 14:33:02 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// $Id:
|
||||
// ---------------------------------------------------------------
|
||||
// GEANT 4 class inlined methods file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD group
|
||||
// History: based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ------------ G4VIeEnergyLoss physics process ------------
|
||||
// by Laszlo Urban, 20 March 1997
|
||||
// ***************************************************************
|
||||
// It is the first implementation of the NEW UNIFIED ENERGY LOSS PROCESS.
|
||||
// It calculates the energy loss of e+/e-.
|
||||
// -------------------------------------------------------------
|
||||
//
|
||||
// 27-05-98: new randomization of the Step limit , new extrapolations for
|
||||
// high/low energies. L.Urban
|
||||
// 26-10-98: cleanup , L.Urban
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
inline G4bool G4VIeEnergyLoss::IsApplicable(const G4ParticleDefinition&
|
||||
particle)
|
||||
{
|
||||
return( (&particle == G4Electron::Electron())
|
||||
||(&particle == G4Positron::Positron()) );
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VIeEnergyLoss::GetContinuousStepLimit(
|
||||
const G4Track& track,
|
||||
G4double,
|
||||
G4double currentMinimumStep,
|
||||
G4double&)
|
||||
{
|
||||
|
||||
G4double Step =
|
||||
GetConstraints(track.GetDynamicParticle(),track.GetMaterial());
|
||||
|
||||
if ((Step>0.0)&&(Step<currentMinimumStep)) currentMinimumStep = Step;
|
||||
|
||||
return Step ;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -1,295 +0,0 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VIhEnergyLoss.hh,v 1.3 2000/08/15 09:42:14 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// $Id:
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ---------- G4VIhEnergyLoss physics process -----------
|
||||
// by Laszlo Urban, 30 May 1997
|
||||
//
|
||||
// ************************************************************
|
||||
// It is the first implementation of the NEW UNIFIED ENERGY LOSS PROCESS.
|
||||
// It calculates the continuous energy loss for charged hadrons.
|
||||
// Processes giving contribution to the continuous loss :
|
||||
// ionisation (= cont.ion.loss + delta ray production)
|
||||
// can be added more easily ..........
|
||||
// This class creates static proton/antiproton dE/dx and range tables ,
|
||||
// which tables can be used by other processes.
|
||||
// The energy loss for other charged hadrons is calculated from the p/pbar
|
||||
// tables with scaled kinetic energy.
|
||||
//
|
||||
// ****************************************************************************
|
||||
// It is assumed that the cut in range is the same for all the charged hadrons!
|
||||
// ****************************************************************************
|
||||
//
|
||||
// 7/10/98 some bugs fixed + some cleanup , L.Urban
|
||||
// 26/10/98 cleanup , L.Urban
|
||||
//
|
||||
|
||||
#ifndef G4VIhEnergyLoss_h
|
||||
#define G4VIhEnergyLoss_h 1
|
||||
|
||||
#include "G4ios.hh"
|
||||
#include "globals.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4IVContinuousDiscreteProcess.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4Element.hh"
|
||||
#include "G4Proton.hh"
|
||||
#include "G4AntiProton.hh"
|
||||
#include "G4Electron.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4PhysicsLogVector.hh"
|
||||
#include "G4PhysicsLinearVector.hh"
|
||||
|
||||
class G4EnergyLossMessenger;
|
||||
|
||||
class G4VIhEnergyLoss : public G4IVContinuousDiscreteProcess
|
||||
|
||||
{
|
||||
public:
|
||||
|
||||
G4VIhEnergyLoss(const G4String& );
|
||||
|
||||
virtual ~G4VIhEnergyLoss();
|
||||
|
||||
G4bool IsApplicable(const G4ParticleDefinition&);
|
||||
|
||||
G4double GetContinuousStepLimit(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& currentSafety) ;
|
||||
|
||||
G4VParticleChange* AlongStepDoIt(const G4Track& track ,const G4Step& Step) ;
|
||||
|
||||
virtual G4VParticleChange* PostStepDoIt(const G4Track& track,
|
||||
const G4Step& Step) = 0 ;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// hide assignment operator
|
||||
|
||||
G4VIhEnergyLoss(G4VIhEnergyLoss &);
|
||||
G4VIhEnergyLoss & operator=(const G4VIhEnergyLoss &right);
|
||||
|
||||
G4double GetConstraints(const G4DynamicParticle *aParticle,
|
||||
G4Material *aMaterial);
|
||||
|
||||
G4double GetLossWithFluct(const G4DynamicParticle *aParticle,
|
||||
G4Material *aMaterial,
|
||||
G4double ChargeSquare,
|
||||
G4double MeanLoss,
|
||||
G4double Step) ;
|
||||
|
||||
// =====================================================================
|
||||
|
||||
public:
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
G4PhysicsTable* theLossTable ;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
G4double fdEdx; // computed in GetContraints
|
||||
|
||||
G4double fRangeNow ; // computed in GetContraints
|
||||
|
||||
G4int EnergyBinNumber ;
|
||||
G4double RangeCoeffA,RangeCoeffB,RangeCoeffC ;
|
||||
|
||||
// variables for the integration routines
|
||||
static G4double Mass,taulow,tauhigh,ltaulow,ltauhigh;
|
||||
|
||||
// data members to speed up the fluctuation calculation
|
||||
G4Material *lastMaterial ;
|
||||
G4int imat ;
|
||||
G4double f1Fluct,f2Fluct,e1Fluct,e2Fluct,rateFluct,ipotFluct;
|
||||
G4double e1LogFluct,e2LogFluct,ipotLogFluct;
|
||||
const G4double MaxExcitationNumber ;
|
||||
const G4double probLimFluct ;
|
||||
const long nmaxDirectFluct,nmaxCont1,nmaxCont2 ;
|
||||
|
||||
// ====================================================================
|
||||
// static part of the class
|
||||
|
||||
public:
|
||||
|
||||
// get the number of processes contributing to the cont.energy loss
|
||||
static G4int GetNumberOfProcesses() { return NumberOfProcesses; };
|
||||
|
||||
// set the number of processes contributing to the cont.energy loss
|
||||
static void SetNumberOfProcesses(G4int number)
|
||||
{NumberOfProcesses=number ; };
|
||||
|
||||
// Increment the number of processes contributing to the cont.energy loss
|
||||
static void PlusNumberOfProcesses()
|
||||
{ NumberOfProcesses++ ; };
|
||||
|
||||
// decrement the number of processes contributing to the cont.energy loss
|
||||
static void MinusNumberOfProcesses()
|
||||
{ NumberOfProcesses-- ; };
|
||||
|
||||
static void SetdRoverRange(G4double value) {dRoverRange = value;}
|
||||
static void SetRndmStep (G4bool value) {rndmStepFlag = value;}
|
||||
static void SetEnlossFluc (G4bool value) {EnlossFlucFlag = value;}
|
||||
static void SetStepFunction (G4double c1, G4double c2)
|
||||
{dRoverRange = c1; finalRange = c2;}
|
||||
|
||||
protected:
|
||||
|
||||
static void BuildDEDXTable(const G4ParticleDefinition& aParticleType);
|
||||
|
||||
private:
|
||||
|
||||
static void BuildRangeTable(const G4ParticleDefinition& aParticleType);
|
||||
|
||||
static void BuildInverseRangeTable(
|
||||
const G4ParticleDefinition& aParticleType);
|
||||
|
||||
static void BuildTimeTables(const G4ParticleDefinition& aParticleType);
|
||||
|
||||
static void BuildLabTimeVector(G4int materialIndex,
|
||||
G4PhysicsLogVector* rangeVector);
|
||||
|
||||
static void BuildProperTimeVector(G4int materialIndex,
|
||||
G4PhysicsLogVector* rangeVector);
|
||||
|
||||
static void InvertRangeVector(G4int materialIndex,
|
||||
G4PhysicsLogVector* rangeVector);
|
||||
|
||||
static void BuildRangeVector(G4int materialIndex,
|
||||
G4PhysicsLogVector* rangeVector);
|
||||
|
||||
static G4double LabTimeIntLog(G4PhysicsVector* physicsVector
|
||||
,G4int nbin);
|
||||
|
||||
static G4double ProperTimeIntLog(G4PhysicsVector* physicsVector,
|
||||
G4int nbin);
|
||||
|
||||
static G4double RangeIntLin(G4PhysicsVector* physicsVector
|
||||
,G4int nbin);
|
||||
|
||||
static G4double RangeIntLog(G4PhysicsVector* physicsVector
|
||||
,G4int nbin);
|
||||
|
||||
static void BuildRangeCoeffATable(
|
||||
const G4ParticleDefinition& aParticleType);
|
||||
static void BuildRangeCoeffBTable(
|
||||
const G4ParticleDefinition& aParticleType);
|
||||
static void BuildRangeCoeffCTable(
|
||||
const G4ParticleDefinition& aParticleType);
|
||||
|
||||
|
||||
|
||||
// ====================================================================
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
static G4PhysicsTable* theDEDXpTable ;
|
||||
static G4PhysicsTable* theDEDXpbarTable ;
|
||||
static G4PhysicsTable* theRangepTable ;
|
||||
static G4PhysicsTable* theRangepbarTable ;
|
||||
|
||||
//inverse of the range tables
|
||||
static G4PhysicsTable* theInverseRangepTable ;
|
||||
static G4PhysicsTable* theInverseRangepbarTable ;
|
||||
|
||||
//lab and proper time tables
|
||||
static G4PhysicsTable* theLabTimepTable ;
|
||||
static G4PhysicsTable* theLabTimepbarTable ;
|
||||
|
||||
static G4PhysicsTable* theProperTimepTable ;
|
||||
static G4PhysicsTable* theProperTimepbarTable ;
|
||||
|
||||
// processes inherited from G4VIhEnergyLoss
|
||||
// register themselves in the static array Recorder
|
||||
static G4PhysicsTable** RecorderOfpProcess;
|
||||
static G4PhysicsTable** RecorderOfpbarProcess;
|
||||
static G4int CounterOfpProcess ;
|
||||
static G4int CounterOfpbarProcess ;
|
||||
|
||||
// particle mass
|
||||
static G4double ParticleMass ;
|
||||
|
||||
static const G4Proton* theProton ;
|
||||
static const G4AntiProton* theAntiProton ;
|
||||
|
||||
// cut in range
|
||||
static G4double CutInRange;
|
||||
|
||||
static G4double LowestKineticEnergy;
|
||||
static G4double HighestKineticEnergy;
|
||||
static G4int TotBin; // number of bins in table,
|
||||
// calculated in BuildPhysicsTable
|
||||
static G4double RTable,LOGRTable; // LOGRTable=log(HighestKineticEnergy
|
||||
// /LowestKineticEnergy)/TotBin
|
||||
// RTable = exp(LOGRTable)
|
||||
|
||||
private:
|
||||
|
||||
static G4PhysicsTable* theDEDXTable;
|
||||
|
||||
static G4PhysicsTable* theRangeTable;
|
||||
static G4PhysicsTable* theInverseRangeTable;
|
||||
|
||||
static G4PhysicsTable* theLabTimeTable;
|
||||
static G4PhysicsTable* theProperTimeTable;
|
||||
|
||||
static G4PhysicsTable** RecorderOfProcess;
|
||||
static G4int CounterOfProcess;
|
||||
|
||||
|
||||
static G4PhysicsTable* thepRangeCoeffATable;
|
||||
static G4PhysicsTable* thepRangeCoeffBTable;
|
||||
static G4PhysicsTable* thepRangeCoeffCTable;
|
||||
static G4PhysicsTable* thepbarRangeCoeffATable;
|
||||
static G4PhysicsTable* thepbarRangeCoeffBTable;
|
||||
static G4PhysicsTable* thepbarRangeCoeffCTable;
|
||||
|
||||
static G4PhysicsTable* theRangeCoeffATable;
|
||||
static G4PhysicsTable* theRangeCoeffBTable;
|
||||
static G4PhysicsTable* theRangeCoeffCTable;
|
||||
|
||||
static G4double dRoverRange ; // maximum allowed deltarange/range
|
||||
// in one step
|
||||
|
||||
static G4double finalRange ; // last step before stop
|
||||
|
||||
static G4bool rndmStepFlag ;
|
||||
static G4bool EnlossFlucFlag ;
|
||||
|
||||
static G4int NumberOfProcesses ;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#include "G4VIhEnergyLoss.icc"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VIhEnergyLoss.icc,v 1.1 2000/04/25 14:33:02 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// $Id:
|
||||
// ---------------------------------------------------------------
|
||||
// GEANT 4 class inlined methods file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD group
|
||||
// History: based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ------------ G4VIhEnergyLoss physics process ------------
|
||||
// by Laszlo Urban, 30 May 1997
|
||||
// ***************************************************************
|
||||
// It is the first implementation of the NEW UNIFIED ENERGY LOSS PROCESS.
|
||||
// It calculates the energy loss of charged hadrons.
|
||||
// ***************************************************************
|
||||
// 26/10/98: cleanup , L.Urban
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
inline G4bool G4VIhEnergyLoss::IsApplicable(const G4ParticleDefinition&
|
||||
particle)
|
||||
{
|
||||
return(particle.GetPDGCharge()!= 0.);
|
||||
}
|
||||
|
||||
inline G4double G4VIhEnergyLoss::GetContinuousStepLimit(
|
||||
const G4Track& track,
|
||||
G4double,
|
||||
G4double currentMinimumStep,
|
||||
G4double&)
|
||||
{
|
||||
|
||||
G4double Step =
|
||||
GetConstraints(track.GetDynamicParticle(),track.GetMaterial()) ;
|
||||
|
||||
if((Step>0.0)&&(Step<currentMinimumStep))
|
||||
currentMinimumStep = Step ;
|
||||
|
||||
return Step ;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VPAIenergyLoss.hh,v 1.2 2000/06/07 17:00:48 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VeEnergyLoss.hh,v 1.5 2000/10/30 06:56:19 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VeEnergyLoss.icc,v 1.2 2000/05/23 14:39:26 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
// GEANT 4 class inlined methods file
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VhEnergyLoss.hh,v 1.7 2000/10/30 06:56:19 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VhEnergyLoss.icc,v 1.2 2000/05/23 14:39:27 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
// GEANT 4 class inlined methods file
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4eBremsstrahlung.hh,v 1.7 2000/08/08 10:26:19 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// $Id: G4eBremsstrahlung.hh,v 1.8 2001/01/11 10:39:48 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -93,9 +93,6 @@ class G4eBremsstrahlung : public G4VeEnergyLoss
|
||||
G4double ComputeBremLoss(G4double Z,G4double natom,G4double T,
|
||||
G4double Cut,G4double x);
|
||||
|
||||
G4double ComputeXYPolynomial(G4double x,G4double y,G4int xSize,
|
||||
G4int ySize,const G4double coeff[]);
|
||||
|
||||
G4double ComputePositronCorrFactorLoss(G4double AtomicNumber,
|
||||
G4double KineticEnergy,
|
||||
G4double GammaEnergyCut);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4eBremsstrahlung.icc,v 1.3 2000/05/23 15:44:07 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4eIonisation.hh,v 1.7 2000/10/30 06:56:19 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4eIonisation.icc,v 1.3 1999/12/15 14:51:49 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
@@ -5,16 +5,16 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4eplusAnnihilation.hh,v 1.3 1999/12/17 18:26:12 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// ------------ G4eplusAnnihilation process ------
|
||||
// by Michel Maire, 7 july 1996
|
||||
// $Id: G4eplusAnnihilation.hh,v 1.4 2001/02/22 18:26:07 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
// 10-01-97, crossection table + meanfreepath table, M.Maire
|
||||
// 17-03-97, merge 'in fly' and 'at rest', M.Maire
|
||||
// 31-08-98, new methods SetBining() and PrintInfo()
|
||||
// ------------------------------------------------------------
|
||||
//
|
||||
|
||||
// class description
|
||||
//
|
||||
|
||||
@@ -5,24 +5,15 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4eplusAnnihilation.icc,v 1.2 1999/12/15 14:51:49 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// $Id: G4eplusAnnihilation.icc,v 1.3 2001/02/22 18:26:08 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
// GEANT 4 class inlined methods file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ------------ G4eplusAnnihilation process ---------
|
||||
// by Michel Maire, 7 July 1996
|
||||
// ***************************************************************
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
// 10-01-97, crossection table + meanfreepath table, M.Maire
|
||||
// 17-03-97, merge 'in fly' and 'at rest', M.Maire
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4bool G4eplusAnnihilation::IsApplicable(const G4ParticleDefinition& particle)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4hIonisation.hh,v 1.10 2000/10/30 06:56:19 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4hIonisation.icc,v 1.3 1999/12/15 14:51:49 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
G4IMultipleScattering.hh
|
||||
G4IMultipleScattering.icc
|
||||
G4IeBremsstrahlung.hh
|
||||
G4IeBremsstrahlung.icc
|
||||
G4IeEnergyLoss.hh
|
||||
G4IeEnergyLoss.icc
|
||||
G4IeIonisation.hh
|
||||
G4IeIonisation.icc
|
||||
G4IeplusAnnihilation.hh
|
||||
G4IeplusAnnihilation.icc
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4ComptonScattering.cc,v 1.4 2000/11/17 15:03:17 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
//
|
||||
//------------ G4ComptonScattering physics process --------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4GammaConversion.cc,v 1.4 2000/08/03 08:36:52 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,963 +0,0 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4IeIonisation.cc,v 1.5 2000/04/25 14:33:08 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// $Id:
|
||||
// -------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD group
|
||||
// History: based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ---------- G4IeIonisation physics process -----------
|
||||
// by Laszlo Urban, 23 June 1998
|
||||
// ************************************************************
|
||||
// It is the first implementation of the IONISATION
|
||||
// PROCESS. ( delta rays + continuous energy loss)
|
||||
// using an INTEGRAL APPROACH instead of the differential
|
||||
// one used in the standard implementation .
|
||||
// ************************************************************
|
||||
// 27/10/98: minor changes + cleanup, L.Urban
|
||||
// --------------------------------------------------------------
|
||||
|
||||
|
||||
#include "G4IeIonisation.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
|
||||
G4IeIonisation::G4IeIonisation(const G4String& processName)
|
||||
: G4VIeEnergyLoss(processName),
|
||||
theMeanFreePathTable(NULL),
|
||||
theNlambdaTable(NULL),
|
||||
theInverseNlambdaTable(NULL),
|
||||
theCoeffATable(NULL),
|
||||
theCoeffBTable(NULL),
|
||||
theCoeffCTable(NULL),
|
||||
LowestKineticEnergy(1.00*keV),
|
||||
HighestKineticEnergy(100.*TeV),
|
||||
TotBin(100),
|
||||
NumberOfBuildPhysicsTableCalls(0),
|
||||
theElectron ( G4Electron::Electron() ),
|
||||
thePositron ( G4Positron::Positron() )
|
||||
{ }
|
||||
|
||||
G4IeIonisation::~G4IeIonisation()
|
||||
{
|
||||
if (theMeanFreePathTable) {
|
||||
theMeanFreePathTable->clearAndDestroy();
|
||||
delete theMeanFreePathTable;
|
||||
}
|
||||
if (theNlambdaTable) {
|
||||
theNlambdaTable->clearAndDestroy();
|
||||
delete theNlambdaTable;
|
||||
}
|
||||
if (theInverseNlambdaTable) {
|
||||
theInverseNlambdaTable->clearAndDestroy();
|
||||
delete theInverseNlambdaTable;
|
||||
}
|
||||
if(theCoeffATable) {
|
||||
theCoeffATable->clearAndDestroy();
|
||||
delete theCoeffATable;
|
||||
}
|
||||
if(theCoeffBTable) {
|
||||
theCoeffBTable->clearAndDestroy();
|
||||
delete theCoeffBTable;
|
||||
}
|
||||
if(theCoeffCTable) {
|
||||
theCoeffCTable->clearAndDestroy();
|
||||
delete theCoeffCTable;
|
||||
}
|
||||
}
|
||||
|
||||
void G4IeIonisation::SetPhysicsTableBining(
|
||||
G4double lowE,G4double highE,G4int nBins)
|
||||
{
|
||||
LowestKineticEnergy=lowE; HighestKineticEnergy=highE; TotBin=nBins;
|
||||
}
|
||||
|
||||
void G4IeIonisation::BuildPhysicsTable(
|
||||
const G4ParticleDefinition& aParticleType)
|
||||
{
|
||||
RTable = exp(log(HighestKineticEnergy/LowestKineticEnergy)/TotBin) ;
|
||||
NumberOfBuildPhysicsTableCalls += 1 ;
|
||||
if(NumberOfBuildPhysicsTableCalls == 1)
|
||||
{
|
||||
BuildLossTable(aParticleType) ;
|
||||
|
||||
if(&aParticleType==theElectron)
|
||||
{
|
||||
RecorderOfElectronProcess[CounterOfElectronProcess] =
|
||||
(*this).theLossTable ;
|
||||
CounterOfElectronProcess++;
|
||||
}
|
||||
else
|
||||
{
|
||||
RecorderOfPositronProcess[CounterOfPositronProcess] =
|
||||
(*this).theLossTable ;
|
||||
CounterOfPositronProcess++;
|
||||
}
|
||||
|
||||
BuildLambdaTable(aParticleType) ;
|
||||
|
||||
BuildDEDXTable(aParticleType) ;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
BuildNlambdaTable(aParticleType) ;
|
||||
|
||||
BuildCoeffATable(aParticleType) ;
|
||||
BuildCoeffBTable(aParticleType) ;
|
||||
BuildCoeffCTable(aParticleType) ;
|
||||
|
||||
BuildInverseNlambdaTable(aParticleType) ;
|
||||
|
||||
G4int printflag = 0 ;
|
||||
if(printflag>0)
|
||||
TestOfInversion(aParticleType,printflag) ;
|
||||
|
||||
NumberOfBuildPhysicsTableCalls = 0 ;
|
||||
|
||||
if(&aParticleType==G4Electron::Electron())
|
||||
PrintInfoDefinition();
|
||||
}
|
||||
}
|
||||
|
||||
void G4IeIonisation::TestOfInversion(
|
||||
const G4ParticleDefinition& aParticleType,
|
||||
G4int printflag)
|
||||
{
|
||||
G4double T,Nlambda,Tprime,delta,del,sum,delmean,Tdelta ;
|
||||
G4bool isOut ;
|
||||
|
||||
const G4MaterialTable* theMaterialTable=
|
||||
G4Material::GetMaterialTable();
|
||||
G4int numOfMaterials = theMaterialTable->length() ;
|
||||
|
||||
G4cout.setf(G4std::ios::scientific, G4std::ios::floatfield) ;
|
||||
if(printflag>1)
|
||||
{
|
||||
G4cout << G4endl;
|
||||
G4cout << " particle=" << aParticleType.GetParticleName() << G4endl;
|
||||
G4cout << "----------------------" << G4endl;
|
||||
}
|
||||
for (G4int J=0; J<numOfMaterials; J++)
|
||||
{
|
||||
if(printflag>1)
|
||||
{
|
||||
G4cout << G4endl;
|
||||
G4cout << " material = " << (*theMaterialTable)[J]->GetName() << G4endl;
|
||||
G4cout << " mat.ind.=" << J << " T Nlambda Tprime"
|
||||
<< " (Tprime-T)/T(%)" << G4endl ;
|
||||
}
|
||||
|
||||
G4PhysicsLogVector* aVector ;
|
||||
|
||||
aVector = new G4PhysicsLogVector(LowestKineticEnergy,
|
||||
HighestKineticEnergy,TotBin) ;
|
||||
delta = 0. ;
|
||||
delmean = 0.;
|
||||
sum = 0.;
|
||||
Tdelta = 0. ;
|
||||
for (G4int i=0; i<TotBin-2; i++)
|
||||
{
|
||||
T = aVector->GetLowEdgeEnergy(i) ;
|
||||
|
||||
Nlambda = (*theNlambdaTable)[J]->GetValue(T,isOut) ;
|
||||
|
||||
if(Nlambda>0.)
|
||||
{
|
||||
Tprime = (*theInverseNlambdaTable)[J]->GetValue(Nlambda,isOut) ;
|
||||
|
||||
if((Nlambda>0.)&&(i<(TotBin-1)))
|
||||
{
|
||||
del = 100.*(Tprime-T)/T ;
|
||||
sum += 1.;
|
||||
delmean += abs(del);
|
||||
if(abs(del)>abs(delta))
|
||||
{
|
||||
delta = del ;
|
||||
Tdelta = T ;
|
||||
}
|
||||
}
|
||||
if(printflag>1)
|
||||
{
|
||||
G4cout << G4std::setw(18) << G4std::setprecision(6) << T << " " <<
|
||||
G4std::setw(14)<< G4std::setprecision(6) << Nlambda << " " <<
|
||||
G4std::setw(14) << G4std::setprecision(6) << Tprime << " " <<
|
||||
G4std::setw(12) << G4std::setprecision(3) << del << G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(printflag>0)
|
||||
{
|
||||
G4cout << G4endl;
|
||||
G4cout << "G4IeIonisation::TestOfInversion (T->Nlambda->Tprime) " << G4endl ;
|
||||
G4cout << "particle= " << aParticleType.GetParticleName() <<
|
||||
" material= " << (*theMaterialTable)[J]->GetName() << G4endl ;
|
||||
G4cout << "max (Tprime-T)/T in % =" << G4std::setw(10) << G4std::setprecision(3) <<
|
||||
delta ;
|
||||
G4cout << " at a kinetic energy " << G4std::setw(10) << G4std::setprecision(3) <<
|
||||
Tdelta/MeV << " MeV" << G4endl;
|
||||
delmean /= sum ;
|
||||
G4cout << "mean rel.diff. (Tprime-T)/T=" << G4std::setw(10) <<
|
||||
G4std::setprecision(3) << delmean <<
|
||||
" % (mean is calculated in abs. value)" << G4endl;
|
||||
G4cout << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void G4IeIonisation::BuildNlambdaTable(
|
||||
const G4ParticleDefinition& aParticleType)
|
||||
{
|
||||
const G4MaterialTable* theMaterialTable=
|
||||
G4Material::GetMaterialTable();
|
||||
G4int numOfMaterials = theMaterialTable->length() ;
|
||||
|
||||
if(theNlambdaTable)
|
||||
{ theNlambdaTable->clearAndDestroy();
|
||||
delete theNlambdaTable ; }
|
||||
|
||||
theNlambdaTable = new G4PhysicsTable(numOfMaterials) ;
|
||||
|
||||
for (G4int J=0; J<numOfMaterials; J++)
|
||||
{
|
||||
G4PhysicsLogVector* aVector ;
|
||||
aVector = new G4PhysicsLogVector(LowestKineticEnergy,
|
||||
HighestKineticEnergy,TotBin) ;
|
||||
BuildNlambdaVector(aParticleType,J,aVector) ;
|
||||
theNlambdaTable->insert(aVector) ;
|
||||
}
|
||||
}
|
||||
|
||||
void G4IeIonisation::BuildNlambdaVector(
|
||||
const G4ParticleDefinition& aParticleType,
|
||||
G4int materialIndex,
|
||||
G4PhysicsLogVector* nlambdaVector)
|
||||
{
|
||||
G4double LowEdgeEnergy,T,Tlast,dEdx,Value,Vlast,u,du,coeff,l ;
|
||||
G4double thresholdEnergy ;
|
||||
const G4int nbin = 20 ;
|
||||
G4bool isOut ;
|
||||
const G4double small = 1.e-100;
|
||||
const G4double lmin=1.e-100,lmax=1.e100;
|
||||
|
||||
const G4MaterialTable* theMaterialTable=
|
||||
G4Material::GetMaterialTable();
|
||||
|
||||
if(&aParticleType == theElectron)
|
||||
thresholdEnergy = 2.*DeltaCutInKineticEnergy[materialIndex];
|
||||
else
|
||||
thresholdEnergy = DeltaCutInKineticEnergy[materialIndex];
|
||||
|
||||
// here assumed that the threshold energy for the process >=
|
||||
// LowestKineticEnergy (temporarily )
|
||||
if(thresholdEnergy >= LowestKineticEnergy)
|
||||
{
|
||||
Value = 0. ;
|
||||
}
|
||||
else
|
||||
{
|
||||
// extrapolation needed ..................
|
||||
//first integral from thresholdEnergy to LowestKineticEnergy
|
||||
Value = 0. ;
|
||||
}
|
||||
nlambdaVector->PutValue(0,Value) ;
|
||||
Tlast = LowestKineticEnergy ;
|
||||
Vlast = Value ;
|
||||
|
||||
for (G4int i=1; i<TotBin; i++)
|
||||
{
|
||||
LowEdgeEnergy = nlambdaVector->GetLowEdgeEnergy(i) ;
|
||||
Value = 0. ;
|
||||
if(LowEdgeEnergy > thresholdEnergy)
|
||||
{
|
||||
u = log(LowEdgeEnergy/Tlast) ;
|
||||
du = u/nbin ;
|
||||
u = -du ;
|
||||
for(G4int n=0; n<=nbin; n++)
|
||||
{
|
||||
u += du ;
|
||||
T = Tlast*exp(u) ;
|
||||
if((n==0)||(n==nbin))
|
||||
coeff=0.5 ;
|
||||
else
|
||||
coeff=1.0 ;
|
||||
|
||||
l = (*theMeanFreePathTable)[materialIndex]->GetValue(T,isOut);
|
||||
if((l>lmin) && (l<lmax))
|
||||
Value += coeff*T/(G4EnergyLossTables::GetPreciseDEDX(&aParticleType,
|
||||
T,(*theMaterialTable)[materialIndex])*l);
|
||||
}
|
||||
|
||||
Value *= du ;
|
||||
Value += Vlast ;
|
||||
|
||||
if(Value<small)
|
||||
Value = 0. ;
|
||||
}
|
||||
|
||||
nlambdaVector->PutValue(i,Value) ;
|
||||
Tlast = LowEdgeEnergy ;
|
||||
Vlast = Value ;
|
||||
}
|
||||
}
|
||||
|
||||
void G4IeIonisation::BuildCoeffATable(
|
||||
const G4ParticleDefinition& aParticleType)
|
||||
{
|
||||
const G4MaterialTable* theMaterialTable=
|
||||
G4Material::GetMaterialTable();
|
||||
// create table for coefficients "A"
|
||||
G4int numOfMaterials = theMaterialTable->length();
|
||||
|
||||
if(theCoeffATable)
|
||||
{ theCoeffATable->clearAndDestroy();
|
||||
delete theCoeffATable; }
|
||||
|
||||
theCoeffATable = new G4PhysicsTable(numOfMaterials);
|
||||
|
||||
G4double R2 = RTable*RTable ;
|
||||
G4double R1 = RTable+1.;
|
||||
G4double w = R1*(RTable-1.)*(RTable-1.);
|
||||
G4double w1 = RTable/w , w2 = -RTable*R1/w , w3 = R2/w ;
|
||||
G4double Ti , Tim , Tip , Ri , Rim , Rip , Value ;
|
||||
G4bool isOut;
|
||||
|
||||
for (G4int J=0; J<numOfMaterials; J++)
|
||||
{
|
||||
G4int binmax=TotBin ;
|
||||
G4PhysicsLinearVector* aVector =
|
||||
new G4PhysicsLinearVector(0.,binmax, TotBin);
|
||||
|
||||
Ti = LowestKineticEnergy ;
|
||||
|
||||
G4PhysicsVector* lVector= (*theNlambdaTable)[J];
|
||||
|
||||
for ( G4int i=0; i<TotBin; i++)
|
||||
{
|
||||
Ri = lVector->GetValue(Ti,isOut) ;
|
||||
|
||||
if ( i==0 )
|
||||
Rim = Ri/sqrt(RTable) ;
|
||||
else
|
||||
{
|
||||
Tim = Ti/RTable ;
|
||||
Rim = lVector->GetValue(Tim,isOut);
|
||||
}
|
||||
|
||||
Tip = Ti*RTable ;
|
||||
Rip = lVector->GetValue(Tip,isOut);
|
||||
|
||||
if( i < (TotBin-1))
|
||||
Value = (w1*Rip + w2*Ri + w3*Rim)/(Ti*Ti) ;
|
||||
else
|
||||
Value = 0. ;
|
||||
|
||||
aVector->PutValue(i,Value);
|
||||
|
||||
Ti = RTable*Ti ;
|
||||
|
||||
}
|
||||
|
||||
theCoeffATable->insert(aVector);
|
||||
}
|
||||
}
|
||||
|
||||
void G4IeIonisation::BuildCoeffBTable(
|
||||
const G4ParticleDefinition& aParticleType)
|
||||
{
|
||||
const G4MaterialTable* theMaterialTable=
|
||||
G4Material::GetMaterialTable();
|
||||
|
||||
// create table for coefficients "B"
|
||||
|
||||
G4int numOfMaterials = theMaterialTable->length();
|
||||
|
||||
if(theCoeffBTable)
|
||||
{ theCoeffBTable->clearAndDestroy();
|
||||
delete theCoeffBTable; }
|
||||
|
||||
theCoeffBTable = new G4PhysicsTable(numOfMaterials);
|
||||
|
||||
G4double R2 = RTable*RTable ;
|
||||
G4double R1 = RTable+1.;
|
||||
G4double w = R1*(RTable-1.)*(RTable-1.);
|
||||
G4double w1 = -R1/w , w2 = R1*(R2+1.)/w , w3 = -R2*R1/w ;
|
||||
G4double Ti , Tim , Tip , Ri , Rim , Rip , Value ;
|
||||
G4bool isOut;
|
||||
|
||||
for (G4int J=0; J<numOfMaterials; J++)
|
||||
{
|
||||
G4int binmax=TotBin ;
|
||||
G4PhysicsLinearVector* aVector =
|
||||
new G4PhysicsLinearVector(0.,binmax, TotBin);
|
||||
|
||||
Ti = LowestKineticEnergy ;
|
||||
|
||||
G4PhysicsVector* lVector= (*theNlambdaTable)[J];
|
||||
|
||||
for ( G4int i=0; i<TotBin; i++)
|
||||
{
|
||||
Ri = lVector->GetValue(Ti,isOut) ;
|
||||
|
||||
if ( i==0 )
|
||||
Rim = Ri/sqrt(RTable) ;
|
||||
else
|
||||
{
|
||||
Tim = Ti/RTable ;
|
||||
Rim = lVector->GetValue(Tim,isOut);
|
||||
}
|
||||
|
||||
Tip = Ti*RTable ;
|
||||
Rip = lVector->GetValue(Tip,isOut);
|
||||
|
||||
if(i < (TotBin-1))
|
||||
Value = (w1*Rip + w2*Ri + w3*Rim)/Ti;
|
||||
else
|
||||
Value = RTable*(Ri-Rim)/((RTable-1.)*Ti) ;
|
||||
|
||||
aVector->PutValue(i,Value);
|
||||
|
||||
Ti = RTable*Ti ;
|
||||
|
||||
}
|
||||
|
||||
theCoeffBTable->insert(aVector);
|
||||
}
|
||||
}
|
||||
|
||||
void G4IeIonisation::BuildCoeffCTable(
|
||||
const G4ParticleDefinition& aParticleType)
|
||||
{
|
||||
const G4MaterialTable* theMaterialTable=
|
||||
G4Material::GetMaterialTable();
|
||||
|
||||
// create table for coefficients "C"
|
||||
G4int numOfMaterials = theMaterialTable->length();
|
||||
|
||||
if(theCoeffCTable)
|
||||
{ theCoeffCTable->clearAndDestroy();
|
||||
delete theCoeffCTable; }
|
||||
|
||||
theCoeffCTable = new G4PhysicsTable(numOfMaterials);
|
||||
|
||||
G4double R2 = RTable*RTable ;
|
||||
G4double R1 = RTable+1.;
|
||||
G4double w = R1*(RTable-1.)*(RTable-1.);
|
||||
G4double w1 = 1./w , w2 = -RTable*R1/w , w3 = RTable*R2/w ;
|
||||
G4double Ti , Tim , Tip , Ri , Rim , Rip , Value ;
|
||||
G4bool isOut;
|
||||
|
||||
for (G4int J=0; J<numOfMaterials; J++)
|
||||
{
|
||||
|
||||
G4int binmax=TotBin ;
|
||||
G4PhysicsLinearVector* aVector =
|
||||
new G4PhysicsLinearVector(0.,binmax, TotBin);
|
||||
|
||||
|
||||
Ti = LowestKineticEnergy ;
|
||||
|
||||
G4PhysicsVector* lVector= (*theNlambdaTable)[J];
|
||||
|
||||
for ( G4int i=0; i<TotBin; i++)
|
||||
{
|
||||
Ri = lVector->GetValue(Ti,isOut) ;
|
||||
|
||||
if ( i==0 )
|
||||
Rim = Ri/sqrt(RTable) ;
|
||||
else
|
||||
{
|
||||
Tim = Ti/RTable ;
|
||||
Rim = lVector->GetValue(Tim,isOut);
|
||||
}
|
||||
|
||||
Tip = Ti*RTable ;
|
||||
Rip = lVector->GetValue(Tip,isOut);
|
||||
|
||||
if(i < (TotBin-1))
|
||||
Value = w1*Rip + w2*Ri + w3*Rim ;
|
||||
else
|
||||
Value = (-Ri+RTable*Rim)/(RTable-1.) ;
|
||||
|
||||
|
||||
aVector->PutValue(i,Value);
|
||||
|
||||
Ti = RTable*Ti ;
|
||||
|
||||
}
|
||||
|
||||
theCoeffCTable->insert(aVector);
|
||||
}
|
||||
}
|
||||
|
||||
void G4IeIonisation::BuildInverseNlambdaTable(
|
||||
const G4ParticleDefinition& aParticleType)
|
||||
{
|
||||
G4double T,Smallest,Biggest ;
|
||||
const G4double small = 1.e-100;
|
||||
G4bool isOut ;
|
||||
|
||||
const G4MaterialTable* theMaterialTable=
|
||||
G4Material::GetMaterialTable();
|
||||
|
||||
G4int numOfMaterials = theMaterialTable->length();
|
||||
|
||||
if(theInverseNlambdaTable)
|
||||
{ theInverseNlambdaTable->clearAndDestroy();
|
||||
delete theInverseNlambdaTable; }
|
||||
|
||||
theInverseNlambdaTable = new G4PhysicsTable(numOfMaterials);
|
||||
|
||||
for (G4int J=0; J<numOfMaterials; J++)
|
||||
{
|
||||
T = LowestKineticEnergy ;
|
||||
do
|
||||
{
|
||||
Smallest = (*theNlambdaTable)[J]->
|
||||
GetValue(T,isOut) ;
|
||||
T *= RTable ;
|
||||
} while ((Smallest <= small)&&(T<HighestKineticEnergy)) ;
|
||||
|
||||
Biggest = (*theNlambdaTable)[J]->
|
||||
GetValue(HighestKineticEnergy,isOut) ;
|
||||
|
||||
// inverse can be built for "meaningful" cut value only!
|
||||
if(Smallest >= Biggest)
|
||||
{
|
||||
G4Exception(
|
||||
"Cut value is too big , smaller value should be used !");
|
||||
}
|
||||
|
||||
G4PhysicsLogVector* aVector;
|
||||
|
||||
aVector = new G4PhysicsLogVector(Smallest,
|
||||
Biggest,TotBin);
|
||||
|
||||
InvertNlambdaVector(aParticleType,J, aVector);
|
||||
|
||||
theInverseNlambdaTable->insert(aVector);
|
||||
}
|
||||
}
|
||||
|
||||
void G4IeIonisation::InvertNlambdaVector(
|
||||
const G4ParticleDefinition& aParticleType,
|
||||
G4int materialIndex,
|
||||
G4PhysicsLogVector* nlambdaVector)
|
||||
{
|
||||
G4double LowEdge,A,B,C,discr,KineticEnergy ;
|
||||
G4double Tbin = LowestKineticEnergy/RTable ;
|
||||
G4double bin = 0.0 ;
|
||||
G4int binnumber = -1 ;
|
||||
G4bool isOut ;
|
||||
|
||||
//loop for Nlambda values
|
||||
for( G4int i=0; i<TotBin; i++)
|
||||
{
|
||||
LowEdge = nlambdaVector->GetLowEdgeEnergy(i) ; //i.e. GetLowEdgeValue(i)
|
||||
|
||||
if( bin < LowEdge )
|
||||
{
|
||||
do
|
||||
{
|
||||
binnumber += 1 ;
|
||||
Tbin *= RTable ;
|
||||
bin = (*theNlambdaTable)[materialIndex]->GetValue(Tbin,isOut) ;
|
||||
}
|
||||
while ((bin < LowEdge) && (binnumber < TotBin-2 )) ;
|
||||
}
|
||||
|
||||
if(binnumber == 0)
|
||||
KineticEnergy = LowestKineticEnergy ;
|
||||
else if(binnumber == TotBin-1)
|
||||
KineticEnergy = HighestKineticEnergy/RTable ;
|
||||
else
|
||||
{
|
||||
A = (*(*theCoeffATable)(materialIndex))(binnumber-1) ;
|
||||
B = (*(*theCoeffBTable)(materialIndex))(binnumber-1) ;
|
||||
C = (*(*theCoeffCTable)(materialIndex))(binnumber-1) ;
|
||||
if(A==0.)
|
||||
KineticEnergy = (LowEdge -C )/B ;
|
||||
else
|
||||
{
|
||||
discr = B*B - 4.*A*(C-LowEdge);
|
||||
discr = discr>0. ? sqrt(discr) : 0.;
|
||||
KineticEnergy = 0.5*(discr-B)/A ;
|
||||
}
|
||||
}
|
||||
|
||||
nlambdaVector->PutValue(i,KineticEnergy) ;
|
||||
}
|
||||
}
|
||||
|
||||
void G4IeIonisation::BuildLossTable(const G4ParticleDefinition& aParticleType)
|
||||
{
|
||||
G4double LowEdgeEnergy , ionloss ;
|
||||
G4bool isOutRange ;
|
||||
const G4MaterialTable* theMaterialTable=
|
||||
G4Material::GetMaterialTable();
|
||||
const G4double twoln10 = 2.*log(10.) ;
|
||||
const G4double Factor = twopi_mc2_rcl2 ;
|
||||
|
||||
ParticleMass = aParticleType.GetPDGMass();
|
||||
|
||||
ParticleCutInKineticEnergy = aParticleType.GetEnergyCuts() ;
|
||||
|
||||
G4int numOfMaterials = theMaterialTable->length();
|
||||
|
||||
if (theLossTable) {
|
||||
theLossTable->clearAndDestroy();
|
||||
delete theLossTable;
|
||||
}
|
||||
|
||||
theLossTable = new G4PhysicsTable(numOfMaterials);
|
||||
|
||||
for (G4int J=0; J<numOfMaterials; J++)
|
||||
{
|
||||
G4PhysicsLogVector* aVector = new G4PhysicsLogVector(
|
||||
LowestKineticEnergy, HighestKineticEnergy, TotBin);
|
||||
|
||||
G4double ElectronDensity,Eexc,Eexcm2,Cden,Mden,Aden,X0den,X1den ;
|
||||
const G4Material* material= (*theMaterialTable)[J];
|
||||
ElectronDensity = material->GetElectronDensity();
|
||||
Eexc = material->GetIonisation()->GetMeanExcitationEnergy();
|
||||
Eexcm2 = Eexc/ParticleMass ;
|
||||
Eexcm2 *= Eexcm2 ;
|
||||
Cden = material->GetIonisation()->GetCdensity();
|
||||
Mden = material->GetIonisation()->GetMdensity();
|
||||
Aden = material->GetIonisation()->GetAdensity();
|
||||
X0den = material->GetIonisation()->GetX0density();
|
||||
X1den = material->GetIonisation()->GetX1density();
|
||||
|
||||
ParticleCutInKineticEnergyNow = ParticleCutInKineticEnergy[J] ;
|
||||
|
||||
// some local variables -------------------
|
||||
G4double tau,Tmax,gamma,gamma2,bg2,beta2,d,d2,d3,d4,delta,x,y ;
|
||||
|
||||
for (G4int i = 0 ; i < TotBin ; i++)
|
||||
{
|
||||
LowEdgeEnergy = aVector->GetLowEdgeEnergy(i) ;
|
||||
tau = LowEdgeEnergy/ParticleMass ;
|
||||
|
||||
// Seltzer-Berger formula
|
||||
gamma = tau +1. ;
|
||||
bg2 = tau*(tau+2.) ;
|
||||
gamma2 = gamma*gamma ;
|
||||
beta2 = bg2/gamma2 ;
|
||||
|
||||
// electron .................................
|
||||
if(&aParticleType==theElectron)
|
||||
{
|
||||
Tmax = LowEdgeEnergy/2. ;
|
||||
|
||||
d = G4std::min(ParticleCutInKineticEnergyNow, Tmax)/ParticleMass;
|
||||
|
||||
ionloss = log(2.*(tau+2.)/Eexcm2)-1.-beta2 ;
|
||||
ionloss += log((tau-d)*d)+tau/(tau-d) ;
|
||||
ionloss += (0.5*d*d+(2.*tau+1.)*log(1.-d/tau))/gamma2 ;
|
||||
}
|
||||
//positron ...............................
|
||||
else
|
||||
{
|
||||
Tmax = LowEdgeEnergy ;
|
||||
|
||||
d = G4std::min(ParticleCutInKineticEnergyNow, Tmax)/ParticleMass;
|
||||
|
||||
d2=d*d/2. ;
|
||||
d3=d*d*d/3. ;
|
||||
d4=d*d*d*d/4. ;
|
||||
|
||||
y=1./(1.+gamma) ;
|
||||
|
||||
ionloss = log(2.*(tau+2.)/Eexcm2)+log(tau*d) ;
|
||||
ionloss-= beta2*(tau+2.*d-y*(3.*d2+y*(d-d3+y*(d2-tau*d3+d4))))/tau;
|
||||
|
||||
}
|
||||
|
||||
// density correction ................................
|
||||
x = log(bg2)/twoln10 ;
|
||||
if ( x < X0den )
|
||||
delta = 0. ;
|
||||
else
|
||||
{
|
||||
delta = twoln10*x - Cden ;
|
||||
if ( x < X1den )
|
||||
delta += Aden*pow((X1den-x),Mden) ;
|
||||
}
|
||||
|
||||
// now you can compute the total ionization loss
|
||||
ionloss -= delta ;
|
||||
ionloss *= Factor*ElectronDensity/beta2 ;
|
||||
if ( ionloss <= 0.)
|
||||
ionloss = 0. ;
|
||||
|
||||
aVector->PutValue(i,ionloss) ;
|
||||
}
|
||||
theLossTable->insert(aVector);
|
||||
}
|
||||
}
|
||||
|
||||
void G4IeIonisation::BuildLambdaTable(const G4ParticleDefinition& aParticleType)
|
||||
{
|
||||
G4double LowEdgeEnergy , Value ,sigma ;
|
||||
G4bool isOutRange ;
|
||||
const G4MaterialTable* theMaterialTable=
|
||||
G4Material::GetMaterialTable();
|
||||
|
||||
G4int numOfMaterials = theMaterialTable->length();
|
||||
|
||||
if (theMeanFreePathTable) {
|
||||
theMeanFreePathTable->clearAndDestroy();
|
||||
delete theMeanFreePathTable;
|
||||
}
|
||||
|
||||
theMeanFreePathTable = new G4PhysicsTable(numOfMaterials);
|
||||
|
||||
DeltaCutInKineticEnergy = theElectron->GetCutsInEnergy() ;
|
||||
ParticleCutInKineticEnergy = aParticleType.GetEnergyCuts() ;
|
||||
|
||||
for (G4int J=0 ; J < numOfMaterials; J++)
|
||||
{
|
||||
G4PhysicsLogVector* aVector = new G4PhysicsLogVector(
|
||||
LowestKineticEnergy, HighestKineticEnergy, TotBin);
|
||||
|
||||
const G4Material* material= (*theMaterialTable)[J];
|
||||
|
||||
const G4ElementVector* theElementVector=
|
||||
material->GetElementVector() ;
|
||||
const G4double* theAtomicNumDensityVector =
|
||||
material->GetAtomicNumDensityVector();
|
||||
const G4int NumberOfElements=
|
||||
material->GetNumberOfElements() ;
|
||||
|
||||
DeltaKineticEnergyCutNow = DeltaCutInKineticEnergy[J] ;
|
||||
|
||||
for ( G4int i = 0 ; i < TotBin ; i++ )
|
||||
{
|
||||
LowEdgeEnergy = aVector->GetLowEdgeEnergy(i) ;
|
||||
sigma = 0. ;
|
||||
for (G4int iel=0; iel<NumberOfElements; iel++ )
|
||||
{
|
||||
sigma += theAtomicNumDensityVector[iel]*
|
||||
ComputeMicroscopicCrossSection(aParticleType,
|
||||
LowEdgeEnergy,
|
||||
(*theElementVector)(iel)->GetZ() ) ;
|
||||
}
|
||||
Value = sigma<=0 ? DBL_MAX : 1./sigma ;
|
||||
aVector->PutValue(i, Value) ;
|
||||
}
|
||||
theMeanFreePathTable->insert(aVector);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
G4double G4IeIonisation::ComputeMicroscopicCrossSection(
|
||||
const G4ParticleDefinition& aParticleType,
|
||||
G4double KineticEnergy,
|
||||
G4double AtomicNumber)
|
||||
{
|
||||
// calculates the microscopic cross section in GEANT4 internal units
|
||||
// ( it is called for elements , AtomicNumber = Z )
|
||||
G4double TotalEnergy,MaxKineticEnergyTransfer,
|
||||
betasquare,gamma,gamma2,x,x2,y,y2,y12,b1,b2,b3,b4,
|
||||
TotalCrossSection;
|
||||
|
||||
TotalEnergy=KineticEnergy + ParticleMass;
|
||||
betasquare = KineticEnergy*(TotalEnergy+ParticleMass)
|
||||
/(TotalEnergy*TotalEnergy);
|
||||
gamma = TotalEnergy/ParticleMass ;
|
||||
x=DeltaKineticEnergyCutNow/KineticEnergy ;
|
||||
|
||||
if(&aParticleType==theElectron)
|
||||
MaxKineticEnergyTransfer = 0.5*KineticEnergy ;
|
||||
else
|
||||
MaxKineticEnergyTransfer = KineticEnergy ;
|
||||
|
||||
if( MaxKineticEnergyTransfer > DeltaKineticEnergyCutNow )
|
||||
{
|
||||
//Moller (e-e-) scattering
|
||||
if(&aParticleType==theElectron)
|
||||
{
|
||||
gamma2 = gamma*gamma ;
|
||||
TotalCrossSection = (gamma-1.)*(gamma-1.)*(0.5-x)/gamma2 + 1./x -
|
||||
1./(1.-x)-(2.*gamma-1.)*log((1.-x)/x)/gamma2 ;
|
||||
TotalCrossSection /= betasquare ;
|
||||
}
|
||||
//Bhabha (e+e-) scattering
|
||||
else
|
||||
{
|
||||
x2=x*x ;
|
||||
y=1./(1.+gamma) ;
|
||||
y2=y*y ;
|
||||
y12=1.-2.*y ;
|
||||
b1=2.-y2 ;
|
||||
b2=y12*(3.+y2) ;
|
||||
b4=y12*y12*y12 ;
|
||||
b3=b4+y12*y12 ;
|
||||
TotalCrossSection = (1./x-1.)/betasquare+b1*log(x)+b2*(1.-x)-
|
||||
b3*(1.-x2)/2.+b4*(1.-x2*x)/3. ;
|
||||
}
|
||||
|
||||
TotalCrossSection = twopi_mc2_rcl2 * AtomicNumber
|
||||
*TotalCrossSection/KineticEnergy ;
|
||||
}
|
||||
else
|
||||
TotalCrossSection = 0. ;
|
||||
|
||||
return TotalCrossSection ;
|
||||
}
|
||||
|
||||
|
||||
G4VParticleChange* G4IeIonisation::PostStepDoIt(
|
||||
const G4Track& trackData,
|
||||
const G4Step& stepData)
|
||||
{
|
||||
aParticleChange.Initialize(trackData) ;
|
||||
|
||||
G4Material* aMaterial = trackData.GetMaterial() ;
|
||||
const G4DynamicParticle* aParticle = trackData.GetDynamicParticle() ;
|
||||
|
||||
G4double Charge = aParticle->GetDefinition()->GetPDGCharge();
|
||||
ParticleMass = aParticle->GetDefinition()->GetPDGMass();
|
||||
G4double KineticEnergy = aParticle->GetKineticEnergy();
|
||||
G4double TotalEnergy = KineticEnergy + ParticleMass;
|
||||
G4double Psquare = KineticEnergy*(TotalEnergy+ParticleMass);
|
||||
G4double TotalMomentum = sqrt(Psquare);
|
||||
G4double Esquare=TotalEnergy*TotalEnergy;
|
||||
G4ParticleMomentum ParticleDirection = aParticle->GetMomentumDirection();
|
||||
|
||||
// get kinetic energy cut for the electron
|
||||
DeltaCutInKineticEnergy = G4Electron::Electron()->GetCutsInEnergy();
|
||||
G4double DeltaThreshold = DeltaCutInKineticEnergy[aMaterial->GetIndex()];
|
||||
|
||||
// some kinematics
|
||||
G4double MaxKineticEnergyTransfer;
|
||||
if (Charge < 0.) MaxKineticEnergyTransfer = 0.5*KineticEnergy;
|
||||
else MaxKineticEnergyTransfer = KineticEnergy;
|
||||
|
||||
// sampling kinetic energy of the delta ray
|
||||
|
||||
if (MaxKineticEnergyTransfer <= DeltaThreshold)
|
||||
return G4IVContinuousDiscreteProcess::PostStepDoIt(trackData,stepData);
|
||||
|
||||
// normal case
|
||||
G4double cc,y,y2,c2,b0,b1,b2,b3,b4,x,x1,grej,grejc;
|
||||
|
||||
G4double tau = KineticEnergy/ParticleMass;
|
||||
G4double gamma = tau+1., gamma2=gamma*gamma;
|
||||
G4double xc = DeltaThreshold/KineticEnergy, xc1=1.-xc;
|
||||
|
||||
if (Charge < 0.) // Moller (e-e-) scattering
|
||||
{
|
||||
b1=4./(9.*gamma2-10.*gamma+5.);
|
||||
b2=tau*tau*b1; b3=(2.*gamma2+2.*gamma-1.)*b1;
|
||||
cc=1.-2.*xc;
|
||||
do {
|
||||
x = xc/(1.-cc*G4UniformRand()); x1 = 1.-x;
|
||||
grej = b2*x*x-b3*x/x1+b1*gamma2/(x1*x1);
|
||||
} while (G4UniformRand()>grej) ;
|
||||
}
|
||||
else // Bhabha (e+e-) scattering
|
||||
{
|
||||
y=1./(gamma+1.); y2=y*y; cc=1.-2.*y;
|
||||
b1=2.-y2; b2=cc*(3.+y2);
|
||||
c2=cc*cc; b4=c2*cc; b3=c2+b4;
|
||||
b0=gamma2/(gamma2-1.);
|
||||
grejc=(((b4*xc-b3)*xc+b2)*xc-b1)*xc+b0;
|
||||
do {
|
||||
x = xc/(1.-xc1*G4UniformRand());
|
||||
grej = ((((b4*x-b3)*x+b2)*x-b1)*x+b0)/grejc;
|
||||
} while (G4UniformRand()>grej);
|
||||
}
|
||||
|
||||
G4double DeltaKineticEnergy = x * KineticEnergy;
|
||||
|
||||
// protection :do not produce a secondary with 0. kinetic energy !
|
||||
if (DeltaKineticEnergy <= 0.)
|
||||
return G4IVContinuousDiscreteProcess::PostStepDoIt(trackData,stepData);
|
||||
|
||||
G4double DeltaTotalMomentum = sqrt(DeltaKineticEnergy * (DeltaKineticEnergy +
|
||||
2. * electron_mass_c2 ));
|
||||
|
||||
G4double costheta = DeltaKineticEnergy * (TotalEnergy + electron_mass_c2)
|
||||
/(DeltaTotalMomentum * TotalMomentum);
|
||||
|
||||
if (costheta < -1.) costheta = -1.;
|
||||
if (costheta > +1.) costheta = +1.;
|
||||
|
||||
// direction of the delta electron
|
||||
|
||||
G4double phi = twopi * G4UniformRand();
|
||||
G4double sintheta = sqrt((1.+costheta)*(1.-costheta));
|
||||
G4double dirx = sintheta * cos(phi), diry = sintheta * sin(phi),
|
||||
dirz = costheta;
|
||||
|
||||
G4ThreeVector DeltaDirection(dirx,diry,dirz);
|
||||
DeltaDirection.rotateUz(ParticleDirection);
|
||||
|
||||
// create G4DynamicParticle object for delta ray
|
||||
|
||||
G4DynamicParticle* theDeltaRay = new G4DynamicParticle;
|
||||
theDeltaRay->SetKineticEnergy( DeltaKineticEnergy );
|
||||
theDeltaRay->SetMomentumDirection(
|
||||
DeltaDirection.x(),DeltaDirection.y(),DeltaDirection.z());
|
||||
theDeltaRay->SetDefinition(G4Electron::Electron());
|
||||
|
||||
// fill aParticleChange
|
||||
// changed energy and momentum of the actual particle
|
||||
G4double finalKineticEnergy = KineticEnergy - DeltaKineticEnergy;
|
||||
|
||||
if (finalKineticEnergy > 0.)
|
||||
{
|
||||
G4double finalPx = TotalMomentum*ParticleDirection.x()
|
||||
- DeltaTotalMomentum*DeltaDirection.x();
|
||||
G4double finalPy = TotalMomentum*ParticleDirection.y()
|
||||
- DeltaTotalMomentum*DeltaDirection.y();
|
||||
G4double finalPz = TotalMomentum*ParticleDirection.z()
|
||||
- DeltaTotalMomentum*DeltaDirection.z();
|
||||
G4double finalMomentum =
|
||||
sqrt(finalPx*finalPx+finalPy*finalPy+finalPz*finalPz) ;
|
||||
finalPx /= finalMomentum ;
|
||||
finalPy /= finalMomentum ;
|
||||
finalPz /= finalMomentum ;
|
||||
|
||||
aParticleChange.SetMomentumChange( finalPx,finalPy,finalPz );
|
||||
}
|
||||
else
|
||||
{
|
||||
finalKineticEnergy = 0.;
|
||||
if (Charge < 0.) aParticleChange.SetStatusChange(fStopAndKill);
|
||||
else aParticleChange.SetStatusChange(fStopButAlive);
|
||||
}
|
||||
|
||||
aParticleChange.SetEnergyChange( finalKineticEnergy );
|
||||
aParticleChange.SetNumberOfSecondaries(1);
|
||||
aParticleChange.AddSecondary( theDeltaRay );
|
||||
aParticleChange.SetLocalEnergyDeposit (0.);
|
||||
|
||||
return G4IVContinuousDiscreteProcess::PostStepDoIt(trackData,stepData);
|
||||
}
|
||||
|
||||
void G4IeIonisation::PrintInfoDefinition()
|
||||
{
|
||||
G4String comments = "delta cross sections from Moller+Bhabha. ";
|
||||
comments += "Good description from 1 KeV to 100 GeV.\n";
|
||||
comments += " delta ray energy sampled from differential Xsection.";
|
||||
|
||||
G4cout << G4endl << GetProcessName() << ": " << comments
|
||||
<< "\n PhysicsTables from " << G4BestUnit(LowestKineticEnergy,"Energy")
|
||||
<< " to " << G4BestUnit(HighestKineticEnergy,"Energy")
|
||||
<< " in " << TotBin << " bins. \n";
|
||||
}
|
||||
|
||||
@@ -1,893 +0,0 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4IeplusAnnihilation.cc,v 1.6 1999/12/15 14:51:50 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// $Id:
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
// CERN Geneva Switzerland
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ------------ G4IeplusAnnihilation process --------
|
||||
// by Michel Maire, 7 July 1996
|
||||
// **************************************************************
|
||||
// --------------------------------------------------------------
|
||||
// ************************************************************
|
||||
// It is the first implementation of the
|
||||
// eplusANNIHILATION PROCESS
|
||||
// using an INTEGRAL APPROACH instead of the differential
|
||||
// one used in the standard implementation .
|
||||
// ************************************************************
|
||||
// by Laszlo Urban, 23 June 1998
|
||||
// -----------------------------------------------------------
|
||||
// 28/10/28: some cleanup , L.Urban
|
||||
|
||||
#include "G4IeplusAnnihilation.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
// constructor
|
||||
G4IeplusAnnihilation::G4IeplusAnnihilation(const G4String& processName)
|
||||
: G4IVRestDiscreteProcess (processName),
|
||||
LowestEnergyLimit ( 10*keV), // initialization
|
||||
HighestEnergyLimit( 10*TeV),
|
||||
NumberOfBuildPhysicsTableCalls(0),
|
||||
NumbBinTable(100)
|
||||
{
|
||||
if (verboseLevel>0) {
|
||||
G4cout << GetProcessName() << " is created "<< G4endl;
|
||||
G4cout << "LowestEnergy: " << LowestEnergyLimit/keV << "keV ";
|
||||
G4cout << "HighestEnergy: " << HighestEnergyLimit/TeV << "TeV " << G4endl;
|
||||
}
|
||||
theCrossSectionTable = NULL;
|
||||
theMeanFreePathTable = NULL;
|
||||
theMeanFreePathTable = NULL ;
|
||||
theNlambdaTable = NULL;
|
||||
theInverseNlambdaTable = NULL;
|
||||
theCoeffATable = NULL ;
|
||||
theCoeffBTable = NULL ;
|
||||
theCoeffCTable = NULL ;
|
||||
|
||||
LowestKineticEnergy = LowestEnergyLimit ;
|
||||
HighestKineticEnergy= HighestEnergyLimit;
|
||||
TotBin = NumbBinTable ;
|
||||
RTable = exp(log(HighestKineticEnergy/LowestKineticEnergy)/TotBin) ;
|
||||
}
|
||||
|
||||
// destructor
|
||||
|
||||
G4IeplusAnnihilation::~G4IeplusAnnihilation()
|
||||
{
|
||||
if (theCrossSectionTable) {
|
||||
theCrossSectionTable->clearAndDestroy();
|
||||
delete theCrossSectionTable;
|
||||
}
|
||||
|
||||
if (theMeanFreePathTable) {
|
||||
theMeanFreePathTable->clearAndDestroy();
|
||||
delete theMeanFreePathTable;
|
||||
}
|
||||
if (theNlambdaTable) {
|
||||
theNlambdaTable->clearAndDestroy();
|
||||
delete theNlambdaTable;
|
||||
}
|
||||
if (theInverseNlambdaTable) {
|
||||
theInverseNlambdaTable->clearAndDestroy();
|
||||
delete theInverseNlambdaTable;
|
||||
}
|
||||
if (theCoeffATable) {
|
||||
theCoeffATable->clearAndDestroy();
|
||||
delete theCoeffATable;
|
||||
}
|
||||
if (theCoeffBTable) {
|
||||
theCoeffBTable->clearAndDestroy();
|
||||
delete theCoeffBTable;
|
||||
}
|
||||
if (theCoeffCTable) {
|
||||
theCoeffCTable->clearAndDestroy();
|
||||
delete theCoeffCTable;
|
||||
}
|
||||
}
|
||||
|
||||
void G4IeplusAnnihilation::SetPhysicsTableBining(G4double lowE,
|
||||
G4double highE, G4int nBins)
|
||||
{
|
||||
LowestEnergyLimit = lowE; HighestEnergyLimit = highE; NumbBinTable = nBins;
|
||||
}
|
||||
|
||||
void G4IeplusAnnihilation::BuildPhysicsTable(const G4ParticleDefinition& PositronType)
|
||||
|
||||
// Build microscopic total cross section tables and mean free path table
|
||||
{
|
||||
NumberOfBuildPhysicsTableCalls += 1 ;
|
||||
if(NumberOfBuildPhysicsTableCalls == 1)
|
||||
{ ; }
|
||||
else
|
||||
{
|
||||
|
||||
G4double LowEdgeEnergy, Value;
|
||||
G4PhysicsLogVector* ptrVector;
|
||||
|
||||
// Build microscopic cross section tables for the e+e- annihilation
|
||||
|
||||
if (theCrossSectionTable) {
|
||||
theCrossSectionTable->clearAndDestroy(); delete theCrossSectionTable; }
|
||||
|
||||
theCrossSectionTable = new G4PhysicsTable( G4Element::GetNumberOfElements()) ;
|
||||
const G4ElementTable* theElementTable = G4Element::GetElementTable() ;
|
||||
G4double AtomicNumber;
|
||||
G4int J;
|
||||
|
||||
for ( J=0 ; J < G4Element::GetNumberOfElements(); J++ )
|
||||
{
|
||||
//create physics vector then fill it ....
|
||||
ptrVector = new G4PhysicsLogVector(LowestEnergyLimit, HighestEnergyLimit,
|
||||
NumbBinTable ) ;
|
||||
AtomicNumber = (*theElementTable)(J)->GetZ();
|
||||
|
||||
for ( G4int i = 0 ; i < NumbBinTable ; i++ )
|
||||
{
|
||||
LowEdgeEnergy = ptrVector->GetLowEdgeEnergy( i ) ;
|
||||
Value = ComputeMicroscopicCrossSection( LowEdgeEnergy, AtomicNumber);
|
||||
ptrVector->PutValue( i , Value ) ;
|
||||
}
|
||||
|
||||
theCrossSectionTable->insertAt( J , ptrVector ) ;
|
||||
|
||||
}
|
||||
|
||||
// Build mean free path table for the e+e- annihilation
|
||||
|
||||
if (theMeanFreePathTable) {
|
||||
theMeanFreePathTable->clearAndDestroy(); delete theMeanFreePathTable; }
|
||||
|
||||
theMeanFreePathTable = new G4PhysicsTable( G4Material::GetNumberOfMaterials() );
|
||||
|
||||
//*******************!!!!!!!!!!!!!!!!!!!!!!********************
|
||||
theMeanFreePathTable = theMeanFreePathTable ;
|
||||
//*******************!!!!!!!!!!!!!!!!!!!!!!********************
|
||||
|
||||
const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable() ;
|
||||
G4Material* material;
|
||||
|
||||
for ( J=0 ; J < G4Material::GetNumberOfMaterials(); J++ )
|
||||
{
|
||||
//create physics vector then fill it ....
|
||||
ptrVector = new G4PhysicsLogVector(LowestEnergyLimit, HighestEnergyLimit,
|
||||
NumbBinTable ) ;
|
||||
material = (*theMaterialTable)(J);
|
||||
|
||||
for ( G4int i = 0 ; i < NumbBinTable ; i++ )
|
||||
{
|
||||
LowEdgeEnergy = ptrVector->GetLowEdgeEnergy( i ) ;
|
||||
Value = ComputeMeanFreePath( LowEdgeEnergy, material);
|
||||
ptrVector->PutValue( i , Value ) ;
|
||||
|
||||
theMeanFreePathTable->insertAt( J , ptrVector ) ;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const G4ParticleDefinition& aParticleType = PositronType ;
|
||||
|
||||
BuildNlambdaTable(aParticleType) ;
|
||||
|
||||
BuildCoeffATable(aParticleType) ;
|
||||
BuildCoeffBTable(aParticleType) ;
|
||||
BuildCoeffCTable(aParticleType) ;
|
||||
|
||||
BuildInverseNlambdaTable(aParticleType) ;
|
||||
|
||||
G4int printflag = 0 ;
|
||||
if(printflag>0)
|
||||
TestOfInversion(aParticleType,printflag) ;
|
||||
|
||||
NumberOfBuildPhysicsTableCalls = 0 ;
|
||||
|
||||
PrintInfoDefinition() ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void G4IeplusAnnihilation::TestOfInversion(
|
||||
const G4ParticleDefinition& aParticleType,
|
||||
G4int printflag)
|
||||
{
|
||||
G4double T,Nlambda,Tprime,delta,del,sum,delmean,Tdelta ;
|
||||
G4bool isOut ;
|
||||
|
||||
const G4MaterialTable* theMaterialTable=
|
||||
G4Material::GetMaterialTable();
|
||||
G4int numOfMaterials = theMaterialTable->length() ;
|
||||
|
||||
G4cout.setf(G4std::ios::scientific, G4std::ios::floatfield) ;
|
||||
if(printflag>1)
|
||||
{
|
||||
G4cout << G4endl;
|
||||
G4cout << " particle=" << aParticleType.GetParticleName() << G4endl;
|
||||
G4cout << "----------------------" << G4endl;
|
||||
}
|
||||
for (G4int J=0; J<numOfMaterials; J++)
|
||||
{
|
||||
if(printflag>1)
|
||||
{
|
||||
G4cout << G4endl;
|
||||
G4cout << " material = " << (*theMaterialTable)[J]->GetName() << G4endl;
|
||||
G4cout << " mat.ind.=" << J << " T Nlambda Tprime"
|
||||
<< " (Tprime-T)/T(%)" << G4endl ;
|
||||
}
|
||||
|
||||
G4PhysicsLogVector* aVector ;
|
||||
|
||||
aVector = new G4PhysicsLogVector(LowestKineticEnergy,
|
||||
HighestKineticEnergy,TotBin) ;
|
||||
delta = 0. ;
|
||||
delmean = 0.;
|
||||
sum = 0.;
|
||||
Tdelta = 0. ;
|
||||
for (G4int i=0; i<TotBin-1; i++)
|
||||
{
|
||||
T = aVector->GetLowEdgeEnergy(i) ;
|
||||
|
||||
Nlambda = (*theNlambdaTable)[J]->GetValue(T,isOut) ;
|
||||
|
||||
if(Nlambda>0.)
|
||||
{
|
||||
Tprime = (*theInverseNlambdaTable)[J]->GetValue(Nlambda,isOut) ;
|
||||
|
||||
if((Nlambda>0.)&&(i<(TotBin-1)))
|
||||
{
|
||||
del = 100.*(Tprime-T)/T ;
|
||||
sum += 1.;
|
||||
delmean += abs(del);
|
||||
if(abs(del)>abs(delta))
|
||||
{
|
||||
delta = del ;
|
||||
Tdelta = T ;
|
||||
}
|
||||
}
|
||||
if(printflag>1)
|
||||
{
|
||||
G4cout << G4std::setw(18) << G4std::setprecision(6) << T << " " <<
|
||||
G4std::setw(14)<< G4std::setprecision(6) << Nlambda << " " <<
|
||||
G4std::setw(14) << G4std::setprecision(6) << Tprime << " " <<
|
||||
G4std::setw(12) << G4std::setprecision(3) << del << G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(printflag>0)
|
||||
{
|
||||
G4cout << G4endl;
|
||||
G4cout << "G4IeplusAnnihilation::TestOfInversion (T->Nlambda->Tprime) " << G4endl
|
||||
;
|
||||
G4cout << "particle= " << aParticleType.GetParticleName() <<
|
||||
" material= " << (*theMaterialTable)[J]->GetName() << G4endl ;
|
||||
G4cout << "max (Tprime-T)/T in % =" << G4std::setw(10) << G4std::setprecision(3) << delta ;
|
||||
G4cout << " at a kinetic energy " << G4std::setw(10) << G4std::setprecision(3) <<
|
||||
Tdelta/MeV << " MeV" << G4endl;
|
||||
delmean /= sum ;
|
||||
G4cout << "mean rel.diff. (Tprime-T)/T=" << G4std::setw(10) <<
|
||||
G4std::setprecision(3) << delmean <<
|
||||
" % (mean is calculated in abs. value)" << G4endl;
|
||||
G4cout << G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void G4IeplusAnnihilation::BuildNlambdaTable(
|
||||
const G4ParticleDefinition& aParticleType)
|
||||
{
|
||||
const G4MaterialTable* theMaterialTable=
|
||||
G4Material::GetMaterialTable();
|
||||
G4int numOfMaterials = theMaterialTable->length() ;
|
||||
|
||||
if(theNlambdaTable)
|
||||
{ theNlambdaTable->clearAndDestroy();
|
||||
delete theNlambdaTable ; }
|
||||
|
||||
theNlambdaTable = new G4PhysicsTable(numOfMaterials) ;
|
||||
|
||||
// loop for materials
|
||||
for (G4int J=0; J<numOfMaterials; J++)
|
||||
{
|
||||
G4PhysicsLogVector* aVector ;
|
||||
|
||||
aVector = new G4PhysicsLogVector(LowestKineticEnergy,
|
||||
HighestKineticEnergy,TotBin) ;
|
||||
|
||||
BuildNlambdaVector(aParticleType,J,aVector) ;
|
||||
|
||||
theNlambdaTable->insert(aVector) ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void G4IeplusAnnihilation::BuildNlambdaVector(
|
||||
const G4ParticleDefinition& aParticleType,
|
||||
G4int materialIndex,
|
||||
G4PhysicsLogVector* nlambdaVector)
|
||||
{
|
||||
G4double LowEdgeEnergy,T,Tlast,dEdx,Value,Vlast,u,du,coeff,l ;
|
||||
const G4int nbin = 20 ;
|
||||
G4bool isOut ;
|
||||
const G4double small = 1.e-100;
|
||||
const G4double plowloss = 0.5 ; //this should be a data member of en.loss!
|
||||
const G4double lmin=1.e-100,lmax=1.e100;
|
||||
|
||||
const G4MaterialTable* theMaterialTable=
|
||||
G4Material::GetMaterialTable();
|
||||
|
||||
//first integral from 0. to LowestKineticEnergy
|
||||
// here assumed that the threshold energy for the process >=
|
||||
// LowestKineticEnergy
|
||||
dEdx = G4EnergyLossTables::GetPreciseDEDX(&aParticleType,
|
||||
LowestKineticEnergy,
|
||||
(*theMaterialTable)[materialIndex]);
|
||||
Value = LowestKineticEnergy/(dEdx*BIGSTEP*(1.-plowloss)) ;
|
||||
if(Value<small)
|
||||
Value = 0. ;
|
||||
|
||||
nlambdaVector->PutValue(0,Value) ;
|
||||
|
||||
Tlast = LowestKineticEnergy ;
|
||||
Vlast = Value ;
|
||||
|
||||
// loop for kinetic energy
|
||||
|
||||
for (G4int i=1; i<TotBin; i++)
|
||||
{
|
||||
LowEdgeEnergy = nlambdaVector->GetLowEdgeEnergy(i) ;
|
||||
|
||||
u = log(LowEdgeEnergy/Tlast) ;
|
||||
du = u/nbin ;
|
||||
|
||||
u = -du ;
|
||||
Value = 0. ;
|
||||
for(G4int n=0; n<=nbin; n++)
|
||||
{
|
||||
u += du ;
|
||||
T = Tlast*exp(u) ;
|
||||
|
||||
if((n==0)||(n==nbin))
|
||||
coeff=0.5 ;
|
||||
else
|
||||
coeff=1.0 ;
|
||||
|
||||
l = (*theMeanFreePathTable)[materialIndex]->GetValue(T,isOut);
|
||||
if((l>lmin) && (l<lmax))
|
||||
Value += coeff*T/(G4EnergyLossTables::GetPreciseDEDX(&aParticleType,
|
||||
T,(*theMaterialTable)[materialIndex])*l);
|
||||
}
|
||||
|
||||
Value *= du ;
|
||||
Value += Vlast ;
|
||||
if(Value<small)
|
||||
Value = 0. ;
|
||||
nlambdaVector->PutValue(i,Value) ;
|
||||
|
||||
Tlast = LowEdgeEnergy ;
|
||||
Vlast = Value ;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void G4IeplusAnnihilation::BuildCoeffATable(
|
||||
const G4ParticleDefinition& aParticleType)
|
||||
{
|
||||
const G4MaterialTable* theMaterialTable=
|
||||
G4Material::GetMaterialTable();
|
||||
|
||||
// create table for coefficients "A"
|
||||
|
||||
G4int numOfMaterials = theMaterialTable->length();
|
||||
|
||||
if(theCoeffATable)
|
||||
|
||||
{ theCoeffATable->clearAndDestroy();
|
||||
delete theCoeffATable; }
|
||||
theCoeffATable = new G4PhysicsTable(numOfMaterials);
|
||||
|
||||
G4double R2 = RTable*RTable ;
|
||||
G4double R1 = RTable+1.;
|
||||
G4double w = R1*(RTable-1.)*(RTable-1.);
|
||||
G4double w1 = RTable/w , w2 = -RTable*R1/w , w3 = R2/w ;
|
||||
G4double Ti , Tim , Tip , Ri , Rim , Rip , Value ;
|
||||
G4bool isOut;
|
||||
|
||||
// loop for materials
|
||||
for (G4int J=0; J<numOfMaterials; J++)
|
||||
{
|
||||
|
||||
// create vector
|
||||
G4int binmax=TotBin ;
|
||||
G4PhysicsLinearVector* aVector =
|
||||
new G4PhysicsLinearVector(0.,binmax, TotBin);
|
||||
|
||||
// loop for kinetic energy
|
||||
|
||||
Ti = LowestKineticEnergy ;
|
||||
|
||||
G4PhysicsVector* lVector= (*theNlambdaTable)[J];
|
||||
|
||||
for ( G4int i=0; i<TotBin; i++)
|
||||
{
|
||||
Ri = lVector->GetValue(Ti,isOut) ;
|
||||
|
||||
|
||||
if ( i==0 )
|
||||
Rim = Ri/sqrt(RTable) ;
|
||||
else
|
||||
{
|
||||
Tim = Ti/RTable ;
|
||||
Rim = lVector->GetValue(Tim,isOut);
|
||||
}
|
||||
|
||||
Tip = Ti*RTable ;
|
||||
Rip = lVector->GetValue(Tip,isOut);
|
||||
|
||||
if( i < (TotBin-1))
|
||||
Value = (w1*Rip + w2*Ri + w3*Rim)/(Ti*Ti) ;
|
||||
else
|
||||
{
|
||||
Rip = Rip*Rip/Rim ;
|
||||
Value = (w1*Rip + w2*Ri + w3*Rim)/(Ti*Ti) ;
|
||||
}
|
||||
|
||||
aVector->PutValue(i,Value);
|
||||
|
||||
|
||||
Ti = RTable*Ti ;
|
||||
|
||||
}
|
||||
|
||||
theCoeffATable->insert(aVector);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void G4IeplusAnnihilation::BuildCoeffBTable(
|
||||
const G4ParticleDefinition& aParticleType)
|
||||
{
|
||||
const G4MaterialTable* theMaterialTable=
|
||||
G4Material::GetMaterialTable();
|
||||
|
||||
// create table for coefficients "B"
|
||||
|
||||
|
||||
G4int numOfMaterials = theMaterialTable->length();
|
||||
|
||||
if(theCoeffBTable)
|
||||
{ theCoeffBTable->clearAndDestroy();
|
||||
delete theCoeffBTable; }
|
||||
theCoeffBTable = new G4PhysicsTable(numOfMaterials);
|
||||
|
||||
G4double R2 = RTable*RTable ;
|
||||
G4double R1 = RTable+1.;
|
||||
G4double w = R1*(RTable-1.)*(RTable-1.);
|
||||
G4double w1 = -R1/w , w2 = R1*(R2+1.)/w , w3 = -R2*R1/w ;
|
||||
G4double Ti , Tim , Tip , Ri , Rim , Rip , Value ;
|
||||
G4bool isOut;
|
||||
|
||||
// loop for materials
|
||||
for (G4int J=0; J<numOfMaterials; J++)
|
||||
{
|
||||
|
||||
// create vector
|
||||
G4int binmax=TotBin ;
|
||||
G4PhysicsLinearVector* aVector =
|
||||
new G4PhysicsLinearVector(0.,binmax, TotBin);
|
||||
|
||||
// loop for kinetic energy
|
||||
|
||||
Ti = LowestKineticEnergy ;
|
||||
|
||||
G4PhysicsVector* lVector= (*theNlambdaTable)[J];
|
||||
|
||||
for ( G4int i=0; i<TotBin; i++)
|
||||
{
|
||||
Ri = lVector->GetValue(Ti,isOut) ;
|
||||
|
||||
if ( i==0 )
|
||||
Rim = Ri/sqrt(RTable) ;
|
||||
else
|
||||
{
|
||||
Tim = Ti/RTable ;
|
||||
Rim = lVector->GetValue(Tim,isOut);
|
||||
}
|
||||
|
||||
Tip = Ti*RTable ;
|
||||
Rip = lVector->GetValue(Tip,isOut);
|
||||
|
||||
if(i < (TotBin-1))
|
||||
Value = (w1*Rip + w2*Ri + w3*Rim)/Ti;
|
||||
else
|
||||
{
|
||||
Rip = Rip*Rip/Rim ;
|
||||
Value = (w1*Rip + w2*Ri + w3*Rim)/Ti ;
|
||||
}
|
||||
|
||||
aVector->PutValue(i,Value);
|
||||
|
||||
Ti = RTable*Ti ;
|
||||
|
||||
}
|
||||
|
||||
theCoeffBTable->insert(aVector);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void G4IeplusAnnihilation::BuildCoeffCTable(
|
||||
const G4ParticleDefinition& aParticleType)
|
||||
{
|
||||
const G4MaterialTable* theMaterialTable=
|
||||
G4Material::GetMaterialTable();
|
||||
|
||||
// create table for coefficients "C"
|
||||
|
||||
G4int numOfMaterials = theMaterialTable->length();
|
||||
|
||||
if(theCoeffCTable)
|
||||
{ theCoeffCTable->clearAndDestroy();
|
||||
delete theCoeffCTable; }
|
||||
theCoeffCTable = new G4PhysicsTable(numOfMaterials);
|
||||
|
||||
G4double R2 = RTable*RTable ;
|
||||
G4double R1 = RTable+1.;
|
||||
G4double w = R1*(RTable-1.)*(RTable-1.);
|
||||
G4double w1 = 1./w , w2 = -RTable*R1/w , w3 = RTable*R2/w ;
|
||||
G4double Ti , Tim , Tip , Ri , Rim , Rip , Value ;
|
||||
G4bool isOut;
|
||||
|
||||
// loop for materials
|
||||
for (G4int J=0; J<numOfMaterials; J++)
|
||||
{
|
||||
|
||||
// create vector
|
||||
G4int binmax=TotBin ;
|
||||
G4PhysicsLinearVector* aVector =
|
||||
new G4PhysicsLinearVector(0.,binmax, TotBin);
|
||||
|
||||
// loop for kinetic energy
|
||||
|
||||
Ti = LowestKineticEnergy ;
|
||||
|
||||
G4PhysicsVector* lVector= (*theNlambdaTable)[J];
|
||||
|
||||
for ( G4int i=0; i<TotBin; i++)
|
||||
{
|
||||
Ri = lVector->GetValue(Ti,isOut) ;
|
||||
|
||||
if ( i==0 )
|
||||
Rim = Ri/sqrt(RTable) ;
|
||||
else
|
||||
{
|
||||
Tim = Ti/RTable ;
|
||||
Rim = lVector->GetValue(Tim,isOut);
|
||||
}
|
||||
|
||||
Tip = Ti*RTable ;
|
||||
Rip = lVector->GetValue(Tip,isOut);
|
||||
|
||||
if(i < (TotBin-1))
|
||||
Value = w1*Rip + w2*Ri + w3*Rim ;
|
||||
else
|
||||
{
|
||||
Rip = Rip*Rip/Rim ;
|
||||
Value = w1*Rip + w2*Ri + w3*Rim ;
|
||||
}
|
||||
|
||||
|
||||
aVector->PutValue(i,Value);
|
||||
|
||||
Ti = RTable*Ti ;
|
||||
|
||||
}
|
||||
|
||||
theCoeffCTable->insert(aVector);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
void G4IeplusAnnihilation::BuildInverseNlambdaTable(
|
||||
const G4ParticleDefinition& aParticleType)
|
||||
{
|
||||
G4double T,Smallest,Biggest,TT ;
|
||||
const G4double small = 1.e-10;
|
||||
G4bool isOut ;
|
||||
|
||||
// create table
|
||||
|
||||
const G4MaterialTable* theMaterialTable=
|
||||
G4Material::GetMaterialTable();
|
||||
|
||||
G4int numOfMaterials = theMaterialTable->length();
|
||||
|
||||
if(theInverseNlambdaTable)
|
||||
{ theInverseNlambdaTable->clearAndDestroy();
|
||||
delete theInverseNlambdaTable; }
|
||||
theInverseNlambdaTable = new G4PhysicsTable(numOfMaterials);
|
||||
|
||||
// loop for materials
|
||||
|
||||
for (G4int J=0; J<numOfMaterials; J++)
|
||||
{
|
||||
T = LowestKineticEnergy ;
|
||||
do
|
||||
{
|
||||
Smallest = (*theNlambdaTable)[J]->
|
||||
GetValue(T,isOut) ;
|
||||
T *= RTable ;
|
||||
} while (Smallest <= small) ;
|
||||
|
||||
Biggest = (*theNlambdaTable)[J]->
|
||||
GetValue(HighestKineticEnergy,isOut) ;
|
||||
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
Biggest *= 1.25 ;
|
||||
|
||||
// create vector
|
||||
G4PhysicsLogVector* aVector;
|
||||
|
||||
aVector = new G4PhysicsLogVector(Smallest,
|
||||
Biggest,TotBin);
|
||||
|
||||
// fill the vector
|
||||
|
||||
InvertNlambdaVector(aParticleType,J, aVector);
|
||||
|
||||
// insert vector to the table
|
||||
|
||||
theInverseNlambdaTable->insert(aVector);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void G4IeplusAnnihilation::InvertNlambdaVector(
|
||||
const G4ParticleDefinition& aParticleType,
|
||||
G4int materialIndex,
|
||||
G4PhysicsLogVector* nlambdaVector)
|
||||
{
|
||||
G4double LowEdge,A,B,C,discr,KineticEnergy ;
|
||||
G4double Tbin = LowestKineticEnergy/RTable ;
|
||||
G4double bin = 0.0 ;
|
||||
G4int binnumber = -1 ;
|
||||
G4bool isOut ;
|
||||
|
||||
//loop for Nlambda values
|
||||
for( G4int i=0; i<TotBin; i++)
|
||||
{
|
||||
LowEdge = nlambdaVector->GetLowEdgeEnergy(i) ; //i.e. GetLowEdgeValue(i)
|
||||
|
||||
if( bin < LowEdge )
|
||||
{
|
||||
do
|
||||
{
|
||||
binnumber += 1 ;
|
||||
Tbin *= RTable ;
|
||||
bin = (*theNlambdaTable)[materialIndex]->GetValue(Tbin,isOut) ;
|
||||
}
|
||||
while ((bin < LowEdge) && (binnumber < TotBin-2 )) ;
|
||||
}
|
||||
|
||||
if(binnumber == 0)
|
||||
KineticEnergy = LowestKineticEnergy ;
|
||||
else if(binnumber == TotBin-1)
|
||||
KineticEnergy = HighestKineticEnergy ;
|
||||
else
|
||||
{
|
||||
A = (*(*theCoeffATable)(materialIndex))(binnumber-1) ;
|
||||
B = (*(*theCoeffBTable)(materialIndex))(binnumber-1) ;
|
||||
C = (*(*theCoeffCTable)(materialIndex))(binnumber-1) ;
|
||||
if(A==0.)
|
||||
KineticEnergy = (LowEdge -C )/B ;
|
||||
else
|
||||
{
|
||||
discr = B*B - 4.*A*(C-LowEdge);
|
||||
discr = discr>0. ? sqrt(discr) : 0.;
|
||||
KineticEnergy = 0.5*(discr-B)/A ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
nlambdaVector->PutValue(i,KineticEnergy) ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
G4double G4IeplusAnnihilation::ComputeMicroscopicCrossSection
|
||||
(G4double PositKinEnergy, G4double AtomicNumber)
|
||||
|
||||
// Calculates the microscopic cross section of annihilation into two photons
|
||||
// from the Heilter formula.
|
||||
// GEANT4 internal units.
|
||||
|
||||
{
|
||||
static const G4double pi_rcl2 = pi*classic_electr_radius*classic_electr_radius;
|
||||
|
||||
G4double gama = 1. + PositKinEnergy/electron_mass_c2;
|
||||
G4double gama2 = gama*gama, sqgama2 = sqrt(gama2-1.);
|
||||
|
||||
return pi_rcl2*AtomicNumber*((gama2+4*gama+1.)*log(gama+sqgama2) - (gama+3.)*sqgama2)
|
||||
/((gama2-1.)*(gama+1.));
|
||||
}
|
||||
|
||||
|
||||
G4VParticleChange* G4IeplusAnnihilation::PostStepDoIt(const G4Track& aTrack,
|
||||
const G4Step& aStep)
|
||||
//
|
||||
// The secondaries Gamma energies are sampled using the Heitler cross section.
|
||||
//
|
||||
// A modified version of the random number techniques of Butcher & Messel is used
|
||||
// (Nuc Phys 20(1960),15).
|
||||
//
|
||||
// GEANT4 internal units.
|
||||
//
|
||||
// Note 1 : The initial electron is assumed free and at rest.
|
||||
//
|
||||
// Note 2 : The annihilation processes producing one or more than two photons are
|
||||
// ignored, as negligible compared to the two photons process.
|
||||
|
||||
{
|
||||
aParticleChange.Initialize(aTrack);
|
||||
G4Material* aMaterial = aTrack.GetMaterial();
|
||||
|
||||
|
||||
const G4DynamicParticle* aDynamicPositron = aTrack.GetDynamicParticle();
|
||||
G4double PositKinEnergy = aDynamicPositron->GetKineticEnergy();
|
||||
G4ParticleMomentum PositDirection = aDynamicPositron->GetMomentumDirection();
|
||||
|
||||
aParticleChange.Initialize(aTrack);
|
||||
|
||||
// Do not make anything if PositKinEnergy=0. , the annihilation then
|
||||
// should be performed by the AtRestDoIt!
|
||||
if(PositKinEnergy == 0.)
|
||||
return &aParticleChange ;
|
||||
|
||||
G4double gama = 1. + PositKinEnergy/electron_mass_c2;
|
||||
G4double gamap1 = gama+1. , gamam1 = gama-1. , sqgrate = sqrt(gamam1/gamap1)/2. ,
|
||||
sqg2m1 = sqrt(gamam1*gamap1);
|
||||
|
||||
// limits of the energy sampling
|
||||
G4double epsil1 = 0.5 - sqgrate , epsil2 = 0.5 + sqgrate;
|
||||
G4double epsilqot = epsil2/epsil1;
|
||||
|
||||
//
|
||||
// sample the energy rate of the created gammas
|
||||
//
|
||||
G4double epsil, greject ;
|
||||
|
||||
do {
|
||||
epsil = epsil1*pow(epsilqot,G4UniformRand());
|
||||
greject = 1. - epsil + (2*gama*epsil-1.)/(epsil*gamap1*gamap1);
|
||||
} while( greject < G4UniformRand() );
|
||||
|
||||
//
|
||||
// scattered Gamma angles. ( Z - axis along the parent positron)
|
||||
//
|
||||
|
||||
G4double cost = (epsil*gamap1-1.)/(epsil*sqg2m1) , sint = sqrt((1.+cost)*(1.-cost));
|
||||
|
||||
|
||||
G4double phi = twopi * G4UniformRand() ;
|
||||
G4double dirx = sint*cos(phi) , diry = sint*sin(phi) , dirz = cost;
|
||||
|
||||
//
|
||||
// kinematic of the created pair
|
||||
//
|
||||
|
||||
G4double LocalEnerDeposit = 0. ;
|
||||
aParticleChange.SetNumberOfSecondaries(2) ;
|
||||
|
||||
G4double TotalAvailableEnergy = PositKinEnergy + 2*electron_mass_c2;
|
||||
G4double Phot1Energy = epsil*TotalAvailableEnergy;
|
||||
|
||||
G4double GammaCut= (G4Gamma::GetCutsInEnergy())[aMaterial->GetIndex()];
|
||||
|
||||
if (Phot1Energy > GammaCut)
|
||||
{
|
||||
G4ThreeVector Phot1Direction ( dirx, diry, dirz );
|
||||
Phot1Direction.rotateUz(PositDirection);
|
||||
|
||||
// create G4DynamicParticle object for the particle1
|
||||
G4DynamicParticle* aParticle1= new G4DynamicParticle (G4Gamma::Gamma(),
|
||||
Phot1Direction, Phot1Energy);
|
||||
aParticleChange.AddSecondary( aParticle1 ) ;
|
||||
}
|
||||
else
|
||||
{ LocalEnerDeposit += Phot1Energy; }
|
||||
|
||||
G4double Phot2Energy =(1.-epsil)*TotalAvailableEnergy;
|
||||
|
||||
if (Phot2Energy > GammaCut)
|
||||
{
|
||||
G4double Eratio = Phot1Energy/Phot2Energy;
|
||||
G4double PositP = sqrt(PositKinEnergy*(PositKinEnergy+2.*electron_mass_c2));
|
||||
G4ThreeVector Phot2Direction (-dirx*Eratio, -diry*Eratio,
|
||||
(PositP-dirz*Phot1Energy)/Phot2Energy);
|
||||
Phot2Direction.rotateUz(PositDirection);
|
||||
|
||||
// create G4DynamicParticle object for the particle2
|
||||
G4DynamicParticle* aParticle2= new G4DynamicParticle (G4Gamma::Gamma(),
|
||||
Phot2Direction, Phot2Energy);
|
||||
aParticleChange.AddSecondary( aParticle2 ) ;
|
||||
}
|
||||
else
|
||||
{ LocalEnerDeposit += Phot2Energy; }
|
||||
|
||||
aParticleChange.SetLocalEnergyDeposit( LocalEnerDeposit ) ;
|
||||
|
||||
//
|
||||
// Kill the incident positron
|
||||
//
|
||||
|
||||
aParticleChange.SetMomentumChange( 0., 0., 0. ) ;
|
||||
aParticleChange.SetEnergyChange( 0. ) ;
|
||||
aParticleChange.SetStatusChange( fStopAndKill ) ;
|
||||
|
||||
return &aParticleChange;
|
||||
}
|
||||
|
||||
|
||||
G4VParticleChange* G4IeplusAnnihilation::AtRestDoIt(const G4Track& aTrack,
|
||||
const G4Step& aStep)
|
||||
//
|
||||
// Performs the e+ e- annihilation when both particles are assumed at rest.
|
||||
// It generates two back to back photons with energy = electron_mass.
|
||||
// The angular distribution is isotropic.
|
||||
// GEANT4 internal units
|
||||
//
|
||||
// Note : Effects due to binding of atomic electrons are negliged.
|
||||
|
||||
{
|
||||
aParticleChange.Initialize(aTrack);
|
||||
G4Material* aMaterial = aTrack.GetMaterial();
|
||||
|
||||
aParticleChange.SetNumberOfSecondaries(2) ;
|
||||
|
||||
if (electron_mass_c2 > (G4Gamma::GetCutsInEnergy())[aMaterial->GetIndex()])
|
||||
{
|
||||
G4double cosTeta = 2*G4UniformRand()-1. , sinTeta = sqrt(1.-cosTeta*cosTeta);
|
||||
G4double Phi = twopi * G4UniformRand() ;
|
||||
G4ThreeVector Direction (sinTeta*cos(Phi), sinTeta*sin(Phi), cosTeta);
|
||||
|
||||
aParticleChange.AddSecondary( new G4DynamicParticle (G4Gamma::Gamma(),
|
||||
Direction, electron_mass_c2) );
|
||||
aParticleChange.AddSecondary( new G4DynamicParticle (G4Gamma::Gamma(),
|
||||
-Direction, electron_mass_c2) );
|
||||
|
||||
aParticleChange.SetLocalEnergyDeposit(0.);
|
||||
}
|
||||
else
|
||||
{ aParticleChange.SetLocalEnergyDeposit( 2*electron_mass_c2 ); }
|
||||
|
||||
// Kill the incident positron
|
||||
//
|
||||
aParticleChange.SetStatusChange( fStopAndKill );
|
||||
|
||||
return &aParticleChange;
|
||||
}
|
||||
|
||||
void G4IeplusAnnihilation::PrintInfoDefinition()
|
||||
{
|
||||
G4String comments="Total cross section from Heitler formula (2 photon annihilation).\n";
|
||||
comments += " gamma energies sampled according Heitler";
|
||||
|
||||
G4cout << G4endl << GetProcessName() << ": " << comments
|
||||
<< "\n PhysicsTables from " << G4BestUnit(LowestEnergyLimit,"Energy")
|
||||
<< " to " << G4BestUnit(HighestEnergyLimit,"Energy")
|
||||
<< " in " << NumbBinTable << " bins. \n";
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4PAIonisation.cc,v 1.13 2000/09/22 14:46:38 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// $Id: G4PAIonisation.cc,v 1.14 2001/02/01 15:12:50 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
//
|
||||
// **************************************************************
|
||||
@@ -489,15 +489,16 @@ G4VParticleChange* G4PAIonisation::AlongStepDoIt( const G4Track& trackData,
|
||||
|
||||
E = aParticle->GetKineticEnergy() ;
|
||||
|
||||
G4double mass = aParticle->GetDefinition()->GetPDGMass() ;
|
||||
G4double gamma = 1.0 + E/mass ;
|
||||
|
||||
if( gamma < 1.2 ) return &aParticleChange ;
|
||||
|
||||
G4double Charge = aParticle->GetDefinition()->GetPDGCharge() ;
|
||||
|
||||
G4double Chargesquare = Charge*Charge ;
|
||||
|
||||
G4double MassRatio = proton_mass_c2/aParticle->GetDefinition()->GetPDGMass() ;
|
||||
|
||||
G4double MassRatio = proton_mass_c2/mass ;
|
||||
ScaledE = E*MassRatio ;
|
||||
|
||||
|
||||
ParticleCutInKineticEnergyNow =
|
||||
(aParticle->GetDefinition()->GetEnergyCuts())[index] ;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4PAIxSection.cc,v 1.4 1999/12/15 14:51:51 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
//
|
||||
// G4PAIxSection.cc -- class implementation file
|
||||
|
||||
@@ -5,21 +5,11 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4PhotoElectricEffect.cc,v 1.11 2000/06/22 08:57:11 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// $Id: G4PhotoElectricEffect.cc,v 1.12 2001/02/22 16:05:43 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
// CERN Geneva Switzerland
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ------------ G4PhotoElectricEffect physics process --------
|
||||
// by Michel Maire, April 1996
|
||||
// **************************************************************
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
// 12-06-96, Added SelectRandomAtom() method, by M.Maire
|
||||
// 21-06-96, SetCuts implementation, M.Maire
|
||||
// 17-09-96, PartialSumSigma(i)
|
||||
@@ -34,8 +24,11 @@
|
||||
// 20-05-99, protection against very low energy photons ,L.Urban
|
||||
// 08-06-99, removed this above protection from the DoIt. mma
|
||||
// 21-06-00, in DoIt, killing photon: aParticleChange.SetEnergyChange(0.); mma
|
||||
// 22-06-00, in DoIt, absorbe very low energy photon (back to 20-05-99); mma
|
||||
// --------------------------------------------------------------
|
||||
// 22-06-00, in DoIt, absorbe very low energy photon (back to 20-05-99); mma
|
||||
// 22-02-01, back to 08-06-99 after correc in SandiaTable (materials-V03-00-05)
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "G4PhotoElectricEffect.hh"
|
||||
#include "G4EnergyLossTables.hh"
|
||||
@@ -244,10 +237,10 @@ G4VParticleChange* G4PhotoElectricEffect::PostStepDoIt(const G4Track& aTrack,
|
||||
G4int NbOfShells = anElement->GetNbOfAtomicShells();
|
||||
G4int i=0;
|
||||
while ((i<NbOfShells)&&(PhotonEnergy<anElement->GetAtomicShell(i))) i++;
|
||||
G4double BindingEnergy = 0.;
|
||||
if (i<NbOfShells) BindingEnergy = anElement->GetAtomicShell(i);
|
||||
|
||||
if (i==NbOfShells) return G4VDiscreteProcess::PostStepDoIt(aTrack,aStep);
|
||||
|
||||
G4double ElecKineEnergy = PhotonEnergy - BindingEnergy;
|
||||
G4double ElecKineEnergy = PhotonEnergy - anElement->GetAtomicShell(i);
|
||||
if ((G4EnergyLossTables::GetRange(G4Electron::Electron(),
|
||||
ElecKineEnergy,aMaterial)>aStep.GetPostStepPoint()->GetSafety())
|
||||
||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4PolarizedComptonScattering.cc,v 1.4 2000/11/17 15:03:18 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
//
|
||||
//---------- G4PolarizedComptonScattering physics process -------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4SynchrotronRadiation.cc,v 1.3 2000/11/01 15:30:46 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VPAIenergyLoss.cc,v 1.1 2000/04/25 14:33:10 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
// -----------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VeEnergyLoss.cc,v 1.8 2000/10/30 07:01:09 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// $Id: G4VeEnergyLoss.cc,v 1.11 2001/03/27 15:10:52 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
|
||||
// --------------------------------------------------------------
|
||||
@@ -16,6 +16,8 @@
|
||||
// 02/02/99 important correction in AlongStepDoIt , L.Urban
|
||||
// 28/04/99 bug fixed (unit independece now),L.Urban
|
||||
// 10/02/00 modifications , new e.m. structure, L.Urban
|
||||
// 23/01/01 bug fixed in AlongStepDoIt , L.Urban
|
||||
// 27/03/01 : commented out the printing of subcutoff energies
|
||||
// --------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -99,6 +101,14 @@ void G4VeEnergyLoss::BuildDEDXTable(
|
||||
LOGRTable=lrate/NbinEloss;
|
||||
RTable =exp(LOGRTable);
|
||||
|
||||
//set physically consistent value for finalRange
|
||||
// and parameters for en.loss step limit
|
||||
if(finalRange > G4Electron::Electron()->GetCuts())
|
||||
finalRange = G4Electron::Electron()->GetCuts() ;
|
||||
c1lim = dRoverRange ;
|
||||
c2lim = 2.*(1.-dRoverRange)*finalRange ;
|
||||
c3lim = -(1.-dRoverRange)*finalRange*finalRange;
|
||||
|
||||
// Build energy loss table as a sum of the energy loss due to the
|
||||
// different processes.
|
||||
//
|
||||
@@ -278,16 +288,16 @@ void G4VeEnergyLoss::BuildDEDXTable(
|
||||
if(!setMinDeltaCutInRange )
|
||||
MinDeltaCutInRange = G4Electron::Electron()->GetCuts()/10. ;
|
||||
|
||||
if((subSecFlag) && (&aParticleType==G4Electron::Electron()))
|
||||
{
|
||||
G4cout << G4endl;
|
||||
G4cout.precision(5) ;
|
||||
G4cout << " eIoni Minimum Delta cut in range=" << MinDeltaCutInRange/mm
|
||||
<< " mm." << G4endl;
|
||||
G4cout << G4endl;
|
||||
G4cout << " material min.delta energy(keV) " << G4endl;
|
||||
G4cout << G4endl;
|
||||
}
|
||||
// if((subSecFlag) && (&aParticleType==G4Electron::Electron()))
|
||||
// {
|
||||
// G4cout << G4endl;
|
||||
// G4cout.precision(5) ;
|
||||
// G4cout << " eIoni Minimum Delta cut in range=" << MinDeltaCutInRange/mm
|
||||
// << " mm." << G4endl;
|
||||
// G4cout << G4endl;
|
||||
// G4cout << " material min.delta energy(keV) " << G4endl;
|
||||
// G4cout << G4endl;
|
||||
// }
|
||||
|
||||
if(MinDeltaEnergy) delete MinDeltaEnergy ;
|
||||
MinDeltaEnergy = new G4double [numOfMaterials] ;
|
||||
@@ -307,15 +317,15 @@ void G4VeEnergyLoss::BuildDEDXTable(
|
||||
if(MinDeltaEnergy[mat]>G4Electron::Electron()->GetCutsInEnergy()[mat])
|
||||
MinDeltaEnergy[mat]=G4Electron::Electron()->GetCutsInEnergy()[mat] ;
|
||||
|
||||
if((subSecFlag) && (&aParticleType==G4Electron::Electron()))
|
||||
{
|
||||
G4cout << G4std::setw(20) << (*theMaterialTable)(mat)->GetName()
|
||||
<< G4std::setw(15) << MinDeltaEnergy[mat]/keV ;
|
||||
if(LowerLimitForced[mat])
|
||||
G4cout << " lower limit forced." << G4endl;
|
||||
else
|
||||
G4cout << G4endl ;
|
||||
}
|
||||
// if((subSecFlag) && (&aParticleType==G4Electron::Electron()))
|
||||
// {
|
||||
// G4cout << G4std::setw(20) << (*theMaterialTable)(mat)->GetName()
|
||||
// << G4std::setw(15) << MinDeltaEnergy[mat]/keV ;
|
||||
// if(LowerLimitForced[mat])
|
||||
// G4cout << " lower limit forced." << G4endl;
|
||||
// else
|
||||
// G4cout << G4endl ;
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -370,7 +380,7 @@ G4VParticleChange* G4VeEnergyLoss::AlongStepDoIt( const G4Track& trackData,
|
||||
if(finalT < MinKineticEnergy) finalT = 0. ;
|
||||
|
||||
MeanLoss = E - finalT ;
|
||||
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// start of subcutoff generation
|
||||
|
||||
@@ -466,7 +476,7 @@ G4VParticleChange* G4VeEnergyLoss::AlongStepDoIt( const G4Track& trackData,
|
||||
N = Ndeltamax ;
|
||||
G4double Px,Py,Pz ;
|
||||
G4ThreeVector ParticleDirection ;
|
||||
ParticleDirection=stepData.GetPostStepPoint()->
|
||||
ParticleDirection=stepData.GetPreStepPoint()->
|
||||
GetMomentumDirection() ;
|
||||
Px =ParticleDirection.x() ;
|
||||
Py =ParticleDirection.y() ;
|
||||
@@ -524,8 +534,6 @@ G4VParticleChange* G4VeEnergyLoss::AlongStepDoIt( const G4Track& trackData,
|
||||
zd=z1+frperstep*dz*urandom ;
|
||||
G4ThreeVector DeltaPosition(xd,yd,zd) ;
|
||||
DeltaTime=time0+frperstep*dTime*urandom ;
|
||||
ParticleDirection=stepData.GetPostStepPoint()->
|
||||
GetMomentumDirection() ;
|
||||
|
||||
G4ThreeVector DeltaDirection(dirx,diry,dirz) ;
|
||||
DeltaDirection.rotateUz(ParticleDirection);
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VhEnergyLoss.cc,v 1.13 2000/10/30 07:01:09 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// $Id: G4VhEnergyLoss.cc,v 1.16 2001/03/27 15:10:52 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
|
||||
// -----------------------------------------------------------
|
||||
@@ -23,6 +23,8 @@
|
||||
// energy losses of ions
|
||||
// 17/08/00 : V.Ivanchenko change EnergyLossFluctuation
|
||||
// 18/08/00 : V.Ivanchenko bug fixed in GetConstrained
|
||||
// 23/01/01 : bug fixed in AlongStepDoIt , L.Urban
|
||||
// 27/03/01 : commented out the printing of subcutoff energies
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -117,6 +119,14 @@ void G4VhEnergyLoss::BuildDEDXTable(
|
||||
LOGRTable=lrate/NbinEloss;
|
||||
RTable =exp(LOGRTable);
|
||||
|
||||
//set physically consistent value for finalRange
|
||||
// and parameters for en.loss step limit
|
||||
if(finalRange > G4Electron::Electron()->GetCuts())
|
||||
finalRange = G4Electron::Electron()->GetCuts() ;
|
||||
c1lim = dRoverRange ;
|
||||
c2lim = 2.*(1.-dRoverRange)*finalRange ;
|
||||
c3lim = -(1.-dRoverRange)*finalRange*finalRange;
|
||||
|
||||
// create table if there is no table or there is a new cut value
|
||||
G4bool MakeTable = false ;
|
||||
|
||||
@@ -315,16 +325,16 @@ void G4VhEnergyLoss::BuildDEDXTable(
|
||||
if(!setMinDeltaCutInRange)
|
||||
MinDeltaCutInRange = G4Electron::Electron()->GetCuts()/10.;
|
||||
|
||||
if((subSecFlag) && (aParticleType.GetParticleName()=="proton"))
|
||||
{
|
||||
G4cout << G4endl;
|
||||
G4cout.precision(5) ;
|
||||
G4cout << " hIoni Minimum Delta cut in range=" << MinDeltaCutInRange/mm
|
||||
<< " mm." << G4endl;
|
||||
G4cout << G4endl;
|
||||
G4cout << " material min.delta energy(keV) " << G4endl;
|
||||
G4cout << G4endl;
|
||||
}
|
||||
// if((subSecFlag) && (aParticleType.GetParticleName()=="proton"))
|
||||
// {
|
||||
// G4cout << G4endl;
|
||||
// G4cout.precision(5) ;
|
||||
// G4cout << " hIoni Minimum Delta cut in range=" << MinDeltaCutInRange/mm
|
||||
// << " mm." << G4endl;
|
||||
// G4cout << G4endl;
|
||||
// G4cout << " material min.delta energy(keV) " << G4endl;
|
||||
// G4cout << G4endl;
|
||||
// }
|
||||
|
||||
if(MinDeltaEnergy) delete MinDeltaEnergy ;
|
||||
MinDeltaEnergy = new G4double [numOfMaterials] ;
|
||||
@@ -343,15 +353,15 @@ void G4VhEnergyLoss::BuildDEDXTable(
|
||||
if(MinDeltaEnergy[mat]>G4Electron::Electron()->GetCutsInEnergy()[mat])
|
||||
MinDeltaEnergy[mat]=G4Electron::Electron()->GetCutsInEnergy()[mat] ;
|
||||
|
||||
if((subSecFlag) && (aParticleType.GetParticleName()=="proton"))
|
||||
{
|
||||
G4cout << G4std::setw(20) << (*theMaterialTable)(mat)->GetName()
|
||||
<< G4std::setw(15) << MinDeltaEnergy[mat]/keV ;
|
||||
if(LowerLimitForced[mat])
|
||||
G4cout << " lower limit forced." << G4endl;
|
||||
else
|
||||
G4cout << G4endl ;
|
||||
}
|
||||
// if((subSecFlag) && (aParticleType.GetParticleName()=="proton"))
|
||||
// {
|
||||
// G4cout << G4std::setw(20) << (*theMaterialTable)(mat)->GetName()
|
||||
// << G4std::setw(15) << MinDeltaEnergy[mat]/keV ;
|
||||
// if(LowerLimitForced[mat])
|
||||
// G4cout << " lower limit forced." << G4endl;
|
||||
// else
|
||||
// G4cout << G4endl ;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -570,12 +580,12 @@ G4VParticleChange* G4VhEnergyLoss::AlongStepDoIt(
|
||||
|
||||
G4double Px,Py,Pz ;
|
||||
G4ThreeVector ParticleDirection ;
|
||||
ParticleDirection=stepData.GetPostStepPoint()->
|
||||
ParticleDirection=aParticle->
|
||||
GetMomentumDirection() ;
|
||||
Px =ParticleDirection.x() ;
|
||||
Py =ParticleDirection.y() ;
|
||||
Pz =ParticleDirection.z() ;
|
||||
|
||||
|
||||
G4int subdelta = 0;
|
||||
|
||||
if(N > 0)
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4eBremsstrahlung.cc,v 1.13 2000/09/21 09:34:29 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// $Id: G4eBremsstrahlung.cc,v 1.15 2001/02/05 17:53:52 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
@@ -265,40 +265,13 @@ void G4eBremsstrahlung::BuildLossTable(const G4ParticleDefinition& aParticleType
|
||||
}
|
||||
|
||||
theLossTable->insert(aVector);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4eBremsstrahlung::ComputeXYPolynomial(G4double x, G4double y,
|
||||
G4int xSize, G4int ySize,
|
||||
const G4double coeff[])
|
||||
{
|
||||
// Computes the polynomial (1 y y^2 ...) * matrix * (1 x x^2 ...) .
|
||||
// xSize and ySize are the dimensions of the matrix,
|
||||
// coeff containts the elements, stored row-wise.
|
||||
|
||||
G4double* a= new G4double[xSize];
|
||||
G4int i, j;
|
||||
|
||||
for (i=0; i<xSize; i++) a[i]= 0.0;
|
||||
|
||||
G4int index= 0; G4double yy= 1.0;
|
||||
for (j=0; j<ySize; j++)
|
||||
{ for (i=0; i<xSize; i++) a[i]+= coeff[index++]*yy;
|
||||
yy*= y;
|
||||
}
|
||||
|
||||
G4double r= a[0]; G4double xx= x;
|
||||
for (i=1; i<xSize; i++) { r+= a[i]*xx; xx*= x;}
|
||||
|
||||
delete[] a;
|
||||
return r;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4eBremsstrahlung::ComputeBremLoss(G4double Z,G4double natom,
|
||||
G4double T,G4double Cut,G4double x)
|
||||
|
||||
@@ -354,6 +327,9 @@ G4double G4eBremsstrahlung::ComputeBremLoss(G4double Z,G4double natom,
|
||||
0.00017519
|
||||
|
||||
} ;
|
||||
static G4double aaa=0.414 ;
|
||||
static G4double bbb=0.345 ;
|
||||
static G4double ccc=0.460 ;
|
||||
|
||||
G4int iz = 0 ;
|
||||
G4double delz = 1.e6 ;
|
||||
@@ -390,6 +366,9 @@ G4double G4eBremsstrahlung::ComputeBremLoss(G4double Z,G4double natom,
|
||||
if(T <= Cut)
|
||||
loss *= exp(alosslow*log(T/Cut)) ;
|
||||
|
||||
// correction ................................
|
||||
loss *= (aaa+bbb*T/Tlim)/(1.+ccc*T/Tlim) ;
|
||||
|
||||
loss *= fl ;
|
||||
|
||||
loss /= Avogadro ;
|
||||
@@ -438,7 +417,9 @@ void G4eBremsstrahlung::BuildLambdaTable(const G4ParticleDefinition& ParticleTyp
|
||||
}
|
||||
theMeanFreePathTable = new G4PhysicsTable(G4Material::GetNumberOfMaterials());
|
||||
|
||||
PartialSumSigma.clearAndDestroy();
|
||||
PartialSumSigma.resize(G4Material::GetNumberOfMaterials());
|
||||
|
||||
G4PhysicsLogVector* ptrVector;
|
||||
for ( G4int J=0 ; J < G4Material::GetNumberOfMaterials(); J++ )
|
||||
{
|
||||
@@ -694,7 +675,8 @@ void G4eBremsstrahlung::ComputePartialSumSigma(const G4ParticleDefinition* Parti
|
||||
const G4double* theAtomNumDensityVector = aMaterial->GetAtomicNumDensityVector();
|
||||
G4double GammaEnergyCut = (G4Gamma::GetCutsInEnergy())[Imate];
|
||||
|
||||
PartialSumSigma(Imate) = new G4ValVector(NbOfElements);
|
||||
|
||||
PartialSumSigma[Imate] = new G4DataVector();
|
||||
|
||||
G4double SIGMA = 0. ;
|
||||
|
||||
@@ -704,7 +686,7 @@ void G4eBremsstrahlung::ComputePartialSumSigma(const G4ParticleDefinition* Parti
|
||||
ComputeMicroscopicCrossSection( ParticleType, KineticEnergy,
|
||||
(*theElementVector)(Ielem)->GetZ(),
|
||||
GammaEnergyCut );
|
||||
PartialSumSigma(Imate)->insertAt(Ielem, SIGMA);
|
||||
PartialSumSigma[Imate]->push_back(SIGMA);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -956,9 +938,9 @@ G4Element* G4eBremsstrahlung::SelectRandomAtom(G4Material* aMaterial) const
|
||||
const G4int NumberOfElements = aMaterial->GetNumberOfElements();
|
||||
const G4ElementVector* theElementVector = aMaterial->GetElementVector();
|
||||
|
||||
G4double rval = G4UniformRand()*((*PartialSumSigma(Index))(NumberOfElements-1));
|
||||
G4double rval = G4UniformRand()*((*PartialSumSigma[Index])[NumberOfElements-1]);
|
||||
for ( G4int i=0; i < NumberOfElements; i++ )
|
||||
if (rval <= (*PartialSumSigma(Index))(i)) return ((*theElementVector)(i));
|
||||
if (rval <= (*PartialSumSigma[Index])[i]) return ((*theElementVector)(i));
|
||||
G4cout << " WARNING !!! - The Material '"<< aMaterial->GetName()
|
||||
<< "' has no elements, NULL pointer returned." << G4endl;
|
||||
return NULL;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4eIonisation.cc,v 1.10 2000/05/23 14:42:21 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
|
||||
@@ -5,26 +5,19 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4eplusAnnihilation.cc,v 1.2 1999/12/15 14:51:53 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// $Id: G4eplusAnnihilation.cc,v 1.3 2001/02/22 18:26:09 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
// CERN Geneva Switzerland
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ------------ G4eplusAnnihilation process --------
|
||||
// by Michel Maire, 7 July 1996
|
||||
// **************************************************************
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
// 10-01-97, crossection table + mean free path table, M.Maire
|
||||
// 17-03-97, merge 'in fly' and 'at rest', M.Maire
|
||||
// 23-03-97, protection in BuildPhysicsTable, M.Maire
|
||||
// 31-08-98, new methods SetBining() and PrintInfo()
|
||||
// --------------------------------------------------------------
|
||||
// 22-02-01, postStepDoIt: fStopButAlive instead of kineEnergy == 0.
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "G4eplusAnnihilation.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
@@ -182,13 +175,13 @@ G4VParticleChange* G4eplusAnnihilation::PostStepDoIt(const G4Track& aTrack,
|
||||
|
||||
aParticleChange.Initialize(aTrack);
|
||||
|
||||
// Do not make anything if PositKinEnergy=0. , the annihilation then
|
||||
// Do not make anything if particle is stopped, the annihilation then
|
||||
// should be performed by the AtRestDoIt!
|
||||
if (PositKinEnergy == 0.) return &aParticleChange;
|
||||
if (aTrack.GetTrackStatus() == fStopButAlive) return &aParticleChange;
|
||||
|
||||
G4double gama = 1. + PositKinEnergy/electron_mass_c2;
|
||||
G4double gamap1 = gama+1. , gamam1 = gama-1. , sqgrate = sqrt(gamam1/gamap1)/2. ,
|
||||
sqg2m1 = sqrt(gamam1*gamap1);
|
||||
G4double gamam1 = PositKinEnergy/electron_mass_c2;
|
||||
G4double gama = gamam1+1. , gamap1 = gamam1+2. , sqgrate = sqrt(gamam1/gamap1)/2. ,
|
||||
sqg2m1 = sqrt(gamam1*gamap1);
|
||||
|
||||
// limits of the energy sampling
|
||||
G4double epsilmin = 0.5 - sqgrate , epsilmax = 0.5 + sqgrate;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4hIonisation.cc,v 1.12 2000/08/10 22:13:01 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
|
||||
Reference in New Issue
Block a user