Import Geant4 2.0.0 source tree
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4EnergyLossTables.hh,v 1.8.2.1.2.1 1999/12/09 10:28:49 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
// $Id: G4EnergyLossTables.hh,v 1.9 1999/12/15 14:52:01 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
// $Id:
|
||||
//
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4EnergyLossTables.icc,v 1.7.2.1 1999/12/07 20:51:21 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
// $Id: G4EnergyLossTables.icc,v 1.11 2000/05/23 14:24:47 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
// $Id:
|
||||
// Inline members of the G4EnergyLossTables class
|
||||
@@ -138,7 +138,8 @@ inline G4double G4EnergyLossTables::GetDEDX(
|
||||
if (scaledKineticEnergy<t.theLowestKineticEnergy) {
|
||||
|
||||
dEdx =(*dEdxTable)(materialIndex)->GetValue(
|
||||
t.theLowestKineticEnergy,isOut);
|
||||
t.theLowestKineticEnergy,isOut)
|
||||
*sqrt(scaledKineticEnergy/t.theLowestKineticEnergy);
|
||||
|
||||
} else if (scaledKineticEnergy>t.theHighestKineticEnergy) {
|
||||
|
||||
@@ -417,7 +418,7 @@ inline G4double G4EnergyLossTables::GetRange(
|
||||
|
||||
if (scaledKineticEnergy<t.theLowestKineticEnergy) {
|
||||
|
||||
Range = scaledKineticEnergy/t.theLowestKineticEnergy*
|
||||
Range = sqrt(scaledKineticEnergy/t.theLowestKineticEnergy)*
|
||||
(*rangeTable)(materialIndex)->GetValue(
|
||||
t.theLowestKineticEnergy,isOut);
|
||||
|
||||
@@ -454,6 +455,7 @@ inline G4double G4EnergyLossTables::GetPreciseEnergyFromRange(
|
||||
Chargesquare = (aParticle->GetPDGCharge())*
|
||||
(aParticle->GetPDGCharge())/
|
||||
QQPositron ;
|
||||
oldIndex = -1 ;
|
||||
}
|
||||
const G4PhysicsTable* rangeTable= t.theRangeTable;
|
||||
const G4PhysicsTable* dEdxTable= t.theDEDXTable;
|
||||
@@ -480,7 +482,7 @@ inline G4double G4EnergyLossTables::GetPreciseEnergyFromRange(
|
||||
if(scaledrange < rmin)
|
||||
{
|
||||
scaledKineticEnergy = t.theLowestKineticEnergy*
|
||||
scaledrange/rmin ;
|
||||
scaledrange*scaledrange/(rmin*rmin) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -0,0 +1,156 @@
|
||||
// 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: G4IMultipleScattering.hh,v 1.1 2000/03/20 14:44:03 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-02-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
|
||||
// --------- G4IMultipleScattering physics process --------
|
||||
// by Laszlo Urban, October 1997
|
||||
// **************************************************************
|
||||
// UNIVERSAL: for arbitrary single charged particle
|
||||
// 09/12/98: charge can be != +- 1 !!!! L.Urban
|
||||
// --------------------------------------------------------------
|
||||
// *****************************************************************
|
||||
// It is the first implementation of the multiple scattering process
|
||||
// using an INTEGRAL APPROACH instead of the differential
|
||||
// one used in the standard implementation .
|
||||
// *****************************************************************
|
||||
// by Laszlo Urban, 23 June 1998
|
||||
// -----------------------------------------------------------------
|
||||
// 27/10/98: cleanup , L.Urban
|
||||
|
||||
#ifndef G4IMultipleScattering_h
|
||||
#define G4IMultipleScattering_h 1
|
||||
|
||||
#include "G4ios.hh"
|
||||
#include "g4std/fstream"
|
||||
#include "g4std/iomanip"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4EnergyLossTables.hh"
|
||||
#include "G4Electron.hh"
|
||||
#include "G4Positron.hh"
|
||||
#include "G4MuonPlus.hh"
|
||||
#include "G4Proton.hh"
|
||||
#include "G4PhysicsLogVector.hh"
|
||||
#include "G4GPILSelection.hh"
|
||||
#include "G4VContinuousDiscreteProcess.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4MaterialTable.hh"
|
||||
#include "G4ElementTable.hh"
|
||||
#include "G4ElementVector.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
|
||||
class G4IMultipleScattering : public G4VContinuousDiscreteProcess
|
||||
|
||||
{
|
||||
public:
|
||||
|
||||
G4IMultipleScattering(const G4String& processName="Imsc") ;
|
||||
|
||||
~G4IMultipleScattering() ;
|
||||
|
||||
G4bool IsApplicable ( const G4ParticleDefinition& ) ;
|
||||
|
||||
void SetPhysicsTableBining(G4double lowE,G4double highE,G4int nBins);
|
||||
|
||||
void BuildPhysicsTable(const G4ParticleDefinition& aParticleType) ;
|
||||
|
||||
void BuildIntegralITable(const G4ParticleDefinition& aParticleType) ;
|
||||
void BuildIntegralJTable(const G4ParticleDefinition& aParticleType) ;
|
||||
|
||||
G4double GetIntegralI(const G4ParticleDefinition *aParticle,
|
||||
G4double KineticEnergy,G4Material* aMaterial) ;
|
||||
G4double GetIntegralJ(const G4ParticleDefinition *aParticle,
|
||||
G4double KineticEnergy,G4Material* aMaterial) ;
|
||||
|
||||
void PrintInfoDefinition();
|
||||
|
||||
G4double GetContinuousStepLimit(const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& currentSafety) ;
|
||||
|
||||
G4double GetMeanFreePath(const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition) ;
|
||||
|
||||
G4VParticleChange* AlongStepDoIt(const G4Track& aTrack,const G4Step& aStep) ;
|
||||
|
||||
G4VParticleChange* PostStepDoIt(const G4Track& aTrack,const G4Step& aStep) ;
|
||||
|
||||
protected:
|
||||
|
||||
G4double ComputeTransportCrossSection(
|
||||
const G4ParticleDefinition& aParticleType,
|
||||
G4double KineticEnergy,
|
||||
G4double AtomicNumber) ;
|
||||
|
||||
G4double TrueToGeomTransformation(const G4DynamicParticle* aParticle,
|
||||
G4Material* aMaterial,
|
||||
G4double truePathLength) ;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// hide assignment operator as private
|
||||
G4IMultipleScattering & operator = (const G4IMultipleScattering &right) ;
|
||||
G4IMultipleScattering ( const G4IMultipleScattering &) ;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// data members ...................................................
|
||||
G4PhysicsTable* theTransportMeanFreePathTable;
|
||||
G4PhysicsTable* theIntegralITable ;
|
||||
G4PhysicsTable* theIntegralJTable ;
|
||||
|
||||
G4double fTransportMeanFreePath ;
|
||||
|
||||
G4double fMeanLateralDisplacement ;
|
||||
|
||||
G4double LowestKineticEnergy ;
|
||||
G4double HighestKineticEnergy ;
|
||||
G4int TotBin ;
|
||||
|
||||
const G4Electron* theElectron ;
|
||||
const G4Positron* thePositron ;
|
||||
|
||||
G4Material* lastMaterial;
|
||||
G4double lastKineticEnergy;
|
||||
|
||||
// GeomStepFinal is the geom.steplength at the end of the AlongStep loop
|
||||
// the others are some 'cache' variables
|
||||
G4double GeomStepFinal ;
|
||||
G4double tLast,zLast,CosTheta ;
|
||||
|
||||
G4double biglambda ;
|
||||
|
||||
//parameters for low energy extrapolation of dE/dx and lambda
|
||||
const G4double plowloss,plowlambda ;
|
||||
|
||||
G4int NumberOfBuildPhysicsTableCalls ;
|
||||
|
||||
G4double tuning ;
|
||||
};
|
||||
|
||||
#include "G4IMultipleScattering.icc"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,268 @@
|
||||
// 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: G4IMultipleScattering.icc,v 1.1 2000/03/20 14:44:03 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-02-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
|
||||
// ------- G4IMultipleScattering physics process ------
|
||||
// by Laszlo Urban, October 1997
|
||||
// **************************************************************
|
||||
// 25/11/97: mods for KinEnergy > HighestLimit
|
||||
//---------------------------------------------------------------
|
||||
// *****************************************************************
|
||||
// It is the first implementation of the multiple scattering process
|
||||
// using an INTEGRAL APPROACH instead of the differential
|
||||
// one used in the standard implementation .
|
||||
// *****************************************************************
|
||||
// by Laszlo Urban, 23 June 1998
|
||||
// -----------------------------------------------------------------
|
||||
// 27/10/98: cleanup , L.Urban
|
||||
|
||||
inline G4double G4IMultipleScattering::TrueToGeomTransformation(
|
||||
const G4DynamicParticle *aParticle,
|
||||
G4Material *aMaterial,
|
||||
G4double truePathLength)
|
||||
|
||||
// it sets the data member fTransportMeanFreePath and
|
||||
// performs the true path length -> geometrical path length
|
||||
// transformation
|
||||
|
||||
{
|
||||
const G4double factt=1.-1.e-6,tausmall=5.e-5,taubig=50.,
|
||||
minim=1.e-6,smalldroverr=1.e-2,smalldToverT=2.e-2 ;
|
||||
|
||||
G4double KineticEnergy,Tfinal,tau,etau,geomPathLength,range,w1,w2,ww1,ww2 ;
|
||||
G4int materialIndex ;
|
||||
G4bool isOut ;
|
||||
|
||||
KineticEnergy = aParticle->GetKineticEnergy() ;
|
||||
|
||||
if((lastMaterial == aMaterial) && (lastKineticEnergy == KineticEnergy))
|
||||
{ ; }
|
||||
else
|
||||
{
|
||||
lastMaterial=aMaterial;
|
||||
lastKineticEnergy=KineticEnergy;
|
||||
materialIndex = aMaterial->GetIndex() ;
|
||||
|
||||
if(KineticEnergy<LowestKineticEnergy)
|
||||
{
|
||||
fTransportMeanFreePath =
|
||||
exp(plowlambda*log((KineticEnergy/LowestKineticEnergy)))*
|
||||
(*theTransportMeanFreePathTable)
|
||||
(materialIndex)->GetValue(LowestKineticEnergy,isOut);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(KineticEnergy>HighestKineticEnergy)
|
||||
KineticEnergy=HighestKineticEnergy;
|
||||
fTransportMeanFreePath = (*theTransportMeanFreePathTable)
|
||||
(materialIndex)->GetValue(KineticEnergy,isOut);
|
||||
}
|
||||
}
|
||||
|
||||
// do the true -> geom transformation
|
||||
if( fTransportMeanFreePath > biglambda )
|
||||
{
|
||||
geomPathLength = truePathLength ;
|
||||
CosTheta = 1. ;
|
||||
}
|
||||
else
|
||||
{
|
||||
const G4ParticleDefinition *theParticle = aParticle->GetDefinition() ;
|
||||
G4double range = G4EnergyLossTables::GetPreciseRangeFromEnergy(
|
||||
theParticle,KineticEnergy,aMaterial) ;
|
||||
if(truePathLength > factt*range)
|
||||
{
|
||||
geomPathLength = GetIntegralJ(theParticle,
|
||||
KineticEnergy,aMaterial) ;
|
||||
CosTheta = 0. ;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(truePathLength/range < smalldroverr)
|
||||
{
|
||||
Tfinal = KineticEnergy - truePathLength*
|
||||
G4EnergyLossTables::GetPreciseDEDX(
|
||||
theParticle,KineticEnergy,aMaterial) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
Tfinal = G4EnergyLossTables::GetPreciseEnergyFromRange(
|
||||
theParticle,range-truePathLength,
|
||||
aMaterial) ;
|
||||
}
|
||||
|
||||
if((KineticEnergy-Tfinal)> smalldToverT)
|
||||
{
|
||||
w1 = GetIntegralI(theParticle,KineticEnergy,aMaterial) ;
|
||||
w2 = GetIntegralI(theParticle,Tfinal ,aMaterial) ;
|
||||
CosTheta = exp(w2-w1) ;
|
||||
if( CosTheta < minim)
|
||||
CosTheta = 0. ;
|
||||
|
||||
ww1 = GetIntegralJ(theParticle,KineticEnergy,aMaterial) ;
|
||||
ww2 = GetIntegralJ(theParticle,Tfinal ,aMaterial) ;
|
||||
|
||||
geomPathLength = ww1 - ww2*CosTheta ;
|
||||
}
|
||||
else
|
||||
{
|
||||
tau = truePathLength/fTransportMeanFreePath ;
|
||||
|
||||
if(tau<tausmall)
|
||||
etau = tau ;
|
||||
else
|
||||
{
|
||||
if(tau>taubig)
|
||||
etau = 1. ;
|
||||
else
|
||||
etau = 1.-exp(-tau) ;
|
||||
}
|
||||
|
||||
geomPathLength = fTransportMeanFreePath*etau ;
|
||||
|
||||
CosTheta = exp(-truePathLength/fTransportMeanFreePath) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(geomPathLength>truePathLength)
|
||||
geomPathLength = truePathLength ;
|
||||
|
||||
tLast = truePathLength ;
|
||||
zLast = geomPathLength ;
|
||||
|
||||
return geomPathLength ;
|
||||
}
|
||||
|
||||
inline G4double G4IMultipleScattering::GetContinuousStepLimit(
|
||||
const G4Track& track,
|
||||
G4double,
|
||||
G4double currentMinimumStep,
|
||||
G4double&)
|
||||
{
|
||||
G4double zPathLength,tPathLength ;
|
||||
const G4DynamicParticle* aParticle ;
|
||||
// this process is not a candidate for selection!!!!!!!!!
|
||||
SetGPILSelection(NotCandidateForSelection) ;
|
||||
|
||||
tPathLength = currentMinimumStep ;
|
||||
aParticle = track.GetDynamicParticle() ;
|
||||
|
||||
zPathLength = TrueToGeomTransformation(aParticle,
|
||||
track.GetMaterial(),tPathLength);
|
||||
return zPathLength ;
|
||||
}
|
||||
|
||||
inline G4double G4IMultipleScattering::GetMeanFreePath(const G4Track&,
|
||||
G4double,
|
||||
G4ForceCondition* condition)
|
||||
// it does not limit the Step size , but it sets condition to
|
||||
// Forced , because the PostStepDoIt always has to be called
|
||||
{
|
||||
*condition = Forced ;
|
||||
|
||||
return DBL_MAX ;
|
||||
}
|
||||
|
||||
inline G4VParticleChange* G4IMultipleScattering::AlongStepDoIt(
|
||||
const G4Track& track,const G4Step& Step)
|
||||
// only a geom path->true path transformation is performed
|
||||
{
|
||||
const G4double Tlowlimit=100.*keV ;
|
||||
const G4double fact = 1.-1.e-10 ;
|
||||
//!! const G4double tausmall=5.e-5,taubig=0.9999,trueBig=5. ;
|
||||
const G4double tausmall=5.e-5,taubig=0.9999,trueBig=9.21034 ;
|
||||
G4double tau ,geomPathLength, truePathLength ;
|
||||
|
||||
aParticleChange.Initialize(track);
|
||||
|
||||
geomPathLength = track.GetStepLength() ;
|
||||
|
||||
//Store this value for later use in PostStepDoIt
|
||||
GeomStepFinal = geomPathLength ;
|
||||
|
||||
if(geomPathLength == zLast)
|
||||
{
|
||||
truePathLength = tLast ;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( fTransportMeanFreePath > biglambda )
|
||||
{
|
||||
truePathLength = track.GetStepLength() ;
|
||||
CosTheta = 1. ;
|
||||
}
|
||||
else
|
||||
{
|
||||
G4double T = track.GetDynamicParticle()->GetKineticEnergy() ;
|
||||
if(T < Tlowlimit)
|
||||
{ // spec. low energy msc code
|
||||
G4double range = G4EnergyLossTables::GetPreciseRangeFromEnergy(
|
||||
track.GetDynamicParticle()->GetDefinition(),
|
||||
T,track.GetMaterial()) ;
|
||||
G4double alfa = 1.+range/fTransportMeanFreePath ;
|
||||
G4double z = geomPathLength ;
|
||||
//protection: z can not be greater than zmax !!!!!!!
|
||||
G4double zmax = fact*range/alfa ;
|
||||
if(z > zmax)
|
||||
z = zmax ;
|
||||
|
||||
if(z == zmax)
|
||||
{
|
||||
truePathLength = range ;
|
||||
CosTheta = 0. ;
|
||||
}
|
||||
else
|
||||
{
|
||||
truePathLength = range*
|
||||
(1.-exp(log(1.-alfa*z/range)/alfa)) ;
|
||||
CosTheta = (1.-alfa*z/range)/(1.-truePathLength/range) ;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tau = geomPathLength/fTransportMeanFreePath ;
|
||||
|
||||
if(tau<tausmall)
|
||||
truePathLength = fTransportMeanFreePath*tau*(1.+0.5*tau) ;
|
||||
else
|
||||
{
|
||||
if(tau<taubig)
|
||||
truePathLength = -fTransportMeanFreePath*log(1.-tau) ;
|
||||
else
|
||||
truePathLength = fTransportMeanFreePath*trueBig ;
|
||||
}
|
||||
CosTheta = exp(-truePathLength/fTransportMeanFreePath) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(truePathLength<geomPathLength)
|
||||
truePathLength = geomPathLength ;
|
||||
|
||||
aParticleChange.SetTrueStepLength(truePathLength) ;
|
||||
|
||||
return &aParticleChange ;
|
||||
}
|
||||
|
||||
|
||||
inline G4bool G4IMultipleScattering::IsApplicable(
|
||||
const G4ParticleDefinition& particle)
|
||||
{
|
||||
return(particle.GetPDGCharge() != 0.);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
// 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: G4MultipleScattering.hh,v 1.1 2000/03/20 14:44:04 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-02-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
|
||||
// --------- G4MultipleScattering physics process --------
|
||||
// by Laszlo Urban, October 1997
|
||||
// **************************************************************
|
||||
// UNIVERSAL: for arbitrary single charged particle
|
||||
// 09/12/98: charge can be != +- 1 !!!! L.Urban
|
||||
// 30/09/99: nuclear size effect correction L.Urban
|
||||
// --------------------------------------------------------------
|
||||
// 22/10/98: cleanup , L.Urban
|
||||
|
||||
#ifndef G4MultipleScattering_h
|
||||
#define G4MultipleScattering_h 1
|
||||
|
||||
#include "G4ios.hh"
|
||||
#include "globals.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4EnergyLossTables.hh"
|
||||
#include "G4Electron.hh"
|
||||
#include "G4Positron.hh"
|
||||
#include "G4MuonPlus.hh"
|
||||
#include "G4PionPlus.hh"
|
||||
#include "G4Proton.hh"
|
||||
#include "G4PhysicsLogVector.hh"
|
||||
#include "G4GPILSelection.hh"
|
||||
#include "G4VContinuousDiscreteProcess.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4ParticleChangeForMSC.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
class G4MultipleScattering : public G4VContinuousDiscreteProcess
|
||||
|
||||
{
|
||||
public:
|
||||
|
||||
G4MultipleScattering(const G4String& processName="msc") ;
|
||||
|
||||
~G4MultipleScattering() ;
|
||||
|
||||
G4bool IsApplicable ( const G4ParticleDefinition& ) ;
|
||||
|
||||
void SetPhysicsTableBining(G4double lowE,G4double highE,G4int nBins);
|
||||
|
||||
void BuildPhysicsTable(const G4ParticleDefinition& aParticleType) ;
|
||||
|
||||
void PrintInfoDefinition();
|
||||
|
||||
G4double GetContinuousStepLimit(const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& currentSafety) ;
|
||||
|
||||
G4double GetMeanFreePath(const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition) ;
|
||||
|
||||
G4VParticleChange* AlongStepDoIt(const G4Track& aTrack,const G4Step& aStep);
|
||||
|
||||
G4VParticleChange* PostStepDoIt(const G4Track& aTrack,const G4Step& aStep) ;
|
||||
|
||||
G4double GetLambda(G4double KineticEnergy,G4Material* material);
|
||||
|
||||
void SetScatteringParameter(G4double value)
|
||||
{ scatteringparameter = value ; } ;
|
||||
void SetTuning(G4double value) { tuning = value ; };
|
||||
void SetCpar (G4double value) { cpar = value ; };
|
||||
void SetTlimitmsc (G4double value) { Tlimit = value ; };
|
||||
void SetLateralDisplacementFlag(G4bool flag) {fLatDisplFlag = flag;};
|
||||
|
||||
void SetNuclCorrPar(G4double val) { NuclCorrPar = val; } ;
|
||||
void SetFactPar(G4double val) { FactPar = val ; } ;
|
||||
|
||||
protected:
|
||||
|
||||
G4double ComputeTransportCrossSection(
|
||||
const G4ParticleDefinition& aParticleType,
|
||||
G4double KineticEnergy,
|
||||
G4double AtomicNumber,
|
||||
G4double AtomicWeight) ;
|
||||
|
||||
G4double TrueToGeomTransformation(const G4DynamicParticle* aParticle,
|
||||
G4Material* aMaterial,
|
||||
G4double truePathLength) ;
|
||||
|
||||
private:
|
||||
|
||||
// hide assignment operator as private
|
||||
G4MultipleScattering & operator = (const G4MultipleScattering &right) ;
|
||||
G4MultipleScattering ( const G4MultipleScattering &) ;
|
||||
|
||||
|
||||
// data members ...................................................
|
||||
private:
|
||||
|
||||
G4PhysicsTable* theTransportMeanFreePathTable ;
|
||||
|
||||
G4double fTransportMeanFreePath ;
|
||||
G4double range,alpha1 ;
|
||||
G4int stepFlag ;
|
||||
|
||||
G4double biglambda ;
|
||||
|
||||
G4double LowestKineticEnergy ;
|
||||
G4double HighestKineticEnergy ;
|
||||
G4int TotBin ;
|
||||
|
||||
const G4Electron* theElectron ;
|
||||
const G4Positron* thePositron ;
|
||||
|
||||
G4Material* lastMaterial;
|
||||
G4double lastKineticEnergy;
|
||||
G4int materialIndex ;
|
||||
|
||||
G4double tLast ;
|
||||
G4double zLast ;
|
||||
|
||||
G4double Tlimit ;
|
||||
|
||||
// model parameters
|
||||
G4double scatteringparameter;
|
||||
G4double tuning;
|
||||
G4double cpar;
|
||||
|
||||
// with/without lateral displacement
|
||||
G4bool fLatDisplFlag ;
|
||||
|
||||
// nuclear size effect correction
|
||||
G4double NuclCorrPar ;
|
||||
G4double FactPar ;
|
||||
|
||||
//New ParticleChange
|
||||
G4ParticleChangeForMSC fParticleChange ;
|
||||
|
||||
};
|
||||
|
||||
#include "G4MultipleScattering.icc"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
// 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: G4MultipleScattering.icc,v 1.2 2000/03/24 08:08:08 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-02-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
|
||||
// ------- G4MultipleScattering physics process ------
|
||||
// by Laszlo Urban, October 1997
|
||||
// **************************************************************
|
||||
// 25/11/97: mods for KinEnergy > HighestLimit
|
||||
// 22/10/98: cleanup , L.Urban
|
||||
// 15/10/99: bugfix, some accuracy problems fixed , L.Urban
|
||||
//---------------------------------------------------------------
|
||||
|
||||
inline G4double G4MultipleScattering::GetContinuousStepLimit(
|
||||
const G4Track& track,
|
||||
G4double,
|
||||
G4double currentMinimumStep,
|
||||
G4double&)
|
||||
{
|
||||
G4double zPathLength,tPathLength ;
|
||||
const G4DynamicParticle* aParticle ;
|
||||
G4Material* aMaterial ;
|
||||
G4double KineticEnergy,tau ;
|
||||
G4bool isOut ;
|
||||
|
||||
// this process is not a candidate for selection!!!!!!!!!
|
||||
SetGPILSelection(NotCandidateForSelection) ;
|
||||
|
||||
if(track.GetCurrentStepNumber() == 1)
|
||||
stepFlag = 0 ;
|
||||
|
||||
tPathLength = currentMinimumStep ;
|
||||
|
||||
aMaterial = track.GetMaterial() ;
|
||||
materialIndex = aMaterial->GetIndex() ;
|
||||
|
||||
aParticle = track.GetDynamicParticle() ;
|
||||
KineticEnergy = aParticle->GetKineticEnergy() ;
|
||||
|
||||
if((lastMaterial != aMaterial) || (lastKineticEnergy != KineticEnergy))
|
||||
{
|
||||
lastKineticEnergy = KineticEnergy ;
|
||||
materialIndex = aMaterial->GetIndex() ;
|
||||
|
||||
if((lastMaterial != aMaterial)||(KineticEnergy >= Tlimit)||(stepFlag != 1))
|
||||
fTransportMeanFreePath = (*theTransportMeanFreePathTable)
|
||||
(materialIndex)->GetValue(KineticEnergy,isOut);
|
||||
|
||||
lastMaterial = aMaterial;
|
||||
|
||||
if(KineticEnergy < Tlimit)
|
||||
{
|
||||
stepFlag = 1 ;
|
||||
range = G4EnergyLossTables::GetRange(aParticle->GetDefinition(),
|
||||
KineticEnergy,aMaterial) ;
|
||||
|
||||
alpha1 = range/fTransportMeanFreePath+1 ;
|
||||
}
|
||||
}
|
||||
|
||||
// do the true -> geom transformation
|
||||
if( fTransportMeanFreePath > biglambda )
|
||||
{
|
||||
zPathLength = tPathLength ;
|
||||
}
|
||||
else if(stepFlag == 0)
|
||||
{
|
||||
tau = tPathLength/fTransportMeanFreePath ;
|
||||
if(tau < perMillion)
|
||||
zPathLength = tPathLength ;
|
||||
else
|
||||
zPathLength = fTransportMeanFreePath*(1.-exp(-tau)) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
tau = tPathLength/range ;
|
||||
if(tau<perMillion)
|
||||
zPathLength = range*(1.-exp(-alpha1*tau))/alpha1 ;
|
||||
else if(tau<0.99)
|
||||
zPathLength = range*(1.-exp(alpha1*log(1.-tau)))/alpha1 ;
|
||||
else
|
||||
zPathLength = range/alpha1 ;
|
||||
}
|
||||
|
||||
tLast = tPathLength ;
|
||||
zLast = zPathLength ;
|
||||
|
||||
return zPathLength ;
|
||||
}
|
||||
|
||||
inline G4double G4MultipleScattering::GetMeanFreePath(
|
||||
const G4Track& track,
|
||||
G4double,
|
||||
G4ForceCondition* condition)
|
||||
|
||||
// it does not limit the Step size , but it sets condition to
|
||||
// Forced , because the PostStepDoIt always has to be called
|
||||
|
||||
{
|
||||
*condition = Forced ;
|
||||
|
||||
return DBL_MAX ;
|
||||
}
|
||||
|
||||
inline G4VParticleChange* G4MultipleScattering::AlongStepDoIt(
|
||||
const G4Track& track,const G4Step& Step)
|
||||
// only a geom path->true path transformation is performed
|
||||
{
|
||||
static const G4double tfacmx = 10. ;
|
||||
G4double tau,geomPathLength, truePathLength ;
|
||||
|
||||
fParticleChange.Initialize(track);
|
||||
|
||||
geomPathLength = track.GetStepLength() ;
|
||||
|
||||
if(geomPathLength == zLast)
|
||||
{
|
||||
truePathLength = tLast ;
|
||||
}
|
||||
else if( fTransportMeanFreePath > biglambda )
|
||||
{
|
||||
truePathLength = geomPathLength ;
|
||||
}
|
||||
else if(stepFlag == 0)
|
||||
{
|
||||
tau = geomPathLength/fTransportMeanFreePath ;
|
||||
if(tau<perMillion)
|
||||
truePathLength = fTransportMeanFreePath*tau ;
|
||||
else if(tau < 1.)
|
||||
truePathLength = -fTransportMeanFreePath*log(1.-tau) ;
|
||||
else
|
||||
truePathLength = tfacmx*fTransportMeanFreePath ;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(geomPathLength/range < perMillion)
|
||||
truePathLength = range*(1.-exp(-geomPathLength/range)) ;
|
||||
else
|
||||
truePathLength = range*(1.-exp(log(1.-alpha1*geomPathLength/range)/
|
||||
alpha1)) ;
|
||||
}
|
||||
|
||||
fParticleChange.SetTrueStepLength(truePathLength) ;
|
||||
|
||||
return &fParticleChange ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
inline G4bool G4MultipleScattering::IsApplicable(
|
||||
const G4ParticleDefinition& particle)
|
||||
{
|
||||
return(particle.GetPDGCharge() != 0.);
|
||||
}
|
||||
|
||||
inline G4double G4MultipleScattering::GetLambda(
|
||||
G4double KineticEnergy,
|
||||
G4Material* material)
|
||||
{
|
||||
G4bool isOut;
|
||||
const G4MaterialTable* theMaterialTable =
|
||||
G4Material::GetMaterialTable() ;
|
||||
|
||||
G4double lambda = (*theTransportMeanFreePathTable)
|
||||
(material->GetIndex())->
|
||||
GetValue(KineticEnergy,isOut);
|
||||
return lambda;
|
||||
}
|
||||
@@ -0,0 +1,224 @@
|
||||
// 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: G4VEnergyLoss.hh,v 1.5 2000/05/23 14:24:48 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
//
|
||||
// Class Description
|
||||
//
|
||||
// General service class for the energy loss classes
|
||||
//
|
||||
// It contains code needed to compute the range tables,
|
||||
// time tables, the inverse range tables and some auxiliary
|
||||
// tables.
|
||||
// The energy loss fluctuation code is here,too.
|
||||
//
|
||||
// All the EnergyLoss classes are inherited from G4VEnergyLoss
|
||||
// class.
|
||||
//
|
||||
// -----------------------------------------------------------
|
||||
// created on 28 January 2000 by L. Urban
|
||||
// -----------------------------------------------------------
|
||||
|
||||
#ifndef G4VEnergyLoss_h
|
||||
#define G4VEnergyLoss_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4Poisson.hh"
|
||||
#include "G4Electron.hh"
|
||||
#include "G4VContinuousDiscreteProcess.hh"
|
||||
#include "G4PhysicsLogVector.hh"
|
||||
#include "G4PhysicsLinearVector.hh"
|
||||
|
||||
|
||||
class G4VEnergyLoss : public G4VContinuousDiscreteProcess
|
||||
{
|
||||
public:
|
||||
|
||||
G4VEnergyLoss(const G4String& ,
|
||||
G4ProcessType aType = fNotDefined );
|
||||
G4VEnergyLoss(G4VEnergyLoss &);
|
||||
|
||||
virtual ~G4VEnergyLoss();
|
||||
|
||||
virtual G4double GetContinuousStepLimit(const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& currentSafety) = 0 ;
|
||||
|
||||
virtual G4VParticleChange* AlongStepDoIt(const G4Track& track,
|
||||
const G4Step& Step) = 0 ;
|
||||
|
||||
virtual G4double GetMeanFreePath(const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition) = 0;
|
||||
|
||||
virtual G4VParticleChange* PostStepDoIt(const G4Track& track,
|
||||
const G4Step& Step) = 0;
|
||||
|
||||
|
||||
|
||||
protected:// with description
|
||||
|
||||
// code for the energy loss fluctuation
|
||||
|
||||
G4double GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
G4Material* aMaterial,
|
||||
G4double threshold);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// hide default constructor and assignment operator as private
|
||||
G4VEnergyLoss();
|
||||
G4VEnergyLoss & operator=(const G4VEnergyLoss &right);
|
||||
|
||||
protected:
|
||||
|
||||
// data members to speed up the fluctuation calculation
|
||||
G4Material* lastMaterial;
|
||||
G4int imat;
|
||||
G4double f1Fluct,f2Fluct,e1Fluct,e2Fluct,rateFluct,ipotFluct;
|
||||
G4double e1LogFluct,e2LogFluct,ipotLogFluct;
|
||||
|
||||
const G4int nmaxCont1,nmaxCont2 ;
|
||||
|
||||
// static part of the class
|
||||
|
||||
public: // With description
|
||||
|
||||
static void SetRndmStep (G4bool value) {rndmStepFlag = value;}
|
||||
// use / do not use randomisation in energy loss steplimit
|
||||
// ( default = no randomisation)
|
||||
|
||||
static void SetEnlossFluc (G4bool value) {EnlossFlucFlag = value;}
|
||||
// compute energy loss with/without fluctuation
|
||||
// ( default : with fluctuation)
|
||||
|
||||
static void SetSubSec (G4bool value) {subSecFlag = value ; }
|
||||
// switch on/off the generation of the subcutoff secondaries
|
||||
// ( default = subcutoff secondary generation )
|
||||
|
||||
static void SetStepFunction (G4double c1, G4double c2)
|
||||
{dRoverRange = c1; finalRange = c2;
|
||||
c1lim=dRoverRange ;
|
||||
c2lim=2.*(1-dRoverRange)*finalRange;
|
||||
c3lim=-(1.-dRoverRange)*finalRange*finalRange;
|
||||
}
|
||||
// sets values for data members used to compute the step limit:
|
||||
// dRoverRange : max. relative range change in one step,
|
||||
// finalRange : if range <= finalRange --> last step for the particle.
|
||||
|
||||
|
||||
protected: // With description
|
||||
|
||||
// Build range table starting from the DEDXtable
|
||||
static G4PhysicsTable*
|
||||
BuildRangeTable(G4PhysicsTable* theDEDXTable,
|
||||
G4PhysicsTable* theRangeTable,
|
||||
G4double Tmin,G4double Tmax,G4int nbin);
|
||||
|
||||
// Build time tables starting from the DEDXtable
|
||||
static G4PhysicsTable*
|
||||
BuildLabTimeTable(G4PhysicsTable* theDEDXTable,
|
||||
G4PhysicsTable* theLabTimeTable,
|
||||
G4double Tmin,G4double Tmax,G4int nbin);
|
||||
|
||||
static G4PhysicsTable*
|
||||
BuildProperTimeTable(G4PhysicsTable* theDEDXTable,
|
||||
G4PhysicsTable* ProperTimeTable,
|
||||
G4double Tmin,G4double Tmax,G4int nbin);
|
||||
|
||||
// Build tables of coefficients needed for inverting the range table
|
||||
static G4PhysicsTable*
|
||||
BuildRangeCoeffATable(G4PhysicsTable* theRangeTable,
|
||||
G4PhysicsTable* theCoeffATable,
|
||||
G4double Tmin,G4double Tmax,G4int nbin);
|
||||
static G4PhysicsTable*
|
||||
BuildRangeCoeffBTable(G4PhysicsTable* theRangeTable,
|
||||
G4PhysicsTable* theCoeffBTable,
|
||||
G4double Tmin,G4double Tmax,G4int nbin);
|
||||
static G4PhysicsTable*
|
||||
BuildRangeCoeffCTable(G4PhysicsTable* theRangeTable,
|
||||
G4PhysicsTable* theCoeffCTable,
|
||||
G4double Tmin,G4double Tmax,G4int nbin);
|
||||
|
||||
// Invert range table
|
||||
static G4PhysicsTable*
|
||||
BuildInverseRangeTable(G4PhysicsTable* theRangeTable,
|
||||
G4PhysicsTable* theRangeCoeffATable,
|
||||
G4PhysicsTable* theRangeCoeffBTable,
|
||||
G4PhysicsTable* theRangeCoeffCTable,
|
||||
G4PhysicsTable* theInverseRangeTable,
|
||||
G4double Tmin,G4double Tmax,G4int nbin);
|
||||
|
||||
private:
|
||||
|
||||
static void BuildRangeVector(G4PhysicsTable* theDEDXTable,
|
||||
G4double Tmin,G4double Tmax,G4int nbin,
|
||||
G4int materialIndex,G4PhysicsLogVector* rangeVector);
|
||||
|
||||
static G4double RangeIntLin(G4PhysicsVector* physicsVector
|
||||
,G4int nbin);
|
||||
|
||||
static G4double RangeIntLog(G4PhysicsVector* physicsVector
|
||||
,G4int nbin);
|
||||
|
||||
static void BuildLabTimeVector(G4PhysicsTable* theDEDXTable,
|
||||
G4double Tmin,G4double Tmax,G4int nbin,
|
||||
G4int materialIndex,G4PhysicsLogVector* rangeVector);
|
||||
|
||||
static void BuildProperTimeVector(G4PhysicsTable* theDEDXTable,
|
||||
G4double Tmin,G4double Tmax,G4int nbin,
|
||||
G4int materialIndex,G4PhysicsLogVector* rangeVector);
|
||||
|
||||
static G4double LabTimeIntLog(G4PhysicsVector* physicsVector
|
||||
,G4int nbin);
|
||||
|
||||
static G4double ProperTimeIntLog(G4PhysicsVector* physicsVector,
|
||||
G4int nbin);
|
||||
|
||||
static void InvertRangeVector(G4PhysicsTable* theRangeTable,
|
||||
G4PhysicsTable* theRangeCoeffATable,
|
||||
G4PhysicsTable* theRangeCoeffBTable,
|
||||
G4PhysicsTable* theRangeCoeffCTable,
|
||||
G4double Tmin,G4double Tmax,G4int nbin,
|
||||
G4int materialIndex,G4PhysicsLogVector* rangeVector);
|
||||
|
||||
|
||||
// data members
|
||||
protected:
|
||||
|
||||
// variables for the integration routines
|
||||
static G4double ParticleMass,taulow,tauhigh,ltaulow,ltauhigh;
|
||||
|
||||
|
||||
static G4double dRoverRange; // dRoverRange is the maximum allowed
|
||||
// deltarange/range in one Step
|
||||
static G4double finalRange; // final step before stopping
|
||||
static G4double c1lim,c2lim,c3lim ; // coeffs for computing steplimit
|
||||
|
||||
static G4bool rndmStepFlag; // control the randomization of the step
|
||||
static G4bool EnlossFlucFlag; // control the energy loss fluctuation
|
||||
static G4bool subSecFlag; // control the generation of subcutoff secondaries
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user