279 lines
8.4 KiB
Plaintext
279 lines
8.4 KiB
Plaintext
//
|
|
// ********************************************************************
|
|
// * DISCLAIMER *
|
|
// * *
|
|
// * The following disclaimer summarizes all the specific disclaimers *
|
|
// * of contributors to this software. The specific disclaimers,which *
|
|
// * govern, are listed with their locations in: *
|
|
// * http://cern.ch/geant4/license *
|
|
// * *
|
|
// * 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. *
|
|
// * *
|
|
// * This code implementation is the intellectual property of the *
|
|
// * GEANT4 collaboration. *
|
|
// * By copying, distributing or modifying the Program (or any work *
|
|
// * based on the Program) you indicate your acceptance of this *
|
|
// * statement, and all its terms. *
|
|
// ********************************************************************
|
|
//
|
|
//
|
|
//
|
|
//
|
|
// ---------------------------------------------------------------
|
|
// GEANT 4 class inlined methods file
|
|
//
|
|
// ------------ G4PAIonisation physics process ------------
|
|
// by Laszlo Urban, 30 May 1997
|
|
// ***************************************************************
|
|
// It is the first implementation of the NEW IONISATION PROCESS.
|
|
// It calculates the ionisation of charged hadrons.
|
|
// ***************************************************************
|
|
// 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
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
//
|
|
//
|
|
|
|
inline G4double
|
|
G4PAIonisation::GetConstraints(const G4DynamicParticle *aParticle,
|
|
G4Material *aMaterial )
|
|
{
|
|
size_t index = aMaterial->GetIndex() ;
|
|
|
|
// G4cout<<"G4PAIonisation::GetConstraints is called"<<G4endl ;
|
|
|
|
if(index != fMatIndex)
|
|
{
|
|
return DBL_MAX ;
|
|
}
|
|
else
|
|
{
|
|
if(aMaterial->GetState() == kStateGas)
|
|
{
|
|
return 100*mm ;
|
|
}
|
|
else
|
|
{
|
|
return 0.1*mm ;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
//
|
|
//
|
|
|
|
inline G4double
|
|
G4PAIonisation::GetContinuousStepLimit( const G4Track& track ,
|
|
G4double ,
|
|
G4double currentMinimumStep ,
|
|
G4double& )
|
|
{
|
|
|
|
G4double Step =
|
|
GetConstraints(track.GetDynamicParticle(),track.GetMaterial()) ;
|
|
|
|
if( (Step > 0.0) && (Step < currentMinimumStep) ) currentMinimumStep = Step ;
|
|
|
|
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, 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)) // <= ?
|
|
{
|
|
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 = GetProtonEnergyVector()->GetLowEdgeEnergy(iTkin - 1) ;
|
|
E2 = GetProtonEnergyVector()->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::
|
|
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 < GetProtonEnergyVector()->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 = GetProtonEnergyVector()->GetLowEdgeEnergy(iTkin - 1) ;
|
|
E2 = GetProtonEnergyVector()->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 < GetProtonEnergyVector()->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 = GetProtonEnergyVector()->GetLowEdgeEnergy(iTkin - 1) ;
|
|
E2 = GetProtonEnergyVector()->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 ;
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
//
|
|
//
|
|
|
|
inline G4bool G4PAIonisation::IsApplicable(
|
|
const G4ParticleDefinition& particle)
|
|
{
|
|
return( particle.GetPDGCharge() != 0. &&
|
|
particle.GetPDGMass() > 0. );
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
//
|
|
//
|
|
|
|
inline
|
|
G4double G4PAIonisation::GetSandiaPhotoAbsCof(G4int i, G4int j) const
|
|
{
|
|
if(i < 0 || i >= fSandiaIntervalNumber || j < 0 || j > 4)
|
|
{
|
|
G4Exception("Invalid arguments in G4Material::GetSandiaPhotoAbsCof") ;
|
|
}
|
|
return fSandiaPhotoAbsCof[i][j] ;
|
|
}
|
|
|
|
|
|
//
|
|
//
|
|
/////////////////////////////////////////////////////////////////////////
|