Import Geant4 8.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 14:36:02 +02:00
parent d93e1e39a9
commit 8a51e0bc40
5471 changed files with 99628 additions and 55248 deletions
@@ -21,7 +21,7 @@
// ********************************************************************
//
// $Id: G4EnergyLossForExtrapolator.cc,v 1.5 2005/06/27 15:29:29 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//---------------------------------------------------------------------------
//
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4MuBetheBlochModel.cc,v 1.18 2005/04/12 13:31:16 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4MuBetheBlochModel.cc,v 1.20 2005/08/18 14:38:55 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
// -------------------------------------------------------------------
//
@@ -78,6 +78,9 @@ G4MuBetheBlochModel::G4MuBetheBlochModel(const G4ParticleDefinition* p,
taulim(8.4146e-3),
alphaprime(fine_structure_const/twopi)
{
theElectron = G4Electron::Electron();
corr = G4LossTableManager::Instance()->EmCorrections();
if(p) SetParticle(p);
}
@@ -90,10 +93,12 @@ G4MuBetheBlochModel::~G4MuBetheBlochModel()
void G4MuBetheBlochModel::SetParticle(const G4ParticleDefinition* p)
{
particle = p;
mass = particle->GetPDGMass();
massSquare = mass*mass;
ratio = electron_mass_c2/mass;
if(!particle) {
particle = p;
mass = particle->GetPDGMass();
massSquare = mass*mass;
ratio = electron_mass_c2/mass;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -109,16 +114,12 @@ G4double G4MuBetheBlochModel::MinEnergyCut(const G4ParticleDefinition*,
void G4MuBetheBlochModel::Initialise(const G4ParticleDefinition* p,
const G4DataVector&)
{
if(!particle) SetParticle(p);
theElectron = G4Electron::Electron();
if(p) SetParticle(p);
if(pParticleChange)
fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange);
else
fParticleChange = new G4ParticleChangeForLoss();
corr = G4LossTableManager::Instance()->EmCorrections();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -244,12 +245,12 @@ G4double G4MuBetheBlochModel::CrossSectionPerVolume(const G4Material* material,
vector<G4DynamicParticle*>* G4MuBetheBlochModel::SampleSecondaries(
const G4MaterialCutsCouple*,
const G4DynamicParticle* dp,
G4double minEnergy,
G4double minKinEnergy,
G4double maxEnergy)
{
G4double tmax = MaxSecondaryKinEnergy(dp);
G4double maxKinEnergy = min(maxEnergy,tmax);
G4double minKinEnergy = min(minEnergy,maxKinEnergy);
if(minKinEnergy >= maxKinEnergy) return 0;
G4double kineticEnergy = dp->GetKineticEnergy();
G4double totEnergy = kineticEnergy + mass;
@@ -21,7 +21,7 @@
// ********************************************************************
//
// $Id: G4MuBremsstrahlung.cc,v 1.36 2005/04/08 15:18:12 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
// -------------------------------------------------------------------
//
@@ -22,7 +22,7 @@
//
//
// $Id: G4MuBremsstrahlung52.cc,v 1.4 2004/12/02 08:20:38 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
//--------------- G4MuBremsstrahlung52 physics process ---------------------------
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4MuBremsstrahlungModel.cc,v 1.16 2005/05/18 16:06:18 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4MuBremsstrahlungModel.cc,v 1.18 2005/08/18 14:38:55 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
// -------------------------------------------------------------------
//
@@ -43,6 +43,7 @@
// 13-02-03 Add name (V.Ivanchenko)
// 10-02-04 Add lowestKinEnergy (V.Ivanchenko)
// 08-04-05 Major optimisation of internal interfaces (V.Ivantchenko)
// 03-08-05 Angular correlations according to PRM (V.Ivantchenko)
//
//
@@ -77,9 +78,10 @@ G4double G4MuBremsstrahlungModel::tdat[]={1.e3,1.e4,1.e5,1.e6,1.e7,1.e8,1.e9,1.e
using namespace std;
G4MuBremsstrahlungModel::G4MuBremsstrahlungModel(const G4ParticleDefinition*,
G4MuBremsstrahlungModel::G4MuBremsstrahlungModel(const G4ParticleDefinition* p,
const G4String& nam)
: G4VEmModel(nam),
particle(0),
lowestKinEnergy(1.0*GeV),
minThreshold(1.0*keV),
nzdat(5),
@@ -88,7 +90,9 @@ G4MuBremsstrahlungModel::G4MuBremsstrahlungModel(const G4ParticleDefinition*,
cutFixed(0.98*keV),
samplingTablesAreFilled(false)
{
highKinEnergy = HighEnergyLimit();
theGamma = G4Gamma::Gamma();
if(p) SetParticle(p);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -113,27 +117,44 @@ G4double G4MuBremsstrahlungModel::MinEnergyCut(const G4ParticleDefinition*,
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4MuBremsstrahlungModel::Initialise(const G4ParticleDefinition*,
void G4MuBremsstrahlungModel::SetParticle(const G4ParticleDefinition* p)
{
if(!particle) {
particle = p;
mass = particle->GetPDGMass();
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4MuBremsstrahlungModel::Initialise(const G4ParticleDefinition* p,
const G4DataVector& cuts)
{
theGamma = G4Gamma::Gamma();
if(p) SetParticle(p);
highKinEnergy = HighEnergyLimit();
const G4ProductionCutsTable* theCoupleTable=
G4ProductionCutsTable::GetProductionCutsTable();
size_t numOfCouples = theCoupleTable->GetTableSize();
G4double fixedEnergy = 0.5*highKinEnergy;
// G4double fixedEnergy = 500000.*TeV;
for (size_t ii=0; ii<partialSumSigma.size(); ii++){
G4DataVector* a=partialSumSigma[ii];
if ( a ) delete a;
}
partialSumSigma.clear();
for (size_t i=0; i<numOfCouples; i++) {
const G4MaterialCutsCouple* couple = theCoupleTable->GetMaterialCutsCouple(i);
const G4Material* material = couple->GetMaterial();
G4DataVector* dv = ComputePartialSumSigma(material, fixedEnergy,cuts[i]);
partialSumSigma.push_back(dv);
const G4ProductionCutsTable* theCoupleTable=
G4ProductionCutsTable::GetProductionCutsTable();
if(theCoupleTable) {
G4int numOfCouples = theCoupleTable->GetTableSize();
for (size_t ii=0; ii<partialSumSigma.size(); ii++){
G4DataVector* a=partialSumSigma[ii];
if ( a ) delete a;
}
partialSumSigma.clear();
if(numOfCouples>0) {
for (G4int i=0; i<numOfCouples; i++) {
const G4MaterialCutsCouple* couple = theCoupleTable->GetMaterialCutsCouple(i);
const G4Material* material = couple->GetMaterial();
G4DataVector* dv = ComputePartialSumSigma(material, fixedEnergy,cuts[i]);
partialSumSigma.push_back(dv);
}
}
}
if(!samplingTablesAreFilled) MakeSamplingTables();
if(pParticleChange)
@@ -178,7 +199,7 @@ G4double G4MuBremsstrahlungModel::ComputeDEDXPerVolume(
G4double G4MuBremsstrahlungModel::ComputMuBremLoss(G4double Z, G4double A,
G4double tkin, G4double cut)
{
G4double totalEnergy = (G4MuonPlus::MuonPlus())->GetPDGMass() + tkin;
G4double totalEnergy = mass + tkin;
G4double ak1 = 0.05;
G4int k2=5;
G4double xgi[]={0.03377,0.16940,0.38069,0.61931,0.83060,0.96623};
@@ -218,7 +239,7 @@ G4double G4MuBremsstrahlungModel::ComputeMicroscopicCrossSection(
G4double A,
G4double cut)
{
G4double totalEnergy = (G4MuonPlus::MuonPlus())->GetPDGMass() + tkin;
G4double totalEnergy = tkin + mass;
G4double ak1 = 2.3;
G4int k2 = 4;
G4double xgi[]={0.03377,0.16940,0.38069,0.61931,0.83060,0.96623};
@@ -261,11 +282,9 @@ G4double G4MuBremsstrahlungModel::ComputeDMicroscopicCrossSection(
G4double gammaEnergy)
// differential cross section
{
G4double particleMass = (G4MuonPlus::MuonPlus())->GetPDGMass();
static const G4double sqrte=sqrt(exp(1.)) ;
static const G4double bh=202.4,bh1=446.,btf=183.,btf1=1429. ;
static const G4double rmass=particleMass/electron_mass_c2 ;
static const G4double rmass=mass/electron_mass_c2 ;
static const G4double cc=classic_electr_radius/rmass ;
static const G4double coeff= 16.*fine_structure_const*cc*cc/3. ;
@@ -273,9 +292,9 @@ G4double G4MuBremsstrahlungModel::ComputeDMicroscopicCrossSection(
if( gammaEnergy > tkin) return dxsection ;
G4double E = tkin + particleMass ;
G4double E = tkin + mass ;
G4double v = gammaEnergy/E ;
G4double delta = 0.5*particleMass*particleMass*v/(E-gammaEnergy) ;
G4double delta = 0.5*mass*mass*v/(E-gammaEnergy) ;
G4double rab0=delta*sqrte ;
G4double z13 = exp(-log(Z)/3.) ;
@@ -299,15 +318,15 @@ G4double G4MuBremsstrahlungModel::ComputeDMicroscopicCrossSection(
// nucleus contribution logarithm
G4double rab1=b*z13;
G4double fn=log(rab1/(dnstar*(electron_mass_c2+rab0*rab1))*
(particleMass+delta*(dnstar*sqrte-2.))) ;
(mass+delta*(dnstar*sqrte-2.))) ;
if(fn <0.) fn = 0. ;
// electron contribution logarithm
G4double epmax1=E/(1.+0.5*particleMass*rmass/E) ;
G4double epmax1=E/(1.+0.5*mass*rmass/E) ;
G4double fe=0.;
if(gammaEnergy<epmax1)
{
G4double rab2=b1*z13*z13 ;
fe=log(rab2*particleMass/((1.+delta*rmass/(electron_mass_c2*sqrte))*
fe=log(rab2*mass/((1.+delta*rmass/(electron_mass_c2*sqrte))*
(electron_mass_c2+rab0*rab2))) ;
if(fe<0.) fe=0. ;
}
@@ -386,8 +405,7 @@ void G4MuBremsstrahlungModel::MakeSamplingTables()
{
G4double AtomicNumber,AtomicWeight,KineticEnergy,
TotalEnergy,Maxep ;
G4double particleMass = (G4MuonPlus::MuonPlus())->GetPDGMass();
TotalEnergy,Maxep;
for (G4int iz=0; iz<nzdat; iz++)
{
@@ -397,7 +415,7 @@ void G4MuBremsstrahlungModel::MakeSamplingTables()
for (G4int it=0; it<ntdat; it++)
{
KineticEnergy = tdat[it];
TotalEnergy = KineticEnergy + particleMass;
TotalEnergy = KineticEnergy + mass;
Maxep = KineticEnergy ;
G4double CrossSection = 0.0 ;
@@ -451,23 +469,25 @@ void G4MuBremsstrahlungModel::MakeSamplingTables()
vector<G4DynamicParticle*>* G4MuBremsstrahlungModel::SampleSecondaries(
const G4MaterialCutsCouple* couple,
const G4DynamicParticle* dp,
G4double minEnergy,
G4double tmin,
G4double maxEnergy)
{
G4double kineticEnergy = dp->GetKineticEnergy();
// check against insufficient energy
G4double tmax = min(kineticEnergy, maxEnergy);
G4double tmin = min(tmax, minEnergy);
if(tmin >= tmax) return 0;
static G4double ysmall = -100. ;
static G4double ytablelow = -5. ;
static const G4double ysmall = -100. ;
static const G4double ytablelow = -5. ;
G4ParticleMomentum ParticleDirection = dp->GetMomentumDirection();
G4ParticleMomentum partDirection = dp->GetMomentumDirection();
// select randomly one element constituing the material
const G4Element* anElement = SelectRandomAtom(couple);
G4double totalEnergy = kineticEnergy + dp->GetMass();
G4double totalEnergy = kineticEnergy + mass;
G4double totalMomentum = sqrt(kineticEnergy*(kineticEnergy + 2.0*mass));
G4double dy = 5./G4float(NBIN);
@@ -533,29 +553,37 @@ vector<G4DynamicParticle*>* G4MuBremsstrahlungModel::SampleSecondaries(
x = exp(y) ;
v = cutFixed*exp(x*log(tmax/cutFixed)) ;
} while ( v <= 0.);
// create G4DynamicParticle object for the Gamma
G4double GammaEnergy = v;
G4double gEnergy = v;
// angles of the emitted gamma. ( Z - axis along the parent particle)
// Teta = electron_mass_c2/TotalEnergy for the moment .....
// sample angle
G4double gam = totalEnergy/mass;
G4double rmax = gam*min(1.0, totalEnergy/gEnergy - 1.0);
rmax *= rmax;
x = G4UniformRand()*rmax/(1.0 + rmax);
G4double Teta = electron_mass_c2/totalEnergy ;
G4double Phi = twopi * G4UniformRand() ;
G4double dirx = sin(Teta)*cos(Phi) , diry = sin(Teta)*sin(Phi) ,
dirz = cos(Teta) ;
G4double theta = sqrt(x/(1.0 - x))/gam;
G4double sint = sin(theta);
G4double phi = twopi * G4UniformRand() ;
G4double dirx = sint*cos(phi), diry = sint*sin(phi), dirz = cos(theta) ;
G4ThreeVector GammaDirection ( dirx, diry, dirz);
GammaDirection.rotateUz(ParticleDirection);
G4ThreeVector gDirection(dirx, diry, dirz);
gDirection.rotateUz(partDirection);
partDirection *= totalMomentum;
partDirection -= gEnergy*gDirection;
partDirection = partDirection.unit();
// primary change
kineticEnergy -= GammaEnergy;
kineticEnergy -= gEnergy;
fParticleChange->SetProposedKineticEnergy(kineticEnergy);
fParticleChange->SetProposedMomentumDirection(partDirection);
// save secondary
G4DynamicParticle* aGamma = new G4DynamicParticle(theGamma,GammaDirection,GammaEnergy);
G4DynamicParticle* aGamma = new G4DynamicParticle(theGamma,gDirection,gEnergy);
vector<G4DynamicParticle*>* vdp = new vector<G4DynamicParticle*>;
vdp->push_back(aGamma);
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4MuIonisation.cc,v 1.47 2005/04/08 15:18:12 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4MuIonisation.cc,v 1.51 2005/10/02 16:39:50 maire Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
// -------------------------------------------------------------------
//
@@ -31,7 +31,7 @@
// File name: G4MuIonisation
//
// Author: Laszlo Urban
//
//
// Creation date: 30.09.1997
//
// Modifications:
@@ -64,6 +64,9 @@
// 17-08-04 Utilise mu+ tables for mu- (V.Ivanchenko)
// 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivantchenko)
// 08-04-05 Major optimisation of internal interfaces (V.Ivantchenko)
// 12-08-05 SetStepLimits(0.2, 0.1*mm) (mma)
// 02-09-05 SetStepLimits(0.2, 1*mm) (V.Ivantchenko)
// 12-08-05 SetStepLimits(0.2, 0.1*mm) + integral off (V.Ivantchenko)
//
// -------------------------------------------------------------------
//
@@ -130,7 +133,8 @@ void G4MuIonisation::InitialiseEnergyLossProcess(const G4ParticleDefinition* par
em2->SetHighEnergyLimit(100.0*TeV);
AddEmModel(3, em2, flucModel);
SetStepLimits(0.2, 1.0*mm);
SetStepLimits(0.2, 1*mm);
SetIntegral(true);
ratio = electron_mass_c2/mass;
isInitialised = true;
@@ -22,7 +22,7 @@
//
//
// $Id: G4MuIonisation52.cc,v 1.4 2004/12/02 08:20:38 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
// --------------- G4MuIonisation52 physics process ------------------------------
// by Laszlo Urban, September 1997
@@ -21,7 +21,7 @@
// ********************************************************************
//
// $Id: G4MuPairProduction.cc,v 1.46 2005/04/08 15:18:12 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
// -------------------------------------------------------------------
//
@@ -22,7 +22,7 @@
//
//
// $Id: G4MuPairProduction52.cc,v 1.4 2004/12/02 08:20:38 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//--------------- G4MuPairProduction52 physics process ---------------------------
// by Laszlo Urban, May 1998
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4MuPairProductionModel.cc,v 1.25 2005/04/12 18:12:33 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4MuPairProductionModel.cc,v 1.28 2005/10/23 16:47:23 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
// -------------------------------------------------------------------
//
@@ -50,6 +50,8 @@
// material (V.Ivanchenko)
// 01-11-04 Fix bug in expression inside ComputeDMicroscopicCrossSection (R.Kokoulin)
// 08-04-05 Major optimisation of internal interfaces (V.Ivantchenko)
// 03-08-05 Add SetParticle method (V.Ivantchenko)
// 23-10-05 Add protection in sampling of e+e- pair energy needed for low cuts (V.Ivantchenko)
//
// Class Description:
@@ -86,7 +88,7 @@ G4double G4MuPairProductionModel::wgi[]={ 0.0506,0.1112,0.1569,0.1813,0.1813,0.1
using namespace std;
G4MuPairProductionModel::G4MuPairProductionModel(const G4ParticleDefinition*,
G4MuPairProductionModel::G4MuPairProductionModel(const G4ParticleDefinition* p,
const G4String& nam)
: G4VEmModel(nam),
minPairEnergy(4.*electron_mass_c2),
@@ -94,9 +96,8 @@ G4MuPairProductionModel::G4MuPairProductionModel(const G4ParticleDefinition*,
factorForCross(4.*fine_structure_const*fine_structure_const
*classic_electr_radius*classic_electr_radius/(3.*pi)),
sqrte(sqrt(exp(1.))),
particleMass(G4MuonPlus::MuonPlus()->GetPDGMass()),
currentZ(0),
particle(G4MuonPlus::MuonPlus()),
particle(0),
nzdat(5),
ntdat(8),
nbiny(1000),
@@ -107,6 +108,11 @@ G4MuPairProductionModel::G4MuPairProductionModel(const G4ParticleDefinition*,
samplingTablesAreFilled(false)
{
SetLowEnergyLimit(minPairEnergy);
theElectron = G4Electron::Electron();
thePositron = G4Positron::Positron();
if(p) SetParticle(p);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -122,16 +128,24 @@ G4double G4MuPairProductionModel::MinEnergyCut(const G4ParticleDefinition*,
return minPairEnergy;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4MuPairProductionModel::SetParticle(const G4ParticleDefinition* p)
{
if(!particle) {
particle = p;
particleMass = particle->GetPDGMass();
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4MuPairProductionModel::Initialise(const G4ParticleDefinition*,
void G4MuPairProductionModel::Initialise(const G4ParticleDefinition* p,
const G4DataVector&)
{
if(p) SetParticle(p);
if (!samplingTablesAreFilled) MakeSamplingTables();
theElectron = G4Electron::Electron();
thePositron = G4Positron::Positron();
if(pParticleChange)
fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange);
else
@@ -435,7 +449,7 @@ void G4MuPairProductionModel::MakeSamplingTables()
vector<G4DynamicParticle*>* G4MuPairProductionModel::SampleSecondaries(
const G4MaterialCutsCouple* couple,
const G4DynamicParticle* aDynamicParticle,
G4double cut,
G4double tmin,
G4double tmax)
{
G4double kineticEnergy = aDynamicParticle->GetKineticEnergy();
@@ -448,23 +462,28 @@ vector<G4DynamicParticle*>* G4MuPairProductionModel::SampleSecondaries(
G4double dt = log(kineticEnergy/tdat[it-1])/log(tdat[it]/tdat[it-1]);
// select randomly one element constituing the material
G4int iymin = 0;
G4int iymax = nbiny-1;
const G4Element* anElement = SelectRandomAtom(kineticEnergy, dt, it, couple);
SetCurrentElement(anElement->GetZ());
G4double maxPairEnergy = MaxSecondaryEnergy(particle,kineticEnergy);
G4double maxEnergy = min(tmax, maxPairEnergy);
G4double minEnergy = min(maxEnergy, cut);
G4double maxEnergy = std::min(tmax, maxPairEnergy);
G4double minEnergy = std::max(tmin, minPairEnergy);
if(minEnergy >= maxEnergy) return 0;
//G4cout << "emin= " << minEnergy << " emax= " << maxEnergy
// << " minPair= " << minPairEnergy << " maxpair= " << maxPairEnergy
// << " ymin= " << ymin << " dy= " << dy << G4endl;
G4int iymin = 0;
G4int iymax = nbiny-1;
if( minEnergy > minPairEnergy)
{
G4double xc = log(minEnergy/minPairEnergy)/log(maxPairEnergy/minPairEnergy);
iymin = (G4int)((log(xc) - ymin)/dy);
if(iymin >= nbiny) iymin = nbiny-1;
else if(iymin < 0) iymin = 0;
xc = log(maxEnergy/minPairEnergy)/log(maxPairEnergy/minPairEnergy);
iymax = (G4int)((log(xc) - ymin)/dy) + 1;
if(iymax >= nbiny) iymax = nbiny-1;
else if(iymax < 0) iymax = 0;
}
// sample e-e+ energy, pair energy first
@@ -488,6 +507,7 @@ vector<G4DynamicParticle*>* G4MuPairProductionModel::SampleSecondaries(
p2 = InterpolatedIntegralCrossSection(dt, dz, iz, it, iy, currentZ);
if(p <= p2) break;
}
// G4cout << "iy= " << iy << " iymin= " << iymin << " iymax= " << iymax << " Z= " << currentZ << G4endl;
G4double y = ya[iy-1] + dy*(p - p1)/(p2 - p1);
G4double PairEnergy = minPairEnergy*exp(exp(y)*log(maxPairEnergy/minPairEnergy));
@@ -495,7 +515,7 @@ vector<G4DynamicParticle*>* G4MuPairProductionModel::SampleSecondaries(
if(PairEnergy > maxEnergy) PairEnergy = maxEnergy;
// sample r=(E+-E-)/PairEnergy ( uniformly .....)
G4double rmax =
G4double rmax =
(1.-6.*particleMass*particleMass/(totalEnergy*(totalEnergy-PairEnergy)))
*sqrt(1.-minPairEnergy/PairEnergy);
G4double r = rmax * (-1.+2.*G4UniformRand()) ;
@@ -506,36 +526,44 @@ vector<G4DynamicParticle*>* G4MuPairProductionModel::SampleSecondaries(
// angles of the emitted particles ( Z - axis along the parent particle)
// (mean theta for the moment)
G4double Teta = electron_mass_c2/totalEnergy ;
G4double Phi = twopi * G4UniformRand() ;
G4double dirx = sin(Teta)*cos(Phi);
G4double diry = sin(Teta)*sin(Phi);
G4double dirz = cos(Teta) ;
//
// scattered electron (positron) angles. ( Z - axis along the parent photon)
//
// universal distribution suggested by L. Urban
// (Geant3 manual (1993) Phys211),
// derived from Tsai distribution (Rev Mod Phys 49,421(1977))
// G4cout << "Ee= " << ElectronEnergy << " Ep= " << PositronEnergy << G4endl;
G4double u;
const G4double a1 = 0.625 , a2 = 3.*a1 , d = 27. ;
//G4double finalPx,finalPy,finalPz ;
G4double ElectKineEnergy = ElectronEnergy - electron_mass_c2 ;
if (9./(9.+d) >G4UniformRand()) u= - log(G4UniformRand()*G4UniformRand())/a1;
else u= - log(G4UniformRand()*G4UniformRand())/a2;
G4ThreeVector ElectDirection ( dirx, diry, dirz );
G4double TetEl = u*electron_mass_c2/ElectronEnergy;
G4double TetPo = u*electron_mass_c2/PositronEnergy;
G4double Phi = twopi * G4UniformRand();
G4double dxEl= sin(TetEl)*cos(Phi),dyEl= sin(TetEl)*sin(Phi),dzEl=cos(TetEl);
G4double dxPo=-sin(TetPo)*cos(Phi),dyPo=-sin(TetPo)*sin(Phi),dzPo=cos(TetPo);
G4ThreeVector ElectDirection (dxEl, dyEl, dzEl);
ElectDirection.rotateUz(ParticleDirection);
// create G4DynamicParticle object for the particle1
G4DynamicParticle* aParticle1= new G4DynamicParticle(theElectron,
ElectDirection,
ElectKineEnergy);
ElectronEnergy - electron_mass_c2);
G4double PositKineEnergy = PositronEnergy - electron_mass_c2 ;
G4ThreeVector PositDirection ( -dirx, -diry, dirz );
G4ThreeVector PositDirection (dxPo, dyPo, dzPo);
PositDirection.rotateUz(ParticleDirection);
// create G4DynamicParticle object for the particle2
G4DynamicParticle* aParticle2= new G4DynamicParticle(thePositron,
PositDirection,
PositKineEnergy);
PositronEnergy - electron_mass_c2);
// primary change
kineticEnergy -= (ElectKineEnergy + PositKineEnergy + 2.0*electron_mass_c2);
kineticEnergy -= (ElectronEnergy + PositronEnergy);
fParticleChange->SetProposedKineticEnergy(kineticEnergy);
vector<G4DynamicParticle*>* vdp = new vector<G4DynamicParticle*>;
@@ -22,7 +22,7 @@
//
//
// $Id: G4VMuEnergyLoss.cc,v 1.31 2004/12/02 08:20:38 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
// --------------------------------------------------------------
// GEANT 4 class implementation file
//