Import Geant4 9.2.0 source tree
This commit is contained in:
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EnergyLossForExtrapolator.cc,v 1.13 2007/07/28 13:44:25 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4EnergyLossForExtrapolator.cc,v 1.18 2008/11/13 14:14:07 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
@@ -66,6 +66,8 @@
|
||||
#include "G4MuPairProductionModel.hh"
|
||||
#include "G4MuBremsstrahlungModel.hh"
|
||||
#include "G4ProductionCuts.hh"
|
||||
#include "G4LossTableManager.hh"
|
||||
#include "G4WentzelVIModel.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -87,6 +89,7 @@ G4EnergyLossForExtrapolator:: ~G4EnergyLossForExtrapolator()
|
||||
delete invRangeElectron;
|
||||
delete invRangePositron;
|
||||
delete invRangeProton;
|
||||
delete mscElectron;
|
||||
delete cuts;
|
||||
}
|
||||
|
||||
@@ -99,8 +102,8 @@ G4double G4EnergyLossForExtrapolator::EnergyAfterStep(G4double kinEnergy,
|
||||
{
|
||||
if(!isInitialised) Initialisation();
|
||||
G4double kinEnergyFinal = kinEnergy;
|
||||
if(mat && part) {
|
||||
G4double step = ComputeTrueStep(mat,part,kinEnergy,stepLength);
|
||||
if(SetupKinematics(part, mat, kinEnergy)) {
|
||||
G4double step = TrueStepLength(kinEnergy,stepLength,mat,part);
|
||||
G4double r = ComputeRange(kinEnergy,part);
|
||||
if(r <= step) {
|
||||
kinEnergyFinal = 0.0;
|
||||
@@ -124,8 +127,8 @@ G4double G4EnergyLossForExtrapolator::EnergyBeforeStep(G4double kinEnergy,
|
||||
if(!isInitialised) Initialisation();
|
||||
G4double kinEnergyFinal = kinEnergy;
|
||||
|
||||
if(mat && part) {
|
||||
G4double step = ComputeTrueStep(mat,part,kinEnergy,stepLength);
|
||||
if(SetupKinematics(part, mat, kinEnergy)) {
|
||||
G4double step = TrueStepLength(kinEnergy,stepLength,mat,part);
|
||||
G4double r = ComputeRange(kinEnergy,part);
|
||||
|
||||
if(step < linLossLimit*r) {
|
||||
@@ -140,10 +143,34 @@ G4double G4EnergyLossForExtrapolator::EnergyBeforeStep(G4double kinEnergy,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4EnergyLossForExtrapolator::ComputeTrueStep(const G4Material* mat,
|
||||
const G4ParticleDefinition* part,
|
||||
G4double kinEnergy, G4double stepLength)
|
||||
G4double G4EnergyLossForExtrapolator::TrueStepLength(G4double kinEnergy,
|
||||
G4double stepLength,
|
||||
const G4Material* mat,
|
||||
const G4ParticleDefinition* part)
|
||||
{
|
||||
G4double res = stepLength;
|
||||
if(!isInitialised) Initialisation();
|
||||
if(SetupKinematics(part, mat, kinEnergy)) {
|
||||
if(part == electron || part == positron) {
|
||||
G4double x = stepLength*ComputeValue(kinEnergy, mscElectron);
|
||||
if(x < 0.2) res *= (1.0 + 0.5*x + x*x/3.0);
|
||||
else if(x < 0.9999) res = -std::log(1.0 - x)*stepLength/x;
|
||||
else res = ComputeRange(kinEnergy,part);
|
||||
|
||||
} else {
|
||||
res = ComputeTrueStep(mat,part,kinEnergy,stepLength);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4bool G4EnergyLossForExtrapolator::SetupKinematics(const G4ParticleDefinition* part,
|
||||
const G4Material* mat,
|
||||
G4double kinEnergy)
|
||||
{
|
||||
if(!part || !mat || kinEnergy < keV) return false;
|
||||
if(!isInitialised) Initialisation();
|
||||
G4bool flag = false;
|
||||
if(part != currentParticle) {
|
||||
@@ -181,8 +208,7 @@ G4double G4EnergyLossForExtrapolator::ComputeTrueStep(const G4Material* mat,
|
||||
}
|
||||
if(tmax > maxEnergyTransfer) tmax = maxEnergyTransfer;
|
||||
}
|
||||
G4double theta = ComputeScatteringAngle(stepLength);
|
||||
return stepLength*std::sqrt(1.0 + 0.625*theta*theta);
|
||||
return true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -230,6 +256,7 @@ void G4EnergyLossForExtrapolator::Initialisation()
|
||||
invRangePositron = PrepareTable();
|
||||
invRangeMuon = PrepareTable();
|
||||
invRangeProton = PrepareTable();
|
||||
mscElectron = PrepareTable();
|
||||
|
||||
G4LossTableBuilder builder;
|
||||
|
||||
@@ -261,6 +288,7 @@ void G4EnergyLossForExtrapolator::Initialisation()
|
||||
builder.BuildRangeTable(dedxProton, rangeProton);
|
||||
builder.BuildInverseRangeTable(rangeProton, invRangeProton);
|
||||
|
||||
ComputeTrasportXS(electron, mscElectron);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -272,6 +300,7 @@ G4PhysicsTable* G4EnergyLossForExtrapolator::PrepareTable()
|
||||
for(G4int i=0; i<nmat; i++) {
|
||||
|
||||
G4PhysicsVector* v = new G4PhysicsLogVector(emin, emax, nbins);
|
||||
v->SetSpline(G4LossTableManager::Instance()->SplineFlag());
|
||||
table->push_back(v);
|
||||
}
|
||||
return table;
|
||||
@@ -487,3 +516,44 @@ void G4EnergyLossForExtrapolator::ComputeProtonDEDX(const G4ParticleDefinition*
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4EnergyLossForExtrapolator::ComputeTrasportXS(const G4ParticleDefinition* part,
|
||||
G4PhysicsTable* table)
|
||||
{
|
||||
G4DataVector v;
|
||||
G4WentzelVIModel* msc = new G4WentzelVIModel();
|
||||
msc->SetPolarAngleLimit(CLHEP::pi);
|
||||
msc->Initialise(part, v);
|
||||
|
||||
mass = part->GetPDGMass();
|
||||
charge2 = 1.0;
|
||||
currentParticle = part;
|
||||
|
||||
const G4MaterialTable* mtable = G4Material::GetMaterialTable();
|
||||
|
||||
if(0<verbose) {
|
||||
G4cout << "G4EnergyLossForExtrapolator::ComputeProtonDEDX for " << part->GetParticleName()
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
for(G4int i=0; i<nmat; i++) {
|
||||
|
||||
const G4Material* mat = (*mtable)[i];
|
||||
if(1<verbose)
|
||||
G4cout << "i= " << i << " mat= " << mat->GetName() << G4endl;
|
||||
G4PhysicsVector* aVector = (*table)[i];
|
||||
for(G4int j=0; j<nbins; j++) {
|
||||
|
||||
G4double e = aVector->GetLowEdgeEnergy(j);
|
||||
G4double xs = msc->CrossSectionPerVolume(mat,part,e);
|
||||
aVector->PutValue(j,xs);
|
||||
if(1<verbose) {
|
||||
G4cout << "j= " << j << " e(MeV)= " << e/MeV
|
||||
<< " xs(1/mm)= " << xs*mm << G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
delete msc;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4MuBetheBlochModel.cc,v 1.23 2007/05/22 17:35:58 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4MuBetheBlochModel.cc,v 1.24 2008/03/25 12:31:04 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -274,7 +274,7 @@ G4double G4MuBetheBlochModel::ComputeDEDXPerVolume(const G4Material* material,
|
||||
dedx *= twopi_mc2_rcl2*eDensity/beta2;
|
||||
|
||||
//High order corrections
|
||||
dedx += corr->HighOrderCorrections(p,material,kineticEnergy);
|
||||
dedx += corr->HighOrderCorrections(p,material,kineticEnergy,cutEnergy);
|
||||
|
||||
return dedx;
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4MuBremsstrahlung.cc,v 1.38 2007/05/22 17:35:58 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4MuBremsstrahlung.cc,v 1.41 2008/10/16 13:37:04 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -81,7 +81,9 @@ G4MuBremsstrahlung::G4MuBremsstrahlung(const G4String& name)
|
||||
theBaseParticle(0),
|
||||
lowestKinEnergy(1.*GeV),
|
||||
isInitialised(false)
|
||||
{}
|
||||
{
|
||||
SetProcessSubType(fBremsstrahlung);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -90,8 +92,9 @@ G4MuBremsstrahlung::~G4MuBremsstrahlung()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4MuBremsstrahlung::InitialiseEnergyLossProcess(const G4ParticleDefinition* part,
|
||||
const G4ParticleDefinition*)
|
||||
void G4MuBremsstrahlung::InitialiseEnergyLossProcess(
|
||||
const G4ParticleDefinition* part,
|
||||
const G4ParticleDefinition*)
|
||||
{
|
||||
if(!isInitialised) {
|
||||
|
||||
@@ -104,9 +107,9 @@ void G4MuBremsstrahlung::InitialiseEnergyLossProcess(const G4ParticleDefinition*
|
||||
G4MuBremsstrahlungModel* em = new G4MuBremsstrahlungModel();
|
||||
em->SetLowestKineticEnergy(lowestKinEnergy);
|
||||
|
||||
G4VEmFluctuationModel* fm = new G4UniversalFluctuation();
|
||||
em->SetLowEnergyLimit(0.1*keV);
|
||||
em->SetHighEnergyLimit(100.0*TeV);
|
||||
G4VEmFluctuationModel* fm = 0;
|
||||
em->SetLowEnergyLimit(MinKinEnergy());
|
||||
em->SetHighEnergyLimit(MaxKinEnergy());
|
||||
AddEmModel(1, em, fm);
|
||||
}
|
||||
}
|
||||
@@ -114,10 +117,7 @@ void G4MuBremsstrahlung::InitialiseEnergyLossProcess(const G4ParticleDefinition*
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4MuBremsstrahlung::PrintInfo()
|
||||
{
|
||||
G4cout << " Parametrised model "
|
||||
<< G4endl;
|
||||
}
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4MuBremsstrahlungModel.cc,v 1.24 2007/11/08 11:48:28 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4MuBremsstrahlungModel.cc,v 1.32 2008/07/22 16:11:34 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -45,11 +45,12 @@
|
||||
// 27-01-03 Make models region aware (V.Ivanchenko)
|
||||
// 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)
|
||||
// 08-04-05 Major optimisation of internal interfaces (V.Ivanchenko)
|
||||
// 03-08-05 Angular correlations according to PRM (V.Ivanchenko)
|
||||
// 13-02-06 add ComputeCrossSectionPerAtom (mma)
|
||||
// 21-03-06 Fix problem of initialisation in case when cuts are not defined (VI)
|
||||
// 07-11-07 Improve sampling of final state (A.Bogdanov)
|
||||
// 28-02-08 Use precomputed Z^1/3 and Log(A) (V.Ivanchenko)
|
||||
//
|
||||
|
||||
//
|
||||
@@ -73,14 +74,6 @@
|
||||
#include "G4ParticleChangeForLoss.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
// static members
|
||||
//
|
||||
G4double G4MuBremsstrahlungModel::zdat[]={1., 4., 13., 29., 92.};
|
||||
G4double G4MuBremsstrahlungModel::adat[]={1.01, 9.01, 26.98, 63.55, 238.03};
|
||||
G4double G4MuBremsstrahlungModel::tdat[]={1.e3, 1.e4, 1.e5, 1.e6, 1.e7, 1.e8,
|
||||
1.e9, 1.e10};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
using namespace std;
|
||||
@@ -89,16 +82,17 @@ G4MuBremsstrahlungModel::G4MuBremsstrahlungModel(const G4ParticleDefinition* p,
|
||||
const G4String& nam)
|
||||
: G4VEmModel(nam),
|
||||
particle(0),
|
||||
sqrte(sqrt(exp(1.))),
|
||||
bh(202.4),
|
||||
bh1(446.),
|
||||
btf(183.),
|
||||
btf1(1429.),
|
||||
fParticleChange(0),
|
||||
lowestKinEnergy(1.0*GeV),
|
||||
minThreshold(1.0*keV),
|
||||
nzdat(5),
|
||||
ntdat(8),
|
||||
NBIN(1000),
|
||||
cutFixed(0.98*keV),
|
||||
ignoreCut(false),
|
||||
samplingTablesAreFilled(false)
|
||||
minThreshold(1.0*keV)
|
||||
{
|
||||
theGamma = G4Gamma::Gamma();
|
||||
nist = G4NistManager::Instance();
|
||||
if(p) SetParticle(p);
|
||||
}
|
||||
|
||||
@@ -116,24 +110,6 @@ G4MuBremsstrahlungModel::~G4MuBremsstrahlungModel()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4MuBremsstrahlungModel::MinEnergyCut(const G4ParticleDefinition*,
|
||||
const G4MaterialCutsCouple*)
|
||||
{
|
||||
return minThreshold;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -141,13 +117,15 @@ void G4MuBremsstrahlungModel::Initialise(const G4ParticleDefinition* p,
|
||||
|
||||
highKinEnergy = HighEnergyLimit();
|
||||
|
||||
// partial cross section is computed for fixed energy
|
||||
G4double fixedEnergy = 0.5*highKinEnergy;
|
||||
|
||||
const G4ProductionCutsTable* theCoupleTable=
|
||||
G4ProductionCutsTable::GetProductionCutsTable();
|
||||
if(theCoupleTable) {
|
||||
G4int numOfCouples = theCoupleTable->GetTableSize();
|
||||
|
||||
|
||||
// clear old data
|
||||
G4int nn = partialSumSigma.size();
|
||||
G4int nc = cuts.size();
|
||||
if(nn > 0) {
|
||||
@@ -157,11 +135,14 @@ void G4MuBremsstrahlungModel::Initialise(const G4ParticleDefinition* p,
|
||||
}
|
||||
partialSumSigma.clear();
|
||||
}
|
||||
// fill new data
|
||||
if (numOfCouples>0) {
|
||||
for (G4int i=0; i<numOfCouples; i++) {
|
||||
G4double cute = DBL_MAX;
|
||||
|
||||
// protection for usage with extrapolator
|
||||
if(i < nc) cute = cuts[i];
|
||||
if(cute < cutFixed || ignoreCut) cute = cutFixed;
|
||||
|
||||
const G4MaterialCutsCouple* couple =
|
||||
theCoupleTable->GetMaterialCutsCouple(i);
|
||||
const G4Material* material = couple->GetMaterial();
|
||||
@@ -170,12 +151,15 @@ void G4MuBremsstrahlungModel::Initialise(const G4ParticleDefinition* p,
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!samplingTablesAreFilled) MakeSamplingTables();
|
||||
if(pParticleChange)
|
||||
fParticleChange =
|
||||
reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange);
|
||||
else
|
||||
fParticleChange = new G4ParticleChangeForLoss();
|
||||
|
||||
// define pointer to G4ParticleChange
|
||||
if(!fParticleChange) {
|
||||
if(pParticleChange)
|
||||
fParticleChange =
|
||||
reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange);
|
||||
else
|
||||
fParticleChange = new G4ParticleChangeForLoss();
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -187,33 +171,32 @@ G4double G4MuBremsstrahlungModel::ComputeDEDXPerVolume(
|
||||
G4double cutEnergy)
|
||||
{
|
||||
G4double dedx = 0.0;
|
||||
if (kineticEnergy <= lowestKinEnergy || ignoreCut) return dedx;
|
||||
if (kineticEnergy <= lowestKinEnergy) return dedx;
|
||||
|
||||
G4double tmax = kineticEnergy;
|
||||
G4double cut = min(cutEnergy,tmax);
|
||||
if(cut < cutFixed) cut = cutFixed;
|
||||
G4double cut = std::min(cutEnergy,tmax);
|
||||
if(cut < minThreshold) cut = minThreshold;
|
||||
|
||||
const G4ElementVector* theElementVector = material->GetElementVector();
|
||||
const G4double* theAtomicNumDensityVector =
|
||||
material->GetAtomicNumDensityVector();
|
||||
material->GetAtomicNumDensityVector();
|
||||
|
||||
// loop for elements in the material
|
||||
for (size_t i=0; i<material->GetNumberOfElements(); i++) {
|
||||
|
||||
G4double Z = (*theElementVector)[i]->GetZ();
|
||||
G4double A = (*theElementVector)[i]->GetA()/(g/mole) ;
|
||||
|
||||
G4double loss = ComputMuBremLoss(Z, A, kineticEnergy, cut);
|
||||
G4double loss =
|
||||
ComputMuBremLoss((*theElementVector)[i]->GetZ(), kineticEnergy, cut);
|
||||
|
||||
dedx += loss*theAtomicNumDensityVector[i];
|
||||
}
|
||||
// G4cout << "BR e= " << kineticEnergy << " dedx= " << dedx << G4endl;
|
||||
if(dedx < 0.) dedx = 0.;
|
||||
return dedx;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4MuBremsstrahlungModel::ComputMuBremLoss(G4double Z, G4double A,
|
||||
G4double G4MuBremsstrahlungModel::ComputMuBremLoss(G4double Z,
|
||||
G4double tkin, G4double cut)
|
||||
{
|
||||
G4double totalEnergy = mass + tkin;
|
||||
@@ -238,7 +221,7 @@ G4double G4MuBremsstrahlungModel::ComputMuBremLoss(G4double Z, G4double A,
|
||||
for(G4int i=0; i<6; i++)
|
||||
{
|
||||
G4double ep = (aa + xgi[i]*hhh)*totalEnergy;
|
||||
loss += ep*wgi[i]*ComputeDMicroscopicCrossSection(tkin, Z, A, ep);
|
||||
loss += ep*wgi[i]*ComputeDMicroscopicCrossSection(tkin, Z, ep);
|
||||
}
|
||||
aa += hhh;
|
||||
}
|
||||
@@ -253,7 +236,6 @@ G4double G4MuBremsstrahlungModel::ComputMuBremLoss(G4double Z, G4double A,
|
||||
G4double G4MuBremsstrahlungModel::ComputeMicroscopicCrossSection(
|
||||
G4double tkin,
|
||||
G4double Z,
|
||||
G4double A,
|
||||
G4double cut)
|
||||
{
|
||||
G4double totalEnergy = tkin + mass;
|
||||
@@ -271,7 +253,7 @@ G4double G4MuBremsstrahlungModel::ComputeMicroscopicCrossSection(
|
||||
G4double aaa = log(vcut);
|
||||
G4double bbb = log(vmax);
|
||||
G4int kkk = (G4int)((bbb-aaa)/ak1)+k2 ;
|
||||
G4double hhh = (bbb-aaa)/float(kkk);
|
||||
G4double hhh = (bbb-aaa)/G4double(kkk);
|
||||
|
||||
G4double aa = aaa;
|
||||
|
||||
@@ -280,13 +262,15 @@ G4double G4MuBremsstrahlungModel::ComputeMicroscopicCrossSection(
|
||||
for(G4int i=0; i<6; i++)
|
||||
{
|
||||
G4double ep = exp(aa + xgi[i]*hhh)*totalEnergy;
|
||||
cross += ep*wgi[i]*ComputeDMicroscopicCrossSection(tkin, Z, A, ep);
|
||||
cross += ep*wgi[i]*ComputeDMicroscopicCrossSection(tkin, Z, ep);
|
||||
}
|
||||
aa += hhh;
|
||||
}
|
||||
|
||||
cross *=hhh;
|
||||
|
||||
//G4cout << "BR e= " << tkin<< " cross= " << cross/barn << G4endl;
|
||||
|
||||
return cross;
|
||||
}
|
||||
|
||||
@@ -295,16 +279,9 @@ G4double G4MuBremsstrahlungModel::ComputeMicroscopicCrossSection(
|
||||
G4double G4MuBremsstrahlungModel::ComputeDMicroscopicCrossSection(
|
||||
G4double tkin,
|
||||
G4double Z,
|
||||
G4double A,
|
||||
G4double gammaEnergy)
|
||||
// differential cross section
|
||||
{
|
||||
static const G4double sqrte=sqrt(exp(1.)) ;
|
||||
static const G4double bh=202.4,bh1=446.,btf=183.,btf1=1429. ;
|
||||
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. ;
|
||||
|
||||
G4double dxsection = 0.;
|
||||
|
||||
if( gammaEnergy > tkin) return dxsection ;
|
||||
@@ -314,22 +291,25 @@ G4double G4MuBremsstrahlungModel::ComputeDMicroscopicCrossSection(
|
||||
G4double delta = 0.5*mass*mass*v/(E-gammaEnergy) ;
|
||||
G4double rab0=delta*sqrte ;
|
||||
|
||||
G4double z13 = exp(-log(Z)/3.) ;
|
||||
G4double dn = 1.54*exp(0.27*log(A)) ;
|
||||
G4int iz = G4int(Z);
|
||||
if(iz < 1) iz = 1;
|
||||
|
||||
G4double z13 = 1.0/nist->GetZ13(iz);
|
||||
G4double dn = 1.54*nist->GetA27(iz);
|
||||
|
||||
G4double b,b1,dnstar ;
|
||||
|
||||
if(Z<1.5)
|
||||
if(1 == iz)
|
||||
{
|
||||
b=bh;
|
||||
b1=bh1;
|
||||
dnstar=dn ;
|
||||
b = bh;
|
||||
b1 = bh1;
|
||||
dnstar = dn;
|
||||
}
|
||||
else
|
||||
{
|
||||
b=btf;
|
||||
b1=btf1;
|
||||
dnstar = exp((1.-1./Z)*log(dn)) ;
|
||||
b = btf;
|
||||
b1 = btf1;
|
||||
dnstar = dn/std::pow(dn, 1./Z);
|
||||
}
|
||||
|
||||
// nucleus contribution logarithm
|
||||
@@ -358,50 +338,21 @@ G4double G4MuBremsstrahlungModel::ComputeDMicroscopicCrossSection(
|
||||
G4double G4MuBremsstrahlungModel::ComputeCrossSectionPerAtom(
|
||||
const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
G4double Z, G4double A,
|
||||
G4double Z, G4double,
|
||||
G4double cutEnergy,
|
||||
G4double)
|
||||
{
|
||||
G4double cut = min(cutEnergy, kineticEnergy);
|
||||
if(cut < cutFixed || ignoreCut) cut = cutFixed;
|
||||
G4double cross =
|
||||
ComputeMicroscopicCrossSection (kineticEnergy, Z, A/(g/mole), cut);
|
||||
return cross;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4MuBremsstrahlungModel::CrossSectionPerVolume(
|
||||
const G4Material* material,
|
||||
const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
G4double cutEnergy,
|
||||
G4double maxEnergy)
|
||||
G4double maxEnergy)
|
||||
{
|
||||
G4double cross = 0.0;
|
||||
if (cutEnergy >= maxEnergy || kineticEnergy <= lowestKinEnergy) return cross;
|
||||
|
||||
G4double tmax = min(maxEnergy, kineticEnergy);
|
||||
G4double cut = min(cutEnergy, tmax);
|
||||
if(cut < cutFixed || ignoreCut) cut = cutFixed;
|
||||
if (kineticEnergy <= lowestKinEnergy) return cross;
|
||||
G4double tmax = std::min(maxEnergy, kineticEnergy);
|
||||
G4double cut = std::min(cutEnergy, kineticEnergy);
|
||||
if(cut < minThreshold) cut = minThreshold;
|
||||
if (cut >= tmax) return cross;
|
||||
|
||||
const G4ElementVector* theElementVector = material->GetElementVector();
|
||||
const G4double* theAtomNumDensityVector =
|
||||
material->GetAtomicNumDensityVector();
|
||||
|
||||
for (size_t i=0; i<material->GetNumberOfElements(); i++) {
|
||||
|
||||
G4double Z = (*theElementVector)[i]->GetZ();
|
||||
G4double A = (*theElementVector)[i]->GetA()/(g/mole);
|
||||
|
||||
G4double cr = ComputeMicroscopicCrossSection(kineticEnergy, Z, A, cut);
|
||||
|
||||
if(tmax < kineticEnergy) {
|
||||
cr -= ComputeMicroscopicCrossSection(kineticEnergy, Z, A, tmax);
|
||||
}
|
||||
cross += theAtomNumDensityVector[i] * cr;
|
||||
cross = ComputeMicroscopicCrossSection (kineticEnergy, Z, cut);
|
||||
if(tmax < kineticEnergy) {
|
||||
cross -= ComputeMicroscopicCrossSection(kineticEnergy, Z, tmax);
|
||||
}
|
||||
|
||||
return cross;
|
||||
}
|
||||
|
||||
@@ -409,27 +360,26 @@ G4double G4MuBremsstrahlungModel::CrossSectionPerVolume(
|
||||
|
||||
G4DataVector* G4MuBremsstrahlungModel::ComputePartialSumSigma(
|
||||
const G4Material* material,
|
||||
G4double kineticEnergy,
|
||||
G4double cut)
|
||||
G4double kineticEnergy,
|
||||
G4double cut)
|
||||
|
||||
// Build the table of cross section per element. The table is built for MATERIAL
|
||||
// This table is used by DoIt to select randomly an element in the material.
|
||||
// Build the table of cross section per element.
|
||||
// The table is built for material
|
||||
// This table is used to select randomly an element in the material.
|
||||
{
|
||||
G4int nElements = material->GetNumberOfElements();
|
||||
const G4ElementVector* theElementVector = material->GetElementVector();
|
||||
const G4double* theAtomNumDensityVector =
|
||||
material->GetAtomicNumDensityVector();
|
||||
material->GetAtomicNumDensityVector();
|
||||
|
||||
G4DataVector* dv = new G4DataVector();
|
||||
|
||||
G4double cross = 0.0;
|
||||
|
||||
for (G4int i=0; i<nElements; i++ ) {
|
||||
|
||||
G4double Z = (*theElementVector)[i]->GetZ();
|
||||
G4double A = (*theElementVector)[i]->GetA()/(g/mole) ;
|
||||
cross += theAtomNumDensityVector[i]
|
||||
* ComputeMicroscopicCrossSection(kineticEnergy, Z, A, cut);
|
||||
* ComputeMicroscopicCrossSection(kineticEnergy,
|
||||
(*theElementVector)[i]->GetZ(), cut);
|
||||
dv->push_back(cross);
|
||||
}
|
||||
return dv;
|
||||
@@ -437,126 +387,52 @@ G4DataVector* G4MuBremsstrahlungModel::ComputePartialSumSigma(
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4MuBremsstrahlungModel::MakeSamplingTables()
|
||||
{
|
||||
|
||||
G4double AtomicNumber,AtomicWeight,KineticEnergy,
|
||||
TotalEnergy,Maxep;
|
||||
|
||||
for (G4int iz=0; iz<nzdat; iz++)
|
||||
{
|
||||
AtomicNumber = zdat[iz];
|
||||
AtomicWeight = adat[iz]*g/mole ;
|
||||
|
||||
for (G4int it=0; it<ntdat; it++)
|
||||
{
|
||||
KineticEnergy = tdat[it];
|
||||
TotalEnergy = KineticEnergy + mass;
|
||||
Maxep = KineticEnergy ;
|
||||
|
||||
G4double CrossSection = 0.0 ;
|
||||
|
||||
// calculate the differential cross section
|
||||
// numerical integration in
|
||||
// log ...............
|
||||
G4double c = log(Maxep/cutFixed) ;
|
||||
G4double ymin = -5. ;
|
||||
G4double ymax = 0. ;
|
||||
G4double dy = (ymax-ymin)/NBIN ;
|
||||
|
||||
G4double y = ymin - 0.5*dy ;
|
||||
G4double yy = ymin - dy ;
|
||||
G4double x = exp(y);
|
||||
G4double fac = exp(dy);
|
||||
G4double dx = exp(yy)*(fac - 1.0);
|
||||
|
||||
for (G4int i=0 ; i<NBIN; i++)
|
||||
{
|
||||
y += dy ;
|
||||
x *= fac;
|
||||
dx*= fac;
|
||||
G4double ep = cutFixed*exp(c*x) ;
|
||||
|
||||
CrossSection += ep*dx*ComputeDMicroscopicCrossSection(
|
||||
KineticEnergy,AtomicNumber,
|
||||
AtomicWeight,ep) ;
|
||||
ya[i]=y ;
|
||||
proba[iz][it][i] = CrossSection ;
|
||||
|
||||
}
|
||||
|
||||
proba[iz][it][NBIN] = CrossSection ;
|
||||
ya[NBIN] = 0. ; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
if(CrossSection > 0.)
|
||||
{
|
||||
for(G4int ib=0; ib<=NBIN; ib++)
|
||||
{
|
||||
proba[iz][it][ib] /= CrossSection ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
samplingTablesAreFilled = true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4MuBremsstrahlungModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
|
||||
const G4MaterialCutsCouple* couple,
|
||||
const G4DynamicParticle* dp,
|
||||
G4double minEnergy,
|
||||
G4double maxEnergy)
|
||||
void G4MuBremsstrahlungModel::SampleSecondaries(
|
||||
std::vector<G4DynamicParticle*>* vdp,
|
||||
const G4MaterialCutsCouple* couple,
|
||||
const G4DynamicParticle* dp,
|
||||
G4double minEnergy,
|
||||
G4double maxEnergy)
|
||||
{
|
||||
G4double kineticEnergy = dp->GetKineticEnergy();
|
||||
// check against insufficient energy
|
||||
G4double tmax = min(kineticEnergy, maxEnergy);
|
||||
G4double tmin = min(kineticEnergy, minEnergy);
|
||||
if(tmin < cutFixed || ignoreCut) tmin = cutFixed;
|
||||
G4double tmax = std::min(kineticEnergy, maxEnergy);
|
||||
G4double tmin = std::min(kineticEnergy, minEnergy);
|
||||
if(tmin < minThreshold) tmin = minThreshold;
|
||||
if(tmin >= tmax) return;
|
||||
|
||||
// ===== the begining of a new code ======
|
||||
// ===== sampling of energy transfer ======
|
||||
|
||||
G4ParticleMomentum partDirection = dp->GetMomentumDirection();
|
||||
|
||||
// select randomly one element constituing the material
|
||||
const G4Element* anElement = SelectRandomAtom(couple);
|
||||
G4double Z = anElement->GetZ();
|
||||
|
||||
G4double totalEnergy = kineticEnergy + mass;
|
||||
G4double totalMomentum = sqrt(kineticEnergy*(kineticEnergy + 2.0*mass));
|
||||
|
||||
G4double AtomicNumber = anElement->GetZ();
|
||||
G4double AtomicWeight = anElement->GetA()/(g/mole);
|
||||
|
||||
G4double func1 = tmin*ComputeDMicroscopicCrossSection(
|
||||
kineticEnergy,AtomicNumber,
|
||||
AtomicWeight,tmin);
|
||||
G4double func1 = tmin*
|
||||
ComputeDMicroscopicCrossSection(kineticEnergy,Z,tmin);
|
||||
|
||||
G4double lnepksi, epksi;
|
||||
G4double func2;
|
||||
G4double ksi2;
|
||||
|
||||
do {
|
||||
lnepksi = log(tmin) + G4UniformRand()*log(kineticEnergy/tmin);
|
||||
epksi = exp(lnepksi);
|
||||
func2 = epksi*ComputeDMicroscopicCrossSection(
|
||||
kineticEnergy,AtomicNumber,
|
||||
AtomicWeight,epksi);
|
||||
ksi2 = G4UniformRand();
|
||||
func2 = epksi*ComputeDMicroscopicCrossSection(kineticEnergy,Z,epksi);
|
||||
|
||||
} while(func2/func1 < ksi2);
|
||||
} while(func2 < func1*G4UniformRand());
|
||||
|
||||
// ===== the end of a new code =====
|
||||
|
||||
// create G4DynamicParticle object for the Gamma
|
||||
G4double gEnergy = epksi;
|
||||
|
||||
// sample angle
|
||||
// ===== sample angle =====
|
||||
|
||||
G4double gam = totalEnergy/mass;
|
||||
G4double rmax = gam*min(1.0, totalEnergy/gEnergy - 1.0);
|
||||
rmax *= rmax;
|
||||
G4double x = G4UniformRand()*rmax/(1.0 + rmax);
|
||||
G4double rmax = gam*std::min(1.0, totalEnergy/gEnergy - 1.0);
|
||||
G4double rmax2= rmax*rmax;
|
||||
G4double x = G4UniformRand()*rmax2/(1.0 + rmax2);
|
||||
|
||||
G4double theta = sqrt(x/(1.0 - x))/gam;
|
||||
G4double sint = sin(theta);
|
||||
@@ -576,7 +452,8 @@ void G4MuBremsstrahlungModel::SampleSecondaries(std::vector<G4DynamicParticle*>*
|
||||
fParticleChange->SetProposedMomentumDirection(partDirection);
|
||||
|
||||
// save secondary
|
||||
G4DynamicParticle* aGamma = new G4DynamicParticle(theGamma,gDirection,gEnergy);
|
||||
G4DynamicParticle* aGamma =
|
||||
new G4DynamicParticle(theGamma,gDirection,gEnergy);
|
||||
vdp->push_back(aGamma);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4MuIonisation.cc,v 1.54 2007/05/22 17:35:58 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4MuIonisation.cc,v 1.57 2008/10/27 10:55:07 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -98,9 +98,10 @@ G4MuIonisation::G4MuIonisation(const G4String& name)
|
||||
theBaseParticle(0),
|
||||
isInitialised(false)
|
||||
{
|
||||
SetStepFunction(0.2, 1*mm);
|
||||
SetIntegral(true);
|
||||
SetVerboseLevel(1);
|
||||
// SetStepFunction(0.2, 1*mm);
|
||||
//SetIntegral(true);
|
||||
//SetVerboseLevel(1);
|
||||
SetProcessSubType(fIonisation);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -124,7 +125,7 @@ void G4MuIonisation::InitialiseEnergyLossProcess(const G4ParticleDefinition* par
|
||||
flucModel = new G4UniversalFluctuation();
|
||||
|
||||
G4VEmModel* em = new G4BraggModel();
|
||||
em->SetLowEnergyLimit(0.1*keV);
|
||||
em->SetLowEnergyLimit(MinKinEnergy());
|
||||
em->SetHighEnergyLimit(0.2*MeV);
|
||||
AddEmModel(1, em, flucModel);
|
||||
G4VEmModel* em1 = new G4BetheBlochModel();
|
||||
@@ -133,7 +134,7 @@ void G4MuIonisation::InitialiseEnergyLossProcess(const G4ParticleDefinition* par
|
||||
AddEmModel(2, em1, flucModel);
|
||||
G4VEmModel* em2 = new G4MuBetheBlochModel();
|
||||
em2->SetLowEnergyLimit(1.0*GeV);
|
||||
em2->SetHighEnergyLimit(100.0*TeV);
|
||||
em2->SetHighEnergyLimit(MaxKinEnergy());
|
||||
AddEmModel(3, em2, flucModel);
|
||||
|
||||
ratio = electron_mass_c2/mass;
|
||||
@@ -144,12 +145,7 @@ void G4MuIonisation::InitialiseEnergyLossProcess(const G4ParticleDefinition* par
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4MuIonisation::PrintInfo()
|
||||
{
|
||||
G4cout << " Bether-Bloch model for E > 0.2 MeV, "
|
||||
<< "parametrisation of Bragg peak below, "
|
||||
<< G4endl;
|
||||
G4cout << " radiative corrections for E > 1 GeV" << G4endl;
|
||||
}
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -1,571 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4MuMscModel.cc,v 1.6 2007/11/11 17:40:48 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// GEANT4 Class file
|
||||
//
|
||||
//
|
||||
// File name: G4MuMscModel
|
||||
//
|
||||
// Author: Laszlo Mu
|
||||
//
|
||||
// Creation date: 03.03.2001
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
// 27-03-03 Move model part from G4MultipleScattering80 (V.Ivanchenko)
|
||||
//
|
||||
|
||||
// Class Description:
|
||||
//
|
||||
// Implementation of the model of multiple scattering based on
|
||||
// H.W.Lewis Phys Rev 78 (1950) 526 and others
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4MuMscModel.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4Electron.hh"
|
||||
#include "G4LossTableManager.hh"
|
||||
#include "G4ParticleChangeForMSC.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
#include "G4SafetyHelper.hh"
|
||||
#include "G4eCoulombScatteringModel.hh"
|
||||
#include "G4PhysicsTableHelper.hh"
|
||||
#include "G4ElementVector.hh"
|
||||
#include "G4ProductionCutsTable.hh"
|
||||
#include "G4PhysicsLogVector.hh"
|
||||
//#include "G4Poisson.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
using namespace std;
|
||||
|
||||
G4MuMscModel::G4MuMscModel(G4double frange,
|
||||
G4double thetaMax,
|
||||
G4double tMax,
|
||||
const G4String& nam)
|
||||
: G4eCoulombScatteringModel(0.0,thetaMax,false,tMax,nam),
|
||||
theLambdaTable(0),
|
||||
theLambda2Table(0),
|
||||
dtrl(0.05),
|
||||
facrange(frange),
|
||||
thetaLimit(thetaMax),
|
||||
numlimit(0.2),
|
||||
lowBinEnergy(keV),
|
||||
highBinEnergy(PeV),
|
||||
nbins(60),
|
||||
nwarnings(0),
|
||||
nwarnlimit(50),
|
||||
currentCouple(0),
|
||||
isInitialized(false),
|
||||
buildTables(true),
|
||||
newrun(true),
|
||||
inside(false)
|
||||
{
|
||||
invsqrt12 = 1./sqrt(12.);
|
||||
tlimitminfix = 1.e-6*mm;
|
||||
theManager = G4LossTableManager::Instance();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4MuMscModel::~G4MuMscModel()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4MuMscModel::Initialise(const G4ParticleDefinition* p,
|
||||
const G4DataVector& cuts)
|
||||
{
|
||||
SetupParticle(p);
|
||||
newrun = true;
|
||||
xSection = currentRange = targetZ = ecut = tkin = 0.0;
|
||||
// set values of some data members
|
||||
if(!isInitialized) {
|
||||
isInitialized = true;
|
||||
if(p->GetParticleName() == "GenericIon") buildTables = false;
|
||||
|
||||
if (pParticleChange)
|
||||
fParticleChange = reinterpret_cast<G4ParticleChangeForMSC*>(pParticleChange);
|
||||
else
|
||||
fParticleChange = new G4ParticleChangeForMSC();
|
||||
|
||||
safetyHelper = G4TransportationManager::GetTransportationManager()
|
||||
->GetSafetyHelper();
|
||||
safetyHelper->InitialiseHelper();
|
||||
}
|
||||
G4eCoulombScatteringModel::Initialise(p, cuts);
|
||||
currentCuts = &cuts;
|
||||
if(buildTables)
|
||||
theLambda2Table = G4PhysicsTableHelper::PreparePhysicsTable(theLambda2Table);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4MuMscModel::BuildTables()
|
||||
{
|
||||
//G4cout << "G4MuMscModel::BuildTables flags newrun= " << newrun
|
||||
// << " buildTables= " << buildTables << G4endl;
|
||||
newrun = false;
|
||||
if(!buildTables) return;
|
||||
|
||||
// Access to materials
|
||||
const G4ProductionCutsTable* theCoupleTable=
|
||||
G4ProductionCutsTable::GetProductionCutsTable();
|
||||
size_t numOfCouples = theCoupleTable->GetTableSize();
|
||||
G4double e, s, cut;
|
||||
|
||||
for(size_t i=0; i<numOfCouples; i++) {
|
||||
|
||||
if (theLambda2Table->GetFlag(i)) {
|
||||
|
||||
// create physics vector and fill it
|
||||
DefineMaterial(theCoupleTable->GetMaterialCutsCouple(i));
|
||||
cut = (*currentCuts)[currentMaterialIndex];
|
||||
G4PhysicsVector* aVector =
|
||||
new G4PhysicsLogVector(lowBinEnergy, highBinEnergy, nbins);
|
||||
for(G4int j=0; j<nbins; j++) {
|
||||
e = aVector->GetLowEdgeEnergy(j);
|
||||
s = ComputeLambda2(e, cut);
|
||||
//G4cout << j << " " << currentCouple->GetMaterial()->GetName()
|
||||
// << " e(MeV)= " << e << " cut(MeV)= " << cut
|
||||
// << " L2= " << s << G4endl;
|
||||
aVector->PutValue(j, s);
|
||||
}
|
||||
|
||||
G4PhysicsTableHelper::SetPhysicsVector(theLambda2Table, i, aVector);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4MuMscModel::ComputeCrossSectionPerAtom(
|
||||
const G4ParticleDefinition* p,
|
||||
G4double kinEnergy,
|
||||
G4double Z, G4double A,
|
||||
G4double cutEnergy, G4double)
|
||||
{
|
||||
if(p == particle && kinEnergy == tkin && Z == targetZ &&
|
||||
cutEnergy == ecut) return xSection;
|
||||
ecut = cutEnergy;
|
||||
xSection = 0.0;
|
||||
SetupParticle(p);
|
||||
G4double ekin = std::max(keV, kinEnergy);
|
||||
SetupTarget(Z, A, ekin);
|
||||
|
||||
G4double tmax = tkin;
|
||||
if(p == theElectron) tmax *= 0.5;
|
||||
else if(p != thePositron) {
|
||||
G4double ratio = electron_mass_c2/mass;
|
||||
tmax = 2.0*mom2/
|
||||
(electron_mass_c2*(1.0 + ratio*(tkin/mass + 1.0) + ratio*ratio));
|
||||
}
|
||||
G4double t = std::min(cutEnergy, tmax);
|
||||
G4double mom21 = t*(t + 2.0*electron_mass_c2);
|
||||
t = tkin - t;
|
||||
G4double mom22 = t*(t + 2.0*mass);
|
||||
cosTetMaxElec = (mom2 + mom22 - mom21)*0.5/sqrt(mom2*mom22);
|
||||
if(cosTetMaxElec < cosTetMaxNuc) cosTetMaxElec = cosTetMaxNuc;
|
||||
|
||||
if(cosTetMaxElec < 1.0) {
|
||||
G4double x2 = screenZ/(1.0 - cosTetMaxElec + screenZ);
|
||||
xSection += (x2 - 1.0 - log(x2))/Z;
|
||||
}
|
||||
// G4cout << "cut= " << ecut << " e= " << tkin << " croosE= "
|
||||
// << xSection/barn << G4endl;
|
||||
|
||||
if(cosTetMaxNuc < 1.0) {
|
||||
G4double x1 = screenZ*formfactA;
|
||||
G4double x2 = 1.0 - cosTetMaxNuc + screenZ;
|
||||
G4double x3 = 1.0 - x1;
|
||||
G4double x4 = 1.0/(formfactA*x2 + x3);
|
||||
G4double x5 = screenZ/x2;
|
||||
xSection += ((1.0 - 2.0*x1/x3)*log(x4/x5) - 1.0 +
|
||||
x5 - (1.0 - 4.0*x1)*(1.0 - x4))/(x3*x3);
|
||||
}
|
||||
xSection *= coeff*Z*Z*chargeSquare*invbeta2/mom2;
|
||||
// G4cout << " croosE= " << xSection/barn << " screenZ= "
|
||||
// << screenZ << " formF= " << formfactA << G4endl;
|
||||
return xSection;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4MuMscModel::ComputeLambda2(G4double kinEnergy,
|
||||
G4double cutEnergy)
|
||||
{
|
||||
G4double res = 0.0;
|
||||
SetupParticle(particle);
|
||||
G4double ekin = std::max(keV, kinEnergy);
|
||||
|
||||
const G4Material* mat = currentCouple->GetMaterial();
|
||||
const G4ElementVector* theElementVector = mat->GetElementVector();
|
||||
const G4double* theAtomNumDensityVector = mat->GetVecNbOfAtomsPerVolume();
|
||||
size_t nelm = mat->GetNumberOfElements();
|
||||
|
||||
SetupKinematic(ekin);
|
||||
|
||||
G4double tmax = tkin;
|
||||
if(particle == theElectron) tmax *= 0.5;
|
||||
else if(particle != thePositron) {
|
||||
G4double ratio = electron_mass_c2/mass;
|
||||
tmax = 2.0*mom2/
|
||||
(electron_mass_c2*(1.0 + ratio*(tkin/mass + 1.0) + ratio*ratio));
|
||||
}
|
||||
G4double t = std::min(cutEnergy, tmax);
|
||||
G4double mom21 = t*(t + 2.0*electron_mass_c2);
|
||||
t = tkin - t;
|
||||
G4double mom22 = t*(t + 2.0*mass);
|
||||
cosTetMaxElec = (mom2 + mom22 - mom21)*0.5/sqrt(mom2*mom22);
|
||||
if(cosTetMaxElec < 0.0) cosTetMaxElec = 0.0;
|
||||
|
||||
G4double x, x1, x2, y;
|
||||
|
||||
for (size_t i=0; i<nelm; i++) {
|
||||
const G4Element* elm = (*theElementVector)[i];
|
||||
G4double Z = elm->GetZ();
|
||||
SetupTarget(Z, elm->GetN(), tkin);
|
||||
G4double s = 0.0;
|
||||
G4double costm = cosTetMaxElec;
|
||||
if(costm < cosTetMaxNuc) costm = cosTetMaxNuc;
|
||||
if(costm < 1.0) {
|
||||
x = 1.0 - costm + screenZ;
|
||||
y = (x - screenZ*(screenZ/x + 2.0*log(x/screenZ)))/Z;
|
||||
if(y < 0.0) {
|
||||
nwarnings++;
|
||||
if(nwarnings < nwarnlimit)
|
||||
G4cout << "Electron scattering <0 for L2 " << y << G4endl;
|
||||
y = 0.0;
|
||||
}
|
||||
s += y;
|
||||
}
|
||||
// G4cout << "cut= " << cut << " e= " << tkin << " croosE= "
|
||||
// << xSection/barn << G4endl;
|
||||
|
||||
// limit main integral because of nuclear size effect
|
||||
|
||||
if(cosTetMaxNuc < 1.0) {
|
||||
x1 = screenZ*formfactA;
|
||||
x2 = 1.0 - cosTetMaxNuc + screenZ;
|
||||
G4double x3 = 1.0 - x1;
|
||||
G4double f = 1.0/formfactA;
|
||||
G4double d = f - screenZ;
|
||||
G4double x4 = f/(x2 + d);
|
||||
G4double x5 = screenZ/x2;
|
||||
y = (screenZ*(1.0 - x5) + (d*d - screenZ*(2.0*d - 3.0*screenZ))*(1.0 - x4)/f -
|
||||
2.0*screenZ*f*log(x4/x5)/d)/(x3*x3);
|
||||
if(y < 0.0) {
|
||||
nwarnings++;
|
||||
if(nwarnings < nwarnlimit)
|
||||
G4cout << "Nuclear scattering <0 for L2 " << y << G4endl;
|
||||
y = 0.0;
|
||||
}
|
||||
s += y;
|
||||
}
|
||||
|
||||
res += Z*Z*s*theAtomNumDensityVector[i];
|
||||
}
|
||||
res *= 0.25*coeff*chargeSquare*invbeta2/mom2;
|
||||
// G4cout << " croosE= " << xSection/barn << " screenZ= "
|
||||
// << screenZ << " formF= " << formfactA << G4endl;
|
||||
return res;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4MuMscModel::ComputeTruePathLengthLimit(
|
||||
const G4Track& track,
|
||||
G4PhysicsTable* theTable,
|
||||
G4double currentMinimalStep)
|
||||
{
|
||||
G4double tlimit = currentMinimalStep;
|
||||
const G4DynamicParticle* dp = track.GetDynamicParticle();
|
||||
|
||||
// initialisation for 1st step
|
||||
if(track.GetCurrentStepNumber() == 1) {
|
||||
inside = false;
|
||||
SetupParticle(dp->GetDefinition());
|
||||
theLambdaTable = theTable;
|
||||
if(newrun && buildTables) BuildTables();
|
||||
}
|
||||
|
||||
// initialisation for each step
|
||||
preKinEnergy = dp->GetKineticEnergy();
|
||||
DefineMaterial(track.GetMaterialCutsCouple());
|
||||
lambda0 = GetLambda(preKinEnergy);
|
||||
currentRange =
|
||||
theManager->GetRangeFromRestricteDEDX(particle,preKinEnergy,currentCouple);
|
||||
|
||||
// extra check for abnormal situation
|
||||
// this check needed to run MSC with eIoni and eBrem inactivated
|
||||
if(tlimit > currentRange) tlimit = currentRange;
|
||||
|
||||
// stop here if small range particle
|
||||
if(inside) return tlimit;
|
||||
|
||||
// pre step
|
||||
G4StepPoint* sp = track.GetStep()->GetPreStepPoint();
|
||||
G4StepStatus stepStatus = sp->GetStepStatus();
|
||||
G4double presafety = sp->GetSafety();
|
||||
|
||||
// compute presafety again if presafety <= 0 and no boundary
|
||||
// i.e. when it is needed for optimization purposes
|
||||
if(stepStatus != fGeomBoundary && presafety < tlimitminfix)
|
||||
presafety = safetyHelper->ComputeSafety(sp->GetPosition());
|
||||
|
||||
// G4cout << "G4MuMscModel::ComputeTruePathLengthLimit tlimit= "
|
||||
// <<tlimit<<" safety= " << presafety
|
||||
// << " range= " <<currentRange<<G4endl;
|
||||
|
||||
// far from geometry boundary
|
||||
if(currentRange < presafety) {
|
||||
inside = true;
|
||||
|
||||
// limit mean scattering angle
|
||||
} else {
|
||||
tlimit = std::min(facrange*lambda0, tlimit);
|
||||
}
|
||||
/*
|
||||
G4cout << particle->GetParticleName() << " e= " << preKinEnergy
|
||||
<< " L0= " << lambda0 << " R= " << currentRange
|
||||
<< "tlimit= " << tlimit
|
||||
<< " currentMinimalStep= " << currentMinimalStep << G4endl;
|
||||
*/
|
||||
return tlimit;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4MuMscModel::ComputeGeomPathLength(G4double truelength)
|
||||
{
|
||||
tPathLength = truelength;
|
||||
zPathLength = tPathLength;
|
||||
|
||||
G4double tau = tPathLength/lambda0;
|
||||
lambdaeff = lambda0;
|
||||
//G4cout << "ComputeGeomPathLength: tLength= " << tPathLength
|
||||
// << " lambda0= " << lambda0 << " tau= " << tau << G4endl;
|
||||
// small step
|
||||
if(tau < numlimit) {
|
||||
par1 = -1. ;
|
||||
par2 = par3 = 0. ;
|
||||
zPathLength *= (1.0 - 0.5*tau + tau*tau/6.0);
|
||||
|
||||
// medium step
|
||||
} else if(tPathLength < currentRange*dtrl) {
|
||||
zPathLength = lambda0*(1.0 - exp(-tau));
|
||||
|
||||
} else if(tkin < mass) {
|
||||
|
||||
par1 = 1./currentRange;
|
||||
par2 = 1./(par1*lambda0);
|
||||
par3 = 1.+ par2;
|
||||
lambdaeff = 1.0/(par1*par3);
|
||||
G4double x = tPathLength/currentRange;
|
||||
G4double x1;
|
||||
if(x < numlimit) x1 = x*(1.0 - 0.5*x + x*x/3.0);
|
||||
else x1 = log(1.0 - x);
|
||||
zPathLength = lambdaeff*(1.-exp(par3*x1));
|
||||
|
||||
} else {
|
||||
|
||||
G4double T1 = theManager->GetEnergy(particle,
|
||||
currentRange-tPathLength,
|
||||
currentCouple);
|
||||
G4double lambda1 = GetLambda(T1);
|
||||
|
||||
par1 = (lambda0-lambda1)/(lambda0*tPathLength) ;
|
||||
par2 = 1./(par1*lambda0) ;
|
||||
par3 = 1.+ par2 ;
|
||||
lambdaeff = 1.0/(par1*par3);
|
||||
zPathLength = lambdaeff*(1.-exp(par3*log(lambda1/lambda0)));
|
||||
}
|
||||
|
||||
// if(zPathLength > lambda0) zPathLength = lambda0;
|
||||
if(zPathLength > tPathLength) zPathLength = tPathLength;
|
||||
|
||||
return zPathLength;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4MuMscModel::ComputeTrueStepLength(G4double geomStepLength)
|
||||
{
|
||||
// step defined other than transportation
|
||||
if(geomStepLength == zPathLength) return tPathLength;
|
||||
|
||||
tPathLength = geomStepLength;
|
||||
zPathLength = geomStepLength;
|
||||
G4double tau = geomStepLength/lambda0;
|
||||
if(tau < numlimit) {
|
||||
tPathLength *= (1.0 + 0.5*tau - tau*tau/3.0);
|
||||
|
||||
} else if(par1 < 0.) {
|
||||
tPathLength = -lambda0*log(1.0 - tau);
|
||||
|
||||
} else {
|
||||
G4double x = par1*par3*geomStepLength;
|
||||
if(x < numlimit)
|
||||
tPathLength = (1.- exp(- x*(1.- 0.5*x + x*x/3.0)/par3))/par1 ;
|
||||
else if (x < 1.0)
|
||||
tPathLength = (1.-exp(log(1.- x)/par3))/par1;
|
||||
else
|
||||
tPathLength = currentRange;
|
||||
}
|
||||
if(tPathLength < geomStepLength) tPathLength = geomStepLength;
|
||||
|
||||
return tPathLength;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4MuMscModel::SampleScattering(const G4DynamicParticle* dynParticle,
|
||||
G4double safety)
|
||||
{
|
||||
G4double kinEnergy = dynParticle->GetKineticEnergy();
|
||||
if(kinEnergy == 0.0) return;
|
||||
G4double x1 = 0.5*tPathLength/lambdaeff;
|
||||
|
||||
/*
|
||||
G4cout << "G4MuMscModel::SampleScattering t(mm)= " << tPathLength
|
||||
<< " 1/lambdaeff= " << 1.0/lambdaeff
|
||||
<< " matIdx= " << currentMaterialIndex << G4endl;
|
||||
*/
|
||||
/*
|
||||
G4double y1 = 1.0 - x1;
|
||||
G4double x2 = tPathLength*GetLambda2(0.5*(preKinEnergy + kinEnergy));
|
||||
G4double x3 = (x2 - x1*x1)/(x1*y1);
|
||||
if(x3 <= 0.0 || x3 >= 0.33) {
|
||||
nwarnings++;
|
||||
if(nwarnings < nwarnlimit)
|
||||
G4cout << "G4MuMscModel::SampleScattering: ePre(MeV)= " << preKinEnergy/MeV
|
||||
<< " ePost(MeV)= " << kinEnergy/MeV
|
||||
<< " <x>= " << x1 << " sqrt(<x^2>)= " << sqrt(x2)
|
||||
<< " x3= " << x3
|
||||
<< G4endl;
|
||||
x3 = std::min(1.0/y1,0.16666);
|
||||
}
|
||||
G4double x4 = 0.25*(3.0*x3 + sqrt(x3*(x3 + 8.0)))/(1.0 - x3);
|
||||
*/
|
||||
|
||||
G4double x = G4UniformRand();
|
||||
G4double z;
|
||||
|
||||
//if(x < y1) z = x1*pow(x/y1,x4);
|
||||
//else z = 1.0 - y1*pow((1.0 - x)/x1,x4);
|
||||
|
||||
z = -x1*log(x);
|
||||
|
||||
G4double cost = 1.0 - 2.0*z;
|
||||
if(cost < -1.0) cost = -1.0;
|
||||
else if(cost > 1.0) cost = 1.0;
|
||||
G4double sint = sqrt((1.0 - cost)*(1.0 + cost));
|
||||
|
||||
G4double phi = twopi*G4UniformRand();
|
||||
|
||||
G4double dirx = sint*cos(phi);
|
||||
G4double diry = sint*sin(phi);
|
||||
|
||||
// G4cout << "G4MuMscModel::SampleSecondaries: tstep(mm)= " << truestep/mm
|
||||
// << " lambdaeff= " << lambdaeff
|
||||
// << " rms= " << rms << G4endl;
|
||||
|
||||
G4ThreeVector oldDirection = dynParticle->GetMomentumDirection();
|
||||
G4ThreeVector newDirection(dirx,diry,cost);
|
||||
newDirection.rotateUz(oldDirection);
|
||||
fParticleChange->ProposeMomentumDirection(newDirection);
|
||||
|
||||
if (latDisplasment && safety > tlimitminfix) {
|
||||
G4double rms= sqrt(2.0*x1);
|
||||
G4double rx = zPathLength*(0.5*dirx + invsqrt12*G4RandGauss::shoot(0.0,rms));
|
||||
G4double ry = zPathLength*(0.5*diry + invsqrt12*G4RandGauss::shoot(0.0,rms));
|
||||
G4double r = sqrt(rx*rx + ry*ry);
|
||||
/*
|
||||
G4cout << "G4MuMscModel::SampleSecondaries: e(MeV)= " << kineticEnergy
|
||||
<< " sinTheta= " << sth << " r(mm)= " << r
|
||||
<< " trueStep(mm)= " << truestep
|
||||
<< " geomStep(mm)= " << zPathLength
|
||||
<< G4endl;
|
||||
*/
|
||||
|
||||
G4ThreeVector latDirection(rx,ry,0.0);
|
||||
latDirection.rotateUz(oldDirection);
|
||||
|
||||
G4ThreeVector Position = *(fParticleChange->GetProposedPosition());
|
||||
G4double fac = 1.;
|
||||
if(r > safety) {
|
||||
// ******* so safety is computed at boundary too ************
|
||||
G4double newsafety = safetyHelper->ComputeSafety(Position);
|
||||
if(r > newsafety)
|
||||
fac = newsafety/r ;
|
||||
}
|
||||
|
||||
if(fac > 0.) {
|
||||
// compute new endpoint of the Step
|
||||
G4ThreeVector newPosition = Position+fac*r*latDirection;
|
||||
|
||||
// definitely not on boundary
|
||||
if(1. == fac) {
|
||||
safetyHelper->ReLocateWithinVolume(newPosition);
|
||||
|
||||
} else {
|
||||
// check safety after displacement
|
||||
G4double postsafety = safetyHelper->ComputeSafety(newPosition);
|
||||
|
||||
// displacement to boundary
|
||||
if(postsafety <= 0.0) {
|
||||
safetyHelper->Locate(newPosition, newDirection);
|
||||
|
||||
// not on the boundary
|
||||
} else {
|
||||
safetyHelper->ReLocateWithinVolume(newPosition);
|
||||
}
|
||||
}
|
||||
fParticleChange->ProposePosition(newPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4MuMscModel::SampleSecondaries(std::vector<G4DynamicParticle*>*,
|
||||
const G4MaterialCutsCouple*,
|
||||
const G4DynamicParticle*,
|
||||
G4double,
|
||||
G4double)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4MuMultipleScattering.cc,v 1.3 2007/11/09 19:48:10 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4MuMultipleScattering.cc,v 1.12 2008/10/16 13:37:04 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
//
|
||||
@@ -46,7 +46,7 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4MuMultipleScattering.hh"
|
||||
#include "G4MuMscModel.hh"
|
||||
#include "G4WentzelVIModel.hh"
|
||||
#include "G4MscStepLimitType.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -60,7 +60,7 @@ G4MuMultipleScattering::G4MuMultipleScattering(G4double tet,
|
||||
dtrl = 0.05;
|
||||
samplez = false ;
|
||||
isInitialized = false;
|
||||
SetRangeFactor(0.04);
|
||||
SetRangeFactor(0.2);
|
||||
SetLateralDisplasmentFlag(true);
|
||||
}
|
||||
|
||||
@@ -83,25 +83,29 @@ void G4MuMultipleScattering::InitialiseProcess(const G4ParticleDefinition* p)
|
||||
// Modification of parameters between runs
|
||||
if(isInitialized) {
|
||||
|
||||
if (p->GetParticleType() != "nucleus") {
|
||||
if (p->GetParticleType() != "nucleus" && p->GetPDGMass() < GeV) {
|
||||
mscModel->SetStepLimitType(StepLimitType());
|
||||
mscModel->SetLateralDisplasmentFlag(LateralDisplasmentFlag());
|
||||
//mscModel->SetThetaLimit(thetaLimit);
|
||||
mscModel->SetRangeFactor(RangeFactor());
|
||||
}
|
||||
mscModel->SetPolarAngleLimit(PolarAngleLimit());
|
||||
return;
|
||||
}
|
||||
|
||||
if (p->GetParticleType() == "nucleus") {
|
||||
if (p->GetParticleType() == "nucleus" || p->GetPDGMass() > GeV) {
|
||||
SetLateralDisplasmentFlag(false);
|
||||
SetBuildLambdaTable(false);
|
||||
// SetRangeFactor(0.2);
|
||||
}
|
||||
|
||||
// initialisation of parameters
|
||||
// G4String part_name = p->GetParticleName();
|
||||
mscModel = new G4MuMscModel(RangeFactor(),thetaLimit);
|
||||
// initialisation of the model
|
||||
|
||||
mscModel = new G4WentzelVIModel();
|
||||
mscModel->SetStepLimitType(StepLimitType());
|
||||
mscModel->SetLateralDisplasmentFlag(LateralDisplasmentFlag());
|
||||
mscModel->SetRangeFactor(RangeFactor());
|
||||
mscModel->SetPolarAngleLimit(PolarAngleLimit());
|
||||
mscModel->SetLowEnergyLimit(MinKinEnergy());
|
||||
mscModel->SetHighEnergyLimit(MaxKinEnergy());
|
||||
|
||||
AddEmModel(1,mscModel);
|
||||
isInitialized = true;
|
||||
@@ -111,10 +115,10 @@ void G4MuMultipleScattering::InitialiseProcess(const G4ParticleDefinition* p)
|
||||
|
||||
void G4MuMultipleScattering::PrintInfo()
|
||||
{
|
||||
G4cout << " Boundary/stepping algorithm is active with RangeFactor= "
|
||||
<< RangeFactor()
|
||||
<< " Step limit type " << StepLimitType()
|
||||
<< G4endl;
|
||||
G4cout << " RangeFactor= " << RangeFactor()
|
||||
<< ", step limit type: " << StepLimitType()
|
||||
<< ", lateralDisplacement: " << LateralDisplasmentFlag()
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4MuPairProduction.cc,v 1.48 2007/05/22 17:35:58 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4MuPairProduction.cc,v 1.51 2008/10/16 13:37:04 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -88,7 +88,9 @@ G4MuPairProduction::G4MuPairProduction(const G4String& name)
|
||||
theBaseParticle(0),
|
||||
lowestKinEnergy(1.*GeV),
|
||||
isInitialised(false)
|
||||
{}
|
||||
{
|
||||
SetProcessSubType(fPairProdByCharged);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -97,8 +99,9 @@ G4MuPairProduction::~G4MuPairProduction()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4MuPairProduction::InitialiseEnergyLossProcess(const G4ParticleDefinition* part,
|
||||
const G4ParticleDefinition*)
|
||||
void G4MuPairProduction::InitialiseEnergyLossProcess(
|
||||
const G4ParticleDefinition* part,
|
||||
const G4ParticleDefinition*)
|
||||
{
|
||||
if (!isInitialised) {
|
||||
isInitialised = true;
|
||||
@@ -109,9 +112,9 @@ void G4MuPairProduction::InitialiseEnergyLossProcess(const G4ParticleDefinition*
|
||||
|
||||
G4MuPairProductionModel* em = new G4MuPairProductionModel();
|
||||
em->SetLowestKineticEnergy(lowestKinEnergy);
|
||||
G4VEmFluctuationModel* fm = new G4UniversalFluctuation();
|
||||
em->SetLowEnergyLimit(0.1*keV);
|
||||
em->SetHighEnergyLimit(100.0*TeV);
|
||||
G4VEmFluctuationModel* fm = 0;
|
||||
em->SetLowEnergyLimit(MinKinEnergy());
|
||||
em->SetHighEnergyLimit(MaxKinEnergy());
|
||||
AddEmModel(1, em, fm);
|
||||
}
|
||||
}
|
||||
@@ -119,10 +122,7 @@ void G4MuPairProduction::InitialiseEnergyLossProcess(const G4ParticleDefinition*
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4MuPairProduction::PrintInfo()
|
||||
{
|
||||
G4cout << " Parametrised model "
|
||||
<< G4endl;
|
||||
}
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4MuPairProductionModel.cc,v 1.35 2007/10/11 13:52:04 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4MuPairProductionModel.cc,v 1.39 2008/07/22 16:11:34 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -103,13 +103,14 @@ using namespace std;
|
||||
G4MuPairProductionModel::G4MuPairProductionModel(const G4ParticleDefinition* p,
|
||||
const G4String& nam)
|
||||
: G4VEmModel(nam),
|
||||
minPairEnergy(4.*electron_mass_c2),
|
||||
lowestKinEnergy(1.*GeV),
|
||||
factorForCross(4.*fine_structure_const*fine_structure_const
|
||||
particle(0),
|
||||
factorForCross(4.*fine_structure_const*fine_structure_const
|
||||
*classic_electr_radius*classic_electr_radius/(3.*pi)),
|
||||
sqrte(sqrt(exp(1.))),
|
||||
currentZ(0),
|
||||
particle(0),
|
||||
fParticleChange(0),
|
||||
minPairEnergy(4.*electron_mass_c2),
|
||||
lowestKinEnergy(1.*GeV),
|
||||
nzdat(5),
|
||||
ntdat(8),
|
||||
nbiny(1000),
|
||||
@@ -117,10 +118,10 @@ G4MuPairProductionModel::G4MuPairProductionModel(const G4ParticleDefinition* p,
|
||||
ymin(-5.),
|
||||
ymax(0.),
|
||||
dy((ymax-ymin)/nbiny),
|
||||
ignoreCut(false),
|
||||
samplingTablesAreFilled(false)
|
||||
{
|
||||
SetLowEnergyLimit(minPairEnergy);
|
||||
nist = G4NistManager::Instance();
|
||||
|
||||
theElectron = G4Electron::Electron();
|
||||
thePositron = G4Positron::Positron();
|
||||
@@ -135,24 +136,6 @@ G4MuPairProductionModel::~G4MuPairProductionModel()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4MuPairProductionModel::MinEnergyCut(const G4ParticleDefinition*,
|
||||
const G4MaterialCutsCouple* )
|
||||
{
|
||||
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* p,
|
||||
const G4DataVector&)
|
||||
{
|
||||
@@ -160,19 +143,12 @@ void G4MuPairProductionModel::Initialise(const G4ParticleDefinition* p,
|
||||
if(p) SetParticle(p);
|
||||
MakeSamplingTables();
|
||||
}
|
||||
if(pParticleChange) {
|
||||
if(ignoreCut) {
|
||||
gParticleChange =
|
||||
reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
|
||||
fParticleChange = 0;
|
||||
} else {
|
||||
if(!fParticleChange) {
|
||||
if(pParticleChange)
|
||||
fParticleChange =
|
||||
reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange);
|
||||
gParticleChange = 0;
|
||||
}
|
||||
} else {
|
||||
fParticleChange = new G4ParticleChangeForLoss();
|
||||
gParticleChange = 0;
|
||||
else
|
||||
fParticleChange = new G4ParticleChangeForLoss();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,8 +161,7 @@ G4double G4MuPairProductionModel::ComputeDEDXPerVolume(
|
||||
G4double cutEnergy)
|
||||
{
|
||||
G4double dedx = 0.0;
|
||||
if (cutEnergy <= minPairEnergy || kineticEnergy <= lowestKinEnergy
|
||||
|| ignoreCut)
|
||||
if (cutEnergy <= minPairEnergy || kineticEnergy <= lowestKinEnergy)
|
||||
return dedx;
|
||||
|
||||
const G4ElementVector* theElementVector = material->GetElementVector();
|
||||
@@ -215,7 +190,7 @@ G4double G4MuPairProductionModel::ComputMuPairLoss(G4double Z,
|
||||
SetCurrentElement(Z);
|
||||
G4double loss = 0.0;
|
||||
|
||||
G4double cut = min(cutEnergy,tmax);
|
||||
G4double cut = std::min(cutEnergy,tmax);
|
||||
if(cut <= minPairEnergy) return loss;
|
||||
|
||||
// calculate the rectricted loss
|
||||
@@ -250,13 +225,10 @@ G4double G4MuPairProductionModel::ComputeMicroscopicCrossSection(
|
||||
G4double tkin,
|
||||
G4double Z,
|
||||
G4double cut)
|
||||
|
||||
{
|
||||
G4double cross = 0. ;
|
||||
|
||||
G4double cross = 0.;
|
||||
SetCurrentElement(Z);
|
||||
G4double tmax = MaxSecondaryEnergy(particle, tkin);
|
||||
|
||||
if (tmax <= cut) return cross;
|
||||
|
||||
G4double ak1=6.9 ;
|
||||
@@ -399,44 +371,20 @@ G4double G4MuPairProductionModel::ComputeCrossSectionPerAtom(
|
||||
G4double kineticEnergy,
|
||||
G4double Z, G4double,
|
||||
G4double cutEnergy,
|
||||
G4double)
|
||||
{
|
||||
G4double cut = max(minPairEnergy,cutEnergy);
|
||||
if(ignoreCut) cut = minPairEnergy;
|
||||
G4double cross = ComputeMicroscopicCrossSection (kineticEnergy, Z, cut);
|
||||
return cross;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4MuPairProductionModel::CrossSectionPerVolume(
|
||||
const G4Material* material,
|
||||
const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
G4double cutEnergy,
|
||||
G4double maxEnergy)
|
||||
G4double maxEnergy)
|
||||
{
|
||||
G4double cross = 0.0;
|
||||
if (kineticEnergy <= lowestKinEnergy) return cross;
|
||||
|
||||
maxEnergy += particleMass;
|
||||
SetCurrentElement(Z);
|
||||
G4double tmax = std::min(maxEnergy, kineticEnergy);
|
||||
G4double cut = std::min(cutEnergy, kineticEnergy);
|
||||
if(cut < minPairEnergy) cut = minPairEnergy;
|
||||
if (cut >= tmax) return cross;
|
||||
|
||||
const G4ElementVector* theElementVector = material->GetElementVector();
|
||||
const G4double* theAtomNumDensityVector = material->
|
||||
GetAtomicNumDensityVector();
|
||||
|
||||
for (size_t i=0; i<material->GetNumberOfElements(); i++) {
|
||||
G4double Z = (*theElementVector)[i]->GetZ();
|
||||
SetCurrentElement(Z);
|
||||
G4double tmax = min(maxEnergy,MaxSecondaryEnergy(particle, kineticEnergy));
|
||||
G4double cut = max(minPairEnergy,cutEnergy);
|
||||
if(ignoreCut) cut = minPairEnergy;
|
||||
if(cut < tmax) {
|
||||
G4double cr = ComputeMicroscopicCrossSection(kineticEnergy, Z, cut)
|
||||
- ComputeMicroscopicCrossSection(kineticEnergy, Z, tmax);
|
||||
|
||||
cross += theAtomNumDensityVector[i] * cr;
|
||||
}
|
||||
cross = ComputeMicroscopicCrossSection (kineticEnergy, Z, cut);
|
||||
if(tmax < kineticEnergy) {
|
||||
cross -= ComputeMicroscopicCrossSection(kineticEnergy, Z, tmax);
|
||||
}
|
||||
return cross;
|
||||
}
|
||||
@@ -450,37 +398,44 @@ void G4MuPairProductionModel::MakeSamplingTables()
|
||||
G4double Z = zdat[iz];
|
||||
SetCurrentElement(Z);
|
||||
|
||||
for (G4int it=0; it<ntdat; it++)
|
||||
{
|
||||
for (G4int it=0; it<ntdat; it++) {
|
||||
|
||||
G4double kineticEnergy = tdat[it];
|
||||
G4double maxPairEnergy = MaxSecondaryEnergy(particle,kineticEnergy);
|
||||
|
||||
// G4cout << "Z= " << currentZ << " z13= " << z13
|
||||
//<< " mE= " << maxPairEnergy << G4endl;
|
||||
G4double CrossSection = 0.0 ;
|
||||
|
||||
G4double y = ymin - 0.5*dy ;
|
||||
G4double yy = ymin - dy ;
|
||||
G4double x = exp(y);
|
||||
G4double fac = exp(dy);
|
||||
G4double dx = exp(yy)*(fac - 1.0);
|
||||
if(maxPairEnergy > minPairEnergy) {
|
||||
|
||||
G4double c = log(maxPairEnergy/minPairEnergy);
|
||||
G4double y = ymin - 0.5*dy ;
|
||||
G4double yy = ymin - dy ;
|
||||
G4double x = exp(y);
|
||||
G4double fac = exp(dy);
|
||||
G4double dx = exp(yy)*(fac - 1.0);
|
||||
|
||||
for (G4int i=0 ; i<nbiny; i++)
|
||||
{
|
||||
y += dy ;
|
||||
if(c > 0.0) {
|
||||
x *= fac;
|
||||
dx*= fac;
|
||||
G4double ep = minPairEnergy*exp(c*x) ;
|
||||
CrossSection += ep*dx*ComputeDMicroscopicCrossSection(
|
||||
kineticEnergy, Z, ep);
|
||||
}
|
||||
ya[i] = y;
|
||||
proba[iz][it][i] = CrossSection;
|
||||
G4double c = log(maxPairEnergy/minPairEnergy);
|
||||
|
||||
for (G4int i=0 ; i<nbiny; i++) {
|
||||
y += dy ;
|
||||
if(c > 0.0) {
|
||||
x *= fac;
|
||||
dx*= fac;
|
||||
G4double ep = minPairEnergy*exp(c*x) ;
|
||||
CrossSection +=
|
||||
ep*dx*ComputeDMicroscopicCrossSection(kineticEnergy, Z, ep);
|
||||
}
|
||||
ya[i] = y;
|
||||
proba[iz][it][i] = CrossSection;
|
||||
}
|
||||
|
||||
} else {
|
||||
for (G4int i=0 ; i<nbiny; i++) {
|
||||
proba[iz][it][i] = CrossSection;
|
||||
}
|
||||
}
|
||||
|
||||
ya[nbiny]=ymax;
|
||||
|
||||
proba[iz][it][nbiny] = CrossSection;
|
||||
|
||||
}
|
||||
@@ -514,7 +469,7 @@ void G4MuPairProductionModel::SampleSecondaries(std::vector<G4DynamicParticle*>*
|
||||
G4double maxPairEnergy = MaxSecondaryEnergy(particle,kineticEnergy);
|
||||
G4double maxEnergy = std::min(tmax, maxPairEnergy);
|
||||
G4double minEnergy = std::max(tmin, minPairEnergy);
|
||||
if(ignoreCut)minEnergy = minPairEnergy;
|
||||
|
||||
if(minEnergy >= maxEnergy) return;
|
||||
//G4cout << "emin= " << minEnergy << " emax= " << maxEnergy
|
||||
// << " minPair= " << minPairEnergy << " maxpair= " << maxPairEnergy
|
||||
@@ -617,10 +572,7 @@ void G4MuPairProductionModel::SampleSecondaries(std::vector<G4DynamicParticle*>*
|
||||
|
||||
// primary change
|
||||
kineticEnergy -= (ElectronEnergy + PositronEnergy);
|
||||
if(fParticleChange)
|
||||
fParticleChange->SetProposedKineticEnergy(kineticEnergy);
|
||||
else
|
||||
gParticleChange->SetProposedKineticEnergy(kineticEnergy);
|
||||
fParticleChange->SetProposedKineticEnergy(kineticEnergy);
|
||||
|
||||
vdp->push_back(aParticle1);
|
||||
vdp->push_back(aParticle2);
|
||||
@@ -654,7 +606,6 @@ const G4Element* G4MuPairProductionModel::SelectRandomAtom(
|
||||
SetCurrentElement(Z);
|
||||
G4double maxPairEnergy = MaxSecondaryEnergy(particle,kinEnergy);
|
||||
G4double minEnergy = std::max(tmin, minPairEnergy);
|
||||
if(ignoreCut)minEnergy = minPairEnergy;
|
||||
|
||||
G4int iz;
|
||||
for(iz=1; iz<nzdat; iz++) {if(Z <= zdat[iz]) break;}
|
||||
|
||||
Reference in New Issue
Block a user