Import Geant4 3.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:55:53 +02:00
parent e7d7193284
commit cfcb558cfe
3050 changed files with 91703 additions and 48310 deletions
@@ -20,8 +20,8 @@
// ***************************************************************
// corrected by L.Urban on 24/09/97
// 06.01.00 V.Grichine, modifications in GetConstraints and GetMenaFreePath
//
//
// 11.07.00 V.Grichine, modifications in GetMeanFreePath
// 12.07.00 V.Grichinw, GetFreePath and GetdEdx were added
////////////////////////////////////////////////////////////////////
@@ -74,31 +74,158 @@ G4PAIonisation::GetContinuousStepLimit( const G4Track& track ,
return Step ;
}
/////////////////////////////////////////////////////////////////////////
//
//
inline G4double G4PAIonisation::
GetMeanFreePath( const G4Track& trackData,
G4double previousStepSize,
G4ForceCondition* condition )
{
// G4cout<<"G4PAIonisation::GetMeanFreePath is called"<<G4endl ;
G4int iTkin, iPlace ;
G4double charge, charge2, massRatio, kinE, 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() ;
charge = aParticle->GetDefinition()->GetPDGCharge() ;
charge2 = charge*charge ;
massRatio = proton_mass_c2/aParticle->GetDefinition()->GetPDGMass() ;
scaledE = kinE*massRatio ;
for(iTkin=0;iTkin<G4PAIonisation::GetBinNumber();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 ;
}
/////////////////////////////////////////////////////////////////////////
//
//
inline G4double G4PAIonisation::GetMeanFreePath(
const G4Track& trackData,
G4double previousStepSize,
G4ForceCondition* condition)
inline G4double G4PAIonisation::
GetFreePath( G4double scaledTkin, G4double charge2 )
{
// G4cout<<"G4PAIonisation::GetMeanFreePath is called"<<G4endl ;
*condition = NotForced ;
G4Material* aMaterial = trackData.GetMaterial() ;
// G4cout<<"G4PAIonisation::GetFreePath is called"<<G4endl ;
if( aMaterial->GetIndex() != fMatIndex )
{
return DBL_MAX;
}
else
{
return DBL_MAX ; // 1*mm ;
}
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 ;
}
/////////////////////////////////////////////////////////////////////////
//
//
inline 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 ;
}
//////////////////////////////////////////////////////////////////////