Import Geant4 7.0.0 source tree
This commit is contained in:
@@ -20,8 +20,8 @@
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4MuBetheBlochModel.cc,v 1.11 2004/02/15 17:46:49 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-01 $
|
||||
// $Id: G4MuBetheBlochModel.cc,v 1.14 2004/12/03 17:32:03 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -60,6 +60,8 @@ G4double G4MuBetheBlochModel::wgi[]={ 0.0506,0.1112,0.1569,0.1813,0.1813,0.1569,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
using namespace std;
|
||||
|
||||
G4MuBetheBlochModel::G4MuBetheBlochModel(const G4ParticleDefinition* p,
|
||||
const G4String& nam)
|
||||
: G4VEmModel(nam),
|
||||
@@ -141,7 +143,7 @@ G4double G4MuBetheBlochModel::ComputeDEDX(const G4MaterialCutsCouple* couple,
|
||||
{
|
||||
G4double tmax = MaxSecondaryEnergy(p, kineticEnergy);
|
||||
G4double tau = kineticEnergy/mass;
|
||||
G4double cutEnergy = std::min(cut,tmax);
|
||||
G4double cutEnergy = min(cut,tmax);
|
||||
G4double gam = tau + 1.0;
|
||||
G4double bg2 = tau * (tau+2.0);
|
||||
G4double beta2 = bg2/(gam*gam);
|
||||
@@ -228,7 +230,7 @@ G4double G4MuBetheBlochModel::CrossSection(const G4MaterialCutsCouple* couple,
|
||||
{
|
||||
G4double cross = 0.0;
|
||||
G4double tmax = MaxSecondaryEnergy(p, kineticEnergy);
|
||||
G4double maxEnergy = std::min(tmax,maxKinEnergy);
|
||||
G4double maxEnergy = min(tmax,maxKinEnergy);
|
||||
if(cutEnergy < maxEnergy) {
|
||||
|
||||
G4double totEnergy = kineticEnergy + mass;
|
||||
@@ -242,7 +244,7 @@ G4double G4MuBetheBlochModel::CrossSection(const G4MaterialCutsCouple* couple,
|
||||
if (maxEnergy > limitKinEnergy) {
|
||||
|
||||
G4double logtmax = log(maxEnergy);
|
||||
G4double logtmin = log(std::max(cutEnergy,limitKinEnergy));
|
||||
G4double logtmin = log(max(cutEnergy,limitKinEnergy));
|
||||
G4double logstep = logtmax - logtmin;
|
||||
G4double dcross = 0.0;
|
||||
|
||||
@@ -275,14 +277,14 @@ G4DynamicParticle* G4MuBetheBlochModel::SampleSecondary(
|
||||
G4double maxEnergy)
|
||||
{
|
||||
G4double tmax = MaxSecondaryEnergy(dp);
|
||||
G4double maxKinEnergy = std::min(maxEnergy,tmax);
|
||||
G4double minKinEnergy = std::min(minEnergy,maxKinEnergy);
|
||||
G4double maxKinEnergy = min(maxEnergy,tmax);
|
||||
G4double minKinEnergy = min(minEnergy,maxKinEnergy);
|
||||
|
||||
G4double kineticEnergy = dp->GetKineticEnergy();
|
||||
G4double totEnergy = kineticEnergy + mass;
|
||||
G4double etot2 = totEnergy*totEnergy;
|
||||
G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*mass)/etot2;
|
||||
|
||||
|
||||
G4double grej = 1.;
|
||||
if(tmax > limitKinEnergy) {
|
||||
G4double a0 = log(2.*totEnergy/mass);
|
||||
@@ -339,13 +341,13 @@ G4DynamicParticle* G4MuBetheBlochModel::SampleSecondary(
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
std::vector<G4DynamicParticle*>* G4MuBetheBlochModel::SampleSecondaries(
|
||||
vector<G4DynamicParticle*>* G4MuBetheBlochModel::SampleSecondaries(
|
||||
const G4MaterialCutsCouple* couple,
|
||||
const G4DynamicParticle* dp,
|
||||
G4double tmin,
|
||||
G4double maxEnergy)
|
||||
{
|
||||
std::vector<G4DynamicParticle*>* vdp = new std::vector<G4DynamicParticle*>;
|
||||
vector<G4DynamicParticle*>* vdp = new vector<G4DynamicParticle*>;
|
||||
G4DynamicParticle* delta = SampleSecondary(couple,dp,tmin,maxEnergy);
|
||||
vdp->push_back(delta);
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4MuBremsstrahlung.cc,v 1.31 2004/02/10 18:07:26 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-01 $
|
||||
// $Id: G4MuBremsstrahlung.cc,v 1.35 2004/12/02 08:20:37 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -52,6 +52,8 @@
|
||||
// 08-08-03 STD substitute standard (V.Ivanchenko)
|
||||
// 12-11-03 G4EnergyLossSTD -> G4EnergyLossProcess (V.Ivanchenko)
|
||||
// 10-02-04 Add lowestKinEnergy (V.Ivanchenko)
|
||||
// 17-08-04 Utilise mu+ tables for mu- (V.Ivanchenko)
|
||||
// 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivantchenko)
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -67,13 +69,19 @@
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
using namespace std;
|
||||
|
||||
G4MuBremsstrahlung::G4MuBremsstrahlung(const G4String& name)
|
||||
: G4VEnergyLossProcess(name),
|
||||
theParticle(0),
|
||||
theBaseParticle(0),
|
||||
lowestKinEnergy(1.*GeV)
|
||||
lowestKinEnergy(1.*GeV),
|
||||
isInitialised(false)
|
||||
{
|
||||
InitialiseProcess();
|
||||
SetDEDXBinning(120);
|
||||
SetLambdaBinning(120);
|
||||
SetMinKinEnergy(0.1*keV);
|
||||
SetMaxKinEnergy(100.0*TeV);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -83,31 +91,25 @@ G4MuBremsstrahlung::~G4MuBremsstrahlung()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4MuBremsstrahlung::InitialiseProcess()
|
||||
void G4MuBremsstrahlung::InitialiseEnergyLossProcess(const G4ParticleDefinition* part,
|
||||
const G4ParticleDefinition*)
|
||||
{
|
||||
SetSecondaryParticle(G4Gamma::Gamma());
|
||||
if(!isInitialised) {
|
||||
|
||||
SetDEDXBinning(120);
|
||||
SetLambdaBinning(120);
|
||||
SetMinKinEnergy(0.1*keV);
|
||||
SetMaxKinEnergy(100.0*TeV);
|
||||
isInitialised = true;
|
||||
|
||||
G4MuBremsstrahlungModel* em = new G4MuBremsstrahlungModel();
|
||||
em->SetLowestKineticEnergy(lowestKinEnergy);
|
||||
theParticle = part;
|
||||
SetSecondaryParticle(G4Gamma::Gamma());
|
||||
SetIonisation(false);
|
||||
|
||||
G4VEmFluctuationModel* fm = new G4UniversalFluctuation();
|
||||
em->SetLowEnergyLimit(0.1*keV);
|
||||
em->SetHighEnergyLimit(100.0*TeV);
|
||||
AddEmModel(1, em, fm);
|
||||
}
|
||||
G4MuBremsstrahlungModel* em = new G4MuBremsstrahlungModel();
|
||||
em->SetLowestKineticEnergy(lowestKinEnergy);
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
const G4ParticleDefinition* G4MuBremsstrahlung::DefineBaseParticle(
|
||||
const G4ParticleDefinition* p)
|
||||
{
|
||||
if(!theParticle) theParticle = p;
|
||||
return theBaseParticle;
|
||||
G4VEmFluctuationModel* fm = new G4UniversalFluctuation();
|
||||
em->SetLowEnergyLimit(0.1*keV);
|
||||
em->SetHighEnergyLimit(100.0*TeV);
|
||||
AddEmModel(1, em, fm);
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MuBremsstrahlung52.cc,v 1.1 2003/08/08 11:28:41 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// $Id: G4MuBremsstrahlung52.cc,v 1.4 2004/12/02 08:20:38 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
//
|
||||
//--------------- G4MuBremsstrahlung52 physics process ---------------------------
|
||||
@@ -41,6 +41,7 @@
|
||||
// 16-01-03 Migrade to cut per region (V.Ivanchenko)
|
||||
// 26-04-03 fix problems of retrieve tables (V.Ivanchenko)
|
||||
// 08-08-03 This class is frozen at the release 5.2 (V.Ivanchenko)
|
||||
// 08-11-04 Remove interface of Store/Retrieve tables (V.Ivantchenko)
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#include "G4MuBremsstrahlung52.hh"
|
||||
@@ -67,7 +68,7 @@ G4int G4MuBremsstrahlung52::NbinLambda = 150;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
// constructor
|
||||
using namespace std;
|
||||
|
||||
G4MuBremsstrahlung52::G4MuBremsstrahlung52(const G4String& processName)
|
||||
: G4VMuEnergyLoss(processName),
|
||||
@@ -589,7 +590,7 @@ G4VParticleChange* G4MuBremsstrahlung52::PostStepDoIt(const G4Track& trackData,
|
||||
NBINminus1 = NBIN-1 ;
|
||||
for (G4int iz=0; iz<nzdat; iz++)
|
||||
{
|
||||
del = abs(lnZ-log(zdat[iz])) ;
|
||||
del = fabs(lnZ-log(zdat[iz])) ;
|
||||
if(del<delmin)
|
||||
{
|
||||
delmin=del ;
|
||||
@@ -600,7 +601,7 @@ G4VParticleChange* G4MuBremsstrahlung52::PostStepDoIt(const G4Track& trackData,
|
||||
delmin = 1.e10 ;
|
||||
for (G4int it=0; it<ntdat; it++)
|
||||
{
|
||||
del = abs(log(KineticEnergy)-log(tdat[it])) ;
|
||||
del = fabs(log(KineticEnergy)-log(tdat[it])) ;
|
||||
if(del<delmin)
|
||||
{
|
||||
delmin=del;
|
||||
@@ -658,15 +659,15 @@ G4VParticleChange* G4MuBremsstrahlung52::PostStepDoIt(const G4Track& trackData,
|
||||
G4double NewKinEnergy = KineticEnergy - GammaEnergy;
|
||||
if (NewKinEnergy > 0.)
|
||||
{
|
||||
aParticleChange.SetMomentumChange(ParticleDirection);
|
||||
aParticleChange.SetEnergyChange(NewKinEnergy);
|
||||
aParticleChange.SetLocalEnergyDeposit (0.);
|
||||
aParticleChange.ProposeMomentumDirection(ParticleDirection);
|
||||
aParticleChange.ProposeEnergy(NewKinEnergy);
|
||||
aParticleChange.ProposeLocalEnergyDeposit (0.);
|
||||
}
|
||||
else
|
||||
{
|
||||
aParticleChange.SetEnergyChange(0.);
|
||||
aParticleChange.SetLocalEnergyDeposit (0.);
|
||||
aParticleChange.SetStatusChange(fStopButAlive);
|
||||
aParticleChange.ProposeEnergy(0.);
|
||||
aParticleChange.ProposeLocalEnergyDeposit (0.);
|
||||
aParticleChange.ProposeTrackStatus(fStopButAlive);
|
||||
}
|
||||
|
||||
return G4VContinuousDiscreteProcess::PostStepDoIt(trackData,stepData);
|
||||
@@ -694,124 +695,6 @@ const G4Element* G4MuBremsstrahlung52::SelectRandomAtom(
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4MuBremsstrahlung52::StorePhysicsTable(G4ParticleDefinition* particle,
|
||||
const G4String& directory,
|
||||
G4bool ascii)
|
||||
{
|
||||
G4String filename;
|
||||
|
||||
// store stopping power table
|
||||
filename = GetPhysicsTableFileName(particle,directory,"StoppingPower",ascii);
|
||||
if ( !theLossTable->StorePhysicsTable(filename, ascii) ){
|
||||
G4cout << " FAIL theLossTable->StorePhysicsTable in " << filename
|
||||
<< G4endl;
|
||||
return false;
|
||||
}
|
||||
// store mean free path table
|
||||
filename = GetPhysicsTableFileName(particle,directory,"MeanFreePath",ascii);
|
||||
if ( !theMeanFreePathTable->StorePhysicsTable(filename, ascii) ){
|
||||
G4cout << " FAIL theMeanFreePathTable->StorePhysicsTable in " << filename
|
||||
<< G4endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
// store PartialSumSigma table (G4OrderedTable)
|
||||
filename = GetPhysicsTableFileName(particle,directory,"PartSumSigma",ascii);
|
||||
if ( !PartialSumSigma.Store(filename, ascii) ){
|
||||
G4cout << " FAIL PartialSumSigma.store in " << filename
|
||||
<< G4endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
G4cout << GetProcessName() << " for " << particle->GetParticleName()
|
||||
<< ": Success to store the PhysicsTables in "
|
||||
<< directory << G4endl;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4MuBremsstrahlung52::RetrievePhysicsTable(G4ParticleDefinition* particle,
|
||||
const G4String& directory,
|
||||
G4bool ascii)
|
||||
{
|
||||
// delete theLossTable and theMeanFreePathTable
|
||||
if (theLossTable != 0) {
|
||||
theLossTable->clearAndDestroy();
|
||||
delete theLossTable;
|
||||
}
|
||||
if (theMeanFreePathTable != 0) {
|
||||
theMeanFreePathTable->clearAndDestroy();
|
||||
delete theMeanFreePathTable;
|
||||
}
|
||||
|
||||
// get bining from EnergyLoss
|
||||
LowestKineticEnergy = GetLowerBoundEloss();
|
||||
HighestKineticEnergy = GetUpperBoundEloss();
|
||||
TotBin = GetNbinEloss();
|
||||
|
||||
G4String filename;
|
||||
const G4ProductionCutsTable* theCoupleTable=
|
||||
G4ProductionCutsTable::GetProductionCutsTable();
|
||||
size_t numOfCouples = theCoupleTable->GetTableSize();
|
||||
|
||||
secondaryEnergyCuts = theCoupleTable->GetEnergyCutsVector(0);
|
||||
PartialSumSigma.clearAndDestroy();
|
||||
PartialSumSigma.reserve(numOfCouples);
|
||||
|
||||
// retreive stopping power table
|
||||
filename = GetPhysicsTableFileName(particle,directory,"StoppingPower",ascii);
|
||||
theLossTable = new G4PhysicsTable(numOfCouples);
|
||||
if ( !theLossTable->RetrievePhysicsTable(filename, ascii) ){
|
||||
G4cout << " FAIL theLossTable->RetrievePhysicsTable in " << filename
|
||||
<< G4endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
// retreive mean free path table
|
||||
filename = GetPhysicsTableFileName(particle,directory,"MeanFreePath",ascii);
|
||||
theMeanFreePathTable = new G4PhysicsTable(numOfCouples);
|
||||
if ( !theMeanFreePathTable->RetrievePhysicsTable(filename, ascii) ){
|
||||
G4cout << " FAIL theMeanFreePathTable->RetrievePhysicsTable in " << filename
|
||||
<< G4endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
// retrieve PartialSumSigma table (G4OrderedTable)
|
||||
filename = GetPhysicsTableFileName(particle,directory,"PartSumSigma",ascii);
|
||||
if ( !PartialSumSigma.Retrieve(filename, ascii) ){
|
||||
G4cout << " FAIL PartialSumSigma.retrieve in " << filename
|
||||
<< G4endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
G4cout << GetProcessName() << " for " << particle->GetParticleName()
|
||||
<< ": Success to retrieve the PhysicsTables from "
|
||||
<< directory << G4endl;
|
||||
|
||||
if (particle->GetPDGCharge() < 0.)
|
||||
{
|
||||
RecorderOfmuminusProcess[CounterOfmuminusProcess] = (*this).theLossTable;
|
||||
CounterOfmuminusProcess++;
|
||||
}
|
||||
else
|
||||
{
|
||||
RecorderOfmuplusProcess[CounterOfmuplusProcess] = (*this).theLossTable;
|
||||
CounterOfmuplusProcess++;
|
||||
}
|
||||
|
||||
secondaryEnergyCuts = theCoupleTable->GetEnergyCutsVector(0);
|
||||
MakeSamplingTables(particle);
|
||||
|
||||
G4VMuEnergyLoss::BuildDEDXTable(*particle);
|
||||
if(particle==G4MuonPlus::MuonPlus()) PrintInfoDefinition();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4MuBremsstrahlung52::PrintInfoDefinition()
|
||||
{
|
||||
G4String comments = "theoretical cross section \n ";
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4MuBremsstrahlungModel.cc,v 1.12 2004/02/10 18:07:26 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-01 $
|
||||
// $Id: G4MuBremsstrahlungModel.cc,v 1.13 2004/12/02 08:20:38 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -73,6 +73,8 @@ G4double G4MuBremsstrahlungModel::tdat[]={1.e3,1.e4,1.e5,1.e6,1.e7,1.e8,1.e9,1.e
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
using namespace std;
|
||||
|
||||
G4MuBremsstrahlungModel::G4MuBremsstrahlungModel(const G4ParticleDefinition*,
|
||||
const G4String& nam)
|
||||
: G4VEmModel(nam),
|
||||
@@ -165,7 +167,7 @@ G4double G4MuBremsstrahlungModel::ComputeDEDX(const G4MaterialCutsCouple* couple
|
||||
if (kineticEnergy <= lowestKinEnergy) return dedx;
|
||||
|
||||
G4double tmax = kineticEnergy;
|
||||
G4double cut = std::min(cutEnergy,tmax);
|
||||
G4double cut = min(cutEnergy,tmax);
|
||||
|
||||
const G4Material* material = couple->GetMaterial();
|
||||
const G4ElementVector* theElementVector = material->GetElementVector();
|
||||
@@ -340,8 +342,8 @@ G4double G4MuBremsstrahlungModel::CrossSection(const G4MaterialCutsCouple* coupl
|
||||
G4double cross = 0.0;
|
||||
if (cutEnergy >= maxEnergy || kineticEnergy <= lowestKinEnergy) return cross;
|
||||
|
||||
G4double tmax = std::min(maxEnergy, kineticEnergy);
|
||||
G4double cut = std::min(cutEnergy, tmax);
|
||||
G4double tmax = min(maxEnergy, kineticEnergy);
|
||||
G4double cut = min(cutEnergy, tmax);
|
||||
|
||||
const G4Material* material = couple->GetMaterial();
|
||||
const G4ElementVector* theElementVector = material->GetElementVector() ;
|
||||
@@ -468,8 +470,8 @@ G4DynamicParticle* G4MuBremsstrahlungModel::SampleSecondary(
|
||||
{
|
||||
G4double kineticEnergy = dp->GetKineticEnergy();
|
||||
// check against insufficient energy
|
||||
G4double tmax = std::min(kineticEnergy, maxEnergy);
|
||||
G4double tmin = std::min(tmax, minEnergy);
|
||||
G4double tmax = min(kineticEnergy, maxEnergy);
|
||||
G4double tmin = min(tmax, minEnergy);
|
||||
|
||||
static G4double ysmall = -100. ;
|
||||
static G4double ytablelow = -5. ;
|
||||
@@ -502,7 +504,7 @@ G4DynamicParticle* G4MuBremsstrahlungModel::SampleSecondary(
|
||||
NBINminus1 = NBIN-1 ;
|
||||
for (G4int iz=0; iz<nzdat; iz++)
|
||||
{
|
||||
del = abs(lnZ-log(zdat[iz])) ;
|
||||
del = fabs(lnZ-log(zdat[iz])) ;
|
||||
if(del<delmin)
|
||||
{
|
||||
delmin=del ;
|
||||
@@ -513,7 +515,7 @@ G4DynamicParticle* G4MuBremsstrahlungModel::SampleSecondary(
|
||||
delmin = 1.e10 ;
|
||||
for (G4int it=0; it<ntdat; it++)
|
||||
{
|
||||
del = abs(log(tmax)-log(tdat[it])) ;
|
||||
del = fabs(log(tmax)-log(tdat[it])) ;
|
||||
if(del<delmin)
|
||||
{
|
||||
delmin=del;
|
||||
@@ -572,13 +574,13 @@ G4DynamicParticle* G4MuBremsstrahlungModel::SampleSecondary(
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
std::vector<G4DynamicParticle*>* G4MuBremsstrahlungModel::SampleSecondaries(
|
||||
vector<G4DynamicParticle*>* G4MuBremsstrahlungModel::SampleSecondaries(
|
||||
const G4MaterialCutsCouple* couple,
|
||||
const G4DynamicParticle* dp,
|
||||
G4double tmin,
|
||||
G4double maxEnergy)
|
||||
{
|
||||
std::vector<G4DynamicParticle*>* vdp = new std::vector<G4DynamicParticle*>;
|
||||
vector<G4DynamicParticle*>* vdp = new vector<G4DynamicParticle*>;
|
||||
G4DynamicParticle* aGamma = SampleSecondary(couple,dp,tmin,maxEnergy);
|
||||
vdp->push_back(aGamma);
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4MuIonisation.cc,v 1.42 2004/05/27 17:29:35 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
// $Id: G4MuIonisation.cc,v 1.46 2004/12/02 08:20:38 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -60,7 +60,9 @@
|
||||
// 08-08-03 STD substitute standard (V.Ivanchenko)
|
||||
// 12-11-03 G4EnergyLossSTD -> G4EnergyLossProcess (V.Ivanchenko)
|
||||
// 10-02-04 Calculation of radiative corrections using R.Kokoulin model (V.Ivanchenko)
|
||||
// 27-05-04 Set integral to be a default regime (V.Ivanchenko)
|
||||
// 27-05-04 Set integral to be a default regime (V.Ivanchenko)
|
||||
// 17-08-04 Utilise mu+ tables for mu- (V.Ivanchenko)
|
||||
// 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivantchenko)
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -80,6 +82,8 @@
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
using namespace std;
|
||||
|
||||
G4MuIonisation::G4MuIonisation(const G4String& name)
|
||||
: G4VEnergyLossProcess(name),
|
||||
theParticle(0),
|
||||
@@ -100,42 +104,37 @@ G4MuIonisation::~G4MuIonisation()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4MuIonisation::InitialiseProcess()
|
||||
void G4MuIonisation::InitialiseEnergyLossProcess(const G4ParticleDefinition* part,
|
||||
const G4ParticleDefinition* bpart)
|
||||
{
|
||||
if(isInitialised) return;
|
||||
mass = theParticle->GetPDGMass();
|
||||
SetSecondaryParticle(G4Electron::Electron());
|
||||
if(!isInitialised) {
|
||||
|
||||
flucModel = new G4UniversalFluctuation();
|
||||
theParticle = part;
|
||||
theBaseParticle = bpart;
|
||||
|
||||
G4VEmModel* em = new G4BraggModel();
|
||||
em->SetLowEnergyLimit(0.1*keV);
|
||||
em->SetHighEnergyLimit(0.2*MeV);
|
||||
AddEmModel(1, em, flucModel);
|
||||
G4VEmModel* em1 = new G4BetheBlochModel();
|
||||
em1->SetLowEnergyLimit(0.2*MeV);
|
||||
em1->SetHighEnergyLimit(1.0*GeV);
|
||||
AddEmModel(2, em1, flucModel);
|
||||
G4VEmModel* em2 = new G4MuBetheBlochModel();
|
||||
em2->SetLowEnergyLimit(1.0*GeV);
|
||||
em2->SetHighEnergyLimit(100.0*TeV);
|
||||
AddEmModel(3, em2, flucModel);
|
||||
mass = theParticle->GetPDGMass();
|
||||
SetSecondaryParticle(G4Electron::Electron());
|
||||
|
||||
SetStepLimits(0.2, 1.0*mm);
|
||||
flucModel = new G4UniversalFluctuation();
|
||||
|
||||
ratio = electron_mass_c2/mass;
|
||||
isInitialised = true;
|
||||
}
|
||||
G4VEmModel* em = new G4BraggModel();
|
||||
em->SetLowEnergyLimit(0.1*keV);
|
||||
em->SetHighEnergyLimit(0.2*MeV);
|
||||
AddEmModel(1, em, flucModel);
|
||||
G4VEmModel* em1 = new G4BetheBlochModel();
|
||||
em1->SetLowEnergyLimit(0.2*MeV);
|
||||
em1->SetHighEnergyLimit(1.0*GeV);
|
||||
AddEmModel(2, em1, flucModel);
|
||||
G4VEmModel* em2 = new G4MuBetheBlochModel();
|
||||
em2->SetLowEnergyLimit(1.0*GeV);
|
||||
em2->SetHighEnergyLimit(100.0*TeV);
|
||||
AddEmModel(3, em2, flucModel);
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
SetStepLimits(0.2, 1.0*mm);
|
||||
|
||||
const G4ParticleDefinition* G4MuIonisation::DefineBaseParticle(
|
||||
const G4ParticleDefinition* p)
|
||||
{
|
||||
if(p) theParticle = p;
|
||||
theBaseParticle = BaseParticle();
|
||||
if(theParticle && !isInitialised) InitialiseProcess();
|
||||
return theBaseParticle;
|
||||
ratio = electron_mass_c2/mass;
|
||||
isInitialised = true;
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MuIonisation52.cc,v 1.1 2003/08/08 11:28:41 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// $Id: G4MuIonisation52.cc,v 1.4 2004/12/02 08:20:38 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// --------------- G4MuIonisation52 physics process ------------------------------
|
||||
// by Laszlo Urban, September 1997
|
||||
@@ -44,6 +44,7 @@
|
||||
// 16-01-03 Migrade to cut per region (V.Ivanchenko)
|
||||
// 26-04-03 fix problems of retrieve tables (V.Ivanchenko)
|
||||
// 08-08-03 This class is frozen at the release 5.2 (V.Ivanchenko)
|
||||
// 08-11-04 Remove interface of Store/Retrieve tables (V.Ivantchenko)
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -61,6 +62,8 @@ G4int G4MuIonisation52::NbinLambda = 150;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
using namespace std;
|
||||
|
||||
G4MuIonisation52::G4MuIonisation52(const G4String& processName)
|
||||
: G4VMuEnergyLoss(processName),
|
||||
theMeanFreePathTable(0)
|
||||
@@ -276,7 +279,7 @@ G4double G4MuIonisation52::ComputeRestrictedMeandEdx (
|
||||
//
|
||||
if (tau > taul)
|
||||
{
|
||||
G4double rcut = std::min(DeltaThreshold/Tmax, 1.);
|
||||
G4double rcut = min(DeltaThreshold/Tmax, 1.);
|
||||
dEdx = log(2.*electron_mass_c2*bg2*Tmax/Eexc2)
|
||||
+log(rcut)-(1.+rcut)*beta2;
|
||||
|
||||
@@ -540,18 +543,18 @@ G4VParticleChange* G4MuIonisation52::PostStepDoIt(const G4Track& trackData,
|
||||
finalPx /= finalMomentum;
|
||||
finalPy /= finalMomentum;
|
||||
finalPz /= finalMomentum;
|
||||
aParticleChange.SetMomentumChange(finalPx,finalPy,finalPz);
|
||||
aParticleChange.ProposeMomentumDirection(finalPx,finalPy,finalPz);
|
||||
}
|
||||
else
|
||||
{
|
||||
finalKineticEnergy = 0.;
|
||||
aParticleChange.SetStatusChange(fStopButAlive);
|
||||
aParticleChange.ProposeTrackStatus(fStopButAlive);
|
||||
}
|
||||
|
||||
aParticleChange.SetEnergyChange( finalKineticEnergy );
|
||||
aParticleChange.ProposeEnergy( finalKineticEnergy );
|
||||
aParticleChange.SetNumberOfSecondaries(1);
|
||||
aParticleChange.AddSecondary(theDeltaRay);
|
||||
aParticleChange.SetLocalEnergyDeposit (0.);
|
||||
aParticleChange.ProposeLocalEnergyDeposit (0.);
|
||||
|
||||
//ResetNumberOfInteractionLengthLeft();
|
||||
return G4VContinuousDiscreteProcess::PostStepDoIt(trackData,stepData);
|
||||
@@ -559,105 +562,6 @@ return G4VContinuousDiscreteProcess::PostStepDoIt(trackData,stepData);
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4MuIonisation52::StorePhysicsTable(G4ParticleDefinition* particle,
|
||||
const G4String& directory,
|
||||
G4bool ascii)
|
||||
{
|
||||
G4String filename;
|
||||
|
||||
// store stopping power table
|
||||
filename = GetPhysicsTableFileName(particle,directory,"StoppingPower",ascii);
|
||||
if ( !theLossTable->StorePhysicsTable(filename, ascii) ){
|
||||
G4cout << " FAIL theLossTable->StorePhysicsTable in " << filename
|
||||
<< G4endl;
|
||||
return false;
|
||||
}
|
||||
// store mean free path table
|
||||
filename = GetPhysicsTableFileName(particle,directory,"MeanFreePath",ascii);
|
||||
if ( !theMeanFreePathTable->StorePhysicsTable(filename, ascii) ){
|
||||
G4cout << " FAIL theMeanFreePathTable->StorePhysicsTable in " << filename
|
||||
<< G4endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
G4cout << GetProcessName() << " for " << particle->GetParticleName()
|
||||
<< ": Success to store the PhysicsTables in "
|
||||
<< directory << G4endl;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4MuIonisation52::RetrievePhysicsTable(G4ParticleDefinition* particle,
|
||||
const G4String& directory,
|
||||
G4bool ascii)
|
||||
{
|
||||
// delete theLossTable and theMeanFreePathTable
|
||||
if (theLossTable != 0) {
|
||||
theLossTable->clearAndDestroy();
|
||||
delete theLossTable;
|
||||
}
|
||||
if (theMeanFreePathTable != 0) {
|
||||
theMeanFreePathTable->clearAndDestroy();
|
||||
delete theMeanFreePathTable;
|
||||
}
|
||||
|
||||
// get bining from EnergyLoss
|
||||
LowestKineticEnergy = GetLowerBoundEloss();
|
||||
HighestKineticEnergy = GetUpperBoundEloss();
|
||||
TotBin = GetNbinEloss();
|
||||
|
||||
G4String filename;
|
||||
|
||||
const G4ProductionCutsTable* theCoupleTable=
|
||||
G4ProductionCutsTable::GetProductionCutsTable();
|
||||
size_t numOfCouples = theCoupleTable->GetTableSize();
|
||||
|
||||
secondaryEnergyCuts = theCoupleTable->GetEnergyCutsVector(1);
|
||||
|
||||
// retreive stopping power table
|
||||
filename = GetPhysicsTableFileName(particle,directory,"StoppingPower",ascii);
|
||||
theLossTable = new G4PhysicsTable(numOfCouples);
|
||||
if ( !theLossTable->RetrievePhysicsTable(filename, ascii) ){
|
||||
G4cout << " FAIL theLossTable0->RetrievePhysicsTable in " << filename
|
||||
<< G4endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
// retreive mean free path table
|
||||
filename = GetPhysicsTableFileName(particle,directory,"MeanFreePath",ascii);
|
||||
theMeanFreePathTable = new G4PhysicsTable(numOfCouples);
|
||||
if ( !theMeanFreePathTable->RetrievePhysicsTable(filename, ascii) ){
|
||||
G4cout << " FAIL theMeanFreePathTable->RetrievePhysicsTable in " << filename
|
||||
<< G4endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
G4cout << GetProcessName() << " for " << particle->GetParticleName()
|
||||
<< ": Success to retrieve the PhysicsTables from "
|
||||
<< directory << G4endl;
|
||||
|
||||
if (particle->GetPDGCharge() > 0.)
|
||||
{
|
||||
RecorderOfmuplusProcess[CounterOfmuplusProcess] = (*this).theLossTable;
|
||||
CounterOfmuplusProcess++;
|
||||
}
|
||||
else
|
||||
{
|
||||
RecorderOfmuminusProcess[CounterOfmuminusProcess] = (*this).theLossTable;
|
||||
CounterOfmuminusProcess++;
|
||||
}
|
||||
|
||||
|
||||
G4VMuEnergyLoss::BuildDEDXTable(*particle);
|
||||
if(particle==G4MuonPlus::MuonPlus()) PrintInfoDefinition();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4MuIonisation52::PrintInfoDefinition()
|
||||
{
|
||||
G4String comments = " Knock-on electron cross sections . "
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4MuPairProduction.cc,v 1.41 2004/02/10 18:07:26 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-01 $
|
||||
// $Id: G4MuPairProduction.cc,v 1.45 2004/12/02 08:20:38 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -58,6 +58,8 @@
|
||||
// 27-09-03 e+ set to be a secondary particle (V.Ivanchenko)
|
||||
// 12-11-03 G4EnergyLossSTD -> G4EnergyLossProcess (V.Ivanchenko)
|
||||
// 10-02-04 Add lowestKinEnergy (V.Ivanchenko)
|
||||
// 17-08-04 Utilise mu+ tables for mu- (V.Ivanchenko)
|
||||
// 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivantchenko)
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -74,14 +76,20 @@
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
using namespace std;
|
||||
|
||||
G4MuPairProduction::G4MuPairProduction(const G4String& name)
|
||||
: G4VEnergyLossProcess(name),
|
||||
theParticle(0),
|
||||
theBaseParticle(0),
|
||||
lowestKinEnergy(1.*GeV),
|
||||
subCutoff(false)
|
||||
subCutoff(false),
|
||||
isInitialised(false)
|
||||
{
|
||||
InitialiseProcess();
|
||||
SetDEDXBinning(120);
|
||||
SetLambdaBinning(120);
|
||||
SetMinKinEnergy(0.1*keV);
|
||||
SetMaxKinEnergy(100.0*TeV);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -91,30 +99,23 @@ G4MuPairProduction::~G4MuPairProduction()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4MuPairProduction::InitialiseProcess()
|
||||
void G4MuPairProduction::InitialiseEnergyLossProcess(const G4ParticleDefinition* part,
|
||||
const G4ParticleDefinition*)
|
||||
{
|
||||
SetSecondaryParticle(G4Positron::Positron());
|
||||
if (!isInitialised) {
|
||||
isInitialised = true;
|
||||
|
||||
SetDEDXBinning(120);
|
||||
SetLambdaBinning(120);
|
||||
SetMinKinEnergy(0.1*keV);
|
||||
SetMaxKinEnergy(100.0*TeV);
|
||||
theParticle = part;
|
||||
SetSecondaryParticle(G4Positron::Positron());
|
||||
SetIonisation(false);
|
||||
|
||||
G4MuPairProductionModel* em = new G4MuPairProductionModel();
|
||||
em->SetLowestKineticEnergy(lowestKinEnergy);
|
||||
G4VEmFluctuationModel* fm = new G4UniversalFluctuation();
|
||||
em->SetLowEnergyLimit(0.1*keV);
|
||||
em->SetHighEnergyLimit(100.0*TeV);
|
||||
AddEmModel(1, em, fm);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
const G4ParticleDefinition* G4MuPairProduction::DefineBaseParticle(
|
||||
const G4ParticleDefinition* p)
|
||||
{
|
||||
if(!theParticle) theParticle = p;
|
||||
return theBaseParticle;
|
||||
G4MuPairProductionModel* em = new G4MuPairProductionModel();
|
||||
em->SetLowestKineticEnergy(lowestKinEnergy);
|
||||
G4VEmFluctuationModel* fm = new G4UniversalFluctuation();
|
||||
em->SetLowEnergyLimit(0.1*keV);
|
||||
em->SetHighEnergyLimit(100.0*TeV);
|
||||
AddEmModel(1, em, fm);
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MuPairProduction52.cc,v 1.1 2003/08/08 11:28:42 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// $Id: G4MuPairProduction52.cc,v 1.4 2004/12/02 08:20:38 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
//--------------- G4MuPairProduction52 physics process ---------------------------
|
||||
// by Laszlo Urban, May 1998
|
||||
@@ -45,6 +45,7 @@
|
||||
// 16-01-03 Migrade to cut per region (V.Ivanchenko)
|
||||
// 26-04-03 fix problems of retrieve tables (V.Ivanchenko)
|
||||
// 08-08-03 This class is frozen at the release 5.2 (V.Ivanchenko)
|
||||
// 08-11-04 Remove interface of Store/Retrieve tables (V.Ivantchenko)
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#include "G4MuPairProduction52.hh"
|
||||
@@ -71,6 +72,8 @@ G4int G4MuPairProduction52::NbinLambda = 150;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
using namespace std;
|
||||
|
||||
G4MuPairProduction52::G4MuPairProduction52(const G4String& processName)
|
||||
: G4VMuEnergyLoss(processName),
|
||||
theMeanFreePathTable(NULL)
|
||||
@@ -754,7 +757,7 @@ G4VParticleChange* G4MuPairProduction52::PostStepDoIt(const G4Track& trackData,
|
||||
G4int NBINminus1 = NBIN-1;
|
||||
for (G4int iz=0; iz<nzdat; iz++)
|
||||
{
|
||||
del = abs(lnZ-log(zdat[iz])) ;
|
||||
del = fabs(lnZ-log(zdat[iz])) ;
|
||||
if(del<delmin)
|
||||
{
|
||||
delmin=del ;
|
||||
@@ -764,7 +767,7 @@ G4VParticleChange* G4MuPairProduction52::PostStepDoIt(const G4Track& trackData,
|
||||
delmin = 1.e10 ;
|
||||
for (G4int it=0; it<ntdat; it++)
|
||||
{
|
||||
del = abs(log(KineticEnergy)-log(tdat[it])) ;
|
||||
del = fabs(log(KineticEnergy)-log(tdat[it])) ;
|
||||
if(del<delmin)
|
||||
{
|
||||
delmin=del;
|
||||
@@ -860,14 +863,14 @@ G4VParticleChange* G4MuPairProduction52::PostStepDoIt(const G4Track& trackData,
|
||||
|
||||
G4double NewKinEnergy = KineticEnergy - ElectronEnergy - PositronEnergy;
|
||||
|
||||
aParticleChange.SetMomentumChange(ParticleDirection);
|
||||
aParticleChange.ProposeMomentumDirection(ParticleDirection);
|
||||
|
||||
if (NewKinEnergy > 0.) aParticleChange.SetEnergyChange(NewKinEnergy);
|
||||
else { aParticleChange.SetEnergyChange(0.);
|
||||
aParticleChange.SetStatusChange(fStopButAlive);
|
||||
if (NewKinEnergy > 0.) aParticleChange.ProposeEnergy(NewKinEnergy);
|
||||
else { aParticleChange.ProposeEnergy(0.);
|
||||
aParticleChange.ProposeTrackStatus(fStopButAlive);
|
||||
}
|
||||
|
||||
aParticleChange.SetLocalEnergyDeposit(LocalEnerDeposit);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(LocalEnerDeposit);
|
||||
|
||||
//reset NumberOfinteractionLengthLeft()
|
||||
return G4VContinuousDiscreteProcess::PostStepDoIt(trackData,stepData);
|
||||
@@ -898,121 +901,6 @@ G4Element* G4MuPairProduction52::SelectRandomAtom(const G4MaterialCutsCouple* co
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4MuPairProduction52::StorePhysicsTable(G4ParticleDefinition* particle,
|
||||
const G4String& directory,
|
||||
G4bool ascii)
|
||||
{
|
||||
G4String filename;
|
||||
|
||||
// store stopping power table
|
||||
filename = GetPhysicsTableFileName(particle,directory,"StoppingPower",ascii);
|
||||
if ( !theLossTable->StorePhysicsTable(filename, ascii) ){
|
||||
G4cout << " FAIL theLossTable->StorePhysicsTable in " << filename
|
||||
<< G4endl;
|
||||
return false;
|
||||
}
|
||||
// store mean free path table
|
||||
filename = GetPhysicsTableFileName(particle,directory,"MeanFreePath",ascii);
|
||||
if ( !theMeanFreePathTable->StorePhysicsTable(filename, ascii) ){
|
||||
G4cout << " FAIL theMeanFreePathTable->StorePhysicsTable in " << filename
|
||||
<< G4endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
// store PartialSumSigma table (G4OrderedTable)
|
||||
filename = GetPhysicsTableFileName(particle,directory,"PartSumSigma",ascii);
|
||||
if ( !PartialSumSigma.Store(filename, ascii) ){
|
||||
G4cout << " FAIL PartialSumSigma.store in " << filename
|
||||
<< G4endl;
|
||||
return false;
|
||||
}
|
||||
G4cout << GetProcessName() << "for " << particle->GetParticleName()
|
||||
<< ": Success to store the PhysicsTables in "
|
||||
<< directory << G4endl;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4MuPairProduction52::RetrievePhysicsTable(G4ParticleDefinition* particle,
|
||||
const G4String& directory,
|
||||
G4bool ascii)
|
||||
{
|
||||
// delete theLossTable and theMeanFreePathTable
|
||||
if (theLossTable != 0) {
|
||||
theLossTable->clearAndDestroy();
|
||||
delete theLossTable;
|
||||
}
|
||||
if (theMeanFreePathTable != 0) {
|
||||
theMeanFreePathTable->clearAndDestroy();
|
||||
delete theMeanFreePathTable;
|
||||
}
|
||||
|
||||
// get bining from EnergyLoss
|
||||
LowestKineticEnergy = GetLowerBoundEloss();
|
||||
HighestKineticEnergy = GetUpperBoundEloss();
|
||||
TotBin = GetNbinEloss();
|
||||
|
||||
G4String filename;
|
||||
const G4ProductionCutsTable* theCoupleTable=
|
||||
G4ProductionCutsTable::GetProductionCutsTable();
|
||||
size_t numOfCouples = theCoupleTable->GetTableSize();
|
||||
electronEnergyCuts = theCoupleTable->GetEnergyCutsVector(1);
|
||||
positronEnergyCuts = theCoupleTable->GetEnergyCutsVector(2);
|
||||
|
||||
// retreive stopping power table
|
||||
filename = GetPhysicsTableFileName(particle,directory,"StoppingPower",ascii);
|
||||
theLossTable = new G4PhysicsTable(numOfCouples);
|
||||
if ( !theLossTable->RetrievePhysicsTable(filename, ascii) ){
|
||||
G4cout << " FAIL theLossTable0->RetrievePhysicsTable in " << filename
|
||||
<< G4endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
// retreive mean free path table
|
||||
filename = GetPhysicsTableFileName(particle,directory,"MeanFreePath",ascii);
|
||||
theMeanFreePathTable = new G4PhysicsTable(numOfCouples);
|
||||
if ( !theMeanFreePathTable->RetrievePhysicsTable(filename, ascii) ){
|
||||
G4cout << " FAIL theMeanFreePathTable->RetrievePhysicsTable in " << filename
|
||||
<< G4endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
// retrieve PartialSumSigma table (G4OrderedTable)
|
||||
PartialSumSigma.clearAndDestroy();
|
||||
PartialSumSigma.reserve(numOfCouples);
|
||||
filename = GetPhysicsTableFileName(particle,directory,"PartSumSigma",ascii);
|
||||
if ( !PartialSumSigma.Retrieve(filename, ascii) ){
|
||||
G4cout << " FAIL PartialSumSigma.retrieve in " << filename
|
||||
<< G4endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
G4cout << GetProcessName() << "for " << particle->GetParticleName()
|
||||
<< ": Success to retrieve the PhysicsTables from "
|
||||
<< directory << G4endl;
|
||||
|
||||
if (particle->GetPDGCharge() < 0.)
|
||||
{
|
||||
RecorderOfmuminusProcess[CounterOfmuminusProcess] = (*this).theLossTable;
|
||||
CounterOfmuminusProcess++;
|
||||
}
|
||||
else
|
||||
{
|
||||
RecorderOfmuplusProcess[CounterOfmuplusProcess] = (*this).theLossTable;
|
||||
CounterOfmuplusProcess++;
|
||||
}
|
||||
|
||||
MakeSamplingTables(particle);
|
||||
G4VMuEnergyLoss::BuildDEDXTable(*particle);
|
||||
if(particle==G4MuonPlus::MuonPlus()) PrintInfoDefinition();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4MuPairProduction52::PrintInfoDefinition()
|
||||
{
|
||||
G4String comments = "theoretical cross sections \n ";
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4MuPairProductionModel.cc,v 1.19 2004/05/05 18:45:42 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
// $Id: G4MuPairProductionModel.cc,v 1.21 2004/12/02 08:20:38 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -48,6 +48,7 @@
|
||||
// 10-02-04 Update parameterisation using R.Kokoulin model (V.Ivanchenko)
|
||||
// 28-04-04 For complex materials repeat calculation of max energy for each
|
||||
// material (V.Ivanchenko)
|
||||
// 01-11-04 Fix bug in expression inside ComputeDMicroscopicCrossSection (R.Kokoulin)
|
||||
|
||||
//
|
||||
// Class Description:
|
||||
@@ -78,10 +79,11 @@ G4double G4MuPairProductionModel::adat[]={1.01,9.01,26.98,63.55,238.03};
|
||||
G4double G4MuPairProductionModel::tdat[]={1.e3,1.e4,1.e5,1.e6,1.e7,1.e8,1.e9,1.e10};
|
||||
G4double G4MuPairProductionModel::xgi[]={ 0.0199,0.1017,0.2372,0.4083,0.5917,0.7628,0.8983,0.9801 };
|
||||
G4double G4MuPairProductionModel::wgi[]={ 0.0506,0.1112,0.1569,0.1813,0.1813,0.1569,0.1112,0.0506 };
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
using namespace std;
|
||||
|
||||
G4MuPairProductionModel::G4MuPairProductionModel(const G4ParticleDefinition*,
|
||||
const G4String& nam)
|
||||
: G4VEmModel(nam),
|
||||
@@ -167,7 +169,7 @@ G4double G4MuPairProductionModel::ComputeDEDX(const G4MaterialCutsCouple* couple
|
||||
G4double Z = (*theElementVector)[i]->GetZ();
|
||||
SetCurrentElement(Z);
|
||||
G4double tmax = MaxSecondaryEnergy(particle, kineticEnergy);
|
||||
G4double cut = std::min(cutEnergy,tmax);
|
||||
G4double cut = min(cutEnergy,tmax);
|
||||
G4double loss = ComputMuPairLoss(Z, kineticEnergy, cut, tmax);
|
||||
dedx += loss*theAtomicNumDensityVector[i];
|
||||
}
|
||||
@@ -305,8 +307,10 @@ G4double G4MuPairProductionModel::ComputeDMicroscopicCrossSection(
|
||||
G4double xi0 = 0.25*massratio2*a1;
|
||||
G4double del = c8/a0;
|
||||
|
||||
G4double tmnexp = (alf+2.*del*a3)/(1.+(1.-del)*sqrt(a3));
|
||||
if(tmnexp <= 0.) return cross;
|
||||
G4double rta3 = sqrt(a3);
|
||||
G4double tmnexp = alf/(1. + rta3) + del*rta3;
|
||||
if(tmnexp >= 1.0) return cross;
|
||||
|
||||
G4double tmn = log(tmnexp);
|
||||
G4double sum = 0.;
|
||||
|
||||
@@ -379,8 +383,8 @@ G4double G4MuPairProductionModel::CrossSection(const G4MaterialCutsCouple* coupl
|
||||
for (size_t i=0; i<material->GetNumberOfElements(); i++) {
|
||||
G4double Z = (*theElementVector)[i]->GetZ();
|
||||
SetCurrentElement(Z);
|
||||
G4double tmax = std::min(maxEnergy,MaxSecondaryEnergy(particle, kineticEnergy));
|
||||
G4double cut = std::max(minPairEnergy,cutEnergy);
|
||||
G4double tmax = min(maxEnergy,MaxSecondaryEnergy(particle, kineticEnergy));
|
||||
G4double cut = max(minPairEnergy,cutEnergy);
|
||||
if(cut < tmax) {
|
||||
G4double cr = ComputeMicroscopicCrossSection(kineticEnergy, Z, cut)
|
||||
- ComputeMicroscopicCrossSection(kineticEnergy, Z, tmax);
|
||||
@@ -451,7 +455,7 @@ G4DynamicParticle* G4MuPairProductionModel::SampleSecondary(
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
std::vector<G4DynamicParticle*>* G4MuPairProductionModel::SampleSecondaries(
|
||||
vector<G4DynamicParticle*>* G4MuPairProductionModel::SampleSecondaries(
|
||||
const G4MaterialCutsCouple* couple,
|
||||
const G4DynamicParticle* aDynamicParticle,
|
||||
G4double cut,
|
||||
@@ -473,8 +477,8 @@ std::vector<G4DynamicParticle*>* G4MuPairProductionModel::SampleSecondaries(
|
||||
SetCurrentElement(anElement->GetZ());
|
||||
|
||||
G4double maxPairEnergy = MaxSecondaryEnergy(particle,kineticEnergy);
|
||||
G4double maxEnergy = std::min(tmax, maxPairEnergy);
|
||||
G4double minEnergy = std::min(maxEnergy, cut);
|
||||
G4double maxEnergy = min(tmax, maxPairEnergy);
|
||||
G4double minEnergy = min(maxEnergy, cut);
|
||||
|
||||
if( minEnergy > minPairEnergy)
|
||||
{
|
||||
@@ -554,7 +558,7 @@ std::vector<G4DynamicParticle*>* G4MuPairProductionModel::SampleSecondaries(
|
||||
PositKineEnergy);
|
||||
|
||||
|
||||
std::vector<G4DynamicParticle*>* vdp = new std::vector<G4DynamicParticle*>;
|
||||
vector<G4DynamicParticle*>* vdp = new vector<G4DynamicParticle*>;
|
||||
vdp->push_back(aParticle1);
|
||||
vdp->push_back(aParticle2);
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VMuEnergyLoss.cc,v 1.29 2003/06/16 17:01:52 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4VMuEnergyLoss.cc,v 1.31 2004/12/02 08:20:38 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
//
|
||||
@@ -103,7 +103,7 @@ G4int G4VMuEnergyLoss::Ndeltamax = 100 ;
|
||||
|
||||
G4EnergyLossMessenger* G4VMuEnergyLoss::eLossMessenger = 0 ;
|
||||
|
||||
// constructor and destructor
|
||||
using namespace std;
|
||||
|
||||
G4VMuEnergyLoss::G4VMuEnergyLoss(const G4String& processName)
|
||||
: G4VEnergyLoss (processName),
|
||||
@@ -365,8 +365,8 @@ void G4VMuEnergyLoss::BuildDEDXTable(
|
||||
|
||||
// if((subSecFlag) && (aParticleType.GetParticleName()=="mu+"))
|
||||
// {
|
||||
// G4cout << std::setw(20) << (*theMaterialTable)[mat]->GetName()
|
||||
// << std::setw(15) << MinDeltaEnergy[mat]/keV ;
|
||||
// G4cout << setw(20) << (*theMaterialTable)[mat]->GetName()
|
||||
// << setw(15) << MinDeltaEnergy[mat]/keV ;
|
||||
// if(LowerLimitForced[mat])
|
||||
// G4cout << " lower limit forced." << G4endl;
|
||||
// else
|
||||
@@ -445,7 +445,7 @@ G4double G4VMuEnergyLoss::GetConstraints(const G4DynamicParticle *aParticle,
|
||||
*KineticEnergy+RangeCoeffC ;
|
||||
|
||||
// compute the Step limit ..............
|
||||
G4double r = std::min(finalRange, couple->GetProductionCuts()
|
||||
G4double r = min(finalRange, couple->GetProductionCuts()
|
||||
->GetProductionCut(idxG4ElectronCut));
|
||||
if(fRangeNow>r)
|
||||
{
|
||||
@@ -558,7 +558,7 @@ G4VParticleChange* G4VMuEnergyLoss::AlongStepDoIt(
|
||||
postsafety =
|
||||
navigator->ComputeSafety(stepData.GetPostStepPoint()->GetPosition());
|
||||
|
||||
safety = std::min(presafety,postsafety) ;
|
||||
safety = min(presafety,postsafety) ;
|
||||
if (safety < rcut)
|
||||
{
|
||||
|
||||
@@ -597,7 +597,7 @@ G4VParticleChange* G4VMuEnergyLoss::AlongStepDoIt(
|
||||
{
|
||||
T0=G4EnergyLossTables::GetPreciseEnergyFromRange(
|
||||
G4Electron::Electron(),
|
||||
std::min(presafety,postsafety),
|
||||
min(presafety,postsafety),
|
||||
couple) ;
|
||||
|
||||
// absolute lower limit for T0
|
||||
@@ -708,7 +708,7 @@ G4VParticleChange* G4VMuEnergyLoss::AlongStepDoIt(
|
||||
|
||||
// update the particle direction and kinetic energy
|
||||
if(subdelta > 0)
|
||||
aParticleChange.SetMomentumChange(Px,Py,Pz) ;
|
||||
aParticleChange.ProposeMomentumDirection(Px,Py,Pz) ;
|
||||
E = Tkin ;
|
||||
}
|
||||
}
|
||||
@@ -733,12 +733,12 @@ G4VParticleChange* G4VMuEnergyLoss::AlongStepDoIt(
|
||||
if (finalT <= 0. )
|
||||
{
|
||||
finalT = 0.;
|
||||
aParticleChange.SetStatusChange(fStopButAlive);
|
||||
aParticleChange.ProposeTrackStatus(fStopButAlive);
|
||||
}
|
||||
|
||||
// aParticleChange.SetNumberOfSecondaries(0);
|
||||
aParticleChange.SetEnergyChange(finalT);
|
||||
aParticleChange.SetLocalEnergyDeposit(E-finalT);
|
||||
aParticleChange.ProposeEnergy(finalT);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(E-finalT);
|
||||
|
||||
return &aParticleChange;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user