Import Geant4 8.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 14:55:03 +02:00
parent 216a75eeb1
commit fe73f43734
6714 changed files with 118229 additions and 68144 deletions
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4ASTARStopping.cc,v 1.6 2006/06/29 19:52:36 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//---------------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BetheBlochModel.cc,v 1.11 2006/06/29 19:52:38 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4BetheBlochModel.cc,v 1.12 2006/08/29 20:21:34 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// -------------------------------------------------------------------
//
@@ -270,7 +270,21 @@ vector<G4DynamicParticle*>* G4BetheBlochModel::SampleSecondaries(
sqrt(deltaKinEnergy * (deltaKinEnergy + 2.0*electron_mass_c2));
G4double cost = deltaKinEnergy * (totEnergy + electron_mass_c2) /
(deltaMomentum * totMomentum);
G4double sint = sqrt(1.0 - cost*cost);
if(cost > 1.0) {
G4cout << "### G4BetheBlochModel WARNING: cost= "
<< cost << " > 1 for "
<< dp->GetDefinition()->GetParticleName()
<< " Ekin(MeV)= " << kineticEnergy
<< " p(MeV/c)= " << totMomentum
<< " delEkin(MeV)= " << deltaKinEnergy
<< " delMom(MeV/c)= " << deltaMomentum
<< " tmin(MeV)= " << minKinEnergy
<< " tmax(MeV)= " << maxKinEnergy
<< " dir= " << dp->GetMomentumDirection()
<< G4endl;
cost = 1.0;
}
G4double sint = sqrt((1.0 - cost)*(1.0 + cost));
G4double phi = twopi * G4UniformRand() ;
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4BetheHeitlerModel.cc,v 1.9 2006/06/29 19:52:40 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
// -------------------------------------------------------------------
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4BohrFluctuations.cc,v 1.4 2006/06/29 19:52:42 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4BraggIonModel.cc,v 1.14 2006/06/29 19:52:44 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4BraggIonModel.cc,v 1.15 2006/10/23 18:57:19 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// -------------------------------------------------------------------
//
@@ -42,6 +42,7 @@
// 29-11-05 Do not use G4Alpha class (V.Ivantchenko)
// 15-02-06 ComputeCrossSectionPerElectron, ComputeCrossSectionPerAtom (mma)
// 25-04-06 Add stopping data from ASTAR (V.Ivanchenko)
// 23-10-06 Reduce lowestKinEnergy to 0.25 keV (V.Ivanchenko)
//
// Class Description:
@@ -75,9 +76,9 @@ G4BraggIonModel::G4BraggIonModel(const G4ParticleDefinition* p,
if(p) SetParticle(p);
highKinEnergy = 2.0*MeV;
lowKinEnergy = 0.0*MeV;
lowestKinEnergy = 1.0*keV;
HeMass = 3.727417*GeV;
rateMassHe2p = HeMass/proton_mass_c2;
lowestKinEnergy = 1.0*keV/rateMassHe2p;
massFactor = 1000.*amu_c2/HeMass;
theZieglerFactor = eV*cm2*1.0e-15;
theElectron = G4Electron::Electron();
@@ -582,7 +583,7 @@ G4double G4BraggIonModel::HeEffChargeSquare(G4double z,
static G4double c[6] = {0.2865, 0.1266, -0.001429,
0.02402,-0.01135, 0.001475};
G4double e = log( max( 1.0, kinEnergyHeInMeV*massFactor)) ;
G4double e = std::max(0.0,std::log(kinEnergyHeInMeV*massFactor));
G4double x = c[0] ;
G4double y = 1.0 ;
for (G4int i=1; i<6; i++) {
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4BraggModel.cc,v 1.14 2006/06/29 19:52:46 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ComptonScattering.cc,v 1.25 2006/06/29 19:52:48 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4ComptonScattering.cc,v 1.27 2006/09/14 10:27:19 maire Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
//------------ G4ComptonScattering physics process -----------------------------
@@ -53,8 +53,12 @@
// 26-05-04, cross section parametrization improved for low energy :
// Egamma <~ 15 keV (Laszlo)
// 08-11-04, Remove Store/Retrieve tables (V.Ivanchenko)
// 09-03-05 Migrate to model interface and inherit from G4VEmProcess (V.Ivanchenko)
// 09-03-05 Migrate to model interface
// and inherit from G4VEmProcess (V.Ivanchenko)
// 04-05-05, Make class to be default (V.Ivanchenko)
// 09-09-06, modify SetModel(G4VEmModel*) (mma)
// 12-09-06, move SetModel(G4VEmModel*) in G4VEmProcess (mma)
//
// -----------------------------------------------------------------------------
#include "G4ComptonScattering.hh"
@@ -67,9 +71,7 @@ using namespace std;
G4ComptonScattering::G4ComptonScattering(const G4String& processName,
G4ProcessType type):G4VEmProcess (processName, type),
isInitialised(false),
selectedModel(0),
mType(0)
isInitialised(false)
{
SetLambdaBinning(90);
SetMinKinEnergy(0.1*keV);
@@ -91,10 +93,10 @@ void G4ComptonScattering::InitialiseProcess(const G4ParticleDefinition*)
SetSecondaryParticle(G4Electron::Electron());
G4double emin = MinKinEnergy();
G4double emax = MaxKinEnergy();
if(0 == mType) selectedModel = new G4KleinNishinaCompton();
selectedModel->SetLowEnergyLimit(emin);
selectedModel->SetHighEnergyLimit(emax);
AddEmModel(1, selectedModel);
if(!Model()) SetModel(new G4KleinNishinaCompton);
Model()->SetLowEnergyLimit(emin);
Model()->SetHighEnergyLimit(emax);
AddEmModel(1, Model());
}
}
@@ -102,17 +104,11 @@ void G4ComptonScattering::InitialiseProcess(const G4ParticleDefinition*)
void G4ComptonScattering::PrintInfo()
{
G4cout << " Total cross sections has a good parametrisation"
<< " from 10 KeV to (100/Z) GeV"
<< "\n Sampling according " << selectedModel->GetName() << " model"
<< G4endl;
G4cout
<< " Total cross sections has a good parametrisation"
<< " from 10 KeV to (100/Z) GeV"
<< "\n Sampling according " << Model()->GetName() << " model"
<< G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4ComptonScattering::SetModel(const G4String& s)
{
if(s == "Klein-Nishina") mType = 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ComptonScattering52.cc,v 1.2 2006/06/29 19:52:50 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4ComptonScattering52.cc,v 1.3 2006/10/16 15:26:49 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
//------------ G4ComptonScattering52 physics process -----------------------------
@@ -477,6 +477,8 @@ void G4ComptonScattering52::PrintInfoDefinition()
<< G4BestUnit(LowestEnergyLimit,"Energy")
<< " to " << G4BestUnit(HighestEnergyLimit,"Energy")
<< " in " << NumbBinTable << " bins. \n";
G4cout << " WARNING: This process is obsolete and will be soon removed"
<< G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4CoulombScattering.cc,v 1.2 2006/06/29 19:52:52 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4CoulombScattering.cc,v 1.7 2006/10/19 09:44:27 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// -------------------------------------------------------------------
//
@@ -38,6 +38,8 @@
// Creation date: 22.08.2004
//
// Modifications:
// 01.08.06 V.Ivanchenko add choice between G4eCoulombScatteringModel and
// G4CoulombScatteringModel
//
//
@@ -55,11 +57,13 @@
using namespace std;
G4CoulombScattering::G4CoulombScattering(const G4String& name)
: G4VEmProcess(name),thetaMin(0.5),thetaMax(pi),q2Max(DBL_MAX),isInitialised(false)
: G4VEmProcess(name),thetaMin(0.0),thetaMax(pi),q2Max(DBL_MAX),
isInitialised(false)
{
SetLambdaBinning(80);
SetMinKinEnergy(1.0*keV);
SetMaxKinEnergy(100.0*GeV);
buildTableFlag = true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -74,17 +78,27 @@ void G4CoulombScattering::InitialiseProcess(const G4ParticleDefinition*)
if(!isInitialised) {
isInitialised = true;
// SetVerboseLevel(3);
SetBuildTableFlag(true);
// SetBuildTableFlag(buildTableFlag);
SetBuildTableFlag(false);
SetStartFromNullFlag(false);
SetIntegral(true);
SetLambdaFactor(0.8);
SetSecondaryParticle(0);
G4double emin = MinKinEnergy();
G4double emax = MaxKinEnergy();
G4CoulombScatteringModel* model =
new G4CoulombScatteringModel(thetaMin,thetaMax,true,q2Max);
model->SetLowEnergyLimit(emin);
model->SetHighEnergyLimit(emax);
AddEmModel(1, model);
if(GetProcessName() == "eCoulombScat") {
G4eCoulombScatteringModel* model =
new G4eCoulombScatteringModel(thetaMin,thetaMax,buildTableFlag,q2Max);
model->SetLowEnergyLimit(emin);
model->SetHighEnergyLimit(emax);
AddEmModel(1, model);
} else {
G4CoulombScatteringModel* model =
new G4CoulombScatteringModel(thetaMin,thetaMax,buildTableFlag,q2Max);
model->SetLowEnergyLimit(emin);
model->SetHighEnergyLimit(emax);
AddEmModel(1, model);
}
}
}
@@ -93,7 +107,7 @@ void G4CoulombScattering::InitialiseProcess(const G4ParticleDefinition*)
void G4CoulombScattering::PrintInfo()
{
G4cout << " Coulomb scattering with ThetaMin(degree)= " << thetaMin/degree
<< "; ThetaMax(degree)= " << thetaMin/degree
<< "; ThetaMax(degree)= " << thetaMax/degree
<< "; q2Max(GeV^2)= " << q2Max/(GeV*GeV)
<< G4endl;
}
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4CoulombScatteringModel.cc,v 1.2 2006/06/29 19:52:54 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4CoulombScatteringModel.cc,v 1.7 2006/10/19 09:44:27 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// -------------------------------------------------------------------
//
@@ -38,6 +38,10 @@
// Creation date: 22.08.2005
//
// Modifications:
// 01.08.06 V.Ivanchenko extend upper limit of table to TeV and review the
// logic of building - only elements from G4ElementTable
// 08.08.06 V.Ivanchenko build internal table in ekin scale, introduce faclim
// 19.10.06 V.Ivanchenko use inheritance from G4eCoulombScatteringModel
//
// Class Description:
//
@@ -48,8 +52,6 @@
#include "G4CoulombScatteringModel.hh"
#include "Randomize.hh"
#include "G4DataVector.hh"
#include "G4PhysicsLogVector.hh"
#include "G4ParticleChangeForGamma.hh"
#include "G4NistManager.hh"
#include "G4ParticleTable.hh"
@@ -63,22 +65,8 @@ using namespace std;
G4CoulombScatteringModel::G4CoulombScatteringModel(
G4double thetaMin, G4double thetaMax, G4bool build,
G4double tlim, const G4String& nam)
: G4VEmModel(nam),
theCrossSectionTable(0),
cosThetaMin(cos(thetaMin)),
cosThetaMax(cos(thetaMax)),
lowMomentum(keV),
highMomentum(MeV),
q2Limit(tlim),
nbins(12),
nmax(100),
buildTable(build),
isInitialised(false)
: G4eCoulombScatteringModel(thetaMin,thetaMax,build,tlim,nam)
{
G4double p0 = hbarc/(Bohr_radius*0.885);
a0 = 0.25*p0*p0;
p0 = electron_mass_c2*classic_electr_radius;
coeff = twopi*p0*p0;
theMatManager = G4NistManager::Instance();
theParticleTable = G4ParticleTable::GetParticleTable();
theProton = G4Proton::Proton();
@@ -87,85 +75,42 @@ G4CoulombScatteringModel::G4CoulombScatteringModel(
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4CoulombScatteringModel::~G4CoulombScatteringModel()
{
if(theCrossSectionTable) {
theCrossSectionTable->clearAndDestroy();
delete theCrossSectionTable;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4CoulombScatteringModel::Initialise(const G4ParticleDefinition* p,
const G4DataVector&)
{
if(isInitialised) return;
isInitialised = true;
if(pParticleChange)
fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
else
fParticleChange = new G4ParticleChangeForGamma();
if(!buildTable || p->GetParticleName() == "GenericIon") return;
// Compute cross section multiplied by Ptot^2*beta^2
G4double mass = p->GetPDGMass();
G4double mass2 = mass*mass;
theCrossSectionTable = new G4PhysicsTable(nmax);
G4PhysicsLogVector* ptrVector;
G4double mom2, value;
G4double pmin = lowMomentum*lowMomentum;
G4double pmax = highMomentum*highMomentum;
nbins = G4int(log10(pmax/pmin)/2.0) + 1;
for(G4int j=1; j<nmax; j++) {
ptrVector = new G4PhysicsLogVector(pmin, pmax, nbins);
for(G4int i=0; i<=nbins; i++) {
mom2 = ptrVector->GetLowEdgeEnergy( i ) ;
value = CalculateCrossSectionPerAtom(p, mom2, j);
value *= mom2*mom2/(mom2 + mass2);
ptrVector->PutValue( i, value );
}
theCrossSectionTable->insert(ptrVector);
}
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4CoulombScatteringModel::CalculateCrossSectionPerAtom(
const G4ParticleDefinition* p,
G4double mom2,
G4double kinEnergy,
G4double Z)
{
G4double cross= 0.0;
G4int iz = G4int(Z);
G4double m = p->GetPDGMass();
G4double mom2 = kinEnergy*(kinEnergy + 2.0*m);
G4double mass2= m*m;
G4double q = p->GetPDGCharge()/eplus;
G4double m1 = theMatManager->GetAtomicMassAmu(iz)*amu_c2;
G4double etot = sqrt(mom2 + mass2) + m1;
G4double etot = kinEnergy + m + m1;
G4double ptot = sqrt(mom2);
G4double bet = ptot/etot;
G4double gam = 1.0/sqrt((1.0 - bet)*(1.0 + bet));
G4double mom = gam*(ptot - bet*etot);
G4double momentum2 = mom*mom;
G4double costm = std::max(cosThetaMax, 1.0 - q2Limit/2.0*momentum2);
G4double momCM = gam*(ptot - bet*etot);
G4double momCM2 = momCM*momCM;
G4double costm = std::max(cosThetaMax, 1.0 - 0.5*q2Limit/momCM2);
if(1 == iz && p == theProton) costm = std::max(0.0, costm);
// Cross section in CM system
if(costm < cosThetaMin) {
G4double invbeta2 = 1.0 + mass2/momentum2;
G4double a = 2.0*pow(Z,0.666666667)*a0*
(1.13 + 3.76*invbeta2*Z*Z*fine_structure_const*fine_structure_const)/momentum2 + 1.0;
G4double f = q * Z * m1 /(m + m1);
cross = coeff*f*f*(cosThetaMin - costm)/((a - cosThetaMin)*(a - costm));
G4double q = p->GetPDGCharge()/eplus;
G4double q2 = q*q;
G4double invbeta2 = 1.0 + mass2/momCM2;
G4double A = ScreeningParameter(Z, q2, momCM2, invbeta2);
G4double a = 2.0*A + 1.0;
G4double f = q * m1 /(m + m1);
cross = coeff*f*f*Z*(Z + 1.0)*invbeta2*(cosThetaMin - costm)/
((a - cosThetaMin)*(a - costm)*momCM2);
}
//G4cout << "p= " << mom << " Z= " << Z << " a= " << a
//G4cout << "p= " << mom << " momCM= " << momCM << " Z= " << Z << " A= " << A
//<< " cross= " << cross << " m1(GeV)= " << m1/GeV <<G4endl;
return cross;
}
@@ -185,7 +130,8 @@ G4double G4CoulombScatteringModel::SelectIsotope(const G4Element* elm)
if (x <= 0.0) break;
}
if(idx >= ni) {
G4cout << "G4CoulombScatteringModel::SelectIsotope WARNING: abandance vector for"
G4cout << "G4CoulombScatteringModel::SelectIsotope WARNING: "
<< "abandance vector for"
<< elm->GetName() << " is not normalised to unit" << G4endl;
} else {
N = G4double(elm->GetIsotope(idx)->GetN());
@@ -206,7 +152,8 @@ std::vector<G4DynamicParticle*>* G4CoulombScatteringModel::SampleSecondaries(
const G4Material* aMaterial = couple->GetMaterial();
const G4ParticleDefinition* p = dp->GetDefinition();
const G4Element* elm = SelectRandomAtom(aMaterial, p, dp->GetKineticEnergy());
const G4Element* elm =
SelectRandomAtom(aMaterial, p, dp->GetKineticEnergy());
G4double Z = elm->GetZ();
G4double N = SelectIsotope(elm);
G4int iz = G4int(Z);
@@ -214,45 +161,52 @@ std::vector<G4DynamicParticle*>* G4CoulombScatteringModel::SampleSecondaries(
G4double m2 = theParticleTable->GetIonTable()->GetNucleusMass(iz, in);
G4double m1 = dp->GetMass();
G4double q = p->GetPDGCharge()/eplus;
G4double q2 = q*q;
// Transformation to CM system
G4LorentzVector lv1 = dp->Get4Momentum();
G4ThreeVector dir = dp->GetMomentumDirection();
G4LorentzVector lv2(0.0,0.0,0.0,m2);
G4LorentzVector lv = lv1 + lv2;
G4ThreeVector bst = lv.boostVector();
lv1.boost(-bst);
lv2.boost(-bst);
G4ThreeVector p1 = lv1.vect();
G4double momentum2 = p1.mag2();
G4double invbeta2 = 1.0 + m1*m1/momentum2;
G4double momCM2 = p1.mag2();
G4double invbeta2 = 1.0 + m1*m1/momCM2;
G4double A = ScreeningParameter(Z, q2, momCM2, invbeta2);
G4double a = 2.0*A + 1.0;
G4double a = 2.*pow(Z,0.666666667)*a0*
(1.13 + 3.76*invbeta2*Z*Z*fine_structure_const*fine_structure_const)/momentum2 + 1.0;
G4double costm = std::max(cosThetaMax, 1.0 - q2Limit/2.0*momentum2);
G4double costm = std::max(cosThetaMax, 1.0 - 0.5*q2Limit/momCM2);
if(1 == iz && p == theProton) costm = std::max(0.0, costm);
if(costm > cosThetaMin) return fvect;
G4double cost = a - (a - cosThetaMin)*(a - costm)/
(a - cosThetaMin + G4UniformRand()*(cosThetaMin - costm));
if(std::abs(cost) > 1.) {
G4cout << "G4CoulombScatteringModel::SampleSecondaries WARNING cost= " << cost << G4endl;
if(cost < -1.) cost = -1.0;
else cost = 1.0;
G4double x = G4UniformRand();
G4double y = (a + 1.0 - cosThetaMin)/(cosThetaMin - costm);
G4double st2 = 0.5*(y*(1.0 - costm) - a*x)/(y + x);
if(st2 < 0.0 || st2 > 1.0) {
G4cout << "G4CoulombScatteringModel::SampleSecondaries WARNING st2= "
<< st2 << G4endl;
st2 = 0.0;
}
G4double sint = sqrt((1.0 + cost)*(1.0 - cost));
G4double tet = 2.0*asin(sqrt(st2));
G4double cost= cos(tet);
G4double sint= sin(tet);
G4double phi = twopi * G4UniformRand();
G4ThreeVector v1(cos(phi)*sint,sin(phi)*sint,cost);
G4double p1tot = sqrt(momentum2);
v1.rotateUz(p1);
G4double p1tot = sqrt(momCM2);
// v1.rotateUz(p1);
G4LorentzVector lfv1(v1.x()*p1tot,v1.y()*p1tot,v1.z(),lv1.e());
G4LorentzVector lfv2 = lv1 + lv2 - lfv1;
lfv1.boost(bst);
lfv2.boost(bst);
fParticleChange->ProposeMomentumDirection(lfv1.vect().unit());
G4LorentzVector lfv2 = lv - lfv1;
G4ThreeVector newdir = lfv1.vect().unit();
fParticleChange->ProposeMomentumDirection(newdir);
G4double ekin = lfv1.e() - m1;
if(ekin < 0.0) ekin = 0.0;
fParticleChange->SetProposedKineticEnergy(ekin);
@@ -263,7 +217,9 @@ std::vector<G4DynamicParticle*>* G4CoulombScatteringModel::SampleSecondaries(
G4ParticleDefinition* ion = theParticleTable->GetIon(iz, in, 0.0);
G4DynamicParticle* newdp = new G4DynamicParticle(ion, lfv2);
fvect->push_back(newdp);
}
} else if(ekin > 0.0) {
fParticleChange->ProposeLocalEnergyDeposit(ekin);
}
return fvect;
}
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4GammaConversion.cc,v 1.25 2006/06/29 19:52:56 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4GammaConversion.cc,v 1.27 2006/09/14 10:27:19 maire Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
//------------------ G4GammaConversion physics process -------------------------
@@ -59,8 +59,11 @@
// 11-01-02 ComputeCrossSection: correction of extrapolation below EnergyLimit
// 21-03-02 DoIt: correction of the e+e- angular distribution (bug 363) mma
// 08-11-04 Remove of Store/Retrieve tables (V.Ivantchenko)
// 19-04-05 Migrate to model interface and inherit from G4VEmProcess (V.Ivanchenko)
// 19-04-05 Migrate to model interface and inherit
// from G4VEmProcess (V.Ivanchenko)
// 04-05-05, Make class to be default (V.Ivanchenko)
// 09-08-06, add SetModel(G4VEmModel*) (mma)
// 12-09-06, move SetModel(G4VEmModel*) in G4VEmProcess (mma)
// -----------------------------------------------------------------------------
#include "G4GammaConversion.hh"
@@ -91,16 +94,15 @@ void G4GammaConversion::InitialiseProcess(const G4ParticleDefinition*)
{
if(!isInitialised) {
isInitialised = true;
// SetVerboseLevel(1);
SetBuildTableFlag(true);
SetSecondaryParticle(G4Electron::Electron());
G4double emin = max(MinKinEnergy(), 2.0*electron_mass_c2);
SetMinKinEnergy(emin);
G4double emax = MaxKinEnergy();
G4VEmModel* model = new G4BetheHeitlerModel();
model->SetLowEnergyLimit(emin);
model->SetHighEnergyLimit(emax);
AddEmModel(1, model);
if(!Model()) SetModel(new G4BetheHeitlerModel);
Model()->SetLowEnergyLimit(emin);
Model()->SetHighEnergyLimit(emax);
AddEmModel(1, Model());
}
}
@@ -108,10 +110,12 @@ void G4GammaConversion::InitialiseProcess(const G4ParticleDefinition*)
void G4GammaConversion::PrintInfo()
{
G4cout << " Total cross sections has a good parametrisation"
<< " from 1.5 MeV to 100 GeV for all Z;"
<< "\n sampling secondary e+e- according to the Bethe-Heitler model"
<< G4endl;
G4cout
<< " Total cross sections has a good parametrisation"
<< " from 1.5 MeV to 100 GeV for all Z;"
<< "\n sampling secondary e+e- according "
<< Model()->GetName() << " model"
<< G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4GammaConversion52.cc,v 1.3 2006/06/29 19:52:58 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4GammaConversion52.cc,v 1.4 2006/10/16 15:26:49 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//------------------ G4GammaConversion52 physics process -------------------------
// by Michel Maire, 24 May 1996
@@ -583,6 +583,8 @@ void G4GammaConversion52::PrintInfoDefinition()
<< G4BestUnit(LowestEnergyLimit, "Energy")
<< " to " << G4BestUnit(HighestEnergyLimit,"Energy")
<< " in " << NumbBinTable << " bins. \n";
G4cout << " WARNING: This process is obsolete and will be soon removed"
<< G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: G4InitXscPAI.cc,v 1.9 2006/06/29 19:53:00 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// G4InitXscPAI.cc -- class implementation file
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4IonFluctuations.cc,v 1.3 2006/06/29 19:53:02 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
// -------------------------------------------------------------------
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4KleinNishinaCompton.cc,v 1.8 2006/06/29 19:53:04 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MollerBhabhaModel.cc,v 1.26 2006/06/29 19:53:06 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4MollerBhabhaModel.cc,v 1.28 2006/08/28 17:44:36 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// -------------------------------------------------------------------
//
@@ -74,12 +74,12 @@ G4MollerBhabhaModel::G4MollerBhabhaModel(const G4ParticleDefinition* p,
const G4String& nam)
: G4VEmModel(nam),
particle(0),
isElectron(true),
twoln10(2.0*log(10.0)),
lowLimit(0.2*keV),
isElectron(true)
lowLimit(0.2*keV)
{
if(p) SetParticle(p);
theElectron = G4Electron::Electron();
if(p) SetParticle(p);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4MscModel71.cc,v 1.4 2006/06/29 19:53:08 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
// -------------------------------------------------------------------
//
@@ -23,10 +23,19 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MultipleScattering.cc,v 1.53 2006/06/29 19:53:10 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4MultipleScattering.cc,v 1.58 2006/11/23 10:07:42 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// -----------------------------------------------------------------------------
//
// GEANT4 Class file
//
// File name: G4MultipleScattering
//
// Author: Laszlo Urban
//
// Creation date: March 2001
//
// 16/05/01 value of cparm changed , L.Urban
// 18/05/01 V.Ivanchenko Clean up against Linux ANSI compilation
// 07/08/01 new methods Store/Retrieve PhysicsTable (mma)
@@ -97,10 +106,18 @@
// 19-01-07 tlimitmin = facrange*50*micrometer, i.e. it depends on the
// value of facrange (L.Urban)
// 16-02-06 value of factail changed, samplez = true (L.Urban)
// 07-03-06 Create G4UrbanMscModel and move there step limit calculation (V.Ivanchenko)
// 07-03-06 Create G4UrbanMscModel and move there step limit calculation (VI)
// 10-05-06 SetMscStepLimitation at initialisation (V.Ivantchenko)
// 11-05-06 values of data members tkinlimit, factail have been
// changed (L.Urban)
// 13-10-06 data member factail removed, new data member skin
// together with set function, data member tkinlimit
// changed to lambdalimit (L.Urban)
// 20-10-06 default value of skin = 0 (no single scattering),
// single scattering for skin > 0,
// there is no z sampling by default (L.Urban)
// 23-10-06 skin = 1 by default (L.Urban)
// 23-11-06 skin = 1 by default for e+-, 0 for other particles (VI)
//
// -----------------------------------------------------------------------------
//
@@ -125,12 +142,15 @@ G4MultipleScattering::G4MultipleScattering(const G4String& processName)
facrange = 0.02;
dtrl = 0.05;
tkinlimit = 1.*MeV;
facgeom = 3.5;
factail = 0.85;
lambdalimit = 1.*mm;
facgeom = 2.5;
// there is no single scattering for this skin <= 0
// to have single scattering at boundary
// skin should be > 0 !
skin = 0.0;
steppingAlgorithm = true;
samplez = true ;
samplez = false ;
isInitialized = false;
SetBinning(totBins);
@@ -174,16 +194,17 @@ void G4MultipleScattering::InitialiseProcess(const G4ParticleDefinition* p)
return;
}
G4String part_name = p->GetParticleName();
if(part_name == "e-" || part_name == "e+") skin = 1.0;
if (p->GetParticleType() == "nucleus") {
// steppingAlgorithm = false;
SetLateralDisplasmentFlag(false);
SetBuildLambdaTable(false);
} else {
SetBuildLambdaTable(true);
}
// compute Tlimit for particle
mscUrban = new G4UrbanMscModel(facrange,dtrl,tkinlimit,
facgeom,factail,
mscUrban = new G4UrbanMscModel(facrange,dtrl,lambdalimit,
facgeom,skin,
samplez,steppingAlgorithm);
mscUrban->SetLateralDisplasmentFlag(LateralDisplasmentFlag());
mscUrban->SetLowEnergyLimit(lowKineticEnergy);
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4MultipleScattering52.cc,v 1.4 2006/06/29 19:53:12 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4MultipleScattering52.cc,v 1.5 2006/10/16 15:26:49 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// -----------------------------------------------------------------------------
// 16/05/01 value of cparm changed , L.Urban
@@ -948,6 +948,8 @@ void G4MultipleScattering52::PrintInfoDefinition()
<< G4BestUnit(LowestKineticEnergy ,"Energy")
<< " to " << G4BestUnit(HighestKineticEnergy,"Energy")
<< " in " << TotBin << " bins. \n";
G4cout << " WARNING: This process is obsolete and will be soon removed"
<< G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MultipleScattering71.cc,v 1.3 2006/06/29 19:53:14 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4MultipleScattering71.cc,v 1.4 2006/10/16 15:26:49 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// -----------------------------------------------------------------------------
// 16/05/01 value of cparm changed , L.Urban
@@ -184,6 +184,9 @@ void G4MultipleScattering71::PrintInfo()
<< facrange
<< G4endl;
}
G4cout << " WARNING: This process is obsolete and will be soon removed"
<< G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -62,7 +62,9 @@ using namespace std;
G4PAIModel::G4PAIModel(const G4ParticleDefinition* p, const G4String& nam)
: G4VEmModel(nam),G4VEmFluctuationModel(nam),
fVerbose(0),
fVerbose(0),
fLowestGamma(1.005),
fHighestGamma(10000.),
fTotBin(200),
fMeanNumber(20),
fParticle(0),
@@ -73,11 +75,16 @@ G4PAIModel::G4PAIModel(const G4ParticleDefinition* p, const G4String& nam)
fTaulim(8.4146e-3)
{
if(p) SetParticle(p);
fLowestKineticEnergy = LowEnergyLimit();
fHighestKineticEnergy = HighEnergyLimit();
fProtonEnergyVector = new G4PhysicsLogVector(fLowestKineticEnergy,
fHighestKineticEnergy,
fTotBin);
// fLowestKineticEnergy = LowEnergyLimit();
// fHighestKineticEnergy = HighEnergyLimit();
fLowestKineticEnergy = fMass*fLowestGamma;
fHighestKineticEnergy = fMass*fHighestGamma;
fParticleEnergyVector = new G4PhysicsLogVector(fLowestKineticEnergy,
fHighestKineticEnergy,
fTotBin );
fPAItransferTable = 0;
fPAIdEdxTable = 0;
fSandiaPhotoAbsCof = 0;
@@ -90,7 +97,7 @@ G4PAIModel::G4PAIModel(const G4ParticleDefinition* p, const G4String& nam)
G4PAIModel::~G4PAIModel()
{
if(fProtonEnergyVector) delete fProtonEnergyVector;
if(fParticleEnergyVector) delete fParticleEnergyVector;
if(fdEdxVector) delete fdEdxVector ;
if ( fLambdaVector) delete fLambdaVector;
if ( fdNdxCutVector) delete fdNdxCutVector;
@@ -167,7 +174,7 @@ void G4PAIModel::Initialise(const G4ParticleDefinition* p,
fMatIndex = iMatGlob;
ComputeSandiaPhotoAbsCof();
BuildPAIonisationTable();
BuildPAIonisationTable(p);
fPAIxscBank.push_back(fPAItransferTable);
fPAIdEdxBank.push_back(fPAIdEdxTable);
@@ -233,7 +240,7 @@ void G4PAIModel::ComputeSandiaPhotoAbsCof()
// *********
void
G4PAIModel::BuildPAIonisationTable()
G4PAIModel::BuildPAIonisationTable(const G4ParticleDefinition* p)
{
G4double LowEdgeEnergy , ionloss ;
G4double massRatio, tau, Tmax, Tmin, Tkin, deltaLow, gamma, bg2 ;
@@ -263,14 +270,28 @@ G4PAIModel::BuildPAIonisationTable()
for (G4int i = 0 ; i < fTotBin ; i++) //The loop for the kinetic energy
{
LowEdgeEnergy = fProtonEnergyVector->GetLowEdgeEnergy(i) ;
tau = LowEdgeEnergy/proton_mass_c2 ;
LowEdgeEnergy = fParticleEnergyVector->GetLowEdgeEnergy(i) ;
tau = LowEdgeEnergy/fMass ;
// if(tau < 0.01) tau = 0.01 ;
gamma = tau +1. ;
// G4cout<<"gamma = "<<gamma<<endl ;
bg2 = tau*(tau + 2. ) ;
massRatio = electron_mass_c2/proton_mass_c2 ;
Tmax = 2.*electron_mass_c2*bg2/(1.+2.*gamma*massRatio+massRatio*massRatio) ;
bg2 = tau*( tau + 2. );
if(p->GetParticleName() == "e-")
{
Tmax = 0.5*LowEdgeEnergy;
}
else if(p->GetParticleName() == "e+")
{
Tmax = LowEdgeEnergy; // Unclear??
}
else
{
massRatio = electron_mass_c2/fMass ;
Tmax = 2.*electron_mass_c2*bg2/(1. + 2.*gamma*massRatio+massRatio*massRatio);
}
// G4cout<<"proton Tkin = "<<LowEdgeEnergy/MeV<<" MeV"
// <<" Tmax = "<<Tmax/MeV<<" MeV"<<G4endl;
// Tkin = DeltaCutInKineticEnergyNow ;
@@ -472,7 +493,7 @@ G4double G4PAIModel::ComputeDEDX(const G4MaterialCutsCouple* matCC,
{
G4int iTkin,iPlace;
size_t jMat;
G4double massRatio = proton_mass_c2/p->GetPDGMass();
G4double massRatio = fMass/p->GetPDGMass();
G4double scaledTkin = kineticEnergy*massRatio;
G4double charge = p->GetPDGCharge();
G4double charge2 = charge*charge, dEdx;
@@ -487,7 +508,7 @@ G4double G4PAIModel::ComputeDEDX(const G4MaterialCutsCouple* matCC,
fdEdxVector = fdEdxTable[jMat];
for(iTkin = 0 ; iTkin < fTotBin ; iTkin++)
{
if(scaledTkin < fProtonEnergyVector->GetLowEdgeEnergy(iTkin)) break ;
if(scaledTkin < fParticleEnergyVector->GetLowEdgeEnergy(iTkin)) break ;
}
iPlace = iTkin - 1;
if(iPlace < 0) iPlace = 0;
@@ -508,7 +529,7 @@ G4double G4PAIModel::CrossSection( const G4MaterialCutsCouple* matCC,
G4int iTkin,iPlace;
size_t jMat;
G4double tmax = min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy);
G4double massRatio = proton_mass_c2/p->GetPDGMass();
G4double massRatio = fMass/p->GetPDGMass();
G4double scaledTkin = kineticEnergy*massRatio;
G4double charge = p->GetPDGCharge();
G4double charge2 = charge*charge, cross, cross1, cross2;
@@ -523,7 +544,7 @@ G4double G4PAIModel::CrossSection( const G4MaterialCutsCouple* matCC,
for(iTkin = 0 ; iTkin < fTotBin ; iTkin++)
{
if(scaledTkin < fProtonEnergyVector->GetLowEdgeEnergy(iTkin)) break ;
if(scaledTkin < fParticleEnergyVector->GetLowEdgeEnergy(iTkin)) break ;
}
iPlace = iTkin - 1;
if(iPlace < 0) iPlace = 0;
@@ -573,7 +594,7 @@ G4PAIModel::SampleSecondaries( const G4MaterialCutsCouple* matCC,
G4double particleMass = dp->GetMass();
G4double kineticEnergy = dp->GetKineticEnergy();
G4double massRatio = proton_mass_c2/particleMass;
G4double massRatio = fMass/particleMass;
G4double scaledTkin = kineticEnergy*massRatio;
G4double totalEnergy = kineticEnergy + particleMass;
G4double pSquare = kineticEnergy*(totalEnergy+particleMass);
@@ -586,6 +607,7 @@ G4PAIModel::SampleSecondaries( const G4MaterialCutsCouple* matCC,
{
G4cout<<"Tkin of secondary e- <= 0."<<G4endl;
G4cout<<"G4PAIModel::SampleSecondary::deltaTkin = "<<deltaTkin<<G4endl;
G4cout<<"G4PAIModel::SampleSecondary::deltaTkin = "<<deltaTkin<<G4endl;
// deltaTkin = 10*eV;
G4cout<<"Set G4PAIModel::SampleSecondary::deltaTkin = "<<deltaTkin<<G4endl;
}
@@ -594,7 +616,8 @@ G4PAIModel::SampleSecondaries( const G4MaterialCutsCouple* matCC,
if(deltaTkin > kineticEnergy &&
particleMass != electron_mass_c2) deltaTkin = kineticEnergy;
if (deltaTkin > 0.5*kineticEnergy &&
dp->GetDefinition()->GetParticleName() == "e-") deltaTkin = 0.5*kineticEnergy;
(dp->GetDefinition()->GetParticleName() == "e-" ||
dp->GetDefinition()->GetParticleName() == "e+") ) deltaTkin = 0.5*kineticEnergy;
G4double deltaTotalMomentum = sqrt(deltaTkin*(deltaTkin + 2. * electron_mass_c2 ));
G4double totalMomentum = sqrt(pSquare);
@@ -650,7 +673,7 @@ G4PAIModel::GetPostStepTransfer( G4double scaledTkin )
for(iTkin=0;iTkin<fTotBin;iTkin++)
{
if(scaledTkin < fProtonEnergyVector->GetLowEdgeEnergy(iTkin)) break ;
if(scaledTkin < fParticleEnergyVector->GetLowEdgeEnergy(iTkin)) break ;
}
iPlace = iTkin - 1 ;
// G4cout<<"from search, iPlace = "<<iPlace<<G4endl ;
@@ -687,8 +710,8 @@ G4PAIModel::GetPostStepTransfer( G4double scaledTkin )
}
else // general case: Tkin between two vectors of the material
{
E1 = fProtonEnergyVector->GetLowEdgeEnergy(iTkin - 1) ;
E2 = fProtonEnergyVector->GetLowEdgeEnergy(iTkin) ;
E1 = fParticleEnergyVector->GetLowEdgeEnergy(iTkin - 1) ;
E2 = fParticleEnergyVector->GetLowEdgeEnergy(iTkin) ;
W = 1.0/(E2 - E1) ;
W1 = (E2 - scaledTkin)*W ;
W2 = (scaledTkin - E1)*W ;
@@ -782,16 +805,17 @@ G4double G4PAIModel::SampleFluctuations( const G4Material* material,
G4double position, E1, E2, W1, W2, W, dNdxCut1, dNdxCut2, meanNumber;
G4bool numb = true;
G4double Tkin = aParticle->GetKineticEnergy() ;
G4double MassRatio = proton_mass_c2/aParticle->GetDefinition()->GetPDGMass() ;
G4double MassRatio = fMass/aParticle->GetDefinition()->GetPDGMass() ;
G4double charge = aParticle->GetDefinition()->GetPDGCharge() ;
charge2 = charge*charge ;
G4double TkinScaled = Tkin*MassRatio ;
for(iTkin=0;iTkin<fTotBin;iTkin++)
{
if(TkinScaled < fProtonEnergyVector->GetLowEdgeEnergy(iTkin)) break ;
if(TkinScaled < fParticleEnergyVector->GetLowEdgeEnergy(iTkin)) break ;
}
iPlace = iTkin - 1 ;
if(iPlace < 0) iPlace = 0;
// G4cout<<"from search, iPlace = "<<iPlace<<G4endl ;
dNdxCut1 = (*fdNdxCutVector)(iPlace) ;
// G4cout<<"dNdxCut1 = "<<dNdxCut1<<G4endl ;
@@ -871,8 +895,8 @@ G4double G4PAIModel::SampleFluctuations( const G4Material* material,
}
else // general case: Tkin between two vectors of the material
{
E1 = fProtonEnergyVector->GetLowEdgeEnergy(iTkin - 1) ;
E2 = fProtonEnergyVector->GetLowEdgeEnergy(iTkin) ;
E1 = fParticleEnergyVector->GetLowEdgeEnergy(iTkin - 1) ;
E2 = fParticleEnergyVector->GetLowEdgeEnergy(iTkin) ;
W = 1.0/(E2 - E1) ;
W1 = (E2 - TkinScaled)*W ;
W2 = (TkinScaled - E1)*W ;
@@ -25,7 +25,7 @@
//
//
// $Id: G4PAIxSection.cc,v 1.21 2006/06/29 19:53:20 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// G4PAIxSection.cc -- class implementation file
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4PEEffectModel.cc,v 1.5 2006/06/29 19:53:22 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
// -------------------------------------------------------------------
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4PSTARStopping.cc,v 1.5 2006/06/29 19:53:24 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//---------------------------------------------------------------------------
//
@@ -23,11 +23,11 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PhotoElectricEffect.cc,v 1.35 2006/06/29 19:53:26 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4PhotoElectricEffect.cc,v 1.37 2006/09/14 10:27:19 maire Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
//------------------ G4PhotoElectricEffect physics process -------------------------
//------------------ G4PhotoElectricEffect physics process ---------------------
// by Michel Maire, 24 May 1996
//
// 12-06-96, Added SelectRandomAtom() method, by M.Maire
@@ -61,8 +61,11 @@
// distribution (mma)
// 15-01-03, photoelectron theta ditribution : return costeta=1 if gamma>5
// (helmut burkhardt)
// 21-04-05 Migrate to model interface and inherit from G4VEmProcess (V.Ivanchenko)
// 21-04-05 Migrate to model interface and inherit
// from G4VEmProcess (V.Ivanchenko)
// 04-05-05, Make class to be default (V.Ivanchenko)
// 09-08-06, add SetModel(G4VEmModel*) (mma)
// 12-09-06, move SetModel(G4VEmModel*) in G4VEmProcess (mma)
// -----------------------------------------------------------------------------
#include "G4PhotoElectricEffect.hh"
@@ -83,19 +86,18 @@ G4PhotoElectricEffect::G4PhotoElectricEffect(const G4String& processName,
G4PhotoElectricEffect::~G4PhotoElectricEffect()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4PhotoElectricEffect::InitialiseProcess(const G4ParticleDefinition*)
{
if(!isInitialised) {
isInitialised = true;
// SetVerboseLevel(1);
SetBuildTableFlag(false);
SetSecondaryParticle(G4Electron::Electron());
G4VEmModel* model = new G4PEEffectModel();
model->SetLowEnergyLimit(MinKinEnergy());
model->SetHighEnergyLimit(MaxKinEnergy());
AddEmModel(1, model);
if(!Model()) SetModel(new G4PEEffectModel);
Model()->SetLowEnergyLimit(MinKinEnergy());
Model()->SetHighEnergyLimit(MaxKinEnergy());
AddEmModel(1, Model());
}
}
@@ -103,8 +105,10 @@ void G4PhotoElectricEffect::InitialiseProcess(const G4ParticleDefinition*)
void G4PhotoElectricEffect::PrintInfo()
{
G4cout << " Total cross sections from Sandia parametrisation. "
<< G4endl;
G4cout
<< " Total cross sections from Sandia parametrisation. "
<< "\n Sampling according " << Model()->GetName() << " model"
<< G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4PhotoElectricEffect52.cc,v 1.2 2006/06/29 19:53:28 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4PhotoElectricEffect52.cc,v 1.3 2006/10/16 15:26:49 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -282,6 +282,8 @@ void G4PhotoElectricEffect52::PrintInfoDefinition()
G4String comments = "Total cross sections from Sandia parametrisation. ";
G4cout << G4endl << GetProcessName() << ": " << comments << G4endl;
G4cout << " WARNING: This process is obsolete and will be soon removed"
<< G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: G4PolarizedComptonScattering.cc,v 1.16 2006/06/29 19:53:30 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
//
//---------- G4PolarizedComptonScattering physics process ----------------------
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4UniversalFluctuation.cc,v 1.8 2006/06/29 19:53:32 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
// -------------------------------------------------------------------
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4UrbanMscModel.cc,v 1.15 2006/06/29 19:53:34 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4UrbanMscModel.cc,v 1.26 2006/12/04 05:53:24 urban Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// -------------------------------------------------------------------
//
@@ -90,6 +90,30 @@
// c_highland 13.6*MeV ---> 13.26*MeV,
// corr_highland 0.555 ---> 0.54,
// value of data member geommin changed (5 nm -> 1 nm) (L.Urban)
// 13-10-06 data member factail removed, data member tkinlimit changed
// to lambdalimit,
// new data members tgeom,tnow,skin,skindepth,Zeff,geomlimit
// G4double GeomLimit(const G4Track& track) changed to
// void GeomLimit(const G4Track& track)
// - important changes in ComputeTruePathLengthLimit:
// possibility to have very small step(s) with single scattering
// before boundary crossing (with skin > 0)
// - changes in SampleCosineTheta :
// single scattering if step <= stepmin, parameter theta0
// slightly modified, tail modified (L.Urban)
// 20-10-06 parameter theta0 now computed in the (public)
// function ComputeTheta0,
// single scattering modified allowing not small
// angles as well (L.Urban)
// 23-10-06 correction in SampleSecondaries, now safety update
// computed in a simpler/faster way (L.Urban)
// 06-11-06 corrections in ComputeTruePathLengthLimit, results are
// more stable in calorimeters (L.Urban)
// 07-11-06 fix in GeomPathLength and SampleCosineTheta (L.Urban)
// 15-11-06 bugfix in SampleCosineTheta (L.Urban)
// 20-11-06 bugfix in single scattering part of SampleCosineTheta,
// single scattering just before boundary crossing now (L.Urban)
// 04-12-06 fix in ComputeTruePathLengthLimit (L.Urban)
//
// Class Description:
@@ -112,21 +136,23 @@
#include "G4TransportationManager.hh"
#include "G4Navigator.hh"
#include "G4Poisson.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
using namespace std;
G4UrbanMscModel::G4UrbanMscModel(G4double m_facrange, G4double m_dtrl,
G4double m_tkinlimit,
G4double m_facgeom, G4double m_factail,
G4double m_lambdalimit,
G4double m_facgeom,G4double m_skin,
G4bool m_samplez, G4bool m_stepAlg,
const G4String& nam)
: G4VEmModel(nam),
dtrl(m_dtrl),
factail(m_factail),
Tkinlimit(m_tkinlimit),
lambdalimit(m_lambdalimit),
facrange(m_facrange),
facgeom(m_facgeom),
skin(m_skin),
samplez(m_samplez),
steppingAlgorithm(m_stepAlg),
isInitialized(false)
@@ -136,26 +162,34 @@ G4UrbanMscModel::G4UrbanMscModel(G4double m_facrange, G4double m_dtrl,
taulim = 1.e-6;
currentTau = taulim;
stepmin = 1.e-6*mm;
skindepth = (skin-1)*stepmin;
skindepth1 = skindepth+stepmin;
currentRange = 0. ;
frscaling2 = 0.1;
frscaling2 = 0.25;
frscaling1 = 1.-frscaling2;
tlimit = 1.e10*mm;
tlimitmin = 5.e-6*mm;
tlimitminfix = 5.e-6*mm;
tlimitmin = 10.e-6*mm;
tlimitminfix = 10.e-6*mm;
tnow = 10.e-6*mm;
nstepmax = 25.;
tgeom = 1.e50*mm;
geombig = 1.e50*mm;
geommin = 1.e-6*mm;
presafety = 0.*mm;
facsafety = 0.20;
geommin = 1.e-3*mm;
geomlimit = geombig;
presafety = 0.*mm;
facsafety = 0.25;
Zeff = 1.;
particle = 0;
theManager = G4LossTableManager::Instance();
inside = false;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4UrbanMscModel::~G4UrbanMscModel()
{}
{
delete safetyHelper;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -173,6 +207,8 @@ void G4UrbanMscModel::Initialise(const G4ParticleDefinition* p,
navigator = G4TransportationManager::GetTransportationManager()
->GetNavigatorForTracking();
safetyHelper= new G4SafetyHelper();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -416,7 +452,6 @@ G4double G4UrbanMscModel::ComputeCrossSectionPerAtom(
else if(AtomicNumber > Z2)
sigma = AtomicNumber*AtomicNumber*c2/(Z2*Z2);
}
// G4cout << "e= " << KineticEnergy << " sigma= " << sigma << G4endl;
return sigma;
}
@@ -437,10 +472,12 @@ G4double G4UrbanMscModel::ComputeTruePathLengthLimit(
currentKinEnergy = dp->GetKineticEnergy();
currentRange =
theManager->GetRangeFromRestricteDEDX(particle,currentKinEnergy,couple);
currentRadLength = couple->GetMaterial()->GetRadlen();
lambda0 = GetLambda(currentKinEnergy);
tPathLength = currentMinimalStep;
if(tPathLength > currentRange)
tPathLength = currentRange;
G4StepPoint* sp = track.GetStep()->GetPreStepPoint();
presafety = sp->GetSafety();
G4StepStatus stepStatus = sp->GetStepStatus();
@@ -450,59 +487,112 @@ G4double G4UrbanMscModel::ComputeTruePathLengthLimit(
//
if (steppingAlgorithm)
{
if((stepNumber > 1) && inside)
return tPathLength;
//compute geomlimit and presafety
GeomLimit(track);
if((stepStatus == fGeomBoundary) || (stepNumber == 1))
{
//define tlimitmin here (it depends on lambda!)
tlimitmin = lambda0/nstepmax;
if(tlimitmin < tlimitminfix) tlimitmin = tlimitminfix;
if((stepNumber == 1) && (currentRange < presafety))
{
stepmin = 1.e-6*mm;
inside = true;
return tPathLength;
}
else
inside = false;
// not so strong step restriction above Tlimit
// facrange scaling in lambda
// not so strong step restriction above llimit
G4double facr = facrange;
if(currentKinEnergy > Tlimit)
facr *= frscaling1+frscaling2*currentKinEnergy/Tlimit;
if(lambda0 > llimit)
facr *= frscaling1+frscaling2*lambda0/llimit;
// constraint from the physics
if (currentRange > lambda0) tlimit = facr*currentRange;
else tlimit = facr*lambda0;
// constraint from the geometry (if tlimit above is too big)
tgeom = geombig;
if(geomlimit > geommin)
{
if(stepStatus == fGeomBoundary)
tgeom = geomlimit/facgeom;
else
tgeom = 2.*geomlimit/facgeom;
}
//define stepmin here (it depends on lambda!)
//rough estimation of lambda_elastic/lambda_transport
G4double rat = currentKinEnergy/MeV ;
rat = 1.e-3/(rat*(10.+rat)) ;
//stepmin ~ lambda_elastic
stepmin = rat*lambda0;
skindepth = (skin-1.)*stepmin;
skindepth1 = skindepth+stepmin;
if(stepmin > tgeom) stepmin = tgeom;
//define tlimitmin
tlimitmin = lambda0/nstepmax;
if(tlimitmin < stepmin) tlimitmin = 1.01*stepmin;
if(tlimitmin < tlimitminfix) tlimitmin = tlimitminfix;
//lower limit for tlimit
if(tlimit < tlimitmin) tlimit = tlimitmin;
G4double geomlimit = GeomLimit(track);
// constraint from the geometry (if tlimit above is too big)
if(geomlimit > geommin)
{
if(stepStatus == fGeomBoundary)
{
if(tlimit > geomlimit/facgeom)
tlimit = geomlimit/facgeom;
}
else
{
if(tlimit > 2.*geomlimit/facgeom)
tlimit = 2.*geomlimit/facgeom;
}
}
}
if(stepNumber == 1)
{
// range <= presafety ---> particle is not able to leave volume
if(currentRange <= presafety)
return currentMinimalStep;
//check against geometry limit
if(tlimit > tgeom) tlimit = tgeom;
//if track starts far from boundaries increase tlimit!
if(tlimit < facsafety*presafety)
if(tlimit < facsafety*presafety)
tlimit = facsafety*presafety ;
}
// range <= presafety ---> particle is not able to leave volume
if(currentRange <= presafety)
return currentMinimalStep;
if(tPathLength > tlimit) tPathLength = tlimit;
// "randomize" tlimit
tlimit *= 0.5+G4UniformRand();
}
if(currentRange < presafety)
{
inside = true;
return tPathLength;
}
// shortcut
if((tPathLength < tlimit) &&
(tPathLength < presafety))
return tPathLength;
//if track far from boundaries increase tPathLength
tnow = tlimit;
if(tlimit < facsafety*presafety)
tnow = facsafety*presafety ;
// step reduction near to boundary
if(skindepth >= 0.)
{
if(geomlimit > skindepth)
{
if(tnow > geomlimit-skindepth)
tnow = geomlimit-skindepth;
}
else
{
if(tnow > stepmin)
tnow = stepmin;
}
}
if(tnow < stepmin)
tnow = stepmin;
if(tPathLength > tnow)
tPathLength = tnow ;
}
// version similar to 7.1 (needed for some experiments)
//
else
{
if(stepNumber == 1)
@@ -522,9 +612,9 @@ G4double G4UrbanMscModel::ComputeTruePathLengthLimit(
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4UrbanMscModel::GeomLimit(const G4Track& track)
void G4UrbanMscModel::GeomLimit(const G4Track& track)
{
G4double geomlimit = geombig;
geomlimit = geombig;
// no geomlimit for the World volume
if((track.GetVolume() != 0) &&
@@ -538,11 +628,7 @@ G4double G4UrbanMscModel::GeomLimit(const G4Track& track)
track.GetMomentumDirection(),
cstep,
presafety);
if(geomlimit < geommin) geomlimit = geommin;
}
return geomlimit;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -550,7 +636,6 @@ G4double G4UrbanMscModel::GeomLimit(const G4Track& track)
G4double G4UrbanMscModel::ComputeGeomPathLength(G4double)
{
// do the true -> geom transformation
const G4double ztmax = 0.99, onethird = 1./3. ;
lambdaeff = lambda0;
par1 = -1. ;
@@ -565,7 +650,7 @@ G4double G4UrbanMscModel::ComputeGeomPathLength(G4double)
G4double tau = tPathLength/lambda0 ;
if ((tau <= tausmall) || (tPathLength < stepmin)) {
if ((tau <= tausmall) || (tPathLength <= stepmin)) {
geomLength = tPathLength;
if(geomLength > lambda0) geomLength = lambda0;
return geomLength;
@@ -574,12 +659,15 @@ G4double G4UrbanMscModel::ComputeGeomPathLength(G4double)
G4double zmean = tPathLength;
if (tPathLength < currentRange*dtrl) {
zmean = lambda0*(1.-exp(-tau));
if(tau < taulim) zmean = tPathLength*(1.-0.5*tPathLength/lambda0) ;
if(tau < taulim) zmean = tPathLength*(1.-0.5*tau) ;
} else if(currentKinEnergy < mass) {
par1 = 1./currentRange ;
par2 = 1./(par1*lambda0) ;
par3 = 1.+par2 ;
zmean = (1.-exp(par3*log(1.-tPathLength/currentRange)))/(par1*par3) ;
if(tPathLength < currentRange)
zmean = (1.-exp(par3*log(1.-tPathLength/currentRange)))/(par1*par3) ;
else
zmean = 1./(par1*par3) ;
} else {
G4double T1 = theManager->GetEnergy(particle,currentRange-tPathLength,couple);
G4double lambda1 = GetLambda(T1);
@@ -590,32 +678,37 @@ G4double G4UrbanMscModel::ComputeGeomPathLength(G4double)
zmean = (1.-exp(par3*log(lambda1/lambda0)))/(par1*par3) ;
}
// sample z
zPathLength = zmean ;
G4double zt = zmean/tPathLength ;
if (samplez && tPathLength >= stepmin && zt < ztmax)
// sample z
if(samplez)
{
G4double u,cz1;
if(zt >= onethird)
const G4double ztmax = 0.99, onethird = 1./3. ;
G4double zt = zmean/tPathLength ;
if (tPathLength > stepmin && zt < ztmax)
{
G4double cz = 0.5*(3.*zt-1.)/(1.-zt) ;
cz1 = 1.+cz ;
G4double u0 = cz/cz1 ;
G4double grej ;
do {
u = exp(log(G4UniformRand())/cz1) ;
grej = exp(cz*log(u/u0))*(1.-u)/(1.-u0) ;
} while (grej < G4UniformRand()) ;
G4double u,cz1;
if(zt >= onethird)
{
G4double cz = 0.5*(3.*zt-1.)/(1.-zt) ;
cz1 = 1.+cz ;
G4double u0 = cz/cz1 ;
G4double grej ;
do {
u = exp(log(G4UniformRand())/cz1) ;
grej = exp(cz*log(u/u0))*(1.-u)/(1.-u0) ;
} while (grej < G4UniformRand()) ;
}
else
{
cz1 = 1./zt-1.;
u = 1.-exp(log(G4UniformRand())/cz1) ;
}
zPathLength = tPathLength*u ;
}
else
{
cz1 = 1./zt-1.;
u = 1.-exp(log(G4UniformRand())/cz1) ;
}
zPathLength = tPathLength*u ;
}
// G4cout << zPathLength << G4endl;
geomLength = zPathLength;
if(geomLength > lambda0) geomLength = lambda0;
@@ -626,14 +719,14 @@ G4double G4UrbanMscModel::ComputeGeomPathLength(G4double)
G4double G4UrbanMscModel::ComputeTrueStepLength(G4double geomStepLength)
{
// msc stop the step
// step defined other than transportation
if(geomStepLength == geomLength && tPathLength <= currentRange)
return tPathLength;
// recalculation
G4double trueLength = geomStepLength;
zPathLength = geomStepLength;
if((geomStepLength > lambda0*tausmall) && (geomStepLength >= stepmin))
if((geomStepLength > lambda0*tausmall) && (geomStepLength > stepmin))
{
if(par1 < 0.)
trueLength = -lambda0*log(1.-geomStepLength/lambda0) ;
@@ -654,6 +747,32 @@ G4double G4UrbanMscModel::ComputeTrueStepLength(G4double geomStepLength)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4UrbanMscModel::ComputeTheta0(G4double trueStepLength,
G4double KineticEnergy)
{
// for all particles take the width of the central part
// from a parametrization similar to the Highland formula
// ( Highland formula: Particle Physics Booklet, July 2002, eq. 26.10)
const G4double c_highland = 13.6*MeV ;
G4double betacp = sqrt(currentKinEnergy*(currentKinEnergy+2.*mass)*
KineticEnergy*(KineticEnergy+2.*mass)/
((currentKinEnergy+mass)*(KineticEnergy+mass)));
G4double y = trueStepLength/currentRadLength;
G4double theta0 = c_highland*charge*sqrt(y)/betacp;
y = log(y);
theta0 *= sqrt(1.+y*(0.105+0.0035*y));
//correction for small Zeff (based on high energy
// proton scattering data)
// see G.Shen at al. Phys.Rev.D20(1979) p.1584
theta0 *= 1.-0.24/(Zeff*(Zeff+1.));
return theta0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
std::vector<G4DynamicParticle*>* G4UrbanMscModel::SampleSecondaries(
const G4MaterialCutsCouple*,
const G4DynamicParticle* dynParticle,
@@ -661,7 +780,7 @@ std::vector<G4DynamicParticle*>* G4UrbanMscModel::SampleSecondaries(
G4double safety)
{
G4double kineticEnergy = dynParticle->GetKineticEnergy();
if(kineticEnergy <= 0.0) return 0;
if((kineticEnergy <= 0.0) || (truestep <= 0.)) return 0;
G4double cth = SampleCosineTheta(truestep,kineticEnergy);
G4double sth = sqrt((1.0 - cth)*(1.0 + cth));
@@ -674,14 +793,6 @@ std::vector<G4DynamicParticle*>* G4UrbanMscModel::SampleSecondaries(
newDirection.rotateUz(oldDirection);
fParticleChange->ProposeMomentumDirection(newDirection);
/*
const G4ParticleDefinition* pd = dynParticle->GetDefinition();
G4cout << "G4UrbanMscModel: Sample secondary; E(MeV)= " << kineticEnergy/MeV
<< " MeV; step(mm)= " << truestep/mm
<< ", safety(mm)= " << safety/mm << " " << pd->GetParticleName()
<< G4endl;
*/
if (latDisplasment) {
G4double r = SampleDisplacement();
@@ -716,23 +827,23 @@ std::vector<G4DynamicParticle*>* G4UrbanMscModel::SampleSecondaries(
{
// ******* we do not have track info at this level ***********
// ******* so navigator is called at boundary too ************
navigator->LocateGlobalPointWithinVolume(Position);
const G4double cstep = safety ;
G4double newsafety = safety;
phi = navigator->ComputeStep(Position,latDirection,
cstep,newsafety);
G4double newsafety= -100.; // = safety;
// newsafety= navigator->ComputeSafety(Position);
newsafety= safetyHelper->ComputeSafety(Position);
safety= newsafety;
if(r < newsafety)
fac = 1.;
else
fac = newsafety/r ;
}
if(fac > 0.)
{
// compute new endpoint of the Step
G4ThreeVector newPosition = Position+fac*r*latDirection;
navigator->LocateGlobalPointWithinVolume(newPosition);
// navigator->LocateGlobalPointWithinVolume(newPosition);
safetyHelper->ReLocateWithinVolume(newPosition);
fParticleChange->ProposePosition(newPosition);
}
@@ -749,19 +860,55 @@ G4double G4UrbanMscModel::SampleCosineTheta(G4double trueStepLength,
G4double cth = 1. ;
G4double tau = trueStepLength/lambda0 ;
if(trueStepLength >= currentRange*dtrl)
if(par1*trueStepLength < 1.)
tau = -par2*log(1.-par1*trueStepLength) ;
else
tau = taubig ;
Zeff = couple->GetMaterial()->GetTotNbOfElectPerVolume()/
couple->GetMaterial()->GetTotNbOfAtomsPerVolume() ;
currentTau = tau ;
lambdaeff = trueStepLength/currentTau;
if(trueStepLength < stepmin)
cth = exp(-currentTau) ;
if((trueStepLength <= stepmin) && (skin > 0.) &&
(geomlimit <= skindepth1))
{
//no scattering, single or plural scattering
// just before boundary crossing only (for skin > 0)
G4double mean = trueStepLength/stepmin ;
cth = 1.;
G4int n = G4Poisson(mean);
if(n > 0)
{
G4double tm = KineticEnergy/mass;
// ascr - screening parameter, factor 0.025 comes from
// requirement of 'smooth' transition msc -> single scattering
G4double ascr = 0.025*exp(log(Zeff)/3.)/(137.*sqrt(tm*(tm+2.)));
G4double ascr1 = 1.+0.5*ascr*ascr;
G4double bp1=ascr1+1.;
G4double bm1=ascr1-1.;
// single scattering from screened Rutherford x-section
G4double ct,st,phi;
G4double sx=0.,sy=0.,sz=0.;
for(G4int i=1; i<=n; i++)
{
ct = ascr1-bp1*bm1/(2.*G4UniformRand()+bm1);
if(ct < -1.) ct = -1.;
if(ct > 1.) ct = 1.;
st = sqrt(1.-ct*ct);
phi = twopi*G4UniformRand();
sx += st*cos(phi);
sy += st*sin(phi);
sz += ct;
}
cth = sz/sqrt(sx*sx+sy*sy+sz*sz);
}
}
else
{
if(trueStepLength >= currentRange*dtrl)
if(par1*trueStepLength < 1.)
tau = -par2*log(1.-par1*trueStepLength) ;
else
tau = taubig ;
currentTau = tau ;
lambdaeff = trueStepLength/currentTau;
currentRadLength = couple->GetMaterial()->GetRadlen();
if (tau >= taubig) cth = -1.+2.*G4UniformRand();
else if (tau >= tausmall)
{
@@ -769,20 +916,9 @@ G4double G4UrbanMscModel::SampleCosineTheta(G4double trueStepLength,
G4double prob = 0., qprob = 1. ;
G4double a = 1., ea = 0., eaa = 1.;
G4double xmean1 = 1., xmean2 = 0.;
G4double xsi = 3.;
// 3 model functions ( normal case)............................
// for all particles take the width of the central part
// from a parametrization similar to the Highland formula
// ( Highland formula: Particle Physics Booklet, July 2002, eq. 26.10)
// here : theta0 = 13.6*MeV*Q*(t/X0)**0.555/(beta*cp)
const G4double xsi = 3., c_highland = 13.26*MeV ;
G4double betacp = sqrt(currentKinEnergy*(currentKinEnergy+2.*mass)*
KineticEnergy*(KineticEnergy+2.*mass)/
((currentKinEnergy+mass)*(KineticEnergy+mass)));
G4double tailpar = c_highland/betacp ;
const G4double corr_highland=0.54;
G4double theta0 = tailpar*charge*exp(corr_highland*
log(trueStepLength/currentRadLength)) ;
G4double theta0 = ComputeTheta0(trueStepLength,KineticEnergy);
if(theta0 > taulim) a = 0.5/(1.-cos(theta0)) ;
else a = 1.0/(theta0*theta0) ;
@@ -793,8 +929,7 @@ G4double G4UrbanMscModel::SampleCosineTheta(G4double trueStepLength,
G4double c1 = c-1.;
G4double x0 = 1.-xsi/a ;
// x0 < ~cos(30 deg)
if(x0 < 0.866)
if(x0 < 0.)
{
// 1 model function
b = exp(tau);
@@ -805,8 +940,12 @@ G4double G4UrbanMscModel::SampleCosineTheta(G4double trueStepLength,
}
else
{
c = xsi-factail*currentRadLength/(lambda0*tailpar*tailpar) ;
if(c <= 2.) c = 2.+taulim ;
//empirical tail parameter
// based some exp. data
c = 2.40-0.027*exp(2.*log(Zeff)/3.);
if(c == 2.) c = 2.+taulim ;
if(c <= 1.) c = 1.+taulim ;
c1 = c-1.;
ea = exp(-xsi) ;
@@ -824,7 +963,7 @@ G4double G4UrbanMscModel::SampleCosineTheta(G4double trueStepLength,
G4double f1x0 = a*ea/eaa ;
G4double f2x0 = c1*eb1*ebx/(eb1-ebx)/exp(c*log(bx)) ;
// from continuity at x=x0
prob = f2x0/(f1x0+f2x0) ;
@@ -907,8 +1046,3 @@ G4double G4UrbanMscModel::LatCorrelation()
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: G4VeEnergyLoss.cc,v 1.35 2006/06/29 19:53:36 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
// -----------------------------------------------------------------------------
@@ -25,7 +25,7 @@
//
//
// $Id: G4VhEnergyLoss.cc,v 1.49 2006/06/29 19:53:38 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
// -----------------------------------------------------------------------------
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4WaterStopping.cc,v 1.2 2006/06/29 19:53:40 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//---------------------------------------------------------------------------
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4eBremsstrahlung.cc,v 1.44 2006/06/29 19:53:43 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
// -------------------------------------------------------------------
//
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4eBremsstrahlung52.cc,v 1.6 2006/06/29 19:53:45 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4eBremsstrahlung52.cc,v 1.7 2006/10/16 15:26:50 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// ------------ G4eBremsstrahlung52 physics process --------
@@ -1035,6 +1035,8 @@ void G4eBremsstrahlung52::PrintInfoDefinition()
<< G4BestUnit(LowerBoundLambda,"Energy")
<< " to " << G4BestUnit(UpperBoundLambda,"Energy")
<< " in " << NbinLambda << " bins. \n";
G4cout << " WARNING: This process is obsolete and will be soon removed"
<< G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4eBremsstrahlungModel.cc,v 1.33 2006/06/29 19:53:47 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4eBremsstrahlungModel.cc,v 1.35 2006/08/29 14:00:25 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// -------------------------------------------------------------------
//
@@ -81,13 +81,13 @@ G4eBremsstrahlungModel::G4eBremsstrahlungModel(const G4ParticleDefinition* p,
const G4String& nam)
: G4VEmModel(nam),
particle(0),
minThreshold(1.0*keV),
isElectron(true),
highKinEnergy(100.*TeV),
lowKinEnergy(1.0*keV),
minThreshold(1.0*keV),
probsup(1.0),
MigdalConstant(classic_electr_radius*electron_Compton_length*electron_Compton_length/pi),
LPMconstant(fine_structure_const*electron_mass_c2*electron_mass_c2/(8.*pi*hbarc)),
isElectron(true),
theLPMflag(true)
{
if(p) SetParticle(p);
@@ -868,24 +868,35 @@ std::vector<G4DynamicParticle*>* G4eBremsstrahlungModel::SampleSecondaries(
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
const G4Element* G4eBremsstrahlungModel::SelectRandomAtom(
const G4MaterialCutsCouple* couple) const
const G4MaterialCutsCouple* couple)
{
// select randomly 1 element within the material
const G4Material* material = couple->GetMaterial();
G4int nElements = material->GetNumberOfElements();
const G4ElementVector* theElementVector = material->GetElementVector();
if(1 == nElements) return (*theElementVector)[0];
G4DataVector* dv = partialSumSigma[couple->GetIndex()];
G4double rval = G4UniformRand()*((*dv)[nElements-1]);
for (G4int i=0; i<nElements; i++) {
if (rval <= (*dv)[i]) return (*theElementVector)[i];
}
G4cout << "G4eBremsstrahlungModel::SelectRandomAtom: Warning - No elements found in "
<< material->GetName()
<< G4endl;
return 0;
const G4Element* elm = 0;
if(1 < nElements) {
G4DataVector* dv = partialSumSigma[couple->GetIndex()];
G4double rval = G4UniformRand()*((*dv)[nElements-1]);
for (G4int i=0; i<nElements; i++) {
if (rval <= (*dv)[i]) elm = (*theElementVector)[i];
}
if(!elm) {
G4cout << "G4eBremsstrahlungModel::SelectRandomAtom: Warning -"
<< " no elements found in "
<< material->GetName()
<< G4endl;
elm = (*theElementVector)[0];
}
} else elm = (*theElementVector)[0];
SetCurrentElement(elm);
return elm;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4eCoulombScatteringModel.cc,v 1.2 2006/06/29 19:53:49 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4eCoulombScatteringModel.cc,v 1.10 2006/10/26 17:36:17 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// -------------------------------------------------------------------
//
@@ -38,6 +38,10 @@
// Creation date: 22.08.2005
//
// Modifications:
// 01.08.06 V.Ivanchenko extend upper limit of table to TeV and review the
// logic of building - only elements from G4ElementTable
// 08.08.06 V.Ivanchenko build internal table in ekin scale, introduce faclim
// 19.08.06 V.Ivanchenko add inline function ScreeningParameter
//
// Class Description:
//
@@ -49,6 +53,7 @@
#include "G4eCoulombScatteringModel.hh"
#include "Randomize.hh"
#include "G4DataVector.hh"
#include "G4ElementTable.hh"
#include "G4PhysicsLogVector.hh"
#include "G4ParticleChangeForGamma.hh"
@@ -60,20 +65,21 @@ G4eCoulombScatteringModel::G4eCoulombScatteringModel(
G4double thetaMin, G4double thetaMax, G4bool build,
G4double tlim, const G4String& nam)
: G4VEmModel(nam),
theCrossSectionTable(0),
cosThetaMin(cos(thetaMin)),
cosThetaMax(cos(thetaMax)),
lowMomentum(keV),
highMomentum(MeV),
q2Limit(tlim),
theCrossSectionTable(0),
lowKEnergy(keV),
highKEnergy(TeV),
alpha2(fine_structure_const*fine_structure_const),
faclim(100.0),
nbins(12),
nmax(100),
buildTable(build),
isInitialised(false)
{
G4double p0 = hbarc/(Bohr_radius*0.885);
a0 = 0.25*p0*p0;
p0 = electron_mass_c2*classic_electr_radius;
a0 = alpha2*electron_mass_c2*electron_mass_c2/(0.885*0.885);
G4double p0 = electron_mass_c2*classic_electr_radius;
coeff = twopi*p0*p0;
}
@@ -90,38 +96,38 @@ G4eCoulombScatteringModel::~G4eCoulombScatteringModel()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4eCoulombScatteringModel::Initialise(const G4ParticleDefinition* p,
const G4DataVector&)
const G4DataVector&)
{
if(isInitialised) return;
isInitialised = true;
if(pParticleChange)
fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
fParticleChange =
reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
else
fParticleChange = new G4ParticleChangeForGamma();
if(!buildTable || p->GetParticleName() == "GenericIon") return;
// Compute cross section multiplied by Ptot^2*beta^2
G4double mass = p->GetPDGMass();
G4double mass2 = mass*mass;
theCrossSectionTable = new G4PhysicsTable(nmax);
theCrossSectionTable = new G4PhysicsTable();
G4PhysicsLogVector* ptrVector;
G4double mom2, value;
G4double pmin = lowMomentum*lowMomentum;
G4double pmax = highMomentum*highMomentum;
nbins = G4int(log10(pmax/pmin)/2.0) + 1;
G4double e, value;
nbins = 2*G4int(log10(highKEnergy/lowKEnergy));
for(G4int j=1; j<nmax; j++) {
const G4ElementTable* elmt = G4Element::GetElementTable();
size_t nelm = G4Element::GetNumberOfElements();
ptrVector = new G4PhysicsLogVector(pmin, pmax, nbins);
for(size_t j=0; j<nelm; j++) {
ptrVector = new G4PhysicsLogVector(lowKEnergy, highKEnergy, nbins);
const G4Element* elm = (*elmt)[j];
G4double Z = elm->GetZ();
index[G4int(Z)] = j;
for(G4int i=0; i<=nbins; i++) {
mom2 = ptrVector->GetLowEdgeEnergy( i ) ;
value = CalculateCrossSectionPerAtom(p, mom2, j);
value *= mom2*mom2/(mom2 + mass2);
ptrVector->PutValue( i, value );
e = ptrVector->GetLowEdgeEnergy( i ) ;
value = CalculateCrossSectionPerAtom(p, e, Z);
ptrVector->PutValue( i, log(value) );
}
theCrossSectionTable->insert(ptrVector);
@@ -132,22 +138,39 @@ void G4eCoulombScatteringModel::Initialise(const G4ParticleDefinition* p,
G4double G4eCoulombScatteringModel::CalculateCrossSectionPerAtom(
const G4ParticleDefinition* p,
G4double momentum2,
G4double kinEnergy,
G4double Z)
{
G4double cross = 0.0;
G4double m = p->GetPDGMass();
G4double q = p->GetPDGCharge()/eplus;
G4double mass2 = m*m;
G4double costm = std::max(cosThetaMax, 1.0 - q2Limit/2.0*momentum2);
G4double tkin = std::max(keV, kinEnergy);
G4double mom2 = tkin*(tkin + 2.0*m);
G4double costm = std::max(cosThetaMax, 1.0 - 0.5*q2Limit/mom2);
if(costm < cosThetaMin) {
G4double invbeta2 = 1.0 + mass2/momentum2;
G4double a = 2.0*pow(Z,0.666666667)*a0*
(1.13 + 3.76*invbeta2*Z*Z*fine_structure_const*fine_structure_const)/momentum2 + 1.0;
cross = coeff*q*q*Z*Z*(cosThetaMin - costm)/((a - cosThetaMin)*(a - costm));
G4double q = p->GetPDGCharge()/eplus;
G4double q2 = q*q;
G4double invbeta2 = 1.0 + m*m/mom2;
G4double A = ScreeningParameter(Z, q2, mom2, invbeta2);
G4double a = 2.0*A + 1.0;
cross = coeff*Z*(Z + 1.0)*q2*invbeta2*(cosThetaMin - costm)/
((a - cosThetaMin)*(a - costm)*mom2);
/*
if(Z == 13 || Z == 79) {
G4cout << "## e= " << kinEnergy << " beta= " << sqrt (1.0/invbeta2)
<<" Z= " << Z
<< " sig(bn)= " << cross/barn
<< " cosMax= " << costm
<< " cosMin= " << cosThetaMin
<< G4endl;
G4double atommass = 27.0;
if(Z == 79) atommass = 197.0;
G4double u0 = 1.e+6*atommass*cm2/(cross*Avogadro);
G4double u1 = 0.5*u0/( A* ( (1.0 + A)*log(1.0 + 1.0/A) -1.0 ) );
G4cout << " l0= " << u0 << " l1= " << u1
<< " A= " << A << G4endl;
}
*/
}
//G4cout << "p= " << sqrt(momentum2) << " Z= " << Z << " a= " << a
//<< " cross= " << cross << " " <<G4endl;
return cross;
}
@@ -164,25 +187,31 @@ std::vector<G4DynamicParticle*>* G4eCoulombScatteringModel::SampleSecondaries(
G4double mass = dp->GetMass();
G4double kinEnergy = dp->GetKineticEnergy();
G4double momentum2 = kinEnergy*(kinEnergy + 2.0*mass);
G4double invbeta2 = (kinEnergy + mass)*(kinEnergy + mass)/momentum2;
G4double mom2 = kinEnergy*(kinEnergy + 2.0*mass);
const G4Element* elm = SelectRandomAtom(aMaterial, p, kinEnergy);
G4double Z = elm->GetZ();
G4double q = p->GetPDGCharge()/eplus;
G4double q2 = q*q;
G4double a = 2.*pow(Z,0.666666667)*a0*
(1.13 + 3.76*invbeta2*Z*Z*fine_structure_const*fine_structure_const)/momentum2 + 1.0;
G4double costm = std::max(cosThetaMax, 1.0 - q2Limit/2.0*momentum2);
if(costm > cosThetaMin) return 0;
G4double invbeta2 = 1.0 + mass*mass/mom2;
G4double a = 2.*ScreeningParameter(Z, q2, mom2, invbeta2);
G4double cost = a - (a - cosThetaMin)*(a - costm)/
(a - cosThetaMin + G4UniformRand()*(cosThetaMin - costm));
if(std::abs(cost) > 1.) {
G4cout << "G4eCoulombScatteringModel::SampleSecondaries WARNING cost= " << cost << G4endl;
if(cost < -1.) cost = -1.0;
else cost = 1.0;
G4double costm = std::max(cosThetaMax, 1.0 - 0.5*q2Limit/mom2);
if(costm >= cosThetaMin) return 0;
G4double x = G4UniformRand();
G4double y = (a + 1.0 - cosThetaMin)/(cosThetaMin - costm);
G4double st2 = 0.5*(y*(1.0 - costm) - a*x)/(y + x);
if(st2 < 0.0 || st2 > 1.0) {
G4cout << "G4eCoulombScatteringModel::SampleSecondaries WARNING st2= "
<< st2 << G4endl;
st2 = 0.0;
}
G4double sint = sqrt((1.0 + cost)*(1.0 - cost));
G4double tet = 2.0*asin(sqrt(st2));
G4double cost= cos(tet);
G4double sint= sin(tet);
G4double phi = twopi * G4UniformRand();
@@ -190,7 +219,7 @@ std::vector<G4DynamicParticle*>* G4eCoulombScatteringModel::SampleSecondaries(
G4ThreeVector newDirection(cos(phi)*sint,sin(phi)*sint,cost);
newDirection.rotateUz(direction);
fParticleChange->ProposeMomentumDirection(direction);
fParticleChange->ProposeMomentumDirection(newDirection);
return 0;
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4eIonisation.cc,v 1.50 2006/06/29 19:53:51 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
// -------------------------------------------------------------------
//
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4eIonisation52.cc,v 1.5 2006/06/29 19:53:53 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4eIonisation52.cc,v 1.6 2006/10/16 15:26:50 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//--------------- G4eIonisation52 physics process --------------------------------
// by Laszlo Urban, 20 March 1997
@@ -531,6 +531,8 @@ void G4eIonisation52::PrintInfoDefinition()
<< "\n Step function: finalRange(mm)= " << finalRange
<< ", dRoverRange= " << dRoverRange
<< G4endl;
G4cout << " WARNING: This process is obsolete and will be soon removed"
<< G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4eeToTwoGammaModel.cc,v 1.10 2006/06/29 19:53:55 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4eeToTwoGammaModel.cc,v 1.12 2006/10/20 08:59:50 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// -------------------------------------------------------------------
//
@@ -38,9 +38,11 @@
// Creation date: 02.08.2004
//
// Modifications:
// 08-04-05 Major optimisation of internal interfaces (V.Ivantchenko)
// 18-04-05 Compute CrossSectionPerVolume (V.Ivantchenko)
// 08-04-05 Major optimisation of internal interfaces (V.Ivanchenko)
// 18-04-05 Compute CrossSectionPerVolume (V.Ivanchenko)
// 06-02-06 ComputeCrossSectionPerElectron, ComputeCrossSectionPerAtom (mma)
// 29-06-06 Fix problem for zero energy incident positron (V.Ivanchenko)
// 20-10-06 Add theGamma as a member (V.Ivanchenko)
//
//
// Class Description:
@@ -82,6 +84,7 @@ G4eeToTwoGammaModel::G4eeToTwoGammaModel(const G4ParticleDefinition*,
: G4VEmModel(nam),
pi_rcl2(pi*classic_electr_radius*classic_electr_radius)
{
theGamma = G4Gamma::Gamma();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -151,66 +154,96 @@ vector<G4DynamicParticle*>* G4eeToTwoGammaModel::SampleSecondaries(
G4double,
G4double)
{
G4double PositKinEnergy = dp->GetKineticEnergy();
G4ThreeVector PositDirection = dp->GetMomentumDirection();
G4double tau = PositKinEnergy/electron_mass_c2;
G4double gam = tau + 1.0;
G4double tau2 = tau + 2.0;
G4double sqgrate = sqrt(tau/tau2)*0.5;
G4double sqg2m1 = sqrt(tau*tau2);
// limits of the energy sampling
G4double epsilmin = 0.5 - sqgrate;
G4double epsilmax = 0.5 + sqgrate;
G4double epsilqot = epsilmax/epsilmin;
//
// sample the energy rate of the created gammas
//
G4double epsil, greject;
do {
epsil = epsilmin*pow(epsilqot,G4UniformRand());
greject = 1. - epsil + (2.*gam*epsil-1.)/(epsil*tau2*tau2);
} while( greject < G4UniformRand() );
//
// scattered Gamma angles. ( Z - axis along the parent positron)
//
G4double cost = (epsil*tau2-1.)/(epsil*sqg2m1);
G4double 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 TotalAvailableEnergy = PositKinEnergy + 2.0*electron_mass_c2;
G4double Phot1Energy = epsil*TotalAvailableEnergy;
vector<G4DynamicParticle*>* vdp = new vector<G4DynamicParticle*>;
G4double PositKinEnergy = dp->GetKineticEnergy();
G4ThreeVector Phot1Direction (dirx, diry, dirz);
Phot1Direction.rotateUz(PositDirection);
G4DynamicParticle* aParticle1 = new G4DynamicParticle (G4Gamma::Gamma(),
Phot1Direction, Phot1Energy);
vdp->push_back(aParticle1);
// Case at rest
if(PositKinEnergy == 0.0) {
G4double cost = 2.*G4UniformRand()-1.;
G4double sint = sqrt((1. - cost)*(1. + cost));
G4double phi = twopi * G4UniformRand();
G4ThreeVector dir (sint*cos(phi), sint*sin(phi), cost);
G4DynamicParticle* aGamma1 = new G4DynamicParticle(theGamma,
dir, electron_mass_c2);
G4DynamicParticle* aGamma2 = new G4DynamicParticle(theGamma,
-dir, electron_mass_c2);
vdp->push_back(aGamma1);
vdp->push_back(aGamma2);
G4double Phot2Energy =(1.-epsil)*TotalAvailableEnergy;
G4double Eratio= Phot1Energy/Phot2Energy;
G4double PositP= sqrt(PositKinEnergy*(PositKinEnergy+2.*electron_mass_c2));
G4ThreeVector Phot2Direction (-dirx*Eratio, -diry*Eratio,
(PositP-dirz*Phot1Energy)/Phot2Energy);
Phot2Direction.unit();
Phot2Direction.rotateUz(PositDirection);
// create G4DynamicParticle object for the particle2
G4DynamicParticle* aParticle2= new G4DynamicParticle (G4Gamma::Gamma(),
Phot2Direction, Phot2Energy);
vdp->push_back(aParticle2);
} else {
G4ThreeVector PositDirection = dp->GetMomentumDirection();
G4double tau = PositKinEnergy/electron_mass_c2;
G4double gam = tau + 1.0;
G4double tau2 = tau + 2.0;
G4double sqgrate = sqrt(tau/tau2)*0.5;
G4double sqg2m1 = sqrt(tau*tau2);
// limits of the energy sampling
G4double epsilmin = 0.5 - sqgrate;
G4double epsilmax = 0.5 + sqgrate;
G4double epsilqot = epsilmax/epsilmin;
//
// sample the energy rate of the created gammas
//
G4double epsil, greject;
do {
epsil = epsilmin*pow(epsilqot,G4UniformRand());
greject = 1. - epsil + (2.*gam*epsil-1.)/(epsil*tau2*tau2);
} while( greject < G4UniformRand() );
//
// scattered Gamma angles. ( Z - axis along the parent positron)
//
G4double cost = (epsil*tau2-1.)/(epsil*sqg2m1);
if(std::abs(cost) > 1.0) {
G4cout << "### G4eeToTwoGammaModel WARNING cost= " << cost
<< " positron Ekin(MeV)= " << PositKinEnergy
<< " gamma epsil= " << epsil
<< G4endl;
if(cost > 1.0) cost = 1.0;
else cost = -1.0;
}
G4double 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 TotalAvailableEnergy = PositKinEnergy + 2.0*electron_mass_c2;
G4double Phot1Energy = epsil*TotalAvailableEnergy;
G4ThreeVector Phot1Direction (dirx, diry, dirz);
Phot1Direction.rotateUz(PositDirection);
G4DynamicParticle* aGamma1 =
new G4DynamicParticle (theGamma,Phot1Direction, Phot1Energy);
vdp->push_back(aGamma1);
G4double Phot2Energy =(1.-epsil)*TotalAvailableEnergy;
G4double PositP= sqrt(PositKinEnergy*(PositKinEnergy+2.*electron_mass_c2));
G4ThreeVector dir = PositDirection*PositP - Phot1Direction*Phot1Energy;
G4ThreeVector Phot2Direction = dir.unit();
// create G4DynamicParticle object for the particle2
G4DynamicParticle* aGamma2=
new G4DynamicParticle (theGamma,Phot2Direction, Phot2Energy);
vdp->push_back(aGamma2);
/*
G4cout << "Annihilation in fly: e0= " << PositKinEnergy
<< " m= " << electron_mass_c2
<< " e1= " << Phot1Energy
<< " e2= " << Phot2Energy << " dir= " << dir
<< " -> " << Phot1Direction << " "
<< Phot2Direction << G4endl;
*/
}
return vdp;
}
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4eplusAnnihilation.cc,v 1.24 2006/06/29 19:53:57 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4eplusAnnihilation.cc,v 1.26 2006/09/14 10:27:19 maire Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// -------------------------------------------------------------------
//
@@ -43,6 +43,8 @@
// 03-05-05 suppress Integral option (mma)
// 04-05-05 Make class to be default (V.Ivanchenko)
// 25-01-06 remove cut dependance in AtRestDoIt (mma)
// 09-08-06 add SetModel(G4VEmModel*) (mma)
// 12-09-06, move SetModel(G4VEmModel*) in G4VEmProcess (mma)
//
//
@@ -77,7 +79,6 @@ void G4eplusAnnihilation::InitialiseProcess(const G4ParticleDefinition*)
{
if(!isInitialised) {
isInitialised = true;
// SetVerboseLevel(3);
SetBuildTableFlag(true);
SetStartFromNullFlag(false);
SetSecondaryParticle(G4Gamma::Gamma());
@@ -86,10 +87,10 @@ void G4eplusAnnihilation::InitialiseProcess(const G4ParticleDefinition*)
SetLambdaBinning(120);
SetMinKinEnergy(emin);
SetMaxKinEnergy(emax);
G4VEmModel* em = new G4eeToTwoGammaModel();
em->SetLowEnergyLimit(emin);
em->SetHighEnergyLimit(emax);
AddEmModel(1, em);
if(!Model()) SetModel(new G4eeToTwoGammaModel);
Model()->SetLowEnergyLimit(emin);
Model()->SetHighEnergyLimit(emax);
AddEmModel(1, Model());
}
}
@@ -97,9 +98,10 @@ void G4eplusAnnihilation::InitialiseProcess(const G4ParticleDefinition*)
void G4eplusAnnihilation::PrintInfo()
{
G4cout << " Heilter model of formula of annihilation into 2 photons"
<< G4endl;
}
G4cout
<< " Sampling according " << Model()->GetName() << " model"
<< G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4eplusAnnihilation52.cc,v 1.2 2006/06/29 19:53:59 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4eplusAnnihilation52.cc,v 1.3 2006/10/16 15:26:50 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -298,7 +298,8 @@ G4VParticleChange* G4eplusAnnihilation52::PostStepDoIt(const G4Track& aTrack,
// Do not make anything if particle is stopped, the Annihilation52 then
// should be performed by the AtRestDoIt!
if (aTrack.GetTrackStatus() == fStopButAlive) return &aParticleChange;
if (aTrack.GetTrackStatus() == fStopButAlive || PositKinEnergy == 0.0)
return &aParticleChange;
G4double gamam1 = PositKinEnergy/electron_mass_c2;
G4double gama = gamam1+1. , gamap1 = gamam1+2.;
@@ -493,6 +494,8 @@ void G4eplusAnnihilation52::PrintInfoDefinition()
<< G4BestUnit(LowestEnergyLimit ,"Energy")
<< " to " << G4BestUnit(HighestEnergyLimit,"Energy")
<< " in " << NumbBinTable << " bins. \n";
G4cout << " WARNING: This process is obsolete and will be soon removed"
<< G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4hIonisation.cc,v 1.65 2006/06/29 19:54:01 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
// -------------------------------------------------------------------
//
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4hIonisation52.cc,v 1.5 2006/06/29 19:54:03 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4hIonisation52.cc,v 1.6 2006/10/16 15:26:50 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//---------------- G4hIonisation52 physics process -------------------------------
// by Laszlo Urban, 30 May 1997
@@ -616,6 +616,8 @@ void G4hIonisation52::PrintInfoDefinition()
<< "\n Step function: finalRange(mm)= " << finalRange
<< ", dRoverRange= " << dRoverRange
<< G4endl;
G4cout << " WARNING: This process is obsolete and will be soon removed"
<< G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,143 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4hMultipleScattering.cc,v 1.1 2006/10/26 11:04:39 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// -----------------------------------------------------------------------------
//
// GEANT4 Class file
//
// File name: G4hMultipleScattering
//
// Author: Laszlo Urban
//
// Creation date: 24.10.2006 cloned from G4MultipleScattering
//
// Modified:
//
// -----------------------------------------------------------------------------
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4hMultipleScattering.hh"
#include "G4UrbanMscModel.hh"
#include "G4TransportationManager.hh"
#include "G4Navigator.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
using namespace std;
G4hMultipleScattering::G4hMultipleScattering(const G4String& processName)
: G4VMultipleScattering(processName)
{
lowKineticEnergy = 0.1*keV;
highKineticEnergy = 100.*TeV;
totBins = 120;
facrange = 0.2;
dtrl = 0.05;
lambdalimit = 1.*mm;
facgeom = 0.5;
// there is no single scattering for this skin <= 0
// to have single scattering at boundary
// skin should be > 0 !
skin = 0.;
steppingAlgorithm = false;
samplez = false ;
isInitialized = false;
SetBinning(totBins);
SetMinKinEnergy(lowKineticEnergy);
SetMaxKinEnergy(highKineticEnergy);
SetLateralDisplasmentFlag(true);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4hMultipleScattering::~G4hMultipleScattering()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4bool G4hMultipleScattering::IsApplicable (const G4ParticleDefinition& p)
{
return (p.GetPDGCharge() != 0.0 && !p.IsShortLived());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4hMultipleScattering::MscStepLimitation(G4bool algorithm, G4double factor)
{
steppingAlgorithm = algorithm;
if (factor > 0.) SetFacrange(factor);
else { if (algorithm) SetFacrange(0.02); else SetFacrange(0.2);}
if(verboseLevel > 1)
G4cout << "Stepping algorithm is set to " << steppingAlgorithm
<< " with facrange = " << facrange << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4hMultipleScattering::InitialiseProcess(const G4ParticleDefinition* p)
{
if(isInitialized) {
mscUrban->SetMscStepLimitation(steppingAlgorithm, facrange);
return;
}
if (p->GetParticleType() == "nucleus") {
SetLateralDisplasmentFlag(false);
SetBuildLambdaTable(false);
} else {
SetBuildLambdaTable(true);
}
mscUrban = new G4UrbanMscModel(facrange,dtrl,lambdalimit,
facgeom,skin,
samplez,steppingAlgorithm);
mscUrban->SetLateralDisplasmentFlag(LateralDisplasmentFlag());
mscUrban->SetLowEnergyLimit(lowKineticEnergy);
mscUrban->SetHighEnergyLimit(highKineticEnergy);
AddEmModel(1,mscUrban);
isInitialized = true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4hMultipleScattering::PrintInfo()
{
G4cout << " Boundary/stepping algorithm is active with facrange= "
<< facrange
<< " Step limitation " << steppingAlgorithm
<< G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: G4ionIonisation.cc,v 1.37 2006/06/29 19:54:05 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
// -------------------------------------------------------------------
//