Import Geant4 3.2.0 source tree
This commit is contained in:
@@ -1,12 +1,28 @@
|
||||
// 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.
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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: G4EnergyLossMessenger.hh,v 1.3 2000/11/09 15:52:23 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
// $Id: G4EnergyLossMessenger.hh,v 1.3.4.1 2001/06/28 19:12:47 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
//
|
||||
//
|
||||
// Class Description:
|
||||
|
||||
@@ -1,12 +1,28 @@
|
||||
// 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.
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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: G4EnergyLossTables.hh,v 1.10 2000/11/04 16:47:28 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
// $Id: G4EnergyLossTables.hh,v 1.10.4.1 2001/06/28 19:12:47 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
//
|
||||
// $Id:
|
||||
//
|
||||
|
||||
@@ -1,12 +1,28 @@
|
||||
// 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.
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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: G4EnergyLossTables.icc,v 1.12 2000/11/04 16:47:28 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
// $Id: G4EnergyLossTables.icc,v 1.13.2.1 2001/06/28 19:12:47 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
//
|
||||
// $Id:
|
||||
// Inline members of the G4EnergyLossTables class
|
||||
@@ -17,6 +33,7 @@
|
||||
// cache mechanism , L.Urban , 11/02/99
|
||||
// bug fixed , L.Urban , 12/04/99
|
||||
// 10/11/99: moved from RWT hash dictionary to STL map, G.Barrand, M.Maire
|
||||
// 18/05/01 V.Ivanchenko Clean up againist Linux ANSI compilation
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
@@ -457,7 +474,6 @@ inline G4double G4EnergyLossTables::GetPreciseEnergyFromRange(
|
||||
QQPositron ;
|
||||
oldIndex = -1 ;
|
||||
}
|
||||
const G4PhysicsTable* rangeTable= t.theRangeTable;
|
||||
const G4PhysicsTable* dEdxTable= t.theDEDXTable;
|
||||
const G4PhysicsTable* inverseRangeTable= t.theInverseRangeTable;
|
||||
|
||||
|
||||
@@ -1,19 +1,33 @@
|
||||
// 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.
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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-03-01 $
|
||||
//
|
||||
// $Id: G4MultipleScattering.hh,v 1.1.4.2 2001/06/28 20:19:51 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
//
|
||||
// $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 --------
|
||||
|
||||
@@ -1,19 +1,33 @@
|
||||
// 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.
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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-03-01 $
|
||||
//
|
||||
// $Id: G4MultipleScattering.icc,v 1.3.2.2 2001/06/28 20:19:51 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
//
|
||||
// $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 ------
|
||||
@@ -22,6 +36,7 @@
|
||||
// 25/11/97: mods for KinEnergy > HighestLimit
|
||||
// 22/10/98: cleanup , L.Urban
|
||||
// 15/10/99: bugfix, some accuracy problems fixed , L.Urban
|
||||
// 18/05/01 V.Ivanchenko Clean up againist Linux ANSI compilation
|
||||
//---------------------------------------------------------------
|
||||
|
||||
inline G4double G4MultipleScattering::GetContinuousStepLimit(
|
||||
@@ -171,8 +186,6 @@ inline G4double G4MultipleScattering::GetLambda(
|
||||
G4Material* material)
|
||||
{
|
||||
G4bool isOut;
|
||||
const G4MaterialTable* theMaterialTable =
|
||||
G4Material::GetMaterialTable() ;
|
||||
|
||||
G4double lambda = (*theTransportMeanFreePathTable)
|
||||
(material->GetIndex())->
|
||||
|
||||
@@ -0,0 +1,189 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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: G4MultipleScatteringx.hh,v 1.1.2.2 2001/06/28 20:19:51 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
//
|
||||
// $Id:
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// History: based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// --------- G4MultipleScatteringx physics process --------
|
||||
// by Laszlo Urban, March 2001
|
||||
// **************************************************************
|
||||
// New version of MSC model
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#ifndef G4MultipleScatteringx_h
|
||||
#define G4MultipleScatteringx_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 G4MultipleScatteringx : public G4VContinuousDiscreteProcess
|
||||
|
||||
{
|
||||
public:
|
||||
|
||||
G4MultipleScatteringx(const G4String& processName="mscx") ;
|
||||
|
||||
~G4MultipleScatteringx() ;
|
||||
|
||||
G4bool IsApplicable ( const G4ParticleDefinition& ) ;
|
||||
|
||||
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 AlongStepGetPhysicalInteractionLength(
|
||||
const G4Track&,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& currentSafety,
|
||||
G4GPILSelection* selection
|
||||
);
|
||||
|
||||
G4double GetLambda(G4double KineticEnergy,G4Material* material);
|
||||
|
||||
void SetScatteringParameter1(G4double value)
|
||||
{ scatteringparameter1 = value ; } ;
|
||||
void SetScatteringParameter2(G4double value)
|
||||
{ scatteringparameter2 = value ; } ;
|
||||
void SetScatteringParameter3(G4double value)
|
||||
{ scatteringparameter3 = value ; } ;
|
||||
void SetBoundary(G4bool value) { boundary = value ;} ;
|
||||
|
||||
void SetTuning(G4double value) { tuning = value ; };
|
||||
void SetCparm (G4double value) { cparm = 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
|
||||
G4MultipleScatteringx & operator = (const G4MultipleScatteringx &right) ;
|
||||
G4MultipleScatteringx ( const G4MultipleScatteringx &) ;
|
||||
|
||||
|
||||
// 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 scatteringparameter1; // for low energy scattering
|
||||
G4double scatteringparameter2; // alfamax in scattering
|
||||
G4double scatteringparameter3; // param. for z/t distr.
|
||||
|
||||
G4bool boundary ; // spec. handling near boundaries
|
||||
G4GPILSelection valueGPILSelectionMSC ;
|
||||
|
||||
G4double tuning; // param. for lambda tuning
|
||||
G4double cparm; // "
|
||||
|
||||
// with/without lateral displacement
|
||||
G4bool fLatDisplFlag ;
|
||||
|
||||
// nuclear size effect correction
|
||||
G4double NuclCorrPar ;
|
||||
G4double FactPar ;
|
||||
|
||||
//New ParticleChange
|
||||
G4ParticleChangeForMSC fParticleChange ;
|
||||
|
||||
};
|
||||
|
||||
#include "G4MultipleScatteringx.icc"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,290 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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: G4MultipleScatteringx.icc,v 1.2.2.2 2001/06/28 20:19:51 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
//
|
||||
// $Id:
|
||||
// -------------------------------------------------------------
|
||||
// GEANT 4 class inlined methods file
|
||||
//
|
||||
// History: based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ------- G4MultipleScatteringx physics process ------
|
||||
// by Laszlo Urban, March 2001
|
||||
//---------------------------------------------------------------
|
||||
// New version of MSC model
|
||||
//---------------------------------------------------------------
|
||||
// Modified:
|
||||
// 18/05/01 V.Ivanchenko Clean up againist Linux ANSI compilation
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
|
||||
inline G4double G4MultipleScatteringx::AlongStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& currentSafety,
|
||||
G4GPILSelection* selection
|
||||
)
|
||||
{
|
||||
// get Step limit proposed by the process
|
||||
G4double steplength =
|
||||
GetContinuousStepLimit(track,previousStepSize,currentMinimumStep, currentSafety);
|
||||
|
||||
// set return value for G4GPILSelection
|
||||
*selection = valueGPILSelectionMSC;
|
||||
|
||||
return steplength ;
|
||||
}
|
||||
|
||||
|
||||
inline G4double G4MultipleScatteringx::GetContinuousStepLimit(
|
||||
const G4Track& track,
|
||||
G4double,
|
||||
G4double currentMinimumStep,
|
||||
G4double&)
|
||||
{
|
||||
G4double zPathLength,tPathLength ;
|
||||
const G4DynamicParticle* aParticle ;
|
||||
G4Material* aMaterial ;
|
||||
G4double KineticEnergy,tau ;
|
||||
G4bool isOut ;
|
||||
|
||||
static const G4double toler = 1.0e-6*mm ;
|
||||
static const G4double factlim = 0.10 ;
|
||||
G4double tlimit ;
|
||||
|
||||
|
||||
static G4double tausmall = 1.e-20 ;
|
||||
static G4double taulow = 1.e-10 ;
|
||||
static G4double clim=1./3. ;
|
||||
G4double etau,beta2,cc,ccc,u ;
|
||||
|
||||
// this process is not a candidate for selection by default !!!!!!!!
|
||||
valueGPILSelectionMSC = 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 ;
|
||||
}
|
||||
}
|
||||
|
||||
// special treatment near boundaries ?
|
||||
if(boundary)
|
||||
{
|
||||
// step limitation at boundary ?
|
||||
if(track.GetCurrentStepNumber() > 1)
|
||||
{
|
||||
if(track.GetStep()->GetPreStepPoint()->GetSafety() < toler)
|
||||
{
|
||||
tlimit = factlim*fTransportMeanFreePath ;
|
||||
if(tPathLength > tlimit)
|
||||
{
|
||||
tPathLength = tlimit*G4UniformRand() ;
|
||||
valueGPILSelectionMSC = CandidateForSelection;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// do the true -> geom transformation
|
||||
if( fTransportMeanFreePath > biglambda )
|
||||
{
|
||||
zPathLength = tPathLength ;
|
||||
}
|
||||
else if(stepFlag == 0)
|
||||
{
|
||||
tau = tPathLength/fTransportMeanFreePath ;
|
||||
if(tau < tausmall)
|
||||
zPathLength = tPathLength*(1.-0.5*tau) ;
|
||||
else
|
||||
{
|
||||
// sample zPathLength
|
||||
etau = exp(-tau) ;
|
||||
if(scatteringparameter3 <= clim)
|
||||
{
|
||||
ccc = 1.-scatteringparameter3 ;
|
||||
}
|
||||
else
|
||||
{
|
||||
cc=0.5/scatteringparameter3-1.5 ;
|
||||
ccc=2.*scatteringparameter3*exp(cc) ;
|
||||
}
|
||||
if(tau < taulow)
|
||||
beta2 = (1.+scatteringparameter3)*(1.-2.*tau/3.)/tau ;
|
||||
else
|
||||
beta2 = 0.5*(1.+scatteringparameter3)*(1.-etau)/(tau-1+etau) ;
|
||||
do {
|
||||
u = -log(1.-G4UniformRand())/beta2 ;
|
||||
} while (G4UniformRand() > (1.-scatteringparameter3+
|
||||
2.*scatteringparameter3*beta2*u)*exp(-beta2*u)/ccc ) ;
|
||||
zPathLength = tPathLength/(1.+u) ;
|
||||
}
|
||||
}
|
||||
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 G4MultipleScatteringx::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* G4MultipleScatteringx::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 ;
|
||||
|
||||
static G4double tausmall = 1.e-20 ;
|
||||
static G4double taulow = 1.e-10 ;
|
||||
static G4double clim=1./3. ;
|
||||
G4double ltau,cc,ccc,beta2,u ;
|
||||
|
||||
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 < tausmall)
|
||||
truePathLength = geomPathLength*(1.+0.5*tau) ;
|
||||
else if(tau < 1.)
|
||||
{
|
||||
// sample tPathLength
|
||||
ltau = -log(1.-tau) ;
|
||||
if(scatteringparameter3 <= clim)
|
||||
{
|
||||
ccc = 1.-scatteringparameter3 ;
|
||||
}
|
||||
else
|
||||
{
|
||||
cc=0.5/scatteringparameter3-1.5 ;
|
||||
ccc=2.*scatteringparameter3*exp(cc) ;
|
||||
}
|
||||
if(tau < taulow)
|
||||
beta2 = (1.+scatteringparameter3)*(1.-2.*tau/3.)/tau ;
|
||||
else
|
||||
beta2 = (1.+scatteringparameter3)*tau/(2.*(ltau-tau)) ;
|
||||
do {
|
||||
u = -log(1.-G4UniformRand())/beta2 ;
|
||||
} while (G4UniformRand() > (1.-scatteringparameter3+
|
||||
2.*scatteringparameter3*beta2*u)*exp(-beta2*u)/ccc ) ;
|
||||
truePathLength = geomPathLength*(1.+u) ;
|
||||
}
|
||||
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 G4MultipleScatteringx::IsApplicable(
|
||||
const G4ParticleDefinition& particle)
|
||||
{
|
||||
return(particle.GetPDGCharge() != 0.);
|
||||
}
|
||||
|
||||
inline G4double G4MultipleScatteringx::GetLambda(
|
||||
G4double KineticEnergy,
|
||||
G4Material* material)
|
||||
{
|
||||
G4bool isOut;
|
||||
|
||||
G4double lambda = (*theTransportMeanFreePathTable)
|
||||
(material->GetIndex())->
|
||||
GetValue(KineticEnergy,isOut);
|
||||
return lambda;
|
||||
}
|
||||
@@ -1,19 +1,33 @@
|
||||
// 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.
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * 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.9 2000/10/30 06:49:46 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
// $Id: G4VEnergyLoss.hh,v 1.9.4.2 2001/06/28 20:19:51 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
//
|
||||
// Class Description
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user