Import Geant4 6.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 10:56:29 +02:00
parent 1d812b78b1
commit e083ffb441
1415 changed files with 111223 additions and 21207 deletions
File diff suppressed because it is too large Load Diff
@@ -158,6 +158,166 @@ G4double G4PAIonisation::GetMaxKineticEnergy() {return HighestKineticEnergy;}
G4double G4PAIonisation::GetMinKineticEnergy() {return LowestKineticEnergy;}
G4int G4PAIonisation::GetBinNumber() {return TotBin;}
/////////////////////////////////////////////////////////////////////////
//
// GetMeanFreePath
G4double
G4PAIonisation::GetMeanFreePath( const G4Track& trackData,
G4double,
G4ForceCondition* condition )
{
// G4cout<<"G4PAIonisation::GetMeanFreePath is called"<<G4endl ;
G4int iTkin, iPlace ;
G4double charge, charge2, mass, massRatio, kinE, gamma, scaledE, meanFreePath ;
G4double E1, E2, W, W1, W2, primaryIon ;
*condition = NotForced ;
G4Material* aMaterial = trackData.GetMaterial() ;
if( aMaterial->GetIndex() != fMatIndex ) meanFreePath = DBL_MAX ;
else
{
const G4DynamicParticle* aParticle = trackData.GetDynamicParticle() ;
kinE = aParticle->GetKineticEnergy() ;
mass = aParticle->GetDefinition()->GetPDGMass() ;
gamma = 1.0 + kinE/mass ;
if(gamma < 1.2) return meanFreePath = DBL_MAX ;
charge = aParticle->GetDefinition()->GetPDGCharge() ;
charge2 = charge*charge ;
massRatio = proton_mass_c2/mass ;
scaledE = kinE*massRatio ;
for(iTkin=0;iTkin<G4PAIonisation::GetBinNumber();iTkin++)
{
// if(scaledE < GetProtonEnergyVector()->GetLowEdgeEnergy(iTkin)) // <= ?
if(scaledE < fProtonEnergyVector->GetLowEdgeEnergy(iTkin)) // <= ?
{
break ;
}
}
iPlace = iTkin - 1 ;
if(iTkin == G4PAIonisation::GetBinNumber()) // Fermi plato, try from left
{
meanFreePath = 1.0/(*(*fPAItransferBank)(iPlace))(0)/charge2 ;
}
else
{
if(iTkin == 0) // Tkin is too small, trying from right only
{
meanFreePath = 1.0/(*(*fPAItransferBank)(iPlace+1))(0)/charge2 ;
}
else
{
E1 = fProtonEnergyVector->GetLowEdgeEnergy(iTkin - 1) ;
E2 = fProtonEnergyVector->GetLowEdgeEnergy(iTkin) ;
W = 1.0/(E2 - E1) ;
W1 = (E2 - scaledE)*W ;
W2 = (scaledE - E1)*W ;
primaryIon = (*(*fPAItransferBank)(iPlace ))(0)*W1 +
(*(*fPAItransferBank)(iPlace+1))(0)*W2 ;
meanFreePath = 1.0/primaryIon/charge2 ;
}
}
// meanFreePath = DBL_MAX ;
}
return meanFreePath ;
}
/////////////////////////////////////////////////////////////////////////
//
// GetFreePath
G4double
G4PAIonisation::GetFreePath( G4double scaledTkin, G4double charge2 )
{
// G4cout<<"G4PAIonisation::GetFreePath is called"<<G4endl ;
G4int iTkin, iPlace ;
G4double meanFreePath ;
G4double E1, E2, W, W1, W2, primaryIon ;
for( iTkin = 0 ; iTkin < G4PAIonisation::GetBinNumber() ; iTkin++ )
{
if(scaledTkin < fProtonEnergyVector->GetLowEdgeEnergy(iTkin)) break ;
}
iPlace = iTkin - 1 ;
if(iTkin == G4PAIonisation::GetBinNumber()) // Fermi plato, try from left
{
meanFreePath = 1.0/(*(*fPAItransferBank)(iPlace))(0)/charge2 ;
}
else
{
if(iTkin == 0) // Tkin is too small, trying from right only
{
meanFreePath = 1.0/(*(*fPAItransferBank)(iPlace+1))(0)/charge2 ;
}
else
{
E1 = fProtonEnergyVector->GetLowEdgeEnergy(iTkin - 1) ;
E2 = fProtonEnergyVector->GetLowEdgeEnergy(iTkin) ;
W = 1.0/(E2 - E1) ;
W1 = (E2 - scaledTkin)*W ;
W2 = (scaledTkin - E1)*W ;
primaryIon = (*(*fPAItransferBank)(iPlace ))(0)*W1 +
(*(*fPAItransferBank)(iPlace+1))(0)*W2 ;
meanFreePath = 1.0/primaryIon/charge2 ;
}
}
// meanFreePath = DBL_MAX ;
return meanFreePath ;
}
/////////////////////////////////////////////////////////////////////////
//
// GetdEdx
G4double
G4PAIonisation::GetdEdx( G4double scaledTkin, G4double charge2 )
{
// G4cout<<"G4PAIonisation::GetdEdx is called"<<G4endl ;
G4int iTkin, iPlace ;
G4double dEdx ;
G4double E1, E2, W, W1, W2 ;
for( iTkin = 0 ; iTkin < G4PAIonisation::GetBinNumber() ; iTkin++ )
{
if(scaledTkin < fProtonEnergyVector->GetLowEdgeEnergy(iTkin)) break ;
}
iPlace = iTkin - 1 ;
if(iTkin == G4PAIonisation::GetBinNumber()) // Fermi plato, try from left
{
dEdx = (*(*theLossTable)(iPlace))(0)*charge2 ;
}
else
{
if(iTkin == 0) // Tkin is too small, trying from right only
{
dEdx = (*(*theLossTable)(iPlace+1))(0)*charge2 ;
}
else
{
E1 = fProtonEnergyVector->GetLowEdgeEnergy(iTkin - 1) ;
E2 = fProtonEnergyVector->GetLowEdgeEnergy(iTkin) ;
W = 1.0/(E2 - E1) ;
W1 = (E2 - scaledTkin)*W ;
W2 = (scaledTkin - E1)*W ;
dEdx = (*(*theLossTable)(iPlace))(0)*W1 + (*(*theLossTable)(iPlace+1))(0)*W2;
dEdx *= charge2 ;
}
}
return dEdx ;
}
/////////////////////////////////////////////////////////////////////////
//
// Calculate Sandia table photo absorption cross section coefficients for
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4PAIxSection.cc,v 1.17 2003/10/19 15:21:22 grichine Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4PAIxSection.cc,v 1.19 2004/06/07 07:33:21 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
// G4PAIxSection.cc -- class implementation file
@@ -35,6 +35,7 @@
// R&D: Vladimir.Grichine@cern.ch
//
// History:
//
// 13.05.03 V. Grichine, bug fixed for maxEnergyTransfer > max interval energy
// 28.05.01 V.Ivanchenko minor changes to provide ANSI -wall compilation
// 17.05.01 V. Grichine, low energy extension down to 10*keV of proton
@@ -50,6 +51,9 @@
#include "G4ios.hh"
#include "G4Poisson.hh"
#include "G4Material.hh"
#include "G4MaterialCutsCouple.hh"
#include "G4SandiaTable.hh"
/* ******************************************************************
@@ -82,6 +86,33 @@ const G4int G4PAIxSection::fMaxSplineSize = 500 ; // Max size of output spline
// Constructor
//
G4PAIxSection::G4PAIxSection(G4MaterialCutsCouple* matCC)
{
fDensity = matCC->GetMaterial()->GetDensity();
G4int matIndex = matCC->GetMaterial()->GetIndex();
fSandia = new G4SandiaTable(matIndex);
G4int i, j;
fMatSandiaMatrix = new G4OrderedTable();
for (i = 0; i < fSandia->GetMaxInterval()-1; i++)
{
fMatSandiaMatrix->push_back(new G4DataVector(5,0.));
}
for (i = 0; i < fSandia->GetMaxInterval()-1; i++)
{
(*(*fMatSandiaMatrix)[i])[0] = fSandia->GetSandiaMatTable(i,0);
for(j = 1; j < 5 ; j++)
{
(*(*fMatSandiaMatrix)[i])[j] = fSandia->GetSandiaMatTable(i,j)*fDensity;
}
}
}
G4PAIxSection::G4PAIxSection(G4int materialIndex,
G4double maxEnergyTransfer)
{
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4SynchrotronRadiation.cc,v 1.9 2004/03/10 16:48:46 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4SynchrotronRadiation.cc,v 1.10 2004/06/07 13:49:52 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
@@ -75,6 +75,95 @@ G4SynchrotronRadiation::~G4SynchrotronRadiation()
// GEANT4 internal units.
//
G4double G4SynchrotronRadiation::GetLambdaConst()
{
return fLambdaConst;
}
G4double G4SynchrotronRadiation::GetEnergyConst()
{
return fEnergyConst;
}
G4double
G4SynchrotronRadiation::GetMeanFreePath( const G4Track& trackData,
G4double,
G4ForceCondition* condition)
{
// gives the MeanFreePath in GEANT4 internal units
const G4DynamicParticle* aDynamicParticle;
G4Material* aMaterial;
G4double MeanFreePath;
//G4bool isOutRange ;
*condition = NotForced ;
aDynamicParticle = trackData.GetDynamicParticle();
aMaterial = trackData.GetMaterial();
G4double gamma = aDynamicParticle->GetTotalEnergy()/
(aDynamicParticle->GetMass() ) ;
G4double KineticEnergy = aDynamicParticle->GetKineticEnergy();
if (KineticEnergy < LowestKineticEnergy || gamma<1.0e3)
{
MeanFreePath = DBL_MAX ;
}
else
{
G4TransportationManager* transportMgr;
G4FieldManager* globalFieldMgr;
transportMgr = G4TransportationManager::GetTransportationManager() ;
globalFieldMgr = transportMgr->GetFieldManager() ;
G4bool FieldExists = globalFieldMgr->DoesFieldExist() ;
G4ThreeVector FieldValue;
const G4Field* pField = 0 ;
if (FieldExists)
{
pField = globalFieldMgr->GetDetectorField() ;
G4ThreeVector globPosition = trackData.GetPosition() ;
G4double globPosVec[3], FieldValueVec[3] ;
globPosVec[0] = globPosition.x() ;
globPosVec[1] = globPosition.y() ;
globPosVec[2] = globPosition.z() ;
pField->GetFieldValue( globPosVec, FieldValueVec ) ;
FieldValue = G4ThreeVector( FieldValueVec[0],
FieldValueVec[1],
FieldValueVec[2] ) ;
G4ThreeVector unitMomentum = aDynamicParticle->GetMomentumDirection();
G4ThreeVector unitMcrossB = FieldValue.cross(unitMomentum) ;
G4double perpB = unitMcrossB.mag() ;
G4double beta = aDynamicParticle->GetTotalMomentum()/
(aDynamicParticle->GetTotalEnergy() ) ;
if(perpB > 0.0)
{
MeanFreePath = fLambdaConst*beta/perpB ;
}
else
{
MeanFreePath = DBL_MAX ;
}
}
else
{
MeanFreePath = DBL_MAX ;
}
}
return MeanFreePath;
}
G4VParticleChange*
G4SynchrotronRadiation::PostStepDoIt(const G4Track& trackData,
const G4Step& stepData )
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4eBremsstrahlungModel.cc,v 1.15 2003/11/20 18:22:31 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4eBremsstrahlungModel.cc,v 1.16 2004/05/20 19:46:14 urban Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -43,6 +43,7 @@
// 27-01-03 Make models region aware (V.Ivanchenko)
// 13-02-03 Add name (V.Ivanchenko)
// 09-05-03 Fix problem of supression function + optimise sampling (V.Ivanchenko)
// 20-05-04 Correction to ensure unit independence (L.Urban)
//
// Class Description:
//
@@ -340,7 +341,7 @@ G4double G4eBremsstrahlungModel::ComputeBremLoss(G4double Z, G4double T,
}
}
G4double xx = log10(T);
G4double xx = log10(T/MeV);
G4double fl = 1.;
if (xx <= xlim)
@@ -542,7 +543,7 @@ G4double G4eBremsstrahlungModel::CrossSectionPerAtom(G4double kineticEnergy,
}
}
G4double xx = log10(kineticEnergy) ;
G4double xx = log10(kineticEnergy/MeV) ;
G4double fs = 1. ;
if (xx <= xlim) {
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4hIonisation.cc,v 1.50 2003/11/12 16:23:42 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4hIonisation.cc,v 1.51 2004/05/27 17:23:02 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -66,6 +66,7 @@
// 04-08-03 Set integral=false to be default (V.Ivanchenko)
// 08-08-03 STD substitute standard (V.Ivanchenko)
// 12-11-03 G4EnergyLossSTD -> G4EnergyLossProcess (V.Ivanchenko)
// 27-05-04 Set integral to be a default regime (V.Ivanchenko)
//
// -------------------------------------------------------------------
//
@@ -96,7 +97,6 @@ G4hIonisation::G4hIonisation(const G4String& name)
SetMinKinEnergy(0.1*keV);
SetMaxKinEnergy(100.0*TeV);
SetVerboseLevel(0);
SetIntegral(false);
mass = 0.0;
ratio = 0.0;
}
@@ -120,11 +120,7 @@ void G4hIonisation::InitialiseProcess()
em->SetLowEnergyLimit(0.1*keV);
em->SetHighEnergyLimit(2.0*MeV*massFactor);
if(IsIntegral()) {
flucModel = new G4BohrFluctuations();
} else {
flucModel = new G4UniversalFluctuation();
}
flucModel = new G4UniversalFluctuation();
AddEmModel(1, em, flucModel);
G4VEmModel* em1 = new G4BetheBlochModel();
@@ -132,6 +128,8 @@ void G4hIonisation::InitialiseProcess()
em1->SetHighEnergyLimit(100.0*TeV);
AddEmModel(2, em1, flucModel);
SetStepLimits(0.2, 1.0*mm);
isInitialised = true;
}
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4ionIonisation.cc,v 1.21 2003/11/12 16:23:42 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4ionIonisation.cc,v 1.23 2004/05/27 17:22:56 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -42,6 +42,7 @@
// 18-04-03 Use IonFluctuations (V.Ivanchenko)
// 03-08-03 Add effective charge (V.Ivanchenko)
// 12-11-03 G4EnergyLossSTD -> G4EnergyLossProcess (V.Ivanchenko)
// 27-05-04 Set integral to be a default regime (V.Ivanchenko)
//
//
// -------------------------------------------------------------------
@@ -95,11 +96,10 @@ void G4ionIonisation::InitialiseProcess()
em1->SetHighEnergyLimit(100.0*TeV);
AddEmModel(2, em1, flucModel);
SetIntegral(false);
chargeLowLimit = 0.1;
energyLowLimit = 250.*MeV;
energyLowLimit = 25.*MeV;
SetLinearLossLimit(0.15);
//SetStepLimits(0.1, 0.1*mm);
SetStepLimits(0.1, 0.1*mm);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -265,7 +265,7 @@ G4double G4ionIonisation::EffectiveCharge(const G4ParticleDefinition* p,
chargeCorrection = s * (1.0 + 0.5*(1.0/q - 1.0)*log(1.0 + lambda*lambda)/(vF*vF) );
}
// G4cout << "G4ionIonisation: charge= " << charge << " q= " << q
// << " chargeCor= " << chargeCorrection << G4endl;
// << " chargeCor= " << chargeCorrection << G4endl;
return charge*q;
}