132 lines
5.2 KiB
Plaintext
132 lines
5.2 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. *
|
|
// ********************************************************************
|
|
//
|
|
//
|
|
// $Id: G4eplusAnnihilation.icc,v 1.8 2001/09/17 17:07:11 maire Exp $
|
|
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
|
//
|
|
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|
|
|
// 10-01-97, crossection table + meanfreepath table, M.Maire
|
|
// 17-03-97, merge 'in fly' and 'at rest', M.Maire
|
|
// 28-05-01, V.Ivanchenko minor changes to provide ANSI -wall compilation
|
|
// 17-09-01, migration of Materials to pure STL (mma)
|
|
//
|
|
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|
|
|
inline G4bool G4eplusAnnihilation::IsApplicable(
|
|
const G4ParticleDefinition& particle)
|
|
{
|
|
return ( &particle == G4Positron::Positron() );
|
|
}
|
|
|
|
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|
|
|
inline G4double G4eplusAnnihilation::GetCrossSectionPerAtom(
|
|
G4DynamicParticle* aDynamicPositron,
|
|
G4Element* anElement)
|
|
|
|
// return the total cross section per atom in GEANT4 internal units
|
|
|
|
{
|
|
G4double crossSection;
|
|
G4double PositronEnergy = aDynamicPositron->GetKineticEnergy();
|
|
G4bool isOutRange ;
|
|
|
|
if (PositronEnergy > HighestEnergyLimit)
|
|
crossSection = 0. ;
|
|
else {
|
|
if (PositronEnergy < LowestEnergyLimit) PositronEnergy = 1.01*LowestEnergyLimit;
|
|
crossSection = (*theCrossSectionTable)(anElement->GetIndex())->
|
|
GetValue( PositronEnergy, isOutRange );
|
|
}
|
|
|
|
return crossSection;
|
|
}
|
|
|
|
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|
|
|
inline G4double G4eplusAnnihilation::GetMeanFreePath(const G4Track& aTrack,
|
|
G4double,
|
|
G4ForceCondition*)
|
|
|
|
// returns the positron mean free path in GEANT4 internal units
|
|
|
|
{
|
|
const G4DynamicParticle* aDynamicPositron = aTrack.GetDynamicParticle();
|
|
G4double PositronEnergy = aDynamicPositron->GetKineticEnergy();
|
|
G4Material* aMaterial = aTrack.GetMaterial();
|
|
|
|
G4double MeanFreePath;
|
|
G4bool isOutRange ;
|
|
|
|
if (PositronEnergy > HighestEnergyLimit) MeanFreePath = DBL_MAX;
|
|
else
|
|
{
|
|
if (PositronEnergy < LowestEnergyLimit)
|
|
PositronEnergy = 1.01*LowestEnergyLimit;
|
|
MeanFreePath = (*theMeanFreePathTable)(aMaterial->GetIndex())->
|
|
GetValue( PositronEnergy, isOutRange );
|
|
}
|
|
|
|
return MeanFreePath;
|
|
}
|
|
|
|
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|
|
|
inline G4double G4eplusAnnihilation::ComputeMeanFreePath(
|
|
G4double PositKinEnergy,
|
|
G4Material* aMaterial)
|
|
|
|
// returns the positron mean free path in GEANT4 internal units
|
|
|
|
{
|
|
const G4ElementVector* theElementVector = aMaterial->GetElementVector();
|
|
const G4double* NbOfAtomsPerVolume = aMaterial->GetVecNbOfAtomsPerVolume();
|
|
|
|
G4double SIGMA = 0 ;
|
|
|
|
for (size_t elm=0 ; elm < aMaterial->GetNumberOfElements() ; elm++ )
|
|
{
|
|
SIGMA += NbOfAtomsPerVolume[elm] *
|
|
ComputeCrossSectionPerAtom(PositKinEnergy,
|
|
(*theElementVector)[elm]->GetZ());
|
|
}
|
|
|
|
return SIGMA > DBL_MIN ? 1./SIGMA : DBL_MAX;
|
|
}
|
|
|
|
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|
|
|
inline G4double G4eplusAnnihilation::GetMeanLifeTime(const G4Track&,
|
|
G4ForceCondition*)
|
|
|
|
// returns the annihilation mean life time in GEANT4 internal units
|
|
|
|
{
|
|
return 0.0;
|
|
}
|
|
|
|
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|
|